From 35ec2410ae6ed47699ba5eb05563eccf4fe61478 Mon Sep 17 00:00:00 2001
From: support
Date: Wed, 15 Jun 2022 10:43:21 +0000
Subject: [PATCH] Built motion from commit d1c16722.|2.6.11
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
package.json | 3 ++-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
server/api/client-side-logs.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.oauth.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/contacts/index.js | 2 +-
server/components/contacts/sql-utils.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/import/cm/csvUpdates.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/interaction/sql-utils.js | 2 +-
.../components/interaction/update-interaction.js | 2 +-
server/components/interaction/utils.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/components/realtime/agents.js | 2 +-
server/components/realtime/queues.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/cloud-provider.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/api.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/events.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/project.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/models/action.js | 2 +-
server/services/ami/dialer/models/agentComplete.js | 2 +-
server/services/ami/dialer/models/final.js | 2 +-
server/services/ami/dialer/models/hangup.js | 2 +-
server/services/ami/dialer/models/history.js | 2 +-
.../ami/dialer/models/queueCallerAbandon.js | 2 +-
server/services/ami/dialer/utils/hopper.js | 2 +-
server/services/ami/dialer/utils/index.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/voiceQueueSummary.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/realtime/utils.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/interval.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/iftime.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
1203 files changed, 1204 insertions(+), 1203 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 7153925..9a6746d 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-06-15T10:20:04.620Z",
+ "time": "2022-06-15T10:35:22.368Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 4fed9d9..ba31ad1 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-06-15T10:20:04.620Z",
+ "time": "2022-06-15T10:35:22.368Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/package.json b/package.json
index e6ece4a..b37a142 100644
--- a/package.json
+++ b/package.json
@@ -47,6 +47,7 @@
"aux-containers": "docker-compose up -d database cache"
},
"dependencies": {
+ "acorn": "5.7.1",
"activedirectory2": "2.1.0",
"apiai-promise": "git+https://github.com/gcareri/apiai-promise.git",
"archiver": "2.1.1",
@@ -145,7 +146,7 @@
"devDependencies": {
"@types/express-serve-static-core": "4.17.28",
"@types/node": "6.14.13",
- "acorn":"6.4.2",
+ "acorn": "6.4.2",
"apidoc": "0.24.0",
"chai": "3.5.0",
"chai-http": "3.0.0",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 827431f..0d426ae 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 _0xd6a4=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x271bf0,_0x426878){var _0x3d8e9b=function(_0x31d9c4){while(--_0x31d9c4){_0x271bf0['push'](_0x271bf0['shift']());}};_0x3d8e9b(++_0x426878);}(_0xd6a4,0xff));var _0x4d6a=function(_0x1118a8,_0x3a8ab3){_0x1118a8=_0x1118a8-0x0;var _0x3490d7=_0xd6a4[_0x1118a8];return _0x3490d7;};'use strict';var Sequelize=require(_0x4d6a('0x0'));module[_0x4d6a('0x1')]={'name':{'type':Sequelize[_0x4d6a('0x2')],'get':function(_0x3dd1ca){return this[_0x4d6a('0x3')]('action');}},'action':{'type':Sequelize[_0x4d6a('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4d6a('0x5'),_0x4d6a('0x6'),_0x4d6a('0x7'),_0x4d6a('0x8'),'urlForward',_0x4d6a('0x9'),'bot',_0x4d6a('0xa')]],'msg':_0x4d6a('0xb')}},'comment':_0x4d6a('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x4d6a('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x4d6a('0xd')},'data4':{'type':Sequelize[_0x4d6a('0x4')](0x1000),'comments':_0x4d6a('0xe')},'data5':{'type':Sequelize[_0x4d6a('0x4')](0x1000),'comments':_0x4d6a('0xf')},'data6':{'type':Sequelize[_0x4d6a('0x4')],'comments':_0x4d6a('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0x4d6a('0x11')}};
\ No newline at end of file
+var _0x74bb=['getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','VIRTUAL'];(function(_0x13d423,_0x2f1969){var _0xf18f30=function(_0xbadbab){while(--_0xbadbab){_0x13d423['push'](_0x13d423['shift']());}};_0xf18f30(++_0x2f1969);}(_0x74bb,0x1de));var _0xb74b=function(_0x388ee3,_0xeb2f22){_0x388ee3=_0x388ee3-0x0;var _0x1b314=_0x74bb[_0x388ee3];return _0x1b314;};'use strict';var Sequelize=require(_0xb74b('0x0'));module['exports']={'name':{'type':Sequelize[_0xb74b('0x1')],'get':function(_0x450214){return this[_0xb74b('0x2')](_0xb74b('0x3'));}},'action':{'type':Sequelize[_0xb74b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb74b('0x5'),'integration',_0xb74b('0x6'),_0xb74b('0x7'),_0xb74b('0x8'),'browser','bot',_0xb74b('0x9')]],'msg':_0xb74b('0xa')}},'comment':_0xb74b('0xa')},'data1':{'type':Sequelize[_0xb74b('0x4')](0x1000),'comment':_0xb74b('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xb74b('0x4')](0x1000),'comment':_0xb74b('0xc')},'data4':{'type':Sequelize[_0xb74b('0x4')](0x1000),'comments':_0xb74b('0xd')},'data5':{'type':Sequelize[_0xb74b('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xb74b('0x4')],'comments':_0xb74b('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0xb74b('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 5fc4834..5f22058 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 _0x96f5=['set','json','apply','save','update','destroy','sendStatus','error','stack','name','send','body','Action','find','then','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','end','limit','undefined','count','offset','status'];(function(_0x1d2ac5,_0x442440){var _0x29772=function(_0x25e082){while(--_0x25e082){_0x1d2ac5['push'](_0x1d2ac5['shift']());}};_0x29772(++_0x442440);}(_0x96f5,0x1f1));var _0x596f=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0x96f5[_0xc0d9bc];return _0x32ff73;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x596f('0x0'));var zipdir=require(_0x596f('0x1'));var jsonpatch=require(_0x596f('0x2'));var rp=require(_0x596f('0x3'));var moment=require(_0x596f('0x4'));var BPromise=require(_0x596f('0x5'));var Mustache=require(_0x596f('0x6'));var util=require(_0x596f('0x7'));var path=require(_0x596f('0x8'));var sox=require(_0x596f('0x9'));var csv=require(_0x596f('0xa'));var ejs=require(_0x596f('0xb'));var fs=require('fs');var fs_extra=require(_0x596f('0xc'));var _=require(_0x596f('0xd'));var squel=require(_0x596f('0xe'));var crypto=require(_0x596f('0xf'));var jsforce=require(_0x596f('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x596f('0x11'));var Redis=require(_0x596f('0x12'));var authService=require(_0x596f('0x13'));var qs=require(_0x596f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x596f('0x15'));var utils=require('../../config/utils');var config=require(_0x596f('0x16'));var licenseUtil=require(_0x596f('0x17'));var db=require(_0x596f('0x18'))['db'];function respondWithStatusCode(_0x5bc126,_0x21462e){_0x21462e=_0x21462e||0xcc;return function(_0x38c711){if(_0x38c711){return _0x5bc126['sendStatus'](_0x21462e);}return _0x5bc126['status'](_0x21462e)[_0x596f('0x19')]();};}function respondWithResult(_0x5c84bf,_0x34ce4d){_0x34ce4d=_0x34ce4d||0xc8;return function(_0x2ee54f){if(_0x2ee54f){return _0x5c84bf['status'](_0x34ce4d)['json'](_0x2ee54f);}};}function respondWithFilteredResult(_0x31c18a,_0x1b29c2){return function(_0x48a8be){if(_0x48a8be){var _0x407095=typeof _0x1b29c2['offset']==='undefined'&&typeof _0x1b29c2[_0x596f('0x1a')]===_0x596f('0x1b');var _0x4f1826=_0x48a8be[_0x596f('0x1c')];var _0x3fa322=_0x407095?0x0:_0x1b29c2[_0x596f('0x1d')];var _0xddfd18=_0x407095?_0x48a8be[_0x596f('0x1c')]:_0x1b29c2[_0x596f('0x1d')]+_0x1b29c2[_0x596f('0x1a')];var _0x2ff90c;if(_0xddfd18>=_0x4f1826){_0xddfd18=_0x4f1826;_0x2ff90c=0xc8;}else{_0x2ff90c=0xce;}_0x31c18a[_0x596f('0x1e')](_0x2ff90c);return _0x31c18a[_0x596f('0x1f')]('Content-Range',_0x3fa322+'-'+_0xddfd18+'/'+_0x4f1826)[_0x596f('0x20')](_0x48a8be);}return null;};}function patchUpdates(_0x56e183){return function(_0x4a8237){try{jsonpatch[_0x596f('0x21')](_0x4a8237,_0x56e183,!![]);}catch(_0x2ecbe8){return BPromise['reject'](_0x2ecbe8);}return _0x4a8237[_0x596f('0x22')]();};}function saveUpdates(_0x49b7a9,_0x697a92){return function(_0x50900f){if(_0x50900f){return _0x50900f[_0x596f('0x23')](_0x49b7a9)['then'](function(_0x665099){return _0x665099;});}return null;};}function removeEntity(_0x466edd,_0x545d6b){return function(_0x26b312){if(_0x26b312){return _0x26b312[_0x596f('0x24')]()['then'](function(){_0x466edd['status'](0xcc)[_0x596f('0x19')]();});}};}function handleEntityNotFound(_0x378d37,_0x481444){return function(_0x35ac75){if(!_0x35ac75){_0x378d37[_0x596f('0x25')](0x194);}return _0x35ac75;};}function handleError(_0xaaad1d,_0x5c22dc){_0x5c22dc=_0x5c22dc||0x1f4;return function(_0x3b357f){logger[_0x596f('0x26')](_0x3b357f[_0x596f('0x27')]);if(_0x3b357f[_0x596f('0x28')]){delete _0x3b357f[_0x596f('0x28')];}_0xaaad1d[_0x596f('0x1e')](_0x5c22dc)[_0x596f('0x29')](_0x3b357f);};}exports[_0x596f('0x23')]=function(_0x234b9c,_0x44a433){if(_0x234b9c['body']['id']){delete _0x234b9c[_0x596f('0x2a')]['id'];}return db[_0x596f('0x2b')][_0x596f('0x2c')]({'where':{'id':_0x234b9c['params']['id']}})[_0x596f('0x2d')](handleEntityNotFound(_0x44a433,null))[_0x596f('0x2d')](saveUpdates(_0x234b9c[_0x596f('0x2a')],null))['then'](respondWithResult(_0x44a433,null))[_0x596f('0x2e')](handleError(_0x44a433,null));};exports[_0x596f('0x24')]=function(_0x53247a,_0x4c7970){return db['Action'][_0x596f('0x2c')]({'where':{'id':_0x53247a[_0x596f('0x2f')]['id']}})['then'](handleEntityNotFound(_0x4c7970,null))[_0x596f('0x2d')](removeEntity(_0x4c7970,null))[_0x596f('0x2e')](handleError(_0x4c7970,null));};
\ No newline at end of file
+var _0x1e89=['undefined','limit','count','Content-Range','save','update','then','end','stack','name','body','find','params','catch','destroy','Action','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset'];(function(_0xd70344,_0x304eac){var _0x338d4b=function(_0x4d42a8){while(--_0x4d42a8){_0xd70344['push'](_0xd70344['shift']());}};_0x338d4b(++_0x304eac);}(_0x1e89,0x118));var _0x91e8=function(_0x23909e,_0x270bf4){_0x23909e=_0x23909e-0x0;var _0x218b62=_0x1e89[_0x23909e];return _0x218b62;};'use strict';var emlformat=require(_0x91e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91e8('0x1'));var jsonpatch=require(_0x91e8('0x2'));var rp=require(_0x91e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x91e8('0x4'));var util=require(_0x91e8('0x5'));var path=require(_0x91e8('0x6'));var sox=require(_0x91e8('0x7'));var csv=require(_0x91e8('0x8'));var ejs=require(_0x91e8('0x9'));var fs=require('fs');var fs_extra=require(_0x91e8('0xa'));var _=require(_0x91e8('0xb'));var squel=require('squel');var crypto=require(_0x91e8('0xc'));var jsforce=require(_0x91e8('0xd'));var deskjs=require(_0x91e8('0xe'));var toCsv=require(_0x91e8('0x8'));var querystring=require(_0x91e8('0xf'));var Papa=require(_0x91e8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x91e8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91e8('0x12'));var logger=require(_0x91e8('0x13'))(_0x91e8('0x14'));var utils=require(_0x91e8('0x15'));var config=require(_0x91e8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x91e8('0x17'))['db'];function respondWithStatusCode(_0x34cfe3,_0x147d95){_0x147d95=_0x147d95||0xcc;return function(_0x553f12){if(_0x553f12){return _0x34cfe3[_0x91e8('0x18')](_0x147d95);}return _0x34cfe3['status'](_0x147d95)['end']();};}function respondWithResult(_0x34c353,_0x5badf6){_0x5badf6=_0x5badf6||0xc8;return function(_0x52f782){if(_0x52f782){return _0x34c353[_0x91e8('0x19')](_0x5badf6)[_0x91e8('0x1a')](_0x52f782);}};}function respondWithFilteredResult(_0xbcd0fb,_0x169d77){return function(_0x43a99b){if(_0x43a99b){var _0x3986cd=typeof _0x169d77[_0x91e8('0x1b')]===_0x91e8('0x1c')&&typeof _0x169d77[_0x91e8('0x1d')]===_0x91e8('0x1c');var _0x5e178a=_0x43a99b[_0x91e8('0x1e')];var _0x55b43f=_0x3986cd?0x0:_0x169d77['offset'];var _0x41b767=_0x3986cd?_0x43a99b[_0x91e8('0x1e')]:_0x169d77[_0x91e8('0x1b')]+_0x169d77[_0x91e8('0x1d')];var _0x197d80;if(_0x41b767>=_0x5e178a){_0x41b767=_0x5e178a;_0x197d80=0xc8;}else{_0x197d80=0xce;}_0xbcd0fb[_0x91e8('0x19')](_0x197d80);return _0xbcd0fb['set'](_0x91e8('0x1f'),_0x55b43f+'-'+_0x41b767+'/'+_0x5e178a)[_0x91e8('0x1a')](_0x43a99b);}return null;};}function patchUpdates(_0x2b13a4){return function(_0x42f23b){try{jsonpatch['apply'](_0x42f23b,_0x2b13a4,!![]);}catch(_0x1abd44){return BPromise['reject'](_0x1abd44);}return _0x42f23b[_0x91e8('0x20')]();};}function saveUpdates(_0x1afdbd,_0x5c2208){return function(_0x3c595d){if(_0x3c595d){return _0x3c595d[_0x91e8('0x21')](_0x1afdbd)['then'](function(_0x4f29dd){return _0x4f29dd;});}return null;};}function removeEntity(_0x14a3d4,_0x30f609){return function(_0x23eecb){if(_0x23eecb){return _0x23eecb['destroy']()[_0x91e8('0x22')](function(){_0x14a3d4['status'](0xcc)[_0x91e8('0x23')]();});}};}function handleEntityNotFound(_0x2331d4,_0x26c203){return function(_0x4d264d){if(!_0x4d264d){_0x2331d4['sendStatus'](0x194);}return _0x4d264d;};}function handleError(_0x339d13,_0x4611f0){_0x4611f0=_0x4611f0||0x1f4;return function(_0xe3c8ba){logger['error'](_0xe3c8ba[_0x91e8('0x24')]);if(_0xe3c8ba[_0x91e8('0x25')]){delete _0xe3c8ba[_0x91e8('0x25')];}_0x339d13[_0x91e8('0x19')](_0x4611f0)['send'](_0xe3c8ba);};}exports[_0x91e8('0x21')]=function(_0x37c59e,_0x45fb43){if(_0x37c59e['body']['id']){delete _0x37c59e[_0x91e8('0x26')]['id'];}return db['Action'][_0x91e8('0x27')]({'where':{'id':_0x37c59e[_0x91e8('0x28')]['id']}})['then'](handleEntityNotFound(_0x45fb43,null))['then'](saveUpdates(_0x37c59e[_0x91e8('0x26')],null))[_0x91e8('0x22')](respondWithResult(_0x45fb43,null))[_0x91e8('0x29')](handleError(_0x45fb43,null));};exports[_0x91e8('0x2a')]=function(_0x443f32,_0x41f4f9){return db[_0x91e8('0x2b')][_0x91e8('0x27')]({'where':{'id':_0x443f32[_0x91e8('0x28')]['id']}})[_0x91e8('0x22')](handleEntityNotFound(_0x41f4f9,null))[_0x91e8('0x22')](removeEntity(_0x41f4f9,null))[_0x91e8('0x29')](handleError(_0x41f4f9,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 1ddf5b1..3d42b8b 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 _0xe0c6=['exports','define','Action','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe0c6,0x9f));var _0x6e0c=function(_0x23e6fb,_0x55a4d2){_0x23e6fb=_0x23e6fb-0x0;var _0x290c89=_0xe0c6[_0x23e6fb];return _0x290c89;};'use strict';var _=require(_0x6e0c('0x0'));var util=require(_0x6e0c('0x1'));var logger=require(_0x6e0c('0x2'))('api');var moment=require(_0x6e0c('0x3'));var BPromise=require(_0x6e0c('0x4'));var rp=require(_0x6e0c('0x5'));var fs=require('fs');var path=require(_0x6e0c('0x6'));var rimraf=require(_0x6e0c('0x7'));var config=require(_0x6e0c('0x8'));var attributes=require(_0x6e0c('0x9'));module[_0x6e0c('0xa')]=function(_0x137da4,_0x5e52fa){return _0x137da4[_0x6e0c('0xb')](_0x6e0c('0xc'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe171=['../../config/environment','./action.attributes','define','Action','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xe171,0xeb));var _0x1e17=function(_0x675a2b,_0x2b12c0){_0x675a2b=_0x675a2b-0x0;var _0x449c09=_0xe171[_0x675a2b];return _0x449c09;};'use strict';var _=require(_0x1e17('0x0'));var util=require('util');var logger=require(_0x1e17('0x1'))(_0x1e17('0x2'));var moment=require(_0x1e17('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e17('0x4'));var fs=require('fs');var path=require(_0x1e17('0x5'));var rimraf=require(_0x1e17('0x6'));var config=require(_0x1e17('0x7'));var attributes=require(_0x1e17('0x8'));module['exports']=function(_0x364dae,_0x5b14ad){return _0x364dae[_0x1e17('0x9')](_0x1e17('0xa'),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 66856f6..4f54fcb 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2e877a,_0x388a3d){var _0x16e759=function(_0x26bfc1){while(--_0x26bfc1){_0x2e877a['push'](_0x2e877a['shift']());}};_0x16e759(++_0x388a3d);}(_0xabce,0x103));var _0xeabc=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xabce[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x484b3a,_0xaf92a9){var _0x589b4c=function(_0x4f9145){while(--_0x4f9145){_0x484b3a['push'](_0x484b3a['shift']());}};_0x589b4c(++_0xaf92a9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0x5fc3[_0x58c851];return _0x534d8a;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 2b8f5a3..b54cffc 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 _0xe6ab=['Router','../../components/interaction/service','./action.controller','put','update','delete','/:id','isAuthenticated','exports','multer','util','path','connect-timeout','express'];(function(_0x3df6e6,_0xc943be){var _0x54f7ba=function(_0x15e619){while(--_0x15e619){_0x3df6e6['push'](_0x3df6e6['shift']());}};_0x54f7ba(++_0xc943be);}(_0xe6ab,0x95));var _0xbe6a=function(_0xc97e20,_0x37963e){_0xc97e20=_0xc97e20-0x0;var _0x454d3f=_0xe6ab[_0xc97e20];return _0x454d3f;};'use strict';var multer=require(_0xbe6a('0x0'));var util=require(_0xbe6a('0x1'));var path=require(_0xbe6a('0x2'));var timeout=require(_0xbe6a('0x3'));var express=require(_0xbe6a('0x4'));var router=express[_0xbe6a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbe6a('0x6'));var config=require('../../config/environment');var controller=require(_0xbe6a('0x7'));router[_0xbe6a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbe6a('0x9')]);router[_0xbe6a('0xa')](_0xbe6a('0xb'),auth[_0xbe6a('0xc')](),controller['destroy']);module[_0xbe6a('0xd')]=router;
\ No newline at end of file
+var _0x6b78=['./action.controller','put','/:id','update','delete','isAuthenticated','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x6ec9ef,_0x554295){var _0x43bc06=function(_0x5eba8d){while(--_0x5eba8d){_0x6ec9ef['push'](_0x6ec9ef['shift']());}};_0x43bc06(++_0x554295);}(_0x6b78,0xd9));var _0x86b7=function(_0x484a6e,_0x2c5949){_0x484a6e=_0x484a6e-0x0;var _0x571693=_0x6b78[_0x484a6e];return _0x571693;};'use strict';var multer=require(_0x86b7('0x0'));var util=require(_0x86b7('0x1'));var path=require(_0x86b7('0x2'));var timeout=require('connect-timeout');var express=require(_0x86b7('0x3'));var router=express[_0x86b7('0x4')]();var fs_extra=require(_0x86b7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x86b7('0x6'));var config=require(_0x86b7('0x7'));var controller=require(_0x86b7('0x8'));router[_0x86b7('0x9')](_0x86b7('0xa'),auth['isAuthenticated'](),controller[_0x86b7('0xb')]);router[_0x86b7('0xc')](_0x86b7('0xa'),auth[_0x86b7('0xd')](),controller['destroy']);module[_0x86b7('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 043a425..aa0c0b1 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 _0x71ab=['TEXT','exports','STRING'];(function(_0x4cc362,_0x2eb430){var _0x5eefb8=function(_0x20c93a){while(--_0x20c93a){_0x4cc362['push'](_0x4cc362['shift']());}};_0x5eefb8(++_0x2eb430);}(_0x71ab,0x64));var _0xb71a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x71ab[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}};
\ No newline at end of file
+var _0xda19=['exports','STRING','TEXT'];(function(_0x20d161,_0x487655){var _0x35d9e9=function(_0x1ed96a){while(--_0x1ed96a){_0x20d161['push'](_0x20d161['shift']());}};_0x35d9e9(++_0x487655);}(_0xda19,0xd5));var _0x9da1=function(_0x18079d,_0x73a61c){_0x18079d=_0x18079d-0x0;var _0x698079=_0xda19[_0x18079d];return _0x698079;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 91680f2..2ceab26 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 _0x011c=['MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','alias','joins','parse','type','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','AnalyticMetric','select','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','rimraf','zip-dir','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','update','get','UserProfileResource','destroy','then','error','stack','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','name','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)'];(function(_0x2a189d,_0x48d453){var _0x3afe63=function(_0x5c57e3){while(--_0x5c57e3){_0x2a189d['push'](_0x2a189d['shift']());}};_0x3afe63(++_0x48d453);}(_0x011c,0xf2));var _0xc011=function(_0x5833d4,_0x4f0b67){_0x5833d4=_0x5833d4-0x0;var _0x41ae86=_0x011c[_0x5833d4];return _0x41ae86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc011('0x0'));var zipdir=require(_0xc011('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc011('0x2'));var Mustache=require(_0xc011('0x3'));var util=require(_0xc011('0x4'));var path=require('path');var sox=require(_0xc011('0x5'));var csv=require('to-csv');var ejs=require(_0xc011('0x6'));var fs=require('fs');var fs_extra=require(_0xc011('0x7'));var _=require(_0xc011('0x8'));var squel=require('squel');var crypto=require(_0xc011('0x9'));var jsforce=require(_0xc011('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc011('0xb'));var querystring=require(_0xc011('0xc'));var Papa=require(_0xc011('0xd'));var Redis=require(_0xc011('0xe'));var authService=require(_0xc011('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc011('0x10'));var logger=require(_0xc011('0x11'))(_0xc011('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc011('0x13'));var db=require(_0xc011('0x14'))['db'];var dbH=require(_0xc011('0x14'))[_0xc011('0x15')];function respondWithStatusCode(_0x92237,_0x403878){_0x403878=_0x403878||0xcc;return function(_0x8bb8e9){if(_0x8bb8e9){return _0x92237[_0xc011('0x16')](_0x403878);}return _0x92237[_0xc011('0x17')](_0x403878)[_0xc011('0x18')]();};}function respondWithResult(_0x42f1cc,_0x2c2821){_0x2c2821=_0x2c2821||0xc8;return function(_0x32ad35){if(_0x32ad35){return _0x42f1cc[_0xc011('0x17')](_0x2c2821)['json'](_0x32ad35);}};}function respondWithFilteredResult(_0x475958,_0x258491){return function(_0x1a6856){if(_0x1a6856){var _0x4809cc=typeof _0x258491[_0xc011('0x19')]===_0xc011('0x1a')&&typeof _0x258491[_0xc011('0x1b')]===_0xc011('0x1a');var _0x451ac7=_0x1a6856['count'];var _0x247e19=_0x4809cc?0x0:_0x258491[_0xc011('0x19')];var _0x4574da=_0x4809cc?_0x1a6856[_0xc011('0x1c')]:_0x258491['offset']+_0x258491['limit'];var _0x389fb1;if(_0x4574da>=_0x451ac7){_0x4574da=_0x451ac7;_0x389fb1=0xc8;}else{_0x389fb1=0xce;}_0x475958['status'](_0x389fb1);return _0x475958['set'](_0xc011('0x1d'),_0x247e19+'-'+_0x4574da+'/'+_0x451ac7)['json'](_0x1a6856);}return null;};}function patchUpdates(_0x1c5462){return function(_0x2b949d){try{jsonpatch[_0xc011('0x1e')](_0x2b949d,_0x1c5462,!![]);}catch(_0x4b1e38){return BPromise['reject'](_0x4b1e38);}return _0x2b949d[_0xc011('0x1f')]();};}function saveUpdates(_0x3e0b80,_0x2a8a69){return function(_0x970bec){if(_0x970bec){return _0x970bec[_0xc011('0x20')](_0x3e0b80)['then'](function(_0x21bfc0){return _0x21bfc0;});}return null;};}function removeEntity(_0x4c38d8,_0x113c8f){return function(_0x1b433b){if(_0x1b433b){return _0x1b433b['destroy']()['then'](function(){var _0xfd3733=_0x1b433b[_0xc011('0x21')]({'plain':!![]});var _0x32996f='CustomReports';return db[_0xc011('0x22')][_0xc011('0x23')]({'where':{'type':_0x32996f,'resourceId':_0xfd3733['id']}})[_0xc011('0x24')](function(){return _0x1b433b;});})[_0xc011('0x24')](function(){_0x4c38d8[_0xc011('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27bf7d,_0x5a5dad){return function(_0x12d9d3){if(!_0x12d9d3){_0x27bf7d[_0xc011('0x16')](0x194);}return _0x12d9d3;};}function handleError(_0x33db49,_0x2b3909){_0x2b3909=_0x2b3909||0x1f4;return function(_0x24614c){logger[_0xc011('0x25')](_0x24614c[_0xc011('0x26')]);if(_0x24614c['name']){delete _0x24614c['name'];}_0x33db49[_0xc011('0x17')](_0x2b3909)[_0xc011('0x27')](_0x24614c);};}exports[_0xc011('0x28')]=function(_0x53913e,_0x2a9626){var _0x1a50b9={},_0x4e12b1={},_0x275f4b={'count':0x0,'rows':[]};var _0x2cbfc4=_[_0xc011('0x29')](db[_0xc011('0x2a')][_0xc011('0x2b')],function(_0x2fecef){return{'name':_0x2fecef[_0xc011('0x2c')],'type':_0x2fecef['type'][_0xc011('0x2d')]};});_0x4e12b1[_0xc011('0x2e')]=_[_0xc011('0x29')](_0x2cbfc4,_0xc011('0x2f'));_0x4e12b1['query']=_['keys'](_0x53913e[_0xc011('0x30')]);_0x4e12b1[_0xc011('0x31')]=_['intersection'](_0x4e12b1[_0xc011('0x2e')],_0x4e12b1['query']);_0x1a50b9['attributes']=_[_0xc011('0x32')](_0x4e12b1['model'],qs[_0xc011('0x33')](_0x53913e['query'][_0xc011('0x33')]));_0x1a50b9[_0xc011('0x34')]=_0x1a50b9[_0xc011('0x34')]['length']?_0x1a50b9['attributes']:_0x4e12b1['model'];if(!_0x53913e[_0xc011('0x30')][_0xc011('0x35')](_0xc011('0x36'))){_0x1a50b9[_0xc011('0x1b')]=qs[_0xc011('0x1b')](_0x53913e[_0xc011('0x30')]['limit']);_0x1a50b9['offset']=qs[_0xc011('0x19')](_0x53913e['query'][_0xc011('0x19')]);}_0x1a50b9[_0xc011('0x37')]=qs['sort'](_0x53913e[_0xc011('0x30')][_0xc011('0x38')]);_0x1a50b9['where']=qs[_0xc011('0x31')](_[_0xc011('0x39')](_0x53913e[_0xc011('0x30')],_0x4e12b1[_0xc011('0x31')]),_0x2cbfc4);if(_0x53913e['query'][_0xc011('0x3a')]){_0x1a50b9[_0xc011('0x3b')]=_[_0xc011('0x3c')](_0x1a50b9[_0xc011('0x3b')],{'$or':_[_0xc011('0x29')](_0x2cbfc4,function(_0x3dfa28){if(_0x3dfa28['type']!=='VIRTUAL'){var _0x225da0={};_0x225da0[_0x3dfa28[_0xc011('0x2f')]]={'$like':'%'+_0x53913e['query'][_0xc011('0x3a')]+'%'};return _0x225da0;}})});}_0x1a50b9=_[_0xc011('0x3c')]({},_0x1a50b9,_0x53913e[_0xc011('0x3d')]);var _0x1242d0={'where':_0x1a50b9[_0xc011('0x3b')]};return db[_0xc011('0x2a')][_0xc011('0x1c')](_0x1242d0)['then'](function(_0x5728e7){_0x275f4b['count']=_0x5728e7;if(_0x53913e[_0xc011('0x30')][_0xc011('0x3e')]){_0x1a50b9['include']=[{'all':!![]}];}return db[_0xc011('0x2a')][_0xc011('0x3f')](_0x1a50b9);})[_0xc011('0x24')](function(_0x1878f6){_0x275f4b[_0xc011('0x40')]=_0x1878f6;return _0x275f4b;})[_0xc011('0x24')](respondWithFilteredResult(_0x2a9626,_0x1a50b9))[_0xc011('0x41')](handleError(_0x2a9626,null));};exports[_0xc011('0x42')]=function(_0x38759b,_0x54667d){var _0x48df2c={'raw':![],'where':{'id':_0x38759b[_0xc011('0x43')]['id']}},_0x13c35a={};_0x13c35a[_0xc011('0x2e')]=_[_0xc011('0x44')](db[_0xc011('0x2a')]['rawAttributes']);_0x13c35a[_0xc011('0x30')]=_[_0xc011('0x44')](_0x38759b[_0xc011('0x30')]);_0x13c35a[_0xc011('0x31')]=_['intersection'](_0x13c35a[_0xc011('0x2e')],_0x13c35a[_0xc011('0x30')]);_0x48df2c['attributes']=_['intersection'](_0x13c35a[_0xc011('0x2e')],qs['fields'](_0x38759b[_0xc011('0x30')][_0xc011('0x33')]));_0x48df2c[_0xc011('0x34')]=_0x48df2c[_0xc011('0x34')][_0xc011('0x45')]?_0x48df2c[_0xc011('0x34')]:_0x13c35a['model'];if(_0x38759b['query']['includeAll']){_0x48df2c[_0xc011('0x46')]=[{'all':!![]}];}_0x48df2c=_[_0xc011('0x3c')]({},_0x48df2c,_0x38759b[_0xc011('0x3d')]);return db['AnalyticCustomReport'][_0xc011('0x47')](_0x48df2c)[_0xc011('0x24')](handleEntityNotFound(_0x54667d,null))[_0xc011('0x24')](respondWithResult(_0x54667d,null))[_0xc011('0x41')](handleError(_0x54667d,null));};exports[_0xc011('0x48')]=function(_0x4fa8cd,_0xffa766){return db[_0xc011('0x2a')]['create'](_0x4fa8cd['body'],{})[_0xc011('0x24')](function(_0xdb5d20){var _0x1493a4=_0x4fa8cd['user'][_0xc011('0x21')]({'plain':!![]});if(!_0x1493a4)throw new Error(_0xc011('0x49'));if(_0x1493a4[_0xc011('0x4a')]===_0xc011('0x4b')){var _0x203c0b=_0xdb5d20[_0xc011('0x21')]({'plain':!![]});var _0x22b88f=_0xc011('0x4c');return db[_0xc011('0x4d')][_0xc011('0x47')]({'where':{'name':_0x22b88f,'userProfileId':_0x1493a4['userProfileId']},'raw':!![]})['then'](function(_0x2b22a1){if(_0x2b22a1&&_0x2b22a1['autoAssociation']===0x0){return db[_0xc011('0x22')][_0xc011('0x48')]({'name':_0x203c0b[_0xc011('0x2f')],'resourceId':_0x203c0b['id'],'type':_0xc011('0x4e'),'sectionId':_0x2b22a1['id']},{})[_0xc011('0x24')](function(){return _0xdb5d20;});}else{return _0xdb5d20;}})[_0xc011('0x41')](function(_0x1b4f50){logger[_0xc011('0x25')](_0xc011('0x4f'),_0x1b4f50);throw _0x1b4f50;});}return _0xdb5d20;})[_0xc011('0x24')](respondWithResult(_0xffa766,0xc9))[_0xc011('0x41')](handleError(_0xffa766,null));};exports[_0xc011('0x20')]=function(_0x41b19b,_0x3d5d3f){if(_0x41b19b[_0xc011('0x50')]['id']){delete _0x41b19b['body']['id'];}return db[_0xc011('0x2a')][_0xc011('0x47')]({'where':{'id':_0x41b19b['params']['id']}})['then'](handleEntityNotFound(_0x3d5d3f,null))['then'](saveUpdates(_0x41b19b['body'],null))[_0xc011('0x24')](respondWithResult(_0x3d5d3f,null))[_0xc011('0x41')](handleError(_0x3d5d3f,null));};exports[_0xc011('0x23')]=function(_0x5552cc,_0x238c4f){return db[_0xc011('0x2a')][_0xc011('0x47')]({'where':{'id':_0x5552cc[_0xc011('0x43')]['id']}})[_0xc011('0x24')](handleEntityNotFound(_0x238c4f,null))[_0xc011('0x24')](removeEntity(_0x238c4f,null))[_0xc011('0x41')](handleError(_0x238c4f,null));};exports[_0xc011('0x51')]=function(_0x4872df,_0x2e69dd){var _0x4c3ddf=0xa;var _0x20e046=['join',_0xc011('0x52'),_0xc011('0x53'),_0xc011('0x54')];var _0x50f032={'SUM':_0xc011('0x55'),'COUNT':_0xc011('0x56'),'COUNT DISTINCT':_0xc011('0x57'),'MAX':_0xc011('0x58'),'MIN':_0xc011('0x59'),'AVG':_0xc011('0x5a'),'GROUP_CONCAT':_0xc011('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc011('0x5c')};var _0x207dac={'SEC_TO_TIME':_0xc011('0x5d'),'DATE':_0xc011('0x5e'),'HOUR':_0xc011('0x5f'),'ROUND':_0xc011('0x60'),'UNIX_TIMESTAMP':_0xc011('0x61')};var _0x4b3dee=function(_0x40fcd9){return!_[_0xc011('0x62')]([_0xc011('0x63'),_0xc011('0x64'),_0xc011('0x65'),_0xc011('0x66')],_0x40fcd9);};var _0x50777d=function(_0x3cc693){if(!_0x3cc693||!_0x3cc693[_0xc011('0x67')][_0xc011('0x45')]){return'';}for(var _0x15ce78='(',_0x1f9bbb=0x0;_0x1f9bbb<_0x3cc693[_0xc011('0x67')][_0xc011('0x45')];_0x1f9bbb+=0x1){_0x1f9bbb>0x0&&(_0x15ce78+='\x20'+_0x3cc693[_0xc011('0x68')]+'\x20');_0x15ce78+=_0x3cc693[_0xc011('0x67')][_0x1f9bbb][_0xc011('0x69')]?_0x50777d(_0x3cc693[_0xc011('0x67')][_0x1f9bbb][_0xc011('0x69')]):_0x3cc693[_0xc011('0x67')][_0x1f9bbb][_0xc011('0x6a')]+'\x20'+_0x3cc693['rules'][_0x1f9bbb][_0xc011('0x6b')]+(_0x4b3dee(_0x3cc693[_0xc011('0x67')][_0x1f9bbb]['condition'])?'\x20'+_0x3cc693[_0xc011('0x67')][_0x1f9bbb][_0xc011('0x6c')]:'');}return _0x15ce78+')';};var _0x3746db={'where':{'id':_0x4872df['params']['id']}},_0x3e2280,_0x6c30ed,_0x5278ce,_0x2c69f4,_0x429a4e;_0x3746db=_[_0xc011('0x3c')]({},_0x3746db,_0x4872df['options']);return db[_0xc011('0x2a')][_0xc011('0x47')](_0x3746db)[_0xc011('0x24')](function(_0x4e36f5){if(_0x4e36f5){_0x3e2280=_0x4e36f5;return _0x4e36f5['getFields']();}return null;})[_0xc011('0x24')](function(_0x2fe71c){if(_0x2fe71c){if(!_0x2fe71c['length']){throw new db[(_0xc011('0x6d'))][(_0xc011('0x6e'))](_0xc011('0x6f'),0x193);}_0x6c30ed=_0x2fe71c;return db['AnalyticMetric'][_0xc011('0x3f')]({'raw':!![]});}return null;})[_0xc011('0x24')](function(_0x5a9d47){if(_0x5a9d47){_0x5278ce=_[_0xc011('0x70')](_0x5a9d47,'id');var _0x47e058;var _0x5ede7c=squel['select']();_0x5ede7c[_0xc011('0x71')](_0x3e2280[_0xc011('0x72')]);for(var _0x52751c=0x0;_0x52751c<_0x6c30ed[_0xc011('0x45')];_0x52751c+=0x1){_0x47e058=_0x6c30ed[_0x52751c][_0xc011('0x73')]?_0x5278ce[_0x6c30ed[_0x52751c][_0xc011('0x73')]][_0xc011('0x74')]:_0x6c30ed[_0x52751c][_0xc011('0x6a')];_0x47e058=_0x6c30ed[_0x52751c]['function']?_[_0xc011('0x75')](_0x50f032[_0x6c30ed[_0x52751c][_0xc011('0x76')]],'%s',_0x47e058):_0x47e058;_0x47e058=_0x6c30ed[_0x52751c][_0xc011('0x77')]?_[_0xc011('0x75')](_0x207dac[_0x6c30ed[_0x52751c][_0xc011('0x77')]],'%s',_0x47e058):_0x47e058;if(_0x6c30ed[_0x52751c][_0xc011('0x78')]){_0x5ede7c[_0xc011('0x69')](_0x47e058);}_0x6c30ed[_0x52751c][_0xc011('0x79')]&&_0x5ede7c[_0xc011('0x37')](_0x47e058,_0x6c30ed[_0x52751c]['orderBy']==='DESC'?![]:!![]);_0x5ede7c[_0xc011('0x6a')](_0x47e058,_0x6c30ed[_0x52751c][_0xc011('0x7a')]||_0x47e058);}if(_0x3e2280[_0xc011('0x7b')]){_0x3e2280[_0xc011('0x7b')]=JSON[_0xc011('0x7c')](_0x3e2280[_0xc011('0x7b')]);for(var _0x31ffdf=0x0;_0x31ffdf<_0x3e2280[_0xc011('0x7b')]['length'];_0x31ffdf+=0x1){if(_0x3e2280[_0xc011('0x7b')][_0x31ffdf][_0xc011('0x7d')]&&_[_0xc011('0x62')](_0x20e046,_0x3e2280[_0xc011('0x7b')][_0x31ffdf][_0xc011('0x7d')])&&_0x3e2280[_0xc011('0x7b')][_0x31ffdf][_0xc011('0x7e')]&&_0x3e2280[_0xc011('0x7b')][_0x31ffdf][_0xc011('0x7f')]&&_0x3e2280['joins'][_0x31ffdf][_0xc011('0x80')]){_0x5ede7c[_0x3e2280[_0xc011('0x7b')][_0x31ffdf][_0xc011('0x7d')]](_0x3e2280[_0xc011('0x7b')][_0x31ffdf][_0xc011('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3e2280['table'],_0x3e2280[_0xc011('0x7b')][_0x31ffdf]['parentKey'],_0x3e2280[_0xc011('0x7b')][_0x31ffdf][_0xc011('0x7f')],_0x3e2280[_0xc011('0x7b')][_0x31ffdf][_0xc011('0x80')]));}}}if(_0x3e2280[_0xc011('0x81')]){_0x3e2280[_0xc011('0x81')]=JSON['parse'](_0x3e2280['conditions']);_0x5ede7c[_0xc011('0x3b')](_0x50777d(_0x3e2280[_0xc011('0x81')][_0xc011('0x69')]));}_0x429a4e=_0x5ede7c[_0xc011('0x82')]();_0x5ede7c['limit'](_0x4c3ddf);_0x5ede7c['offset'](0x0);logger[_0xc011('0x83')](_0xc011('0x84'),_0x5ede7c[_0xc011('0x85')]());return dbH[_0xc011('0x86')][_0xc011('0x30')](_0x5ede7c[_0xc011('0x85')](),{'type':dbH[_0xc011('0x86')]['QueryTypes'][_0xc011('0x87')]});}})[_0xc011('0x24')](respondWithResult(_0x2e69dd,null))['catch'](handleError(_0x2e69dd,null));};function runReport(_0xf2491,_0x434b0e,_0x1c1613){var _0x3f550c=_0x434b0e['name'];var _0x235c97=0xa;var _0xc69de5=[_0xc011('0x88'),_0xc011('0x52'),_0xc011('0x53'),_0xc011('0x54')];var _0x2ea564={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xc011('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc011('0x5b'),'GROUP_CONCAT ASC':_0xc011('0x89'),'GROUP_CONCAT DESC':_0xc011('0x5c')};var _0x2ee49a={'SEC_TO_TIME':_0xc011('0x5d'),'DATE':'DATE(%s)','HOUR':_0xc011('0x5f'),'ROUND':_0xc011('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1539e0=function(_0x5d8638){return!_[_0xc011('0x62')]([_0xc011('0x63'),_0xc011('0x64'),_0xc011('0x65'),_0xc011('0x66')],_0x5d8638);};var _0x2503bf=function(_0x1f2e74){if(!_0x1f2e74||!_0x1f2e74[_0xc011('0x67')][_0xc011('0x45')]){return'';}for(var _0x275c07='(',_0x7faa03=0x0;_0x7faa03<_0x1f2e74['rules'][_0xc011('0x45')];_0x7faa03+=0x1){_0x7faa03>0x0&&(_0x275c07+='\x20'+_0x1f2e74[_0xc011('0x68')]+'\x20');_0x275c07+=_0x1f2e74['rules'][_0x7faa03][_0xc011('0x69')]?_0x2503bf(_0x1f2e74[_0xc011('0x67')][_0x7faa03]['group']):_0x1f2e74[_0xc011('0x67')][_0x7faa03][_0xc011('0x6a')]+'\x20'+_0x1f2e74[_0xc011('0x67')][_0x7faa03][_0xc011('0x6b')]+(_0x1539e0(_0x1f2e74[_0xc011('0x67')][_0x7faa03][_0xc011('0x6b')])?'\x20'+_0x1f2e74[_0xc011('0x67')][_0x7faa03][_0xc011('0x6c')]:'');}return _0x275c07+')';};var _0x3c9d50={'where':{'id':_0xf2491['id']}},_0x5abf8c,_0x1b8116,_0x5c196f,_0x408a91,_0x4a627f;_0x3c9d50=_[_0xc011('0x3c')]({},_0x3c9d50,_0x1c1613);return db[_0xc011('0x2a')][_0xc011('0x47')](_0x3c9d50)[_0xc011('0x24')](function(_0x3638bb){if(_0x3638bb){_0x5abf8c=_0x3638bb;return _0x3638bb[_0xc011('0x8a')]();}return null;})[_0xc011('0x24')](function(_0x282d6e){if(_0x282d6e){if(!_0x282d6e[_0xc011('0x45')]){throw new db['Sequelize'][(_0xc011('0x6e'))](_0xc011('0x6f'),0x193);}_0x1b8116=_0x282d6e;return db[_0xc011('0x8b')]['findAll']({'raw':!![]});}return null;})[_0xc011('0x24')](function(_0x3b3d34){if(_0x3b3d34){_0x5c196f=_['keyBy'](_0x3b3d34,'id');var _0x16a593;var _0x1010ad=squel[_0xc011('0x8c')]();_0x1010ad[_0xc011('0x71')](_0x5abf8c['table']);for(var _0x34a2ef=0x0;_0x34a2ef<_0x1b8116[_0xc011('0x45')];_0x34a2ef+=0x1){_0x16a593=_0x1b8116[_0x34a2ef][_0xc011('0x73')]?_0x5c196f[_0x1b8116[_0x34a2ef]['MetricId']][_0xc011('0x74')]:_0x1b8116[_0x34a2ef]['field'];_0x16a593=_0x1b8116[_0x34a2ef][_0xc011('0x76')]?_[_0xc011('0x75')](_0x2ea564[_0x1b8116[_0x34a2ef][_0xc011('0x76')]],'%s',_0x16a593):_0x16a593;_0x16a593=_0x1b8116[_0x34a2ef]['format']?_['replace'](_0x2ee49a[_0x1b8116[_0x34a2ef][_0xc011('0x77')]],'%s',_0x16a593):_0x16a593;if(_0x1b8116[_0x34a2ef][_0xc011('0x78')]){_0x1010ad[_0xc011('0x69')](_0x16a593);}_0x1b8116[_0x34a2ef][_0xc011('0x79')]&&_0x1010ad['order'](_0x16a593,_0x1b8116[_0x34a2ef]['orderBy']===_0xc011('0x8d')?![]:!![]);_0x1010ad[_0xc011('0x6a')](_0x16a593,_0x1b8116[_0x34a2ef]['alias']||_0x16a593);}if(_0x5abf8c['joins']){_0x5abf8c[_0xc011('0x7b')]=JSON[_0xc011('0x7c')](_0x5abf8c[_0xc011('0x7b')]);for(var _0x1d93b1=0x0;_0x1d93b1<_0x5abf8c[_0xc011('0x7b')][_0xc011('0x45')];_0x1d93b1+=0x1){if(_0x5abf8c[_0xc011('0x7b')][_0x1d93b1][_0xc011('0x7d')]&&_[_0xc011('0x62')](_0xc69de5,_0x5abf8c[_0xc011('0x7b')][_0x1d93b1][_0xc011('0x7d')])&&_0x5abf8c[_0xc011('0x7b')][_0x1d93b1]['parentKey']&&_0x5abf8c[_0xc011('0x7b')][_0x1d93b1][_0xc011('0x7f')]&&_0x5abf8c[_0xc011('0x7b')][_0x1d93b1]['foreignKey']){_0x1010ad[_0x5abf8c[_0xc011('0x7b')][_0x1d93b1][_0xc011('0x7d')]](_0x5abf8c['joins'][_0x1d93b1][_0xc011('0x7f')],null,util[_0xc011('0x77')](_0xc011('0x8e'),_0x5abf8c[_0xc011('0x72')],_0x5abf8c['joins'][_0x1d93b1][_0xc011('0x7e')],_0x5abf8c[_0xc011('0x7b')][_0x1d93b1]['foreignTable'],_0x5abf8c['joins'][_0x1d93b1]['foreignKey']));}}}if(_0x5abf8c[_0xc011('0x81')]){_0x5abf8c[_0xc011('0x81')]=JSON[_0xc011('0x7c')](_0x5abf8c[_0xc011('0x81')]);_0x1010ad[_0xc011('0x3b')](_0x2503bf(_0x5abf8c[_0xc011('0x81')][_0xc011('0x69')]));}_0x4a627f=_0x1010ad[_0xc011('0x82')]();_0x1010ad[_0xc011('0x1b')](_0x235c97);_0x1010ad['offset'](0x0);return;}})[_0xc011('0x24')](function(){if(_0x434b0e[_0xc011('0x8f')]===_0xc011('0x90')){return null;}var _0x9eee2e=_[_0xc011('0x3c')](_0x434b0e,{'name':_0x434b0e[_0xc011('0x91')]||_0x434b0e['name']||_0x5abf8c['name'],'basename':_0x3f550c,'savename':util[_0xc011('0x77')]('%s-%s.%s',_0x434b0e[_0xc011('0x2f')]||_0x5abf8c[_0xc011('0x2f')],require(_0xc011('0x92'))[_0xc011('0x93')](0x4),_0x434b0e['output']||_0xc011('0x94')),'reportId':_0x5abf8c['id'],'reportType':_0xc011('0x95')});return db[_0xc011('0x96')][_0xc011('0x48')](_0x9eee2e,{'raw':!![]});})[_0xc011('0x24')](function(_0x223934){if(_0x5abf8c['table']===_0xc011('0x97')){_0x4a627f[_0xc011('0x3b')](_0x5abf8c[_0xc011('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x434b0e[_0xc011('0x98')],_0x434b0e[_0xc011('0x99')]);}else{_0x4a627f['where'](_0x5abf8c[_0xc011('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x434b0e[_0xc011('0x98')],_0x434b0e[_0xc011('0x99')]);}if(_0x223934){logger[_0xc011('0x9a')](_0xc011('0x9b'),_0x4a627f[_0xc011('0x85')]());require(_0xc011('0x9c'))['fork'](path[_0xc011('0x88')](__dirname,_0xc011('0x9d'),_0x223934[_0xc011('0x8f')]),[_0x223934['id'],_0x4a627f[_0xc011('0x85')](),path['join'](__dirname,_0xc011('0x9e'),_0x223934[_0xc011('0x9f')]),_0x3f550c]);return _0x223934;}else{var _0x2d5f03=squel[_0xc011('0x8c')]();_0x2d5f03['from']('('+_0x4a627f['toString']()+')',_0xc011('0xa0'));_0x2d5f03[_0xc011('0x6a')](_0xc011('0xa1'),_0xc011('0x1c'));_0x4a627f['limit'](_0x434b0e['limit']||_0x235c97);_0x4a627f['offset'](_0x434b0e[_0xc011('0x19')]||0x0);return dbH[_0xc011('0x86')][_0xc011('0x30')](_0x2d5f03[_0xc011('0x85')](),{'type':dbH[_0xc011('0x86')][_0xc011('0xa2')][_0xc011('0x87')]})['then'](function(_0x38e390){if(!_0x38e390[_0xc011('0x45')]){_0x408a91=0x0;}else{_0x408a91=_0x38e390[0x0][_0xc011('0x1c')]||0x0;}return dbH[_0xc011('0x86')][_0xc011('0x30')](_0x4a627f[_0xc011('0x85')](),{'type':dbH[_0xc011('0x86')][_0xc011('0xa2')]['SELECT']});})[_0xc011('0x24')](function(_0x3c8111){return{'rows':_0x3c8111||[],'count':_0x408a91};});}});}exports[_0xc011('0xa3')]=function(_0x326d33,_0x2c1d56){return runReport(_0x326d33['params'],_0x326d33['query'],_0x326d33[_0xc011('0x3d')])[_0xc011('0x24')](respondWithResult(_0x2c1d56,null))['catch'](handleError(_0x2c1d56,null));};exports[_0xc011('0xa4')]=runReport;exports['query']=function(_0x3524fd,_0x4377bd){var _0x58274c=0xa;var _0x5912a4=[_0xc011('0x88'),_0xc011('0x52'),_0xc011('0x53'),'cross_join'];var _0x2abb02={'SUM':_0xc011('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc011('0x57'),'MAX':'MAX(%s)','MIN':_0xc011('0x59'),'AVG':_0xc011('0x5a'),'GROUP_CONCAT':_0xc011('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc011('0x5c')};var _0x15db8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc011('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0xc011('0x60'),'UNIX_TIMESTAMP':_0xc011('0x61')};var _0x3d92a9=function(_0x2745c1){return!_[_0xc011('0x62')](['IS\x20NULL',_0xc011('0x64'),_0xc011('0x65'),'IS\x20NOT\x20EMPTY'],_0x2745c1);};var _0x112ad=function(_0x258542){if(!_0x258542||!_0x258542[_0xc011('0x67')]['length']){return'';}for(var _0x503a28='(',_0x3d1e39=0x0;_0x3d1e39<_0x258542['rules'][_0xc011('0x45')];_0x3d1e39+=0x1){_0x3d1e39>0x0&&(_0x503a28+='\x20'+_0x258542[_0xc011('0x68')]+'\x20');_0x503a28+=_0x258542[_0xc011('0x67')][_0x3d1e39][_0xc011('0x69')]?_0x112ad(_0x258542['rules'][_0x3d1e39][_0xc011('0x69')]):_0x258542[_0xc011('0x67')][_0x3d1e39]['field']+'\x20'+_0x258542[_0xc011('0x67')][_0x3d1e39][_0xc011('0x6b')]+(_0x3d92a9(_0x258542[_0xc011('0x67')][_0x3d1e39][_0xc011('0x6b')])?'\x20'+_0x258542[_0xc011('0x67')][_0x3d1e39]['value']:'');}return _0x503a28+')';};var _0x323c01={'where':{'id':_0x3524fd[_0xc011('0x43')]['id']}},_0x35eb74,_0x58e0a0,_0x2e2eda,_0x52933e,_0x12e697;_0x323c01=_[_0xc011('0x3c')]({},_0x323c01,_0x3524fd['options']);return db['AnalyticCustomReport']['find'](_0x323c01)['then'](function(_0x1b39cd){if(_0x1b39cd){_0x35eb74=_0x1b39cd;return _0x1b39cd[_0xc011('0x8a')]();}return null;})[_0xc011('0x24')](function(_0x351f3d){if(_0x351f3d){if(!_0x351f3d[_0xc011('0x45')]){throw new db[(_0xc011('0x6d'))][(_0xc011('0x6e'))](_0xc011('0x6f'),0x193);}_0x58e0a0=_0x351f3d;return db[_0xc011('0x8b')]['findAll']({'raw':!![]});}return null;})[_0xc011('0x24')](function(_0x187d98){if(_0x187d98){_0x2e2eda=_[_0xc011('0x70')](_0x187d98,'id');var _0x3d4c34;var _0x878784=squel[_0xc011('0x8c')]();_0x878784['from'](_0x35eb74[_0xc011('0x72')]);for(var _0x2fd012=0x0;_0x2fd012<_0x58e0a0[_0xc011('0x45')];_0x2fd012+=0x1){_0x3d4c34=_0x58e0a0[_0x2fd012][_0xc011('0x73')]?_0x2e2eda[_0x58e0a0[_0x2fd012]['MetricId']][_0xc011('0x74')]:_0x58e0a0[_0x2fd012][_0xc011('0x6a')];_0x3d4c34=_0x58e0a0[_0x2fd012][_0xc011('0x76')]?_[_0xc011('0x75')](_0x2abb02[_0x58e0a0[_0x2fd012][_0xc011('0x76')]],'%s',_0x3d4c34):_0x3d4c34;_0x3d4c34=_0x58e0a0[_0x2fd012][_0xc011('0x77')]?_[_0xc011('0x75')](_0x15db8b[_0x58e0a0[_0x2fd012][_0xc011('0x77')]],'%s',_0x3d4c34):_0x3d4c34;if(_0x58e0a0[_0x2fd012][_0xc011('0x78')]){_0x878784['group'](_0x3d4c34);}_0x58e0a0[_0x2fd012][_0xc011('0x79')]&&_0x878784[_0xc011('0x37')](_0x3d4c34,_0x58e0a0[_0x2fd012][_0xc011('0x79')]==='DESC'?![]:!![]);_0x878784[_0xc011('0x6a')](_0x3d4c34,_0x58e0a0[_0x2fd012][_0xc011('0x7a')]||_0x3d4c34);}if(_0x35eb74[_0xc011('0x7b')]){_0x35eb74[_0xc011('0x7b')]=JSON[_0xc011('0x7c')](_0x35eb74['joins']);for(var _0x51ea42=0x0;_0x51ea42<_0x35eb74[_0xc011('0x7b')][_0xc011('0x45')];_0x51ea42+=0x1){if(_0x35eb74[_0xc011('0x7b')][_0x51ea42][_0xc011('0x7d')]&&_[_0xc011('0x62')](_0x5912a4,_0x35eb74[_0xc011('0x7b')][_0x51ea42]['type'])&&_0x35eb74[_0xc011('0x7b')][_0x51ea42][_0xc011('0x7e')]&&_0x35eb74[_0xc011('0x7b')][_0x51ea42][_0xc011('0x7f')]&&_0x35eb74[_0xc011('0x7b')][_0x51ea42]['foreignKey']){_0x878784[_0x35eb74[_0xc011('0x7b')][_0x51ea42][_0xc011('0x7d')]](_0x35eb74['joins'][_0x51ea42][_0xc011('0x7f')],null,util[_0xc011('0x77')](_0xc011('0x8e'),_0x35eb74[_0xc011('0x72')],_0x35eb74[_0xc011('0x7b')][_0x51ea42][_0xc011('0x7e')],_0x35eb74[_0xc011('0x7b')][_0x51ea42][_0xc011('0x7f')],_0x35eb74[_0xc011('0x7b')][_0x51ea42][_0xc011('0x80')]));}}}if(_0x35eb74[_0xc011('0x81')]){_0x35eb74['conditions']=JSON[_0xc011('0x7c')](_0x35eb74[_0xc011('0x81')]);_0x878784[_0xc011('0x3b')](_0x112ad(_0x35eb74[_0xc011('0x81')][_0xc011('0x69')]));}_0x12e697=_0x878784['clone']();_0x878784[_0xc011('0x1b')](_0x58274c);_0x878784[_0xc011('0x19')](0x0);logger[_0xc011('0x83')](_0xc011('0x84'),_0x878784[_0xc011('0x85')]());return dbH[_0xc011('0x86')][_0xc011('0x30')](_0x878784[_0xc011('0x85')](),{'type':dbH[_0xc011('0x86')][_0xc011('0xa2')][_0xc011('0x87')]});}})[_0xc011('0x24')](function(){return{'sql':_0x12e697[_0xc011('0x85')]()};})[_0xc011('0x24')](respondWithResult(_0x4377bd,null))[_0xc011('0x41')](handleError(_0x4377bd,null));};
\ No newline at end of file
+var _0xd7b1=['options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','right_join','SUM(%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','orderBy','order','DESC','alias','joins','parse','parentKey','%s.%s\x20=\x20%s.%s','foreignTable','foreignKey','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','Sequelize','groupBy','clone','web','fullPath','randomstring','generate','output','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','savename','countTable','run','runReport','operator','ValidationErrorItem','metric','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','name','send','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL'];(function(_0x57dfc8,_0x5f35b8){var _0x4213aa=function(_0x3266ab){while(--_0x3266ab){_0x57dfc8['push'](_0x57dfc8['shift']());}};_0x4213aa(++_0x5f35b8);}(_0xd7b1,0x1ab));var _0x1d7b=function(_0x1bf828,_0xd3919d){_0x1bf828=_0x1bf828-0x0;var _0x5deba2=_0xd7b1[_0x1bf828];return _0x5deba2;};'use strict';var emlformat=require(_0x1d7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d7b('0x1'));var jsonpatch=require(_0x1d7b('0x2'));var rp=require(_0x1d7b('0x3'));var moment=require(_0x1d7b('0x4'));var BPromise=require(_0x1d7b('0x5'));var Mustache=require(_0x1d7b('0x6'));var util=require(_0x1d7b('0x7'));var path=require(_0x1d7b('0x8'));var sox=require(_0x1d7b('0x9'));var csv=require(_0x1d7b('0xa'));var ejs=require(_0x1d7b('0xb'));var fs=require('fs');var fs_extra=require(_0x1d7b('0xc'));var _=require('lodash');var squel=require(_0x1d7b('0xd'));var crypto=require(_0x1d7b('0xe'));var jsforce=require(_0x1d7b('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1d7b('0x11'));var as=require(_0x1d7b('0x12'));var hardwareService=require(_0x1d7b('0x13'));var logger=require(_0x1d7b('0x14'))(_0x1d7b('0x15'));var utils=require(_0x1d7b('0x16'));var config=require(_0x1d7b('0x17'));var licenseUtil=require(_0x1d7b('0x18'));var db=require(_0x1d7b('0x19'))['db'];var dbH=require(_0x1d7b('0x19'))['dbH'];function respondWithStatusCode(_0x592204,_0xbbb68f){_0xbbb68f=_0xbbb68f||0xcc;return function(_0x58ee0f){if(_0x58ee0f){return _0x592204[_0x1d7b('0x1a')](_0xbbb68f);}return _0x592204['status'](_0xbbb68f)[_0x1d7b('0x1b')]();};}function respondWithResult(_0x46e964,_0x5189a9){_0x5189a9=_0x5189a9||0xc8;return function(_0x35597){if(_0x35597){return _0x46e964[_0x1d7b('0x1c')](_0x5189a9)[_0x1d7b('0x1d')](_0x35597);}};}function respondWithFilteredResult(_0x7de54f,_0x924d9b){return function(_0x239bad){if(_0x239bad){var _0x3c914b=typeof _0x924d9b[_0x1d7b('0x1e')]===_0x1d7b('0x1f')&&typeof _0x924d9b[_0x1d7b('0x20')]===_0x1d7b('0x1f');var _0x13bf43=_0x239bad[_0x1d7b('0x21')];var _0x3085c7=_0x3c914b?0x0:_0x924d9b[_0x1d7b('0x1e')];var _0x4ea19f=_0x3c914b?_0x239bad['count']:_0x924d9b['offset']+_0x924d9b[_0x1d7b('0x20')];var _0x44b4d5;if(_0x4ea19f>=_0x13bf43){_0x4ea19f=_0x13bf43;_0x44b4d5=0xc8;}else{_0x44b4d5=0xce;}_0x7de54f[_0x1d7b('0x1c')](_0x44b4d5);return _0x7de54f[_0x1d7b('0x22')](_0x1d7b('0x23'),_0x3085c7+'-'+_0x4ea19f+'/'+_0x13bf43)[_0x1d7b('0x1d')](_0x239bad);}return null;};}function patchUpdates(_0x3eb36c){return function(_0x98b4ad){try{jsonpatch[_0x1d7b('0x24')](_0x98b4ad,_0x3eb36c,!![]);}catch(_0x37ee16){return BPromise[_0x1d7b('0x25')](_0x37ee16);}return _0x98b4ad[_0x1d7b('0x26')]();};}function saveUpdates(_0x1becdc,_0x3a15bf){return function(_0x3abec3){if(_0x3abec3){return _0x3abec3[_0x1d7b('0x27')](_0x1becdc)[_0x1d7b('0x28')](function(_0x1aac9){return _0x1aac9;});}return null;};}function removeEntity(_0x23d537,_0x53a94b){return function(_0x323575){if(_0x323575){return _0x323575[_0x1d7b('0x29')]()['then'](function(){var _0x17ea1c=_0x323575[_0x1d7b('0x2a')]({'plain':!![]});var _0x1209c5=_0x1d7b('0x2b');return db[_0x1d7b('0x2c')][_0x1d7b('0x29')]({'where':{'type':_0x1209c5,'resourceId':_0x17ea1c['id']}})[_0x1d7b('0x28')](function(){return _0x323575;});})[_0x1d7b('0x28')](function(){_0x23d537[_0x1d7b('0x1c')](0xcc)[_0x1d7b('0x1b')]();});}};}function handleEntityNotFound(_0x481e96,_0x6dd12e){return function(_0x3764b0){if(!_0x3764b0){_0x481e96[_0x1d7b('0x1a')](0x194);}return _0x3764b0;};}function handleError(_0x1ad048,_0x51ac00){_0x51ac00=_0x51ac00||0x1f4;return function(_0x7a6bc3){logger[_0x1d7b('0x2d')](_0x7a6bc3['stack']);if(_0x7a6bc3['name']){delete _0x7a6bc3[_0x1d7b('0x2e')];}_0x1ad048['status'](_0x51ac00)[_0x1d7b('0x2f')](_0x7a6bc3);};}exports['index']=function(_0x182b95,_0x233b52){var _0x2b4da5={},_0x3d427d={},_0x29f18e={'count':0x0,'rows':[]};var _0x18e4e4=_[_0x1d7b('0x30')](db[_0x1d7b('0x31')][_0x1d7b('0x32')],function(_0x3efcba){return{'name':_0x3efcba['fieldName'],'type':_0x3efcba[_0x1d7b('0x33')][_0x1d7b('0x34')]};});_0x3d427d[_0x1d7b('0x35')]=_[_0x1d7b('0x30')](_0x18e4e4,_0x1d7b('0x2e'));_0x3d427d[_0x1d7b('0x36')]=_[_0x1d7b('0x37')](_0x182b95['query']);_0x3d427d[_0x1d7b('0x38')]=_[_0x1d7b('0x39')](_0x3d427d[_0x1d7b('0x35')],_0x3d427d[_0x1d7b('0x36')]);_0x2b4da5[_0x1d7b('0x3a')]=_['intersection'](_0x3d427d['model'],qs[_0x1d7b('0x3b')](_0x182b95[_0x1d7b('0x36')][_0x1d7b('0x3b')]));_0x2b4da5[_0x1d7b('0x3a')]=_0x2b4da5['attributes'][_0x1d7b('0x3c')]?_0x2b4da5[_0x1d7b('0x3a')]:_0x3d427d[_0x1d7b('0x35')];if(!_0x182b95['query'][_0x1d7b('0x3d')](_0x1d7b('0x3e'))){_0x2b4da5[_0x1d7b('0x20')]=qs[_0x1d7b('0x20')](_0x182b95['query']['limit']);_0x2b4da5[_0x1d7b('0x1e')]=qs[_0x1d7b('0x1e')](_0x182b95['query'][_0x1d7b('0x1e')]);}_0x2b4da5['order']=qs[_0x1d7b('0x3f')](_0x182b95['query']['sort']);_0x2b4da5['where']=qs['filters'](_['pick'](_0x182b95[_0x1d7b('0x36')],_0x3d427d[_0x1d7b('0x38')]),_0x18e4e4);if(_0x182b95[_0x1d7b('0x36')][_0x1d7b('0x40')]){_0x2b4da5[_0x1d7b('0x41')]=_[_0x1d7b('0x42')](_0x2b4da5[_0x1d7b('0x41')],{'$or':_[_0x1d7b('0x30')](_0x18e4e4,function(_0x4af89b){if(_0x4af89b['type']!==_0x1d7b('0x43')){var _0x565baf={};_0x565baf[_0x4af89b[_0x1d7b('0x2e')]]={'$like':'%'+_0x182b95[_0x1d7b('0x36')][_0x1d7b('0x40')]+'%'};return _0x565baf;}})});}_0x2b4da5=_[_0x1d7b('0x42')]({},_0x2b4da5,_0x182b95[_0x1d7b('0x44')]);var _0x4d08d6={'where':_0x2b4da5[_0x1d7b('0x41')]};return db['AnalyticCustomReport']['count'](_0x4d08d6)[_0x1d7b('0x28')](function(_0x4e4ed7){_0x29f18e['count']=_0x4e4ed7;if(_0x182b95[_0x1d7b('0x36')][_0x1d7b('0x45')]){_0x2b4da5[_0x1d7b('0x46')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x1d7b('0x47')](_0x2b4da5);})[_0x1d7b('0x28')](function(_0x428548){_0x29f18e[_0x1d7b('0x48')]=_0x428548;return _0x29f18e;})[_0x1d7b('0x28')](respondWithFilteredResult(_0x233b52,_0x2b4da5))[_0x1d7b('0x49')](handleError(_0x233b52,null));};exports[_0x1d7b('0x4a')]=function(_0x43ec1c,_0x28a7a0){var _0x186f77={'raw':![],'where':{'id':_0x43ec1c['params']['id']}},_0x381361={};_0x381361[_0x1d7b('0x35')]=_['keys'](db[_0x1d7b('0x31')]['rawAttributes']);_0x381361[_0x1d7b('0x36')]=_['keys'](_0x43ec1c[_0x1d7b('0x36')]);_0x381361['filters']=_['intersection'](_0x381361[_0x1d7b('0x35')],_0x381361['query']);_0x186f77['attributes']=_[_0x1d7b('0x39')](_0x381361[_0x1d7b('0x35')],qs[_0x1d7b('0x3b')](_0x43ec1c[_0x1d7b('0x36')][_0x1d7b('0x3b')]));_0x186f77['attributes']=_0x186f77[_0x1d7b('0x3a')][_0x1d7b('0x3c')]?_0x186f77[_0x1d7b('0x3a')]:_0x381361[_0x1d7b('0x35')];if(_0x43ec1c[_0x1d7b('0x36')][_0x1d7b('0x45')]){_0x186f77['include']=[{'all':!![]}];}_0x186f77=_[_0x1d7b('0x42')]({},_0x186f77,_0x43ec1c[_0x1d7b('0x44')]);return db[_0x1d7b('0x31')][_0x1d7b('0x4b')](_0x186f77)[_0x1d7b('0x28')](handleEntityNotFound(_0x28a7a0,null))['then'](respondWithResult(_0x28a7a0,null))[_0x1d7b('0x49')](handleError(_0x28a7a0,null));};exports[_0x1d7b('0x4c')]=function(_0x4d5b4e,_0x1b46a5){return db[_0x1d7b('0x31')][_0x1d7b('0x4c')](_0x4d5b4e[_0x1d7b('0x4d')],{})[_0x1d7b('0x28')](function(_0x266144){var _0x285b80=_0x4d5b4e[_0x1d7b('0x4e')][_0x1d7b('0x2a')]({'plain':!![]});if(!_0x285b80)throw new Error(_0x1d7b('0x4f'));if(_0x285b80[_0x1d7b('0x50')]==='user'){var _0x1ea7b8=_0x266144[_0x1d7b('0x2a')]({'plain':!![]});var _0x4a04c9=_0x1d7b('0x51');return db[_0x1d7b('0x52')][_0x1d7b('0x4b')]({'where':{'name':_0x4a04c9,'userProfileId':_0x285b80[_0x1d7b('0x53')]},'raw':!![]})[_0x1d7b('0x28')](function(_0x5b4e82){if(_0x5b4e82&&_0x5b4e82[_0x1d7b('0x54')]===0x0){return db[_0x1d7b('0x2c')][_0x1d7b('0x4c')]({'name':_0x1ea7b8[_0x1d7b('0x2e')],'resourceId':_0x1ea7b8['id'],'type':'CustomReports','sectionId':_0x5b4e82['id']},{})[_0x1d7b('0x28')](function(){return _0x266144;});}else{return _0x266144;}})['catch'](function(_0x952c54){logger[_0x1d7b('0x2d')](_0x1d7b('0x55'),_0x952c54);throw _0x952c54;});}return _0x266144;})[_0x1d7b('0x28')](respondWithResult(_0x1b46a5,0xc9))[_0x1d7b('0x49')](handleError(_0x1b46a5,null));};exports[_0x1d7b('0x27')]=function(_0x260392,_0xcc0c50){if(_0x260392[_0x1d7b('0x4d')]['id']){delete _0x260392[_0x1d7b('0x4d')]['id'];}return db[_0x1d7b('0x31')][_0x1d7b('0x4b')]({'where':{'id':_0x260392['params']['id']}})[_0x1d7b('0x28')](handleEntityNotFound(_0xcc0c50,null))[_0x1d7b('0x28')](saveUpdates(_0x260392['body'],null))['then'](respondWithResult(_0xcc0c50,null))[_0x1d7b('0x49')](handleError(_0xcc0c50,null));};exports[_0x1d7b('0x29')]=function(_0x4e74d7,_0x3e47bc){return db['AnalyticCustomReport'][_0x1d7b('0x4b')]({'where':{'id':_0x4e74d7[_0x1d7b('0x56')]['id']}})[_0x1d7b('0x28')](handleEntityNotFound(_0x3e47bc,null))['then'](removeEntity(_0x3e47bc,null))[_0x1d7b('0x49')](handleError(_0x3e47bc,null));};exports['preview']=function(_0x4a550a,_0x445798){var _0x184cc5=0xa;var _0xc2af=[_0x1d7b('0x57'),_0x1d7b('0x58'),_0x1d7b('0x59'),'cross_join'];var _0x351d5b={'SUM':_0x1d7b('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1d7b('0x5b'),'MIN':_0x1d7b('0x5c'),'AVG':_0x1d7b('0x5d'),'GROUP_CONCAT':_0x1d7b('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x1d7b('0x5f')};var _0x3fb99a={'SEC_TO_TIME':_0x1d7b('0x60'),'DATE':_0x1d7b('0x61'),'HOUR':_0x1d7b('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1d7b('0x63')};var _0x1bf231=function(_0x406ff2){return!_[_0x1d7b('0x64')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1d7b('0x65'),_0x1d7b('0x66')],_0x406ff2);};var _0x2da1fe=function(_0x5b04dc){if(!_0x5b04dc||!_0x5b04dc[_0x1d7b('0x67')][_0x1d7b('0x3c')]){return'';}for(var _0x55a81e='(',_0x5d8277=0x0;_0x5d8277<_0x5b04dc[_0x1d7b('0x67')][_0x1d7b('0x3c')];_0x5d8277+=0x1){_0x5d8277>0x0&&(_0x55a81e+='\x20'+_0x5b04dc['operator']+'\x20');_0x55a81e+=_0x5b04dc[_0x1d7b('0x67')][_0x5d8277][_0x1d7b('0x68')]?_0x2da1fe(_0x5b04dc[_0x1d7b('0x67')][_0x5d8277][_0x1d7b('0x68')]):_0x5b04dc['rules'][_0x5d8277][_0x1d7b('0x69')]+'\x20'+_0x5b04dc[_0x1d7b('0x67')][_0x5d8277][_0x1d7b('0x6a')]+(_0x1bf231(_0x5b04dc[_0x1d7b('0x67')][_0x5d8277][_0x1d7b('0x6a')])?'\x20'+_0x5b04dc['rules'][_0x5d8277][_0x1d7b('0x6b')]:'');}return _0x55a81e+')';};var _0x2d110c={'where':{'id':_0x4a550a['params']['id']}},_0x3ac628,_0x110781,_0x2d59a5,_0x1ebb8c,_0x25e7fb;_0x2d110c=_[_0x1d7b('0x42')]({},_0x2d110c,_0x4a550a[_0x1d7b('0x44')]);return db[_0x1d7b('0x31')][_0x1d7b('0x4b')](_0x2d110c)['then'](function(_0x192ba5){if(_0x192ba5){_0x3ac628=_0x192ba5;return _0x192ba5[_0x1d7b('0x6c')]();}return null;})[_0x1d7b('0x28')](function(_0x5ef1dd){if(_0x5ef1dd){if(!_0x5ef1dd[_0x1d7b('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x1d7b('0x6d'),0x193);}_0x110781=_0x5ef1dd;return db[_0x1d7b('0x6e')][_0x1d7b('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3b3a4b){if(_0x3b3a4b){_0x2d59a5=_[_0x1d7b('0x6f')](_0x3b3a4b,'id');var _0x2a66c1;var _0x3dc199=squel[_0x1d7b('0x70')]();_0x3dc199[_0x1d7b('0x71')](_0x3ac628[_0x1d7b('0x72')]);for(var _0x56b5c0=0x0;_0x56b5c0<_0x110781[_0x1d7b('0x3c')];_0x56b5c0+=0x1){_0x2a66c1=_0x110781[_0x56b5c0][_0x1d7b('0x73')]?_0x2d59a5[_0x110781[_0x56b5c0]['MetricId']]['metric']:_0x110781[_0x56b5c0][_0x1d7b('0x69')];_0x2a66c1=_0x110781[_0x56b5c0][_0x1d7b('0x74')]?_[_0x1d7b('0x75')](_0x351d5b[_0x110781[_0x56b5c0][_0x1d7b('0x74')]],'%s',_0x2a66c1):_0x2a66c1;_0x2a66c1=_0x110781[_0x56b5c0][_0x1d7b('0x76')]?_[_0x1d7b('0x75')](_0x3fb99a[_0x110781[_0x56b5c0]['format']],'%s',_0x2a66c1):_0x2a66c1;if(_0x110781[_0x56b5c0]['groupBy']){_0x3dc199[_0x1d7b('0x68')](_0x2a66c1);}_0x110781[_0x56b5c0][_0x1d7b('0x77')]&&_0x3dc199[_0x1d7b('0x78')](_0x2a66c1,_0x110781[_0x56b5c0]['orderBy']===_0x1d7b('0x79')?![]:!![]);_0x3dc199['field'](_0x2a66c1,_0x110781[_0x56b5c0][_0x1d7b('0x7a')]||_0x2a66c1);}if(_0x3ac628['joins']){_0x3ac628[_0x1d7b('0x7b')]=JSON[_0x1d7b('0x7c')](_0x3ac628['joins']);for(var _0x482297=0x0;_0x482297<_0x3ac628[_0x1d7b('0x7b')][_0x1d7b('0x3c')];_0x482297+=0x1){if(_0x3ac628[_0x1d7b('0x7b')][_0x482297][_0x1d7b('0x33')]&&_[_0x1d7b('0x64')](_0xc2af,_0x3ac628[_0x1d7b('0x7b')][_0x482297][_0x1d7b('0x33')])&&_0x3ac628['joins'][_0x482297][_0x1d7b('0x7d')]&&_0x3ac628[_0x1d7b('0x7b')][_0x482297]['foreignTable']&&_0x3ac628[_0x1d7b('0x7b')][_0x482297]['foreignKey']){_0x3dc199[_0x3ac628['joins'][_0x482297]['type']](_0x3ac628[_0x1d7b('0x7b')][_0x482297]['foreignTable'],null,util['format'](_0x1d7b('0x7e'),_0x3ac628['table'],_0x3ac628[_0x1d7b('0x7b')][_0x482297]['parentKey'],_0x3ac628[_0x1d7b('0x7b')][_0x482297][_0x1d7b('0x7f')],_0x3ac628[_0x1d7b('0x7b')][_0x482297][_0x1d7b('0x80')]));}}}if(_0x3ac628['conditions']){_0x3ac628[_0x1d7b('0x81')]=JSON['parse'](_0x3ac628[_0x1d7b('0x81')]);_0x3dc199[_0x1d7b('0x41')](_0x2da1fe(_0x3ac628[_0x1d7b('0x81')][_0x1d7b('0x68')]));}_0x25e7fb=_0x3dc199['clone']();_0x3dc199[_0x1d7b('0x20')](_0x184cc5);_0x3dc199['offset'](0x0);logger['debug'](_0x1d7b('0x82'),_0x3dc199[_0x1d7b('0x83')]());return dbH['sequelize']['query'](_0x3dc199['toString'](),{'type':dbH[_0x1d7b('0x84')][_0x1d7b('0x85')][_0x1d7b('0x86')]});}})[_0x1d7b('0x28')](respondWithResult(_0x445798,null))[_0x1d7b('0x49')](handleError(_0x445798,null));};function runReport(_0xe18960,_0x204703,_0x5cd5eb){var _0x3bc633=_0x204703[_0x1d7b('0x2e')];var _0x44ac92=0xa;var _0x1a6350=['join',_0x1d7b('0x58'),_0x1d7b('0x59'),_0x1d7b('0x87')];var _0x572358={'SUM':_0x1d7b('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1d7b('0x88'),'MAX':'MAX(%s)','MIN':_0x1d7b('0x5c'),'AVG':_0x1d7b('0x5d'),'GROUP_CONCAT':_0x1d7b('0x5e'),'GROUP_CONCAT ASC':_0x1d7b('0x89'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x581ba7={'SEC_TO_TIME':_0x1d7b('0x60'),'DATE':_0x1d7b('0x61'),'HOUR':_0x1d7b('0x62'),'ROUND':_0x1d7b('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x35a702=function(_0x1f48b8){return!_[_0x1d7b('0x64')]([_0x1d7b('0x8b'),'IS\x20NOT\x20NULL',_0x1d7b('0x65'),'IS\x20NOT\x20EMPTY'],_0x1f48b8);};var _0x32eea6=function(_0x1c4665){if(!_0x1c4665||!_0x1c4665[_0x1d7b('0x67')]['length']){return'';}for(var _0x439082='(',_0x103b16=0x0;_0x103b16<_0x1c4665[_0x1d7b('0x67')]['length'];_0x103b16+=0x1){_0x103b16>0x0&&(_0x439082+='\x20'+_0x1c4665['operator']+'\x20');_0x439082+=_0x1c4665[_0x1d7b('0x67')][_0x103b16]['group']?_0x32eea6(_0x1c4665[_0x1d7b('0x67')][_0x103b16]['group']):_0x1c4665[_0x1d7b('0x67')][_0x103b16][_0x1d7b('0x69')]+'\x20'+_0x1c4665[_0x1d7b('0x67')][_0x103b16]['condition']+(_0x35a702(_0x1c4665[_0x1d7b('0x67')][_0x103b16][_0x1d7b('0x6a')])?'\x20'+_0x1c4665[_0x1d7b('0x67')][_0x103b16][_0x1d7b('0x6b')]:'');}return _0x439082+')';};var _0xd7ea4={'where':{'id':_0xe18960['id']}},_0x32bf05,_0x1d00d3,_0x233018,_0x572a70,_0x5e2924;_0xd7ea4=_[_0x1d7b('0x42')]({},_0xd7ea4,_0x5cd5eb);return db[_0x1d7b('0x31')][_0x1d7b('0x4b')](_0xd7ea4)['then'](function(_0x4079da){if(_0x4079da){_0x32bf05=_0x4079da;return _0x4079da['getFields']();}return null;})[_0x1d7b('0x28')](function(_0x459791){if(_0x459791){if(!_0x459791[_0x1d7b('0x3c')]){throw new db[(_0x1d7b('0x8c'))]['ValidationErrorItem'](_0x1d7b('0x6d'),0x193);}_0x1d00d3=_0x459791;return db[_0x1d7b('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x30912e){if(_0x30912e){_0x233018=_['keyBy'](_0x30912e,'id');var _0x9e23f;var _0x4cad20=squel[_0x1d7b('0x70')]();_0x4cad20['from'](_0x32bf05['table']);for(var _0x51c0f1=0x0;_0x51c0f1<_0x1d00d3[_0x1d7b('0x3c')];_0x51c0f1+=0x1){_0x9e23f=_0x1d00d3[_0x51c0f1][_0x1d7b('0x73')]?_0x233018[_0x1d00d3[_0x51c0f1][_0x1d7b('0x73')]]['metric']:_0x1d00d3[_0x51c0f1][_0x1d7b('0x69')];_0x9e23f=_0x1d00d3[_0x51c0f1][_0x1d7b('0x74')]?_['replace'](_0x572358[_0x1d00d3[_0x51c0f1][_0x1d7b('0x74')]],'%s',_0x9e23f):_0x9e23f;_0x9e23f=_0x1d00d3[_0x51c0f1][_0x1d7b('0x76')]?_[_0x1d7b('0x75')](_0x581ba7[_0x1d00d3[_0x51c0f1][_0x1d7b('0x76')]],'%s',_0x9e23f):_0x9e23f;if(_0x1d00d3[_0x51c0f1][_0x1d7b('0x8d')]){_0x4cad20[_0x1d7b('0x68')](_0x9e23f);}_0x1d00d3[_0x51c0f1][_0x1d7b('0x77')]&&_0x4cad20[_0x1d7b('0x78')](_0x9e23f,_0x1d00d3[_0x51c0f1][_0x1d7b('0x77')]===_0x1d7b('0x79')?![]:!![]);_0x4cad20[_0x1d7b('0x69')](_0x9e23f,_0x1d00d3[_0x51c0f1][_0x1d7b('0x7a')]||_0x9e23f);}if(_0x32bf05[_0x1d7b('0x7b')]){_0x32bf05[_0x1d7b('0x7b')]=JSON[_0x1d7b('0x7c')](_0x32bf05[_0x1d7b('0x7b')]);for(var _0x1d31e0=0x0;_0x1d31e0<_0x32bf05['joins'][_0x1d7b('0x3c')];_0x1d31e0+=0x1){if(_0x32bf05[_0x1d7b('0x7b')][_0x1d31e0][_0x1d7b('0x33')]&&_[_0x1d7b('0x64')](_0x1a6350,_0x32bf05['joins'][_0x1d31e0][_0x1d7b('0x33')])&&_0x32bf05[_0x1d7b('0x7b')][_0x1d31e0][_0x1d7b('0x7d')]&&_0x32bf05['joins'][_0x1d31e0]['foreignTable']&&_0x32bf05[_0x1d7b('0x7b')][_0x1d31e0][_0x1d7b('0x80')]){_0x4cad20[_0x32bf05['joins'][_0x1d31e0]['type']](_0x32bf05['joins'][_0x1d31e0][_0x1d7b('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x32bf05[_0x1d7b('0x72')],_0x32bf05[_0x1d7b('0x7b')][_0x1d31e0][_0x1d7b('0x7d')],_0x32bf05[_0x1d7b('0x7b')][_0x1d31e0][_0x1d7b('0x7f')],_0x32bf05[_0x1d7b('0x7b')][_0x1d31e0]['foreignKey']));}}}if(_0x32bf05[_0x1d7b('0x81')]){_0x32bf05[_0x1d7b('0x81')]=JSON[_0x1d7b('0x7c')](_0x32bf05[_0x1d7b('0x81')]);_0x4cad20[_0x1d7b('0x41')](_0x32eea6(_0x32bf05[_0x1d7b('0x81')][_0x1d7b('0x68')]));}_0x5e2924=_0x4cad20[_0x1d7b('0x8e')]();_0x4cad20[_0x1d7b('0x20')](_0x44ac92);_0x4cad20['offset'](0x0);return;}})['then'](function(){if(_0x204703['output']===_0x1d7b('0x8f')){return null;}var _0x59b8ee=_[_0x1d7b('0x42')](_0x204703,{'name':_0x204703[_0x1d7b('0x90')]||_0x204703[_0x1d7b('0x2e')]||_0x32bf05[_0x1d7b('0x2e')],'basename':_0x3bc633,'savename':util[_0x1d7b('0x76')]('%s-%s.%s',_0x204703[_0x1d7b('0x2e')]||_0x32bf05['name'],require(_0x1d7b('0x91'))[_0x1d7b('0x92')](0x4),_0x204703[_0x1d7b('0x93')]||'csv'),'reportId':_0x32bf05['id'],'reportType':_0x1d7b('0x94')});return db['AnalyticExtractedReport'][_0x1d7b('0x4c')](_0x59b8ee,{'raw':!![]});})[_0x1d7b('0x28')](function(_0x5061c0){if(_0x32bf05['table']===_0x1d7b('0x95')){_0x5e2924[_0x1d7b('0x41')](_0x32bf05['table']+_0x1d7b('0x96'),_0x204703['startDate'],_0x204703[_0x1d7b('0x97')]);}else{_0x5e2924['where'](_0x32bf05[_0x1d7b('0x72')]+_0x1d7b('0x98'),_0x204703[_0x1d7b('0x99')],_0x204703[_0x1d7b('0x97')]);}if(_0x5061c0){logger[_0x1d7b('0x9a')](_0x1d7b('0x9b'),_0x5e2924[_0x1d7b('0x83')]());require('child_process')[_0x1d7b('0x9c')](path[_0x1d7b('0x57')](__dirname,'../../components/export/',_0x5061c0[_0x1d7b('0x93')]),[_0x5061c0['id'],_0x5e2924['toString'](),path[_0x1d7b('0x57')](__dirname,'../../files/reports',_0x5061c0[_0x1d7b('0x9d')]),_0x3bc633]);return _0x5061c0;}else{var _0x395b16=squel[_0x1d7b('0x70')]();_0x395b16[_0x1d7b('0x71')]('('+_0x5e2924[_0x1d7b('0x83')]()+')',_0x1d7b('0x9e'));_0x395b16[_0x1d7b('0x69')]('COUNT(*)','count');_0x5e2924[_0x1d7b('0x20')](_0x204703[_0x1d7b('0x20')]||_0x44ac92);_0x5e2924[_0x1d7b('0x1e')](_0x204703[_0x1d7b('0x1e')]||0x0);return dbH['sequelize'][_0x1d7b('0x36')](_0x395b16[_0x1d7b('0x83')](),{'type':dbH[_0x1d7b('0x84')]['QueryTypes']['SELECT']})['then'](function(_0x342482){if(!_0x342482[_0x1d7b('0x3c')]){_0x572a70=0x0;}else{_0x572a70=_0x342482[0x0][_0x1d7b('0x21')]||0x0;}return dbH[_0x1d7b('0x84')]['query'](_0x5e2924[_0x1d7b('0x83')](),{'type':dbH['sequelize'][_0x1d7b('0x85')][_0x1d7b('0x86')]});})['then'](function(_0x307a79){return{'rows':_0x307a79||[],'count':_0x572a70};});}});}exports[_0x1d7b('0x9f')]=function(_0x3d64b7,_0x5024c4){return runReport(_0x3d64b7[_0x1d7b('0x56')],_0x3d64b7[_0x1d7b('0x36')],_0x3d64b7['options'])[_0x1d7b('0x28')](respondWithResult(_0x5024c4,null))[_0x1d7b('0x49')](handleError(_0x5024c4,null));};exports[_0x1d7b('0xa0')]=runReport;exports[_0x1d7b('0x36')]=function(_0x3009c2,_0x21804b){var _0x445380=0xa;var _0x122701=[_0x1d7b('0x57'),_0x1d7b('0x58'),'right_join',_0x1d7b('0x87')];var _0x5e4ec9={'SUM':_0x1d7b('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1d7b('0x88'),'MAX':_0x1d7b('0x5b'),'MIN':_0x1d7b('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1d7b('0x5e'),'GROUP_CONCAT ASC':_0x1d7b('0x89'),'GROUP_CONCAT DESC':_0x1d7b('0x5f')};var _0x171aa6={'SEC_TO_TIME':_0x1d7b('0x60'),'DATE':_0x1d7b('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x1d7b('0x8a'),'UNIX_TIMESTAMP':_0x1d7b('0x63')};var _0x22d4a2=function(_0x31c2c3){return!_[_0x1d7b('0x64')]([_0x1d7b('0x8b'),'IS\x20NOT\x20NULL',_0x1d7b('0x65'),'IS\x20NOT\x20EMPTY'],_0x31c2c3);};var _0x13f066=function(_0x1679b4){if(!_0x1679b4||!_0x1679b4[_0x1d7b('0x67')]['length']){return'';}for(var _0x17c099='(',_0x1ac92f=0x0;_0x1ac92f<_0x1679b4[_0x1d7b('0x67')]['length'];_0x1ac92f+=0x1){_0x1ac92f>0x0&&(_0x17c099+='\x20'+_0x1679b4[_0x1d7b('0xa1')]+'\x20');_0x17c099+=_0x1679b4[_0x1d7b('0x67')][_0x1ac92f][_0x1d7b('0x68')]?_0x13f066(_0x1679b4[_0x1d7b('0x67')][_0x1ac92f]['group']):_0x1679b4[_0x1d7b('0x67')][_0x1ac92f][_0x1d7b('0x69')]+'\x20'+_0x1679b4[_0x1d7b('0x67')][_0x1ac92f][_0x1d7b('0x6a')]+(_0x22d4a2(_0x1679b4[_0x1d7b('0x67')][_0x1ac92f][_0x1d7b('0x6a')])?'\x20'+_0x1679b4[_0x1d7b('0x67')][_0x1ac92f][_0x1d7b('0x6b')]:'');}return _0x17c099+')';};var _0x53935d={'where':{'id':_0x3009c2[_0x1d7b('0x56')]['id']}},_0x38a89f,_0x37797b,_0xf7b486,_0x31cd71,_0xdbd38b;_0x53935d=_['merge']({},_0x53935d,_0x3009c2['options']);return db[_0x1d7b('0x31')][_0x1d7b('0x4b')](_0x53935d)['then'](function(_0x48267b){if(_0x48267b){_0x38a89f=_0x48267b;return _0x48267b['getFields']();}return null;})['then'](function(_0x425d86){if(_0x425d86){if(!_0x425d86[_0x1d7b('0x3c')]){throw new db[(_0x1d7b('0x8c'))][(_0x1d7b('0xa2'))](_0x1d7b('0x6d'),0x193);}_0x37797b=_0x425d86;return db[_0x1d7b('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x1d7b('0x28')](function(_0x3f0254){if(_0x3f0254){_0xf7b486=_[_0x1d7b('0x6f')](_0x3f0254,'id');var _0x56ceea;var _0x39776a=squel[_0x1d7b('0x70')]();_0x39776a['from'](_0x38a89f[_0x1d7b('0x72')]);for(var _0x6d5e8c=0x0;_0x6d5e8c<_0x37797b[_0x1d7b('0x3c')];_0x6d5e8c+=0x1){_0x56ceea=_0x37797b[_0x6d5e8c][_0x1d7b('0x73')]?_0xf7b486[_0x37797b[_0x6d5e8c]['MetricId']][_0x1d7b('0xa3')]:_0x37797b[_0x6d5e8c][_0x1d7b('0x69')];_0x56ceea=_0x37797b[_0x6d5e8c][_0x1d7b('0x74')]?_[_0x1d7b('0x75')](_0x5e4ec9[_0x37797b[_0x6d5e8c]['function']],'%s',_0x56ceea):_0x56ceea;_0x56ceea=_0x37797b[_0x6d5e8c]['format']?_[_0x1d7b('0x75')](_0x171aa6[_0x37797b[_0x6d5e8c][_0x1d7b('0x76')]],'%s',_0x56ceea):_0x56ceea;if(_0x37797b[_0x6d5e8c][_0x1d7b('0x8d')]){_0x39776a['group'](_0x56ceea);}_0x37797b[_0x6d5e8c][_0x1d7b('0x77')]&&_0x39776a['order'](_0x56ceea,_0x37797b[_0x6d5e8c][_0x1d7b('0x77')]==='DESC'?![]:!![]);_0x39776a[_0x1d7b('0x69')](_0x56ceea,_0x37797b[_0x6d5e8c][_0x1d7b('0x7a')]||_0x56ceea);}if(_0x38a89f[_0x1d7b('0x7b')]){_0x38a89f[_0x1d7b('0x7b')]=JSON[_0x1d7b('0x7c')](_0x38a89f[_0x1d7b('0x7b')]);for(var _0x52a8a4=0x0;_0x52a8a4<_0x38a89f['joins'][_0x1d7b('0x3c')];_0x52a8a4+=0x1){if(_0x38a89f[_0x1d7b('0x7b')][_0x52a8a4][_0x1d7b('0x33')]&&_[_0x1d7b('0x64')](_0x122701,_0x38a89f['joins'][_0x52a8a4]['type'])&&_0x38a89f[_0x1d7b('0x7b')][_0x52a8a4]['parentKey']&&_0x38a89f[_0x1d7b('0x7b')][_0x52a8a4][_0x1d7b('0x7f')]&&_0x38a89f[_0x1d7b('0x7b')][_0x52a8a4][_0x1d7b('0x80')]){_0x39776a[_0x38a89f[_0x1d7b('0x7b')][_0x52a8a4][_0x1d7b('0x33')]](_0x38a89f['joins'][_0x52a8a4][_0x1d7b('0x7f')],null,util[_0x1d7b('0x76')](_0x1d7b('0x7e'),_0x38a89f[_0x1d7b('0x72')],_0x38a89f['joins'][_0x52a8a4][_0x1d7b('0x7d')],_0x38a89f['joins'][_0x52a8a4][_0x1d7b('0x7f')],_0x38a89f[_0x1d7b('0x7b')][_0x52a8a4]['foreignKey']));}}}if(_0x38a89f[_0x1d7b('0x81')]){_0x38a89f['conditions']=JSON[_0x1d7b('0x7c')](_0x38a89f[_0x1d7b('0x81')]);_0x39776a[_0x1d7b('0x41')](_0x13f066(_0x38a89f[_0x1d7b('0x81')]['group']));}_0xdbd38b=_0x39776a[_0x1d7b('0x8e')]();_0x39776a[_0x1d7b('0x20')](_0x445380);_0x39776a[_0x1d7b('0x1e')](0x0);logger[_0x1d7b('0xa4')](_0x1d7b('0x82'),_0x39776a[_0x1d7b('0x83')]());return dbH[_0x1d7b('0x84')][_0x1d7b('0x36')](_0x39776a[_0x1d7b('0x83')](),{'type':dbH['sequelize'][_0x1d7b('0x85')][_0x1d7b('0x86')]});}})[_0x1d7b('0x28')](function(){return{'sql':_0xdbd38b[_0x1d7b('0x83')]()};})[_0x1d7b('0x28')](respondWithResult(_0x21804b,null))[_0x1d7b('0x49')](handleError(_0x21804b,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 4f58df1..a0eb980 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 _0x5bef=['analytics_custom_reports','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0x5bef,0xe8));var _0xf5be=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x5bef[_0x2ef44b];return _0x2405b9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5be('0x0'))('api');var moment=require(_0xf5be('0x1'));var BPromise=require(_0xf5be('0x2'));var rp=require(_0xf5be('0x3'));var fs=require('fs');var path=require(_0xf5be('0x4'));var rimraf=require('rimraf');var config=require(_0xf5be('0x5'));var attributes=require(_0xf5be('0x6'));module[_0xf5be('0x7')]=function(_0x5294f5,_0x30cf96){return _0x5294f5[_0xf5be('0x8')](_0xf5be('0x9'),attributes,{'tableName':_0xf5be('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe91=['moment','bluebird','request-promise','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0xbe91,0xe4));var _0x1be9=function(_0x22c415,_0x273b84){_0x22c415=_0x22c415-0x0;var _0x3ef055=_0xbe91[_0x22c415];return _0x3ef055;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1be9('0x0'))(_0x1be9('0x1'));var moment=require(_0x1be9('0x2'));var BPromise=require(_0x1be9('0x3'));var rp=require(_0x1be9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1be9('0x5'));var attributes=require(_0x1be9('0x6'));module[_0x1be9('0x7')]=function(_0x19262c,_0x20eb7d){return _0x19262c['define'](_0x1be9('0x8'),attributes,{'tableName':_0x1be9('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 97cc668..f8a9e1b 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 _0x5c06=['jayson/promise','request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x5c06,0x1ee));var _0x65c0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5c06[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x65c0('0x0'));var util=require(_0x65c0('0x1'));var moment=require('moment');var BPromise=require(_0x65c0('0x2'));var rs=require(_0x65c0('0x3'));var fs=require('fs');var Redis=require(_0x65c0('0x4'));var db=require(_0x65c0('0x5'))['db'];var utils=require(_0x65c0('0x6'));var logger=require(_0x65c0('0x7'))(_0x65c0('0x8'));var config=require(_0x65c0('0x9'));var jayson=require(_0x65c0('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6b5e12,_0x2862a1,_0x31cf4c){return new BPromise(function(_0x67c37f,_0x19ee4f){return client[_0x65c0('0xb')](_0x6b5e12,_0x31cf4c)[_0x65c0('0xc')](function(_0x595bd8){logger[_0x65c0('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2862a1,_0x65c0('0xe'));logger['debug'](_0x65c0('0xf'),_0x2862a1,_0x65c0('0xe'),JSON['stringify'](_0x595bd8));if(_0x595bd8[_0x65c0('0x10')]){if(_0x595bd8['error'][_0x65c0('0x11')]===0x1f4){logger[_0x65c0('0x10')](_0x65c0('0x12'),_0x2862a1,_0x595bd8[_0x65c0('0x10')][_0x65c0('0x13')]);return _0x19ee4f(_0x595bd8[_0x65c0('0x10')][_0x65c0('0x13')]);}logger[_0x65c0('0x10')](_0x65c0('0x12'),_0x2862a1,_0x595bd8[_0x65c0('0x10')][_0x65c0('0x13')]);return _0x67c37f(_0x595bd8[_0x65c0('0x10')]['message']);}else{logger[_0x65c0('0xd')](_0x65c0('0x12'),_0x2862a1,_0x65c0('0xe'));_0x67c37f(_0x595bd8[_0x65c0('0x14')][_0x65c0('0x13')]);}})['catch'](function(_0x8938d0){logger[_0x65c0('0x10')](_0x65c0('0x12'),_0x2862a1,_0x8938d0);_0x19ee4f(_0x8938d0);});});}
\ No newline at end of file
+var _0x5692=['then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3081ec,_0x19ced4){var _0x3cb142=function(_0x483dd6){while(--_0x483dd6){_0x3081ec['push'](_0x3081ec['shift']());}};_0x3cb142(++_0x19ced4);}(_0x5692,0x135));var _0x2569=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5692[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2569('0x0'));var util=require(_0x2569('0x1'));var moment=require(_0x2569('0x2'));var BPromise=require(_0x2569('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2569('0x4'))['db'];var utils=require(_0x2569('0x5'));var logger=require('../../config/logger')(_0x2569('0x6'));var config=require(_0x2569('0x7'));var jayson=require(_0x2569('0x8'));var client=jayson[_0x2569('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26f9d4,_0x4b5712,_0x4624eb){return new BPromise(function(_0x530ebd,_0x4004f7){return client[_0x2569('0xa')](_0x26f9d4,_0x4624eb)[_0x2569('0xb')](function(_0x7861c8){logger[_0x2569('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4b5712,_0x2569('0xd'));logger[_0x2569('0xe')](_0x2569('0xf'),_0x4b5712,_0x2569('0xd'),JSON['stringify'](_0x7861c8));if(_0x7861c8[_0x2569('0x10')]){if(_0x7861c8['error']['code']===0x1f4){logger[_0x2569('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4b5712,_0x7861c8[_0x2569('0x10')][_0x2569('0x11')]);return _0x4004f7(_0x7861c8['error'][_0x2569('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4b5712,_0x7861c8[_0x2569('0x10')][_0x2569('0x11')]);return _0x530ebd(_0x7861c8['error'][_0x2569('0x11')]);}else{logger[_0x2569('0xc')](_0x2569('0x12'),_0x4b5712,'request\x20sent');_0x530ebd(_0x7861c8[_0x2569('0x13')][_0x2569('0x11')]);}})['catch'](function(_0x1207b7){logger[_0x2569('0x10')](_0x2569('0x12'),_0x4b5712,_0x1207b7);_0x4004f7(_0x1207b7);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index ca0396d..40e23ff 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 _0xf5a7=['show','/:id/preview','/:id/run','run','post','put','update','delete','/:id','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x12d93a,_0x460b08){var _0x5e0913=function(_0x353783){while(--_0x353783){_0x12d93a['push'](_0x12d93a['shift']());}};_0x5e0913(++_0x460b08);}(_0xf5a7,0x185));var _0x7f5a=function(_0x4d7d84,_0x1cb638){_0x4d7d84=_0x4d7d84-0x0;var _0x1fb680=_0xf5a7[_0x4d7d84];return _0x1fb680;};'use strict';var multer=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var path=require(_0x7f5a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7f5a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7f5a('0x4'));var interaction=require(_0x7f5a('0x5'));var config=require(_0x7f5a('0x6'));var controller=require(_0x7f5a('0x7'));router[_0x7f5a('0x8')]('/',auth[_0x7f5a('0x9')](),controller[_0x7f5a('0xa')]);router['get']('/:id',auth[_0x7f5a('0x9')](),controller[_0x7f5a('0xb')]);router[_0x7f5a('0x8')](_0x7f5a('0xc'),auth[_0x7f5a('0x9')](),controller['preview']);router[_0x7f5a('0x8')](_0x7f5a('0xd'),auth['isAuthenticated'](),controller[_0x7f5a('0xe')]);router[_0x7f5a('0x8')]('/:id/query',auth[_0x7f5a('0x9')](),controller['query']);router[_0x7f5a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7f5a('0x10')]('/:id',auth[_0x7f5a('0x9')](),controller[_0x7f5a('0x11')]);router[_0x7f5a('0x12')](_0x7f5a('0x13'),auth[_0x7f5a('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x9b4b=['Router','fs-extra','../../components/auth/service','index','get','isAuthenticated','/:id/preview','preview','/:id/run','run','query','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x5661b5,_0x4cb990){var _0x50d57a=function(_0x2a2e08){while(--_0x2a2e08){_0x5661b5['push'](_0x5661b5['shift']());}};_0x50d57a(++_0x4cb990);}(_0x9b4b,0x11a));var _0xb9b4=function(_0x44784c,_0x4498c1){_0x44784c=_0x44784c-0x0;var _0x4bbfb1=_0x9b4b[_0x44784c];return _0x4bbfb1;};'use strict';var multer=require('multer');var util=require(_0xb9b4('0x0'));var path=require(_0xb9b4('0x1'));var timeout=require(_0xb9b4('0x2'));var express=require(_0xb9b4('0x3'));var router=express[_0xb9b4('0x4')]();var fs_extra=require(_0xb9b4('0x5'));var auth=require(_0xb9b4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb9b4('0x7')]);router[_0xb9b4('0x8')]('/:id',auth[_0xb9b4('0x9')](),controller['show']);router[_0xb9b4('0x8')](_0xb9b4('0xa'),auth[_0xb9b4('0x9')](),controller[_0xb9b4('0xb')]);router[_0xb9b4('0x8')](_0xb9b4('0xc'),auth[_0xb9b4('0x9')](),controller[_0xb9b4('0xd')]);router[_0xb9b4('0x8')]('/:id/query',auth['isAuthenticated'](),controller[_0xb9b4('0xe')]);router[_0xb9b4('0xf')]('/',auth[_0xb9b4('0x9')](),controller[_0xb9b4('0x10')]);router[_0xb9b4('0x11')](_0xb9b4('0x12'),auth[_0xb9b4('0x9')](),controller[_0xb9b4('0x13')]);router['delete'](_0xb9b4('0x12'),auth[_0xb9b4('0x9')](),controller[_0xb9b4('0x14')]);module[_0xb9b4('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index d915a99..11672cd 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 _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x248a82,_0x4fca3e){var _0x4bef56=function(_0x1d68f6){while(--_0x1d68f6){_0x248a82['push'](_0x248a82['shift']());}};_0x4bef56(++_0x4fca3e);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x599041,_0x40fbea){_0x599041=_0x599041-0x0;var _0x1c4969=_0xf2ca[_0x599041];return _0x1c4969;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}};
\ No newline at end of file
+var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x1d3263,_0x4211b6){var _0x54bd9f=function(_0x5b68a2){while(--_0x5b68a2){_0x1d3263['push'](_0x1d3263['shift']());}};_0x54bd9f(++_0x4211b6);}(_0xeda8,0x104));var _0x8eda=function(_0x7dc0bb,_0x360abf){_0x7dc0bb=_0x7dc0bb-0x0;var _0x37d0d3=_0xeda8[_0x7dc0bb];return _0x37d0d3;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 0ec0dc1..d097b31 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 _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x553b6c,_0x4ea227){var _0x14717a=function(_0x34dc05){while(--_0x34dc05){_0x553b6c['push'](_0x553b6c['shift']());}};_0x14717a(++_0x4ea227);}(_0x1cb9,0x14e));var _0x91cb=function(_0x312d4a,_0x5c2f25){_0x312d4a=_0x312d4a-0x0;var _0x5d88c4=_0x1cb9[_0x312d4a];return _0x5d88c4;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
+var _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x15833e,_0x58a046){_0x15833e=_0x15833e-0x0;var _0x5c4745=_0x687b[_0x15833e];return _0x5c4745;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 6b27d40..06696cd 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 _0xf8e3=['bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api'];(function(_0x7642a8,_0x534dac){var _0x5a9ef3=function(_0x17a3a1){while(--_0x17a3a1){_0x7642a8['push'](_0x7642a8['shift']());}};_0x5a9ef3(++_0x534dac);}(_0xf8e3,0x141));var _0x3f8e=function(_0x2a0fc4,_0x2eaf74){_0x2a0fc4=_0x2a0fc4-0x0;var _0x531d00=_0xf8e3[_0x2a0fc4];return _0x531d00;};'use strict';var _=require(_0x3f8e('0x0'));var util=require(_0x3f8e('0x1'));var logger=require(_0x3f8e('0x2'))(_0x3f8e('0x3'));var moment=require('moment');var BPromise=require(_0x3f8e('0x4'));var rp=require(_0x3f8e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3f8e('0x6'));var config=require(_0x3f8e('0x7'));var attributes=require(_0x3f8e('0x8'));module[_0x3f8e('0x9')]=function(_0x23ee55,_0x49b5ac){return _0x23ee55[_0x3f8e('0xa')](_0x3f8e('0xb'),attributes,{'tableName':_0x3f8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcaf0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api'];(function(_0x2cbb74,_0x241c10){var _0xa6d18=function(_0x5a2940){while(--_0x5a2940){_0x2cbb74['push'](_0x2cbb74['shift']());}};_0xa6d18(++_0x241c10);}(_0xcaf0,0x65));var _0x0caf=function(_0x4a624e,_0x4c63b2){_0x4a624e=_0x4a624e-0x0;var _0x4d3bc0=_0xcaf0[_0x4a624e];return _0x4d3bc0;};'use strict';var _=require(_0x0caf('0x0'));var util=require('util');var logger=require(_0x0caf('0x1'))(_0x0caf('0x2'));var moment=require(_0x0caf('0x3'));var BPromise=require(_0x0caf('0x4'));var rp=require(_0x0caf('0x5'));var fs=require('fs');var path=require(_0x0caf('0x6'));var rimraf=require(_0x0caf('0x7'));var config=require(_0x0caf('0x8'));var attributes=require(_0x0caf('0x9'));module['exports']=function(_0x4a61da,_0x120fbf){return _0x4a61da[_0x0caf('0xa')](_0x0caf('0xb'),attributes,{'tableName':_0x0caf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 8158ce7..af1c61b 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 _0x5416=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x18ed36,_0x40cfaf){var _0x174738=function(_0x5882e7){while(--_0x5882e7){_0x18ed36['push'](_0x18ed36['shift']());}};_0x174738(++_0x40cfaf);}(_0x5416,0xed));var _0x6541=function(_0x45c1e6,_0x5cc3cd){_0x45c1e6=_0x45c1e6-0x0;var _0x527020=_0x5416[_0x45c1e6];return _0x527020;};'use strict';var _=require(_0x6541('0x0'));var util=require(_0x6541('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6541('0x2'));var fs=require('fs');var Redis=require(_0x6541('0x3'));var db=require(_0x6541('0x4'))['db'];var utils=require(_0x6541('0x5'));var logger=require(_0x6541('0x6'))(_0x6541('0x7'));var config=require(_0x6541('0x8'));var jayson=require(_0x6541('0x9'));var client=jayson[_0x6541('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26c66d,_0x4ba14c,_0x77cc11){return new BPromise(function(_0x2856bf,_0x491d45){return client[_0x6541('0xb')](_0x26c66d,_0x77cc11)[_0x6541('0xc')](function(_0x559cdf){logger[_0x6541('0xd')](_0x6541('0xe'),_0x4ba14c,'request\x20sent');logger['debug'](_0x6541('0xf'),_0x4ba14c,_0x6541('0x10'),JSON[_0x6541('0x11')](_0x559cdf));if(_0x559cdf[_0x6541('0x12')]){if(_0x559cdf[_0x6541('0x12')]['code']===0x1f4){logger['error'](_0x6541('0xe'),_0x4ba14c,_0x559cdf[_0x6541('0x12')]['message']);return _0x491d45(_0x559cdf[_0x6541('0x12')][_0x6541('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ba14c,_0x559cdf['error'][_0x6541('0x13')]);return _0x2856bf(_0x559cdf['error'][_0x6541('0x13')]);}else{logger[_0x6541('0xd')](_0x6541('0xe'),_0x4ba14c,_0x6541('0x10'));_0x2856bf(_0x559cdf[_0x6541('0x14')][_0x6541('0x13')]);}})[_0x6541('0x15')](function(_0x32ffc2){logger[_0x6541('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ba14c,_0x32ffc2);_0x491d45(_0x32ffc2);});});}
\ No newline at end of file
+var _0x091e=['code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x57bf5f,_0x22405e){var _0x139f6c=function(_0x25044b){while(--_0x25044b){_0x57bf5f['push'](_0x57bf5f['shift']());}};_0x139f6c(++_0x22405e);}(_0x091e,0x17e));var _0xe091=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x091e[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0xe091('0x0'));var util=require(_0xe091('0x1'));var moment=require('moment');var BPromise=require(_0xe091('0x2'));var rs=require(_0xe091('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe091('0x4'))['db'];var utils=require(_0xe091('0x5'));var logger=require(_0xe091('0x6'))(_0xe091('0x7'));var config=require(_0xe091('0x8'));var jayson=require(_0xe091('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11ef28,_0x5736ae,_0x1ebfaa){return new BPromise(function(_0x2da76c,_0x2aa3c7){return client[_0xe091('0xa')](_0x11ef28,_0x1ebfaa)[_0xe091('0xb')](function(_0x22412d){logger[_0xe091('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5736ae,'request\x20sent');logger[_0xe091('0xd')](_0xe091('0xe'),_0x5736ae,_0xe091('0xf'),JSON['stringify'](_0x22412d));if(_0x22412d[_0xe091('0x10')]){if(_0x22412d[_0xe091('0x10')][_0xe091('0x11')]===0x1f4){logger[_0xe091('0x10')](_0xe091('0x12'),_0x5736ae,_0x22412d['error'][_0xe091('0x13')]);return _0x2aa3c7(_0x22412d[_0xe091('0x10')][_0xe091('0x13')]);}logger[_0xe091('0x10')](_0xe091('0x12'),_0x5736ae,_0x22412d[_0xe091('0x10')][_0xe091('0x13')]);return _0x2da76c(_0x22412d[_0xe091('0x10')][_0xe091('0x13')]);}else{logger[_0xe091('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5736ae,'request\x20sent');_0x2da76c(_0x22412d[_0xe091('0x14')][_0xe091('0x13')]);}})['catch'](function(_0x2319be){logger[_0xe091('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5736ae,_0x2319be);_0x2aa3c7(_0x2319be);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 939f69e..082c576 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 _0x9048=['delete','exports','multer','path','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','query','create','put','update'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9048,0xf2));var _0x8904=function(_0x1c6f83,_0x5a67e3){_0x1c6f83=_0x1c6f83-0x0;var _0x396677=_0x9048[_0x1c6f83];return _0x396677;};'use strict';var multer=require(_0x8904('0x0'));var util=require('util');var path=require(_0x8904('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8904('0x2'));var auth=require(_0x8904('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8904('0x4'));var controller=require(_0x8904('0x5'));router[_0x8904('0x6')]('/',auth[_0x8904('0x7')](),controller[_0x8904('0x8')]);router[_0x8904('0x6')](_0x8904('0x9'),auth[_0x8904('0x7')](),controller[_0x8904('0xa')]);router[_0x8904('0x6')](_0x8904('0xb'),auth[_0x8904('0x7')](),controller[_0x8904('0xc')]);router[_0x8904('0x6')]('/:id/run',auth['isAuthenticated'](),controller[_0x8904('0xd')]);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x8904('0xe')]);router['post']('/',auth[_0x8904('0x7')](),controller[_0x8904('0xf')]);router[_0x8904('0x10')](_0x8904('0x9'),auth[_0x8904('0x7')](),controller[_0x8904('0x11')]);router[_0x8904('0x12')](_0x8904('0x9'),auth[_0x8904('0x7')](),controller['destroy']);module[_0x8904('0x13')]=router;
\ No newline at end of file
+var _0x3f8b=['get','isAuthenticated','index','/:id','show','/:id/run','run','create','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11c221,_0x65c6a5){var _0x26deef=function(_0x2fa41a){while(--_0x2fa41a){_0x11c221['push'](_0x11c221['shift']());}};_0x26deef(++_0x65c6a5);}(_0x3f8b,0x1c4));var _0xb3f8=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x3f8b[_0x11946c];return _0x383935;};'use strict';var multer=require(_0xb3f8('0x0'));var util=require(_0xb3f8('0x1'));var path=require('path');var timeout=require(_0xb3f8('0x2'));var express=require(_0xb3f8('0x3'));var router=express['Router']();var fs_extra=require(_0xb3f8('0x4'));var auth=require(_0xb3f8('0x5'));var interaction=require(_0xb3f8('0x6'));var config=require(_0xb3f8('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xb3f8('0x8')]('/',auth[_0xb3f8('0x9')](),controller[_0xb3f8('0xa')]);router['get'](_0xb3f8('0xb'),auth['isAuthenticated'](),controller[_0xb3f8('0xc')]);router[_0xb3f8('0x8')]('/:id/preview',auth[_0xb3f8('0x9')](),controller['preview']);router[_0xb3f8('0x8')](_0xb3f8('0xd'),auth[_0xb3f8('0x9')](),controller[_0xb3f8('0xe')]);router[_0xb3f8('0x8')]('/:id/query',auth[_0xb3f8('0x9')](),controller['query']);router['post']('/',auth[_0xb3f8('0x9')](),controller[_0xb3f8('0xf')]);router[_0xb3f8('0x10')](_0xb3f8('0xb'),auth[_0xb3f8('0x9')](),controller[_0xb3f8('0x11')]);router[_0xb3f8('0x12')](_0xb3f8('0xb'),auth[_0xb3f8('0x9')](),controller['destroy']);module[_0xb3f8('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 53395b6..2a5d07c 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 _0x99f0=['sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE','Loading','manual','scheduled','UNSIGNED'];(function(_0x2b897c,_0x2ab777){var _0x2602a6=function(_0x22d5a4){while(--_0x22d5a4){_0x2b897c['push'](_0x2b897c['shift']());}};_0x2602a6(++_0x2ab777);}(_0x99f0,0x1e0));var _0x099f=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0x99f0[_0x903228];return _0xcec81d;};'use strict';var Sequelize=require(_0x099f('0x0'));var moment=require(_0x099f('0x1'));module[_0x099f('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x099f('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x099f('0x4')](_0x099f('0x5'),'pdf',_0x099f('0x6')),'allowNull':![],'defaultValue':_0x099f('0x5')},'savename':{'type':Sequelize[_0x099f('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x099f('0x7')]},'endDate':{'type':Sequelize[_0x099f('0x7')]},'status':{'type':Sequelize[_0x099f('0x3')],'defaultValue':_0x099f('0x8')},'type':{'type':Sequelize[_0x099f('0x4')](_0x099f('0x9'),_0x099f('0xa')),'allowNull':![],'defaultValue':_0x099f('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x099f('0xb')]},'reportType':{'type':Sequelize[_0x099f('0x3')]}};
\ No newline at end of file
+var _0xe0d0=['ENUM','pdf','csv','DATE','Loading','manual','scheduled','sequelize','moment','exports','STRING'];(function(_0x3a99c3,_0x4b254c){var _0x525117=function(_0x17e8bd){while(--_0x17e8bd){_0x3a99c3['push'](_0x3a99c3['shift']());}};_0x525117(++_0x4b254c);}(_0xe0d0,0x1e0));var _0x0e0d=function(_0x4325f8,_0xf8fee0){_0x4325f8=_0x4325f8-0x0;var _0x566582=_0xe0d0[_0x4325f8];return _0x566582;};'use strict';var Sequelize=require(_0x0e0d('0x0'));var moment=require(_0x0e0d('0x1'));module[_0x0e0d('0x2')]={'name':{'type':Sequelize[_0x0e0d('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x0e0d('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x0e0d('0x4')]('csv',_0x0e0d('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x0e0d('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x0e0d('0x7')]},'endDate':{'type':Sequelize[_0x0e0d('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x0e0d('0x8')},'type':{'type':Sequelize[_0x0e0d('0x4')](_0x0e0d('0x9'),_0x0e0d('0xa')),'allowNull':![],'defaultValue':_0x0e0d('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x0e0d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index eae0704..22014cc 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 _0x3f8b=['set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','output','join','root','server/files/reports','savename','Sequelize','ValidationError','exists','download','%s.%s','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x52354f,_0x32d3a3){var _0x71824e=function(_0x4f6e65){while(--_0x4f6e65){_0x52354f['push'](_0x52354f['shift']());}};_0x71824e(++_0x32d3a3);}(_0x3f8b,0xa0));var _0xb3f8=function(_0x1e6beb,_0x186539){_0x1e6beb=_0x1e6beb-0x0;var _0x54738c=_0x3f8b[_0x1e6beb];return _0x54738c;};'use strict';var emlformat=require(_0xb3f8('0x0'));var rimraf=require(_0xb3f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3f8('0x2'));var rp=require(_0xb3f8('0x3'));var moment=require(_0xb3f8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb3f8('0x5'));var util=require('util');var path=require(_0xb3f8('0x6'));var sox=require(_0xb3f8('0x7'));var csv=require(_0xb3f8('0x8'));var ejs=require(_0xb3f8('0x9'));var fs=require('fs');var fs_extra=require(_0xb3f8('0xa'));var _=require(_0xb3f8('0xb'));var squel=require('squel');var crypto=require(_0xb3f8('0xc'));var jsforce=require(_0xb3f8('0xd'));var deskjs=require(_0xb3f8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb3f8('0xf'));var Papa=require(_0xb3f8('0x10'));var Redis=require('ioredis');var authService=require(_0xb3f8('0x11'));var qs=require(_0xb3f8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb3f8('0x13'));var utils=require(_0xb3f8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb3f8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37bb23,_0x5a42bb){_0x5a42bb=_0x5a42bb||0xcc;return function(_0x7adc8a){if(_0x7adc8a){return _0x37bb23[_0xb3f8('0x16')](_0x5a42bb);}return _0x37bb23[_0xb3f8('0x17')](_0x5a42bb)[_0xb3f8('0x18')]();};}function respondWithResult(_0x124d04,_0x410a5d){_0x410a5d=_0x410a5d||0xc8;return function(_0x14ef8a){if(_0x14ef8a){return _0x124d04[_0xb3f8('0x17')](_0x410a5d)[_0xb3f8('0x19')](_0x14ef8a);}};}function respondWithFilteredResult(_0x25493d,_0x511dec){return function(_0x2d1e0c){if(_0x2d1e0c){var _0x3abc49=typeof _0x511dec[_0xb3f8('0x1a')]===_0xb3f8('0x1b')&&typeof _0x511dec['limit']===_0xb3f8('0x1b');var _0x7adea2=_0x2d1e0c[_0xb3f8('0x1c')];var _0x4c4c23=_0x3abc49?0x0:_0x511dec[_0xb3f8('0x1a')];var _0x492906=_0x3abc49?_0x2d1e0c[_0xb3f8('0x1c')]:_0x511dec[_0xb3f8('0x1a')]+_0x511dec[_0xb3f8('0x1d')];var _0x30f7e2;if(_0x492906>=_0x7adea2){_0x492906=_0x7adea2;_0x30f7e2=0xc8;}else{_0x30f7e2=0xce;}_0x25493d[_0xb3f8('0x17')](_0x30f7e2);return _0x25493d[_0xb3f8('0x1e')](_0xb3f8('0x1f'),_0x4c4c23+'-'+_0x492906+'/'+_0x7adea2)[_0xb3f8('0x19')](_0x2d1e0c);}return null;};}function patchUpdates(_0x51c51e){return function(_0x28ca7f){try{jsonpatch[_0xb3f8('0x20')](_0x28ca7f,_0x51c51e,!![]);}catch(_0x5cac2b){return BPromise[_0xb3f8('0x21')](_0x5cac2b);}return _0x28ca7f[_0xb3f8('0x22')]();};}function saveUpdates(_0x4cbba8,_0x3edb71){return function(_0x453dce){if(_0x453dce){return _0x453dce[_0xb3f8('0x23')](_0x4cbba8)[_0xb3f8('0x24')](function(_0x4a859e){return _0x4a859e;});}return null;};}function removeEntity(_0x5349a4,_0x5c987b){return function(_0x139c7f){if(_0x139c7f){return _0x139c7f[_0xb3f8('0x25')]()['then'](function(){var _0x48da1f=_0x139c7f[_0xb3f8('0x26')]({'plain':!![]});var _0x3894a9=_0xb3f8('0x27');return db[_0xb3f8('0x28')][_0xb3f8('0x25')]({'where':{'type':_0x3894a9,'resourceId':_0x48da1f['id']}})[_0xb3f8('0x24')](function(){return _0x139c7f;});})[_0xb3f8('0x24')](function(){_0x5349a4[_0xb3f8('0x17')](0xcc)[_0xb3f8('0x18')]();});}};}function handleEntityNotFound(_0x29ed08,_0x1bab5c){return function(_0x4357ce){if(!_0x4357ce){_0x29ed08['sendStatus'](0x194);}return _0x4357ce;};}function handleError(_0x5090bd,_0x86af01){_0x86af01=_0x86af01||0x1f4;return function(_0x3744ca){logger[_0xb3f8('0x29')](_0x3744ca[_0xb3f8('0x2a')]);if(_0x3744ca[_0xb3f8('0x2b')]){delete _0x3744ca['name'];}_0x5090bd[_0xb3f8('0x17')](_0x86af01)[_0xb3f8('0x2c')](_0x3744ca);};}exports['index']=function(_0x2051a9,_0x459e07){var _0x30c61a={},_0x4b54af={},_0x940591={'count':0x0,'rows':[]};var _0xb3ced=_[_0xb3f8('0x2d')](db[_0xb3f8('0x2e')][_0xb3f8('0x2f')],function(_0x184a17){return{'name':_0x184a17[_0xb3f8('0x30')],'type':_0x184a17[_0xb3f8('0x31')][_0xb3f8('0x32')]};});_0x4b54af[_0xb3f8('0x33')]=_[_0xb3f8('0x2d')](_0xb3ced,_0xb3f8('0x2b'));_0x4b54af[_0xb3f8('0x34')]=_[_0xb3f8('0x35')](_0x2051a9[_0xb3f8('0x34')]);_0x4b54af[_0xb3f8('0x36')]=_['intersection'](_0x4b54af[_0xb3f8('0x33')],_0x4b54af[_0xb3f8('0x34')]);_0x30c61a[_0xb3f8('0x37')]=_[_0xb3f8('0x38')](_0x4b54af['model'],qs[_0xb3f8('0x39')](_0x2051a9[_0xb3f8('0x34')][_0xb3f8('0x39')]));_0x30c61a[_0xb3f8('0x37')]=_0x30c61a[_0xb3f8('0x37')]['length']?_0x30c61a[_0xb3f8('0x37')]:_0x4b54af[_0xb3f8('0x33')];if(!_0x2051a9['query'][_0xb3f8('0x3a')](_0xb3f8('0x3b'))){_0x30c61a[_0xb3f8('0x1d')]=qs[_0xb3f8('0x1d')](_0x2051a9[_0xb3f8('0x34')]['limit']);_0x30c61a[_0xb3f8('0x1a')]=qs['offset'](_0x2051a9[_0xb3f8('0x34')][_0xb3f8('0x1a')]);}_0x30c61a['order']=qs[_0xb3f8('0x3c')](_0x2051a9['query'][_0xb3f8('0x3c')]);_0x30c61a[_0xb3f8('0x3d')]=qs['filters'](_[_0xb3f8('0x3e')](_0x2051a9['query'],_0x4b54af[_0xb3f8('0x36')]),_0xb3ced);if(_0x2051a9[_0xb3f8('0x34')]['filter']){_0x30c61a[_0xb3f8('0x3d')]=_[_0xb3f8('0x3f')](_0x30c61a[_0xb3f8('0x3d')],{'$or':_[_0xb3f8('0x2d')](_0xb3ced,function(_0x5b46d4){if(_0x5b46d4[_0xb3f8('0x31')]!==_0xb3f8('0x40')){var _0x3cd945={};_0x3cd945[_0x5b46d4[_0xb3f8('0x2b')]]={'$like':'%'+_0x2051a9['query'][_0xb3f8('0x41')]+'%'};return _0x3cd945;}})});}_0x30c61a=_[_0xb3f8('0x3f')]({},_0x30c61a,_0x2051a9[_0xb3f8('0x42')]);var _0x5ac425={'where':_0x30c61a[_0xb3f8('0x3d')]};return db[_0xb3f8('0x2e')][_0xb3f8('0x1c')](_0x5ac425)[_0xb3f8('0x24')](function(_0x229d91){_0x940591[_0xb3f8('0x1c')]=_0x229d91;if(_0x2051a9['query'][_0xb3f8('0x43')]){_0x30c61a['include']=[{'all':!![]}];}return db[_0xb3f8('0x2e')][_0xb3f8('0x44')](_0x30c61a);})[_0xb3f8('0x24')](function(_0x140d67){_0x940591[_0xb3f8('0x45')]=_0x140d67;return _0x940591;})[_0xb3f8('0x24')](respondWithFilteredResult(_0x459e07,_0x30c61a))[_0xb3f8('0x46')](handleError(_0x459e07,null));};exports[_0xb3f8('0x47')]=function(_0xd30e60,_0x3d0faa){var _0x948a4f={'raw':!![],'where':{'id':_0xd30e60[_0xb3f8('0x48')]['id']}},_0x1ef289={};_0x1ef289[_0xb3f8('0x33')]=_[_0xb3f8('0x35')](db[_0xb3f8('0x2e')][_0xb3f8('0x2f')]);_0x1ef289['query']=_[_0xb3f8('0x35')](_0xd30e60[_0xb3f8('0x34')]);_0x1ef289['filters']=_['intersection'](_0x1ef289[_0xb3f8('0x33')],_0x1ef289['query']);_0x948a4f['attributes']=_[_0xb3f8('0x38')](_0x1ef289['model'],qs['fields'](_0xd30e60['query'][_0xb3f8('0x39')]));_0x948a4f[_0xb3f8('0x37')]=_0x948a4f['attributes'][_0xb3f8('0x49')]?_0x948a4f['attributes']:_0x1ef289['model'];if(_0xd30e60['query'][_0xb3f8('0x43')]){_0x948a4f['include']=[{'all':!![]}];}_0x948a4f=_[_0xb3f8('0x3f')]({},_0x948a4f,_0xd30e60[_0xb3f8('0x42')]);return db['AnalyticExtractedReport'][_0xb3f8('0x4a')](_0x948a4f)[_0xb3f8('0x24')](handleEntityNotFound(_0x3d0faa,null))[_0xb3f8('0x24')](respondWithResult(_0x3d0faa,null))[_0xb3f8('0x46')](handleError(_0x3d0faa,null));};exports[_0xb3f8('0x4b')]=function(_0x457f94,_0x4a2537){return db[_0xb3f8('0x2e')][_0xb3f8('0x4b')](_0x457f94[_0xb3f8('0x4c')],{})[_0xb3f8('0x24')](function(_0x18a887){var _0x19b027=_0x457f94['user']['get']({'plain':!![]});if(!_0x19b027)throw new Error(_0xb3f8('0x4d'));if(_0x19b027[_0xb3f8('0x4e')]===_0xb3f8('0x4f')){var _0x454c8c=_0x18a887[_0xb3f8('0x26')]({'plain':!![]});var _0x3a8102=_0xb3f8('0x27');return db[_0xb3f8('0x50')][_0xb3f8('0x4a')]({'where':{'name':_0x3a8102,'userProfileId':_0x19b027[_0xb3f8('0x51')]},'raw':!![]})[_0xb3f8('0x24')](function(_0x13e7d5){if(_0x13e7d5&&_0x13e7d5[_0xb3f8('0x52')]===0x0){return db[_0xb3f8('0x28')][_0xb3f8('0x4b')]({'name':_0x454c8c['name'],'resourceId':_0x454c8c['id'],'type':_0x13e7d5[_0xb3f8('0x2b')],'sectionId':_0x13e7d5['id']},{})['then'](function(){return _0x18a887;});}else{return _0x18a887;}})['catch'](function(_0x569baa){logger[_0xb3f8('0x29')](_0xb3f8('0x53'),_0x569baa);throw _0x569baa;});}return _0x18a887;})['then'](respondWithResult(_0x4a2537,0xc9))[_0xb3f8('0x46')](handleError(_0x4a2537,null));};exports[_0xb3f8('0x23')]=function(_0x2f6e22,_0x5e30cc){if(_0x2f6e22[_0xb3f8('0x4c')]['id']){delete _0x2f6e22[_0xb3f8('0x4c')]['id'];}return db['AnalyticExtractedReport'][_0xb3f8('0x4a')]({'where':{'id':_0x2f6e22[_0xb3f8('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e30cc,null))[_0xb3f8('0x24')](saveUpdates(_0x2f6e22[_0xb3f8('0x4c')],null))['then'](respondWithResult(_0x5e30cc,null))[_0xb3f8('0x46')](handleError(_0x5e30cc,null));};exports[_0xb3f8('0x25')]=function(_0xdf67a5,_0xa0c18c){return db['AnalyticExtractedReport'][_0xb3f8('0x4a')]({'where':{'id':_0xdf67a5[_0xb3f8('0x48')]['id']}})['then'](handleEntityNotFound(_0xa0c18c,null))[_0xb3f8('0x24')](removeEntity(_0xa0c18c,null))[_0xb3f8('0x46')](handleError(_0xa0c18c,null));};exports['download']=function(_0x4ba8e2,_0x4188a4,_0x1d86d1){return db['AnalyticExtractedReport'][_0xb3f8('0x4a')]({'where':{'id':_0x4ba8e2[_0xb3f8('0x48')]['id']},'attributes':[_0xb3f8('0x2b'),'basename','savename',_0xb3f8('0x54')],'raw':!![]})[_0xb3f8('0x24')](handleEntityNotFound(_0x4188a4,null))['then'](function(_0x323da9){if(_0x323da9){if(!fs['existsSync'](path[_0xb3f8('0x55')](config[_0xb3f8('0x56')],_0xb3f8('0x57'),_0x323da9[_0xb3f8('0x58')]))){throw new db[(_0xb3f8('0x59'))][(_0xb3f8('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x4ba8e2[_0xb3f8('0x34')][_0xb3f8('0x5b')]){return _0x4188a4[_0xb3f8('0x16')](0xc8);}return _0x4188a4[_0xb3f8('0x5c')](path[_0xb3f8('0x55')](config[_0xb3f8('0x56')],_0xb3f8('0x57'),_0x323da9[_0xb3f8('0x58')]),util['format'](_0xb3f8('0x5d'),_0x323da9[_0xb3f8('0x5e')]||_0x323da9['name'],_0x323da9[_0xb3f8('0x54')]['toLowerCase']()));}})['catch'](handleError(_0x4188a4,null));};
\ No newline at end of file
+var _0x6a38=['type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','savename','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','name','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','filter'];(function(_0x23a823,_0x4dbde0){var _0x5cbe93=function(_0x511fc9){while(--_0x511fc9){_0x23a823['push'](_0x23a823['shift']());}};_0x5cbe93(++_0x4dbde0);}(_0x6a38,0x189));var _0x86a3=function(_0xb204aa,_0x1809b2){_0xb204aa=_0xb204aa-0x0;var _0x2b2ee1=_0x6a38[_0xb204aa];return _0x2b2ee1;};'use strict';var emlformat=require(_0x86a3('0x0'));var rimraf=require(_0x86a3('0x1'));var zipdir=require(_0x86a3('0x2'));var jsonpatch=require(_0x86a3('0x3'));var rp=require('request-promise');var moment=require(_0x86a3('0x4'));var BPromise=require(_0x86a3('0x5'));var Mustache=require(_0x86a3('0x6'));var util=require(_0x86a3('0x7'));var path=require('path');var sox=require(_0x86a3('0x8'));var csv=require(_0x86a3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86a3('0xa'));var _=require('lodash');var squel=require(_0x86a3('0xb'));var crypto=require(_0x86a3('0xc'));var jsforce=require(_0x86a3('0xd'));var deskjs=require(_0x86a3('0xe'));var toCsv=require(_0x86a3('0x9'));var querystring=require('querystring');var Papa=require(_0x86a3('0xf'));var Redis=require(_0x86a3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x86a3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x86a3('0x12'));var logger=require(_0x86a3('0x13'))('api');var utils=require(_0x86a3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x86a3('0x15'));var db=require(_0x86a3('0x16'))['db'];function respondWithStatusCode(_0x34111e,_0x7f5c7a){_0x7f5c7a=_0x7f5c7a||0xcc;return function(_0x3a13a9){if(_0x3a13a9){return _0x34111e[_0x86a3('0x17')](_0x7f5c7a);}return _0x34111e[_0x86a3('0x18')](_0x7f5c7a)[_0x86a3('0x19')]();};}function respondWithResult(_0x23e247,_0x383a7d){_0x383a7d=_0x383a7d||0xc8;return function(_0x196fbe){if(_0x196fbe){return _0x23e247['status'](_0x383a7d)[_0x86a3('0x1a')](_0x196fbe);}};}function respondWithFilteredResult(_0x4c2b31,_0xc68a9f){return function(_0x28ebe7){if(_0x28ebe7){var _0x19591f=typeof _0xc68a9f['offset']===_0x86a3('0x1b')&&typeof _0xc68a9f[_0x86a3('0x1c')]===_0x86a3('0x1b');var _0xc7b4e0=_0x28ebe7['count'];var _0x4ac139=_0x19591f?0x0:_0xc68a9f[_0x86a3('0x1d')];var _0x126ecb=_0x19591f?_0x28ebe7[_0x86a3('0x1e')]:_0xc68a9f[_0x86a3('0x1d')]+_0xc68a9f[_0x86a3('0x1c')];var _0x4298df;if(_0x126ecb>=_0xc7b4e0){_0x126ecb=_0xc7b4e0;_0x4298df=0xc8;}else{_0x4298df=0xce;}_0x4c2b31[_0x86a3('0x18')](_0x4298df);return _0x4c2b31[_0x86a3('0x1f')](_0x86a3('0x20'),_0x4ac139+'-'+_0x126ecb+'/'+_0xc7b4e0)[_0x86a3('0x1a')](_0x28ebe7);}return null;};}function patchUpdates(_0x59fc3e){return function(_0x34ee32){try{jsonpatch['apply'](_0x34ee32,_0x59fc3e,!![]);}catch(_0x2c1fe2){return BPromise[_0x86a3('0x21')](_0x2c1fe2);}return _0x34ee32[_0x86a3('0x22')]();};}function saveUpdates(_0x9619ad,_0xf88977){return function(_0x198f7b){if(_0x198f7b){return _0x198f7b['update'](_0x9619ad)[_0x86a3('0x23')](function(_0xe5e0a9){return _0xe5e0a9;});}return null;};}function removeEntity(_0x855eb4,_0x2479ea){return function(_0x228476){if(_0x228476){return _0x228476[_0x86a3('0x24')]()['then'](function(){var _0x47e99c=_0x228476[_0x86a3('0x25')]({'plain':!![]});var _0x1c6036='ExtractedReports';return db[_0x86a3('0x26')][_0x86a3('0x24')]({'where':{'type':_0x1c6036,'resourceId':_0x47e99c['id']}})['then'](function(){return _0x228476;});})[_0x86a3('0x23')](function(){_0x855eb4[_0x86a3('0x18')](0xcc)[_0x86a3('0x19')]();});}};}function handleEntityNotFound(_0x41cbbd,_0x4d9d3d){return function(_0x2965d4){if(!_0x2965d4){_0x41cbbd[_0x86a3('0x17')](0x194);}return _0x2965d4;};}function handleError(_0x4bd969,_0x4ecbb6){_0x4ecbb6=_0x4ecbb6||0x1f4;return function(_0x48fed9){logger[_0x86a3('0x27')](_0x48fed9['stack']);if(_0x48fed9[_0x86a3('0x28')]){delete _0x48fed9[_0x86a3('0x28')];}_0x4bd969[_0x86a3('0x18')](_0x4ecbb6)['send'](_0x48fed9);};}exports['index']=function(_0x239928,_0x16116d){var _0x23e27d={},_0x3ad8ec={},_0x3b0d67={'count':0x0,'rows':[]};var _0x34b529=_[_0x86a3('0x29')](db[_0x86a3('0x2a')][_0x86a3('0x2b')],function(_0x49d1a8){return{'name':_0x49d1a8[_0x86a3('0x2c')],'type':_0x49d1a8['type'][_0x86a3('0x2d')]};});_0x3ad8ec[_0x86a3('0x2e')]=_[_0x86a3('0x29')](_0x34b529,_0x86a3('0x28'));_0x3ad8ec[_0x86a3('0x2f')]=_[_0x86a3('0x30')](_0x239928['query']);_0x3ad8ec[_0x86a3('0x31')]=_[_0x86a3('0x32')](_0x3ad8ec[_0x86a3('0x2e')],_0x3ad8ec[_0x86a3('0x2f')]);_0x23e27d['attributes']=_['intersection'](_0x3ad8ec[_0x86a3('0x2e')],qs[_0x86a3('0x33')](_0x239928[_0x86a3('0x2f')][_0x86a3('0x33')]));_0x23e27d['attributes']=_0x23e27d[_0x86a3('0x34')][_0x86a3('0x35')]?_0x23e27d['attributes']:_0x3ad8ec['model'];if(!_0x239928[_0x86a3('0x2f')]['hasOwnProperty']('nolimit')){_0x23e27d['limit']=qs[_0x86a3('0x1c')](_0x239928['query'][_0x86a3('0x1c')]);_0x23e27d[_0x86a3('0x1d')]=qs['offset'](_0x239928[_0x86a3('0x2f')][_0x86a3('0x1d')]);}_0x23e27d['order']=qs[_0x86a3('0x36')](_0x239928[_0x86a3('0x2f')][_0x86a3('0x36')]);_0x23e27d[_0x86a3('0x37')]=qs[_0x86a3('0x31')](_['pick'](_0x239928[_0x86a3('0x2f')],_0x3ad8ec[_0x86a3('0x31')]),_0x34b529);if(_0x239928['query'][_0x86a3('0x38')]){_0x23e27d[_0x86a3('0x37')]=_['merge'](_0x23e27d[_0x86a3('0x37')],{'$or':_[_0x86a3('0x29')](_0x34b529,function(_0x26e8a5){if(_0x26e8a5[_0x86a3('0x39')]!==_0x86a3('0x3a')){var _0x51ce42={};_0x51ce42[_0x26e8a5['name']]={'$like':'%'+_0x239928[_0x86a3('0x2f')][_0x86a3('0x38')]+'%'};return _0x51ce42;}})});}_0x23e27d=_[_0x86a3('0x3b')]({},_0x23e27d,_0x239928[_0x86a3('0x3c')]);var _0x1081d7={'where':_0x23e27d['where']};return db[_0x86a3('0x2a')][_0x86a3('0x1e')](_0x1081d7)[_0x86a3('0x23')](function(_0x2b8f7b){_0x3b0d67['count']=_0x2b8f7b;if(_0x239928[_0x86a3('0x2f')][_0x86a3('0x3d')]){_0x23e27d[_0x86a3('0x3e')]=[{'all':!![]}];}return db[_0x86a3('0x2a')][_0x86a3('0x3f')](_0x23e27d);})[_0x86a3('0x23')](function(_0x593f30){_0x3b0d67[_0x86a3('0x40')]=_0x593f30;return _0x3b0d67;})[_0x86a3('0x23')](respondWithFilteredResult(_0x16116d,_0x23e27d))['catch'](handleError(_0x16116d,null));};exports[_0x86a3('0x41')]=function(_0x53e571,_0xe497bb){var _0x3b0d1b={'raw':!![],'where':{'id':_0x53e571[_0x86a3('0x42')]['id']}},_0x4ae206={};_0x4ae206[_0x86a3('0x2e')]=_[_0x86a3('0x30')](db[_0x86a3('0x2a')][_0x86a3('0x2b')]);_0x4ae206[_0x86a3('0x2f')]=_['keys'](_0x53e571[_0x86a3('0x2f')]);_0x4ae206[_0x86a3('0x31')]=_[_0x86a3('0x32')](_0x4ae206[_0x86a3('0x2e')],_0x4ae206['query']);_0x3b0d1b[_0x86a3('0x34')]=_[_0x86a3('0x32')](_0x4ae206[_0x86a3('0x2e')],qs[_0x86a3('0x33')](_0x53e571['query'][_0x86a3('0x33')]));_0x3b0d1b[_0x86a3('0x34')]=_0x3b0d1b[_0x86a3('0x34')][_0x86a3('0x35')]?_0x3b0d1b[_0x86a3('0x34')]:_0x4ae206[_0x86a3('0x2e')];if(_0x53e571[_0x86a3('0x2f')][_0x86a3('0x3d')]){_0x3b0d1b[_0x86a3('0x3e')]=[{'all':!![]}];}_0x3b0d1b=_[_0x86a3('0x3b')]({},_0x3b0d1b,_0x53e571[_0x86a3('0x3c')]);return db[_0x86a3('0x2a')][_0x86a3('0x43')](_0x3b0d1b)[_0x86a3('0x23')](handleEntityNotFound(_0xe497bb,null))[_0x86a3('0x23')](respondWithResult(_0xe497bb,null))['catch'](handleError(_0xe497bb,null));};exports[_0x86a3('0x44')]=function(_0x5d4f6c,_0x2181ea){return db[_0x86a3('0x2a')][_0x86a3('0x44')](_0x5d4f6c[_0x86a3('0x45')],{})[_0x86a3('0x23')](function(_0x40af65){var _0x311e6a=_0x5d4f6c[_0x86a3('0x46')][_0x86a3('0x25')]({'plain':!![]});if(!_0x311e6a)throw new Error(_0x86a3('0x47'));if(_0x311e6a[_0x86a3('0x48')]===_0x86a3('0x46')){var _0x24b3a1=_0x40af65['get']({'plain':!![]});var _0x58af52='ExtractedReports';return db[_0x86a3('0x49')]['find']({'where':{'name':_0x58af52,'userProfileId':_0x311e6a[_0x86a3('0x4a')]},'raw':!![]})[_0x86a3('0x23')](function(_0x14e14b){if(_0x14e14b&&_0x14e14b[_0x86a3('0x4b')]===0x0){return db[_0x86a3('0x26')][_0x86a3('0x44')]({'name':_0x24b3a1['name'],'resourceId':_0x24b3a1['id'],'type':_0x14e14b[_0x86a3('0x28')],'sectionId':_0x14e14b['id']},{})[_0x86a3('0x23')](function(){return _0x40af65;});}else{return _0x40af65;}})[_0x86a3('0x4c')](function(_0xc1807f){logger['error'](_0x86a3('0x4d'),_0xc1807f);throw _0xc1807f;});}return _0x40af65;})[_0x86a3('0x23')](respondWithResult(_0x2181ea,0xc9))['catch'](handleError(_0x2181ea,null));};exports['update']=function(_0x2602ee,_0xfdccbf){if(_0x2602ee['body']['id']){delete _0x2602ee[_0x86a3('0x45')]['id'];}return db[_0x86a3('0x2a')]['find']({'where':{'id':_0x2602ee['params']['id']}})[_0x86a3('0x23')](handleEntityNotFound(_0xfdccbf,null))[_0x86a3('0x23')](saveUpdates(_0x2602ee[_0x86a3('0x45')],null))[_0x86a3('0x23')](respondWithResult(_0xfdccbf,null))[_0x86a3('0x4c')](handleError(_0xfdccbf,null));};exports[_0x86a3('0x24')]=function(_0x591785,_0x19b572){return db['AnalyticExtractedReport'][_0x86a3('0x43')]({'where':{'id':_0x591785['params']['id']}})['then'](handleEntityNotFound(_0x19b572,null))[_0x86a3('0x23')](removeEntity(_0x19b572,null))[_0x86a3('0x4c')](handleError(_0x19b572,null));};exports[_0x86a3('0x4e')]=function(_0x597153,_0x450e83,_0x483e64){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x597153[_0x86a3('0x42')]['id']},'attributes':[_0x86a3('0x28'),_0x86a3('0x4f'),'savename',_0x86a3('0x50')],'raw':!![]})[_0x86a3('0x23')](handleEntityNotFound(_0x450e83,null))[_0x86a3('0x23')](function(_0x4b7c85){if(_0x4b7c85){if(!fs[_0x86a3('0x51')](path[_0x86a3('0x52')](config[_0x86a3('0x53')],_0x86a3('0x54'),_0x4b7c85['savename']))){throw new db['Sequelize']['ValidationError'](_0x86a3('0x55'));}if(_0x597153[_0x86a3('0x2f')][_0x86a3('0x56')]){return _0x450e83[_0x86a3('0x17')](0xc8);}return _0x450e83[_0x86a3('0x4e')](path[_0x86a3('0x52')](config['root'],_0x86a3('0x54'),_0x4b7c85[_0x86a3('0x57')]),util['format'](_0x86a3('0x58'),_0x4b7c85['basename']||_0x4b7c85[_0x86a3('0x28')],_0x4b7c85[_0x86a3('0x50')][_0x86a3('0x59')]()));}})[_0x86a3('0x4c')](handleError(_0x450e83,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 883ee18..f92f39d 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 _0x4041=['./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','moment','bluebird','request-promise','../../config/environment'];(function(_0x51a32e,_0x5b6849){var _0x15c3b7=function(_0x3cbb1e){while(--_0x3cbb1e){_0x51a32e['push'](_0x51a32e['shift']());}};_0x15c3b7(++_0x5b6849);}(_0x4041,0xf7));var _0x1404=function(_0x41dec9,_0x2be329){_0x41dec9=_0x41dec9-0x0;var _0x2c7a76=_0x4041[_0x41dec9];return _0x2c7a76;};'use strict';var _=require(_0x1404('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1404('0x1'));var BPromise=require(_0x1404('0x2'));var rp=require(_0x1404('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1404('0x4'));var attributes=require(_0x1404('0x5'));module['exports']=function(_0x4c02e7,_0x2158e2){return _0x4c02e7[_0x1404('0x6')](_0x1404('0x7'),attributes,{'tableName':_0x1404('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd314=['define','AnalyticExtractedReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x3ea5e1,_0x17c486){var _0x1b81d7=function(_0x5af999){while(--_0x5af999){_0x3ea5e1['push'](_0x3ea5e1['shift']());}};_0x1b81d7(++_0x17c486);}(_0xd314,0x9e));var _0x4d31=function(_0x4daa9b,_0x4a0596){_0x4daa9b=_0x4daa9b-0x0;var _0x33b857=_0xd314[_0x4daa9b];return _0x33b857;};'use strict';var _=require(_0x4d31('0x0'));var util=require(_0x4d31('0x1'));var logger=require(_0x4d31('0x2'))(_0x4d31('0x3'));var moment=require('moment');var BPromise=require(_0x4d31('0x4'));var rp=require(_0x4d31('0x5'));var fs=require('fs');var path=require(_0x4d31('0x6'));var rimraf=require('rimraf');var config=require(_0x4d31('0x7'));var attributes=require(_0x4d31('0x8'));module[_0x4d31('0x9')]=function(_0x3508c4,_0x64e3ca){return _0x3508c4[_0x4d31('0xa')](_0x4d31('0xb'),attributes,{'tableName':'analytics_extracted_reports','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 b48b923..4356a48 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 _0x924e=['request\x20sent','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x3cc6c1,_0x6dbd58){var _0x52522b=function(_0x5cc44a){while(--_0x5cc44a){_0x3cc6c1['push'](_0x3cc6c1['shift']());}};_0x52522b(++_0x6dbd58);}(_0x924e,0xce));var _0xe924=function(_0x5e958b,_0xef0360){_0x5e958b=_0x5e958b-0x0;var _0x57bcf9=_0x924e[_0x5e958b];return _0x57bcf9;};'use strict';var _=require('lodash');var util=require(_0xe924('0x0'));var moment=require('moment');var BPromise=require(_0xe924('0x1'));var rs=require(_0xe924('0x2'));var fs=require('fs');var Redis=require(_0xe924('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe924('0x4'));var logger=require(_0xe924('0x5'))(_0xe924('0x6'));var config=require(_0xe924('0x7'));var jayson=require(_0xe924('0x8'));var client=jayson[_0xe924('0x9')][_0xe924('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159156,_0x5e6bed,_0x147759){return new BPromise(function(_0x2a7159,_0x39bfb5){return client['request'](_0x159156,_0x147759)[_0xe924('0xb')](function(_0x5e5a72){logger['info'](_0xe924('0xc'),_0x5e6bed,'request\x20sent');logger['debug'](_0xe924('0xd'),_0x5e6bed,_0xe924('0xe'),JSON[_0xe924('0xf')](_0x5e5a72));if(_0x5e5a72[_0xe924('0x10')]){if(_0x5e5a72[_0xe924('0x10')][_0xe924('0x11')]===0x1f4){logger[_0xe924('0x10')](_0xe924('0xc'),_0x5e6bed,_0x5e5a72[_0xe924('0x10')][_0xe924('0x12')]);return _0x39bfb5(_0x5e5a72[_0xe924('0x10')]['message']);}logger['error'](_0xe924('0xc'),_0x5e6bed,_0x5e5a72[_0xe924('0x10')][_0xe924('0x12')]);return _0x2a7159(_0x5e5a72[_0xe924('0x10')][_0xe924('0x12')]);}else{logger[_0xe924('0x13')](_0xe924('0xc'),_0x5e6bed,_0xe924('0xe'));_0x2a7159(_0x5e5a72[_0xe924('0x14')][_0xe924('0x12')]);}})[_0xe924('0x15')](function(_0x25b7ca){logger[_0xe924('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5e6bed,_0x25b7ca);_0x39bfb5(_0x25b7ca);});});}
\ No newline at end of file
+var _0xd840=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5d1d48,_0x342cf8){var _0x4abd7d=function(_0x262dae){while(--_0x262dae){_0x5d1d48['push'](_0x5d1d48['shift']());}};_0x4abd7d(++_0x342cf8);}(_0xd840,0xd7));var _0x0d84=function(_0x11cd06,_0x48a90a){_0x11cd06=_0x11cd06-0x0;var _0x16290f=_0xd840[_0x11cd06];return _0x16290f;};'use strict';var _=require(_0x0d84('0x0'));var util=require(_0x0d84('0x1'));var moment=require(_0x0d84('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d84('0x3'));var fs=require('fs');var Redis=require(_0x0d84('0x4'));var db=require(_0x0d84('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d84('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0d84('0x7'));var client=jayson['client'][_0x0d84('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5df0e9,_0x4edba8,_0x95403c){return new BPromise(function(_0x3147a1,_0x4e633e){return client[_0x0d84('0x9')](_0x5df0e9,_0x95403c)[_0x0d84('0xa')](function(_0x3b7164){logger['info'](_0x0d84('0xb'),_0x4edba8,_0x0d84('0xc'));logger[_0x0d84('0xd')](_0x0d84('0xe'),_0x4edba8,'request\x20sent',JSON[_0x0d84('0xf')](_0x3b7164));if(_0x3b7164[_0x0d84('0x10')]){if(_0x3b7164['error'][_0x0d84('0x11')]===0x1f4){logger['error'](_0x0d84('0xb'),_0x4edba8,_0x3b7164[_0x0d84('0x10')]['message']);return _0x4e633e(_0x3b7164[_0x0d84('0x10')][_0x0d84('0x12')]);}logger['error'](_0x0d84('0xb'),_0x4edba8,_0x3b7164[_0x0d84('0x10')]['message']);return _0x3147a1(_0x3b7164[_0x0d84('0x10')][_0x0d84('0x12')]);}else{logger['info'](_0x0d84('0xb'),_0x4edba8,'request\x20sent');_0x3147a1(_0x3b7164[_0x0d84('0x13')][_0x0d84('0x12')]);}})[_0x0d84('0x14')](function(_0x12e5c0){logger[_0x0d84('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4edba8,_0x12e5c0);_0x4e633e(_0x12e5c0);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 11e1171..1c47b50 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 _0x5018=['get','isAuthenticated','index','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x5018,0xe8));var _0x8501=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0x5018[_0x575057];return _0x49dbc8;};'use strict';var multer=require(_0x8501('0x0'));var util=require(_0x8501('0x1'));var path=require(_0x8501('0x2'));var timeout=require('connect-timeout');var express=require(_0x8501('0x3'));var router=express[_0x8501('0x4')]();var fs_extra=require(_0x8501('0x5'));var auth=require(_0x8501('0x6'));var interaction=require(_0x8501('0x7'));var config=require(_0x8501('0x8'));var controller=require(_0x8501('0x9'));router[_0x8501('0xa')]('/',auth[_0x8501('0xb')](),controller[_0x8501('0xc')]);router[_0x8501('0xa')]('/:id',auth[_0x8501('0xb')](),controller[_0x8501('0xd')]);router[_0x8501('0xa')](_0x8501('0xe'),auth['isAuthenticated'](),controller[_0x8501('0xf')]);router[_0x8501('0x10')]('/',auth[_0x8501('0xb')](),controller[_0x8501('0x11')]);router[_0x8501('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8501('0x13')]);router[_0x8501('0x14')]('/:id',auth[_0x8501('0xb')](),controller[_0x8501('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xae03=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','/:id/download','post','create','put','update','destroy'];(function(_0xc7ed0c,_0x1d50c8){var _0x4f6662=function(_0x4c1108){while(--_0x4c1108){_0xc7ed0c['push'](_0xc7ed0c['shift']());}};_0x4f6662(++_0x1d50c8);}(_0xae03,0x1e4));var _0x3ae0=function(_0x192882,_0x76baac){_0x192882=_0x192882-0x0;var _0x3ccd45=_0xae03[_0x192882];return _0x3ccd45;};'use strict';var multer=require(_0x3ae0('0x0'));var util=require(_0x3ae0('0x1'));var path=require(_0x3ae0('0x2'));var timeout=require(_0x3ae0('0x3'));var express=require(_0x3ae0('0x4'));var router=express[_0x3ae0('0x5')]();var fs_extra=require(_0x3ae0('0x6'));var auth=require(_0x3ae0('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3ae0('0x8'));router[_0x3ae0('0x9')]('/',auth['isAuthenticated'](),controller[_0x3ae0('0xa')]);router['get'](_0x3ae0('0xb'),auth[_0x3ae0('0xc')](),controller[_0x3ae0('0xd')]);router[_0x3ae0('0x9')](_0x3ae0('0xe'),auth[_0x3ae0('0xc')](),controller['download']);router[_0x3ae0('0xf')]('/',auth[_0x3ae0('0xc')](),controller[_0x3ae0('0x10')]);router[_0x3ae0('0x11')](_0x3ae0('0xb'),auth[_0x3ae0('0xc')](),controller[_0x3ae0('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3ae0('0x13')]);module[_0x3ae0('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 3c8cf12..594040f 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 _0xd607=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x1047d0,_0x2ccc67){var _0xccfbe8=function(_0x354cc9){while(--_0x354cc9){_0x1047d0['push'](_0x1047d0['shift']());}};_0xccfbe8(++_0x2ccc67);}(_0xd607,0x164));var _0x7d60=function(_0x263b9c,_0x560b00){_0x263b9c=_0x263b9c-0x0;var _0x5e5083=_0xd607[_0x263b9c];return _0x5e5083;};'use strict';var Sequelize=require(_0x7d60('0x0'));module[_0x7d60('0x1')]={'field':{'type':Sequelize[_0x7d60('0x2')]},'alias':{'type':Sequelize[_0x7d60('0x3')]},'function':{'type':Sequelize[_0x7d60('0x3')]},'format':{'type':Sequelize[_0x7d60('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x7d60('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x63a7=['exports','STRING','BOOLEAN','sequelize'];(function(_0x267eeb,_0x58cefa){var _0x1dcd83=function(_0x3a7fb4){while(--_0x3a7fb4){_0x267eeb['push'](_0x267eeb['shift']());}};_0x1dcd83(++_0x58cefa);}(_0x63a7,0xd3));var _0x763a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x63a7[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x763a('0x0'));module[_0x763a('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x763a('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x763a('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x763a('0x2')]},'custom':{'type':Sequelize[_0x763a('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 84d59fd..26a0cb4 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 _0x1b09=['CustomReportId','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','then','destroy','stack','name','index','AnalyticFieldReport','rawAttributes','fieldName','type','map','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','length','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','findOne'];(function(_0x6022a,_0x31109e){var _0xf697b9=function(_0x21476c){while(--_0x21476c){_0x6022a['push'](_0x6022a['shift']());}};_0xf697b9(++_0x31109e);}(_0x1b09,0xa7));var _0x91b0=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x1b09[_0x349148];return _0x2f2b0f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x91b0('0x0'));var zipdir=require(_0x91b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91b0('0x2'));var moment=require(_0x91b0('0x3'));var BPromise=require(_0x91b0('0x4'));var Mustache=require(_0x91b0('0x5'));var util=require(_0x91b0('0x6'));var path=require(_0x91b0('0x7'));var sox=require(_0x91b0('0x8'));var csv=require('to-csv');var ejs=require(_0x91b0('0x9'));var fs=require('fs');var fs_extra=require(_0x91b0('0xa'));var _=require(_0x91b0('0xb'));var squel=require(_0x91b0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x91b0('0xd'));var toCsv=require(_0x91b0('0xe'));var querystring=require(_0x91b0('0xf'));var Papa=require('papaparse');var Redis=require(_0x91b0('0x10'));var authService=require(_0x91b0('0x11'));var qs=require(_0x91b0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91b0('0x13'));var logger=require(_0x91b0('0x14'))(_0x91b0('0x15'));var utils=require(_0x91b0('0x16'));var config=require(_0x91b0('0x17'));var licenseUtil=require(_0x91b0('0x18'));var db=require(_0x91b0('0x19'))['db'];function respondWithStatusCode(_0x40fe87,_0x5f1053){_0x5f1053=_0x5f1053||0xcc;return function(_0x4b76f3){if(_0x4b76f3){return _0x40fe87[_0x91b0('0x1a')](_0x5f1053);}return _0x40fe87[_0x91b0('0x1b')](_0x5f1053)[_0x91b0('0x1c')]();};}function respondWithResult(_0x2cdee4,_0x2946c3){_0x2946c3=_0x2946c3||0xc8;return function(_0x3dfaac){if(_0x3dfaac){return _0x2cdee4[_0x91b0('0x1b')](_0x2946c3)[_0x91b0('0x1d')](_0x3dfaac);}};}function respondWithFilteredResult(_0x1aa65d,_0x528787){return function(_0x51fd7d){if(_0x51fd7d){var _0x3b32ed=typeof _0x528787['offset']==='undefined'&&typeof _0x528787[_0x91b0('0x1e')]===_0x91b0('0x1f');var _0x2b23f6=_0x51fd7d[_0x91b0('0x20')];var _0x3170aa=_0x3b32ed?0x0:_0x528787[_0x91b0('0x21')];var _0x3f725c=_0x3b32ed?_0x51fd7d['count']:_0x528787[_0x91b0('0x21')]+_0x528787[_0x91b0('0x1e')];var _0x27e305;if(_0x3f725c>=_0x2b23f6){_0x3f725c=_0x2b23f6;_0x27e305=0xc8;}else{_0x27e305=0xce;}_0x1aa65d[_0x91b0('0x1b')](_0x27e305);return _0x1aa65d[_0x91b0('0x22')](_0x91b0('0x23'),_0x3170aa+'-'+_0x3f725c+'/'+_0x2b23f6)[_0x91b0('0x1d')](_0x51fd7d);}return null;};}function patchUpdates(_0x24beda){return function(_0x449fa){try{jsonpatch[_0x91b0('0x24')](_0x449fa,_0x24beda,!![]);}catch(_0x198a2c){return BPromise[_0x91b0('0x25')](_0x198a2c);}return _0x449fa[_0x91b0('0x26')]();};}function saveUpdates(_0x51f93f,_0x303baf){return function(_0x55d994){if(_0x55d994){return _0x55d994['update'](_0x51f93f)[_0x91b0('0x27')](function(_0x4e4666){return _0x4e4666;});}return null;};}function removeEntity(_0x5b4690,_0x487f42){return function(_0x33ca0a){if(_0x33ca0a){return _0x33ca0a[_0x91b0('0x28')]()[_0x91b0('0x27')](function(){_0x5b4690['status'](0xcc)[_0x91b0('0x1c')]();});}};}function handleEntityNotFound(_0x4e790b,_0x10a547){return function(_0x2f3ffc){if(!_0x2f3ffc){_0x4e790b['sendStatus'](0x194);}return _0x2f3ffc;};}function handleError(_0x241016,_0x2f0ee7){_0x2f0ee7=_0x2f0ee7||0x1f4;return function(_0x22eb6e){logger['error'](_0x22eb6e[_0x91b0('0x29')]);if(_0x22eb6e['name']){delete _0x22eb6e[_0x91b0('0x2a')];}_0x241016[_0x91b0('0x1b')](_0x2f0ee7)['send'](_0x22eb6e);};}exports[_0x91b0('0x2b')]=function(_0x1c9495,_0x589775){var _0x1942a4={},_0x156cdc={},_0x5c52ad={'count':0x0,'rows':[]};var _0x2f1b4b=_['map'](db[_0x91b0('0x2c')][_0x91b0('0x2d')],function(_0x46d0f8){return{'name':_0x46d0f8[_0x91b0('0x2e')],'type':_0x46d0f8[_0x91b0('0x2f')]['key']};});_0x156cdc['model']=_[_0x91b0('0x30')](_0x2f1b4b,_0x91b0('0x2a'));_0x156cdc[_0x91b0('0x31')]=_['keys'](_0x1c9495['query']);_0x156cdc[_0x91b0('0x32')]=_['intersection'](_0x156cdc[_0x91b0('0x33')],_0x156cdc['query']);_0x1942a4[_0x91b0('0x34')]=_[_0x91b0('0x35')](_0x156cdc[_0x91b0('0x33')],qs[_0x91b0('0x36')](_0x1c9495[_0x91b0('0x31')][_0x91b0('0x36')]));_0x1942a4[_0x91b0('0x34')]=_0x1942a4[_0x91b0('0x34')]['length']?_0x1942a4['attributes']:_0x156cdc[_0x91b0('0x33')];if(!_0x1c9495[_0x91b0('0x31')][_0x91b0('0x37')](_0x91b0('0x38'))){_0x1942a4['limit']=qs[_0x91b0('0x1e')](_0x1c9495[_0x91b0('0x31')][_0x91b0('0x1e')]);_0x1942a4[_0x91b0('0x21')]=qs[_0x91b0('0x21')](_0x1c9495[_0x91b0('0x31')][_0x91b0('0x21')]);}_0x1942a4[_0x91b0('0x39')]=qs[_0x91b0('0x3a')](_0x1c9495[_0x91b0('0x31')]['sort']);_0x1942a4['where']=qs[_0x91b0('0x32')](_[_0x91b0('0x3b')](_0x1c9495['query'],_0x156cdc[_0x91b0('0x32')]),_0x2f1b4b);if(_0x1c9495[_0x91b0('0x31')][_0x91b0('0x3c')]){_0x1942a4[_0x91b0('0x3d')]=_[_0x91b0('0x3e')](_0x1942a4['where'],{'$or':_[_0x91b0('0x30')](_0x2f1b4b,function(_0x53f4b8){if(_0x53f4b8[_0x91b0('0x2f')]!==_0x91b0('0x3f')){var _0x297048={};_0x297048[_0x53f4b8[_0x91b0('0x2a')]]={'$like':'%'+_0x1c9495[_0x91b0('0x31')][_0x91b0('0x3c')]+'%'};return _0x297048;}})});}_0x1942a4=_['merge']({},_0x1942a4,_0x1c9495[_0x91b0('0x40')]);var _0x6496dd={'where':_0x1942a4[_0x91b0('0x3d')]};return db[_0x91b0('0x2c')]['count'](_0x6496dd)[_0x91b0('0x27')](function(_0x25cced){_0x5c52ad['count']=_0x25cced;if(_0x1c9495[_0x91b0('0x31')][_0x91b0('0x41')]){_0x1942a4[_0x91b0('0x42')]=[{'all':!![]}];}return db[_0x91b0('0x2c')][_0x91b0('0x43')](_0x1942a4);})[_0x91b0('0x27')](function(_0x52ce96){_0x5c52ad['rows']=_0x52ce96;return _0x5c52ad;})[_0x91b0('0x27')](respondWithFilteredResult(_0x589775,_0x1942a4))['catch'](handleError(_0x589775,null));};exports[_0x91b0('0x44')]=function(_0x1d809a,_0xd57bcb){var _0x30e779={'raw':![],'where':{'id':_0x1d809a[_0x91b0('0x45')]['id']}},_0x2cf01d={};_0x2cf01d['model']=_['keys'](db['AnalyticFieldReport'][_0x91b0('0x2d')]);_0x2cf01d[_0x91b0('0x31')]=_[_0x91b0('0x46')](_0x1d809a[_0x91b0('0x31')]);_0x2cf01d[_0x91b0('0x32')]=_[_0x91b0('0x35')](_0x2cf01d['model'],_0x2cf01d[_0x91b0('0x31')]);_0x30e779[_0x91b0('0x34')]=_[_0x91b0('0x35')](_0x2cf01d[_0x91b0('0x33')],qs[_0x91b0('0x36')](_0x1d809a[_0x91b0('0x31')][_0x91b0('0x36')]));_0x30e779[_0x91b0('0x34')]=_0x30e779[_0x91b0('0x34')][_0x91b0('0x47')]?_0x30e779[_0x91b0('0x34')]:_0x2cf01d['model'];if(_0x1d809a['query'][_0x91b0('0x41')]){_0x30e779[_0x91b0('0x42')]=[{'all':!![]}];}_0x30e779=_[_0x91b0('0x3e')]({},_0x30e779,_0x1d809a[_0x91b0('0x40')]);return db[_0x91b0('0x2c')][_0x91b0('0x48')](_0x30e779)[_0x91b0('0x27')](handleEntityNotFound(_0xd57bcb,null))[_0x91b0('0x27')](respondWithResult(_0xd57bcb,null))[_0x91b0('0x49')](handleError(_0xd57bcb,null));};exports[_0x91b0('0x4a')]=function(_0x3fbd85,_0xde86a5){return db[_0x91b0('0x2c')][_0x91b0('0x4a')](_0x3fbd85[_0x91b0('0x4b')],{})[_0x91b0('0x27')](respondWithResult(_0xde86a5,0xc9))[_0x91b0('0x49')](handleError(_0xde86a5,null));};exports[_0x91b0('0x4c')]=function(_0x511ef6,_0x88bd23){return db[_0x91b0('0x2c')][_0x91b0('0x4c')](_0x511ef6[_0x91b0('0x4b')],{'raw':![],'individualHooks':!![]})[_0x91b0('0x27')](respondWithResult(_0x88bd23,0xc9))[_0x91b0('0x49')](handleError(_0x88bd23,null));};exports[_0x91b0('0x4d')]=function(_0x236ccb,_0x5031a4){if(_0x236ccb['body']['id']){delete _0x236ccb['body']['id'];}return db[_0x91b0('0x2c')][_0x91b0('0x48')]({'where':{'id':_0x236ccb[_0x91b0('0x45')]['id']}})[_0x91b0('0x27')](handleEntityNotFound(_0x5031a4,null))['then'](saveUpdates(_0x236ccb[_0x91b0('0x4b')],null))[_0x91b0('0x27')](respondWithResult(_0x5031a4,null))[_0x91b0('0x49')](handleError(_0x5031a4,null));};exports[_0x91b0('0x28')]=function(_0x5772ea,_0x4eda93){return db[_0x91b0('0x2c')]['find']({'where':{'id':_0x5772ea['params']['id']}})[_0x91b0('0x27')](handleEntityNotFound(_0x4eda93,null))[_0x91b0('0x27')](removeEntity(_0x4eda93,null))['catch'](handleError(_0x4eda93,null));};exports[_0x91b0('0x4e')]=function(_0x456c9f,_0x29240f){return db[_0x91b0('0x2c')][_0x91b0('0x28')]({'where':{'id':_0x456c9f['query'][_0x91b0('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x91b0('0x27')](respondWithResult(_0x29240f,0xcc))[_0x91b0('0x49')](handleError(_0x29240f,null));};exports[_0x91b0('0x50')]=function(_0x489f98,_0x27a672,_0x3901e7){return db['AnalyticCustomReport'][_0x91b0('0x51')]({'where':{'id':_0x489f98[_0x91b0('0x45')]['id']}})[_0x91b0('0x27')](handleEntityNotFound(_0x27a672,null))[_0x91b0('0x27')](function(_0x190ba6){if(_0x190ba6){return db['sequelize']['transaction'](function(_0x3eb2b7){return db[_0x91b0('0x2c')][_0x91b0('0x28')]({'where':{'CustomReportId':_0x489f98['params']['id']},'transaction':_0x3eb2b7})[_0x91b0('0x27')](function(_0x201cbe){var _0x508393=_[_0x91b0('0x30')](_0x489f98[_0x91b0('0x4b')],function(_0x302f76){delete _0x302f76['id'];_0x302f76[_0x91b0('0x52')]=_0x489f98['params']['id'];return _0x302f76;});return db[_0x91b0('0x2c')][_0x91b0('0x4c')](_0x508393,{'transaction':_0x3eb2b7});});})[_0x91b0('0x27')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x489f98[_0x91b0('0x45')]['id']}});});}})['then'](respondWithResult(_0x27a672,null))[_0x91b0('0x49')](handleError(_0x27a672,null));};
\ No newline at end of file
+var _0x1633=['request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','reject','save','update','then','sendStatus','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','include','options','catch','create','bulkCreate','body','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','zip-dir'];(function(_0x20695e,_0x5929df){var _0x3746cf=function(_0x54f2a2){while(--_0x54f2a2){_0x20695e['push'](_0x20695e['shift']());}};_0x3746cf(++_0x5929df);}(_0x1633,0x19d));var _0x3163=function(_0x1f6a9f,_0x2b0a69){_0x1f6a9f=_0x1f6a9f-0x0;var _0x56842c=_0x1633[_0x1f6a9f];return _0x56842c;};'use strict';var emlformat=require(_0x3163('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3163('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3163('0x2'));var moment=require('moment');var BPromise=require(_0x3163('0x3'));var Mustache=require(_0x3163('0x4'));var util=require(_0x3163('0x5'));var path=require(_0x3163('0x6'));var sox=require(_0x3163('0x7'));var csv=require('to-csv');var ejs=require(_0x3163('0x8'));var fs=require('fs');var fs_extra=require(_0x3163('0x9'));var _=require(_0x3163('0xa'));var squel=require(_0x3163('0xb'));var crypto=require(_0x3163('0xc'));var jsforce=require(_0x3163('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3163('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3163('0xf'));var authService=require(_0x3163('0x10'));var qs=require(_0x3163('0x11'));var as=require(_0x3163('0x12'));var hardwareService=require(_0x3163('0x13'));var logger=require(_0x3163('0x14'))(_0x3163('0x15'));var utils=require(_0x3163('0x16'));var config=require(_0x3163('0x17'));var licenseUtil=require(_0x3163('0x18'));var db=require(_0x3163('0x19'))['db'];function respondWithStatusCode(_0x3f9d8d,_0x39f8d9){_0x39f8d9=_0x39f8d9||0xcc;return function(_0x38bc0e){if(_0x38bc0e){return _0x3f9d8d['sendStatus'](_0x39f8d9);}return _0x3f9d8d[_0x3163('0x1a')](_0x39f8d9)[_0x3163('0x1b')]();};}function respondWithResult(_0x1ab4d9,_0x4defb0){_0x4defb0=_0x4defb0||0xc8;return function(_0x5684d0){if(_0x5684d0){return _0x1ab4d9[_0x3163('0x1a')](_0x4defb0)['json'](_0x5684d0);}};}function respondWithFilteredResult(_0x131a86,_0x371231){return function(_0x576ee7){if(_0x576ee7){var _0x25f451=typeof _0x371231[_0x3163('0x1c')]===_0x3163('0x1d')&&typeof _0x371231[_0x3163('0x1e')]==='undefined';var _0x29629e=_0x576ee7['count'];var _0x539784=_0x25f451?0x0:_0x371231[_0x3163('0x1c')];var _0x16613a=_0x25f451?_0x576ee7[_0x3163('0x1f')]:_0x371231[_0x3163('0x1c')]+_0x371231[_0x3163('0x1e')];var _0x2218f8;if(_0x16613a>=_0x29629e){_0x16613a=_0x29629e;_0x2218f8=0xc8;}else{_0x2218f8=0xce;}_0x131a86['status'](_0x2218f8);return _0x131a86['set']('Content-Range',_0x539784+'-'+_0x16613a+'/'+_0x29629e)[_0x3163('0x20')](_0x576ee7);}return null;};}function patchUpdates(_0x5890a4){return function(_0x344a18){try{jsonpatch['apply'](_0x344a18,_0x5890a4,!![]);}catch(_0x2d6198){return BPromise[_0x3163('0x21')](_0x2d6198);}return _0x344a18[_0x3163('0x22')]();};}function saveUpdates(_0xc196db,_0x3694fc){return function(_0x3631cb){if(_0x3631cb){return _0x3631cb[_0x3163('0x23')](_0xc196db)[_0x3163('0x24')](function(_0x537087){return _0x537087;});}return null;};}function removeEntity(_0x504333,_0x8ca862){return function(_0x1f3bcd){if(_0x1f3bcd){return _0x1f3bcd['destroy']()['then'](function(){_0x504333[_0x3163('0x1a')](0xcc)[_0x3163('0x1b')]();});}};}function handleEntityNotFound(_0x59e921,_0x24f1f8){return function(_0x39009a){if(!_0x39009a){_0x59e921[_0x3163('0x25')](0x194);}return _0x39009a;};}function handleError(_0x424064,_0x125dca){_0x125dca=_0x125dca||0x1f4;return function(_0x4e472e){logger[_0x3163('0x26')](_0x4e472e[_0x3163('0x27')]);if(_0x4e472e['name']){delete _0x4e472e[_0x3163('0x28')];}_0x424064['status'](_0x125dca)[_0x3163('0x29')](_0x4e472e);};}exports[_0x3163('0x2a')]=function(_0x34b1d8,_0x406c79){var _0x14ab47={},_0x572d8a={},_0x6d7ad1={'count':0x0,'rows':[]};var _0x46395d=_['map'](db[_0x3163('0x2b')][_0x3163('0x2c')],function(_0x5787b5){return{'name':_0x5787b5[_0x3163('0x2d')],'type':_0x5787b5['type'][_0x3163('0x2e')]};});_0x572d8a['model']=_[_0x3163('0x2f')](_0x46395d,_0x3163('0x28'));_0x572d8a['query']=_[_0x3163('0x30')](_0x34b1d8[_0x3163('0x31')]);_0x572d8a[_0x3163('0x32')]=_[_0x3163('0x33')](_0x572d8a[_0x3163('0x34')],_0x572d8a[_0x3163('0x31')]);_0x14ab47[_0x3163('0x35')]=_[_0x3163('0x33')](_0x572d8a[_0x3163('0x34')],qs[_0x3163('0x36')](_0x34b1d8['query'][_0x3163('0x36')]));_0x14ab47[_0x3163('0x35')]=_0x14ab47[_0x3163('0x35')][_0x3163('0x37')]?_0x14ab47['attributes']:_0x572d8a[_0x3163('0x34')];if(!_0x34b1d8[_0x3163('0x31')]['hasOwnProperty'](_0x3163('0x38'))){_0x14ab47[_0x3163('0x1e')]=qs[_0x3163('0x1e')](_0x34b1d8[_0x3163('0x31')][_0x3163('0x1e')]);_0x14ab47['offset']=qs[_0x3163('0x1c')](_0x34b1d8[_0x3163('0x31')]['offset']);}_0x14ab47[_0x3163('0x39')]=qs[_0x3163('0x3a')](_0x34b1d8[_0x3163('0x31')]['sort']);_0x14ab47[_0x3163('0x3b')]=qs[_0x3163('0x32')](_['pick'](_0x34b1d8['query'],_0x572d8a[_0x3163('0x32')]),_0x46395d);if(_0x34b1d8[_0x3163('0x31')][_0x3163('0x3c')]){_0x14ab47[_0x3163('0x3b')]=_[_0x3163('0x3d')](_0x14ab47[_0x3163('0x3b')],{'$or':_[_0x3163('0x2f')](_0x46395d,function(_0x31876f){if(_0x31876f[_0x3163('0x3e')]!==_0x3163('0x3f')){var _0x5bf6da={};_0x5bf6da[_0x31876f[_0x3163('0x28')]]={'$like':'%'+_0x34b1d8[_0x3163('0x31')]['filter']+'%'};return _0x5bf6da;}})});}_0x14ab47=_[_0x3163('0x3d')]({},_0x14ab47,_0x34b1d8['options']);var _0x513aaf={'where':_0x14ab47[_0x3163('0x3b')]};return db[_0x3163('0x2b')][_0x3163('0x1f')](_0x513aaf)[_0x3163('0x24')](function(_0x20c9be){_0x6d7ad1[_0x3163('0x1f')]=_0x20c9be;if(_0x34b1d8[_0x3163('0x31')][_0x3163('0x40')]){_0x14ab47['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3163('0x41')](_0x14ab47);})['then'](function(_0x438964){_0x6d7ad1[_0x3163('0x42')]=_0x438964;return _0x6d7ad1;})[_0x3163('0x24')](respondWithFilteredResult(_0x406c79,_0x14ab47))['catch'](handleError(_0x406c79,null));};exports[_0x3163('0x43')]=function(_0x261ad3,_0x3c34c2){var _0x5c38df={'raw':![],'where':{'id':_0x261ad3[_0x3163('0x44')]['id']}},_0x334fab={};_0x334fab[_0x3163('0x34')]=_[_0x3163('0x30')](db['AnalyticFieldReport'][_0x3163('0x2c')]);_0x334fab[_0x3163('0x31')]=_[_0x3163('0x30')](_0x261ad3[_0x3163('0x31')]);_0x334fab[_0x3163('0x32')]=_[_0x3163('0x33')](_0x334fab[_0x3163('0x34')],_0x334fab['query']);_0x5c38df['attributes']=_[_0x3163('0x33')](_0x334fab[_0x3163('0x34')],qs['fields'](_0x261ad3['query'][_0x3163('0x36')]));_0x5c38df['attributes']=_0x5c38df['attributes'][_0x3163('0x37')]?_0x5c38df[_0x3163('0x35')]:_0x334fab[_0x3163('0x34')];if(_0x261ad3[_0x3163('0x31')][_0x3163('0x40')]){_0x5c38df[_0x3163('0x45')]=[{'all':!![]}];}_0x5c38df=_[_0x3163('0x3d')]({},_0x5c38df,_0x261ad3[_0x3163('0x46')]);return db[_0x3163('0x2b')]['find'](_0x5c38df)[_0x3163('0x24')](handleEntityNotFound(_0x3c34c2,null))[_0x3163('0x24')](respondWithResult(_0x3c34c2,null))[_0x3163('0x47')](handleError(_0x3c34c2,null));};exports[_0x3163('0x48')]=function(_0x3bf0d7,_0x49e389){return db[_0x3163('0x2b')]['create'](_0x3bf0d7['body'],{})[_0x3163('0x24')](respondWithResult(_0x49e389,0xc9))[_0x3163('0x47')](handleError(_0x49e389,null));};exports[_0x3163('0x49')]=function(_0x12bd77,_0x9fbf4d){return db[_0x3163('0x2b')][_0x3163('0x49')](_0x12bd77['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x9fbf4d,0xc9))[_0x3163('0x47')](handleError(_0x9fbf4d,null));};exports[_0x3163('0x23')]=function(_0x39e601,_0x5ad0bc){if(_0x39e601[_0x3163('0x4a')]['id']){delete _0x39e601[_0x3163('0x4a')]['id'];}return db[_0x3163('0x2b')][_0x3163('0x4b')]({'where':{'id':_0x39e601[_0x3163('0x44')]['id']}})['then'](handleEntityNotFound(_0x5ad0bc,null))[_0x3163('0x24')](saveUpdates(_0x39e601[_0x3163('0x4a')],null))['then'](respondWithResult(_0x5ad0bc,null))[_0x3163('0x47')](handleError(_0x5ad0bc,null));};exports['destroy']=function(_0x2d4383,_0x5820a7){return db['AnalyticFieldReport'][_0x3163('0x4b')]({'where':{'id':_0x2d4383[_0x3163('0x44')]['id']}})[_0x3163('0x24')](handleEntityNotFound(_0x5820a7,null))[_0x3163('0x24')](removeEntity(_0x5820a7,null))['catch'](handleError(_0x5820a7,null));};exports[_0x3163('0x4c')]=function(_0x17f9d3,_0x563556){return db[_0x3163('0x2b')]['destroy']({'where':{'id':_0x17f9d3['query'][_0x3163('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x3163('0x24')](respondWithResult(_0x563556,0xcc))[_0x3163('0x47')](handleError(_0x563556,null));};exports[_0x3163('0x4e')]=function(_0x34c704,_0x5e7661,_0xf3cda1){return db[_0x3163('0x4f')][_0x3163('0x50')]({'where':{'id':_0x34c704[_0x3163('0x44')]['id']}})[_0x3163('0x24')](handleEntityNotFound(_0x5e7661,null))[_0x3163('0x24')](function(_0x490c77){if(_0x490c77){return db['sequelize'][_0x3163('0x51')](function(_0x3c96dd){return db[_0x3163('0x2b')]['destroy']({'where':{'CustomReportId':_0x34c704[_0x3163('0x44')]['id']},'transaction':_0x3c96dd})[_0x3163('0x24')](function(_0x436669){var _0x1d1a11=_[_0x3163('0x2f')](_0x34c704[_0x3163('0x4a')],function(_0x27d83b){delete _0x27d83b['id'];_0x27d83b[_0x3163('0x52')]=_0x34c704[_0x3163('0x44')]['id'];return _0x27d83b;});return db[_0x3163('0x2b')][_0x3163('0x49')](_0x1d1a11,{'transaction':_0x3c96dd});});})[_0x3163('0x24')](function(){return db[_0x3163('0x2b')][_0x3163('0x41')]({'where':{'CustomReportId':_0x34c704[_0x3163('0x44')]['id']}});});}})[_0x3163('0x24')](respondWithResult(_0x5e7661,null))['catch'](handleError(_0x5e7661,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 2401063..92cc198 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 _0x2dbd=['../../config/environment','./analyticFieldReport.attributes','define','analytics_report_fields','lodash','util','api','moment','bluebird','rimraf'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x2dbd,0x144));var _0xd2db=function(_0x4e23e4,_0xff7279){_0x4e23e4=_0x4e23e4-0x0;var _0x4389e3=_0x2dbd[_0x4e23e4];return _0x4389e3;};'use strict';var _=require(_0xd2db('0x0'));var util=require(_0xd2db('0x1'));var logger=require('../../config/logger')(_0xd2db('0x2'));var moment=require(_0xd2db('0x3'));var BPromise=require(_0xd2db('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd2db('0x5'));var config=require(_0xd2db('0x6'));var attributes=require(_0xd2db('0x7'));module['exports']=function(_0x53d78e,_0x2312b6){return _0x53d78e[_0xd2db('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0xd2db('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf195=['api','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger'];(function(_0x30a2d6,_0x43201d){var _0x10bff2=function(_0x1eee56){while(--_0x1eee56){_0x30a2d6['push'](_0x30a2d6['shift']());}};_0x10bff2(++_0x43201d);}(_0xf195,0xd0));var _0x5f19=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xf195[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0x5f19('0x0'));var util=require('util');var logger=require(_0x5f19('0x1'))(_0x5f19('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5f19('0x3'));var fs=require('fs');var path=require(_0x5f19('0x4'));var rimraf=require('rimraf');var config=require(_0x5f19('0x5'));var attributes=require(_0x5f19('0x6'));module['exports']=function(_0x243370,_0xf554d5){return _0x243370[_0x5f19('0x7')](_0x5f19('0x8'),attributes,{'tableName':_0x5f19('0x9'),'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 d96cac8..b9c7cbd 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 _0xb6d3=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0xf02982,_0x51cacc){var _0x30b0d7=function(_0x2e9b85){while(--_0x2e9b85){_0xf02982['push'](_0xf02982['shift']());}};_0x30b0d7(++_0x51cacc);}(_0xb6d3,0xa9));var _0x3b6d=function(_0x47d0b8,_0xe8ee4b){_0x47d0b8=_0x47d0b8-0x0;var _0x1f385a=_0xb6d3[_0x47d0b8];return _0x1f385a;};'use strict';var _=require(_0x3b6d('0x0'));var util=require(_0x3b6d('0x1'));var moment=require(_0x3b6d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b6d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x3b6d('0x4'));var jayson=require(_0x3b6d('0x5'));var client=jayson[_0x3b6d('0x6')][_0x3b6d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5788cf,_0x2a02a8,_0x44f17e){return new BPromise(function(_0x5318da,_0x5b4946){return client[_0x3b6d('0x8')](_0x5788cf,_0x44f17e)['then'](function(_0x2d239d){logger[_0x3b6d('0x9')](_0x3b6d('0xa'),_0x2a02a8,'request\x20sent');logger[_0x3b6d('0xb')](_0x3b6d('0xc'),_0x2a02a8,_0x3b6d('0xd'),JSON[_0x3b6d('0xe')](_0x2d239d));if(_0x2d239d[_0x3b6d('0xf')]){if(_0x2d239d['error'][_0x3b6d('0x10')]===0x1f4){logger[_0x3b6d('0xf')](_0x3b6d('0xa'),_0x2a02a8,_0x2d239d[_0x3b6d('0xf')][_0x3b6d('0x11')]);return _0x5b4946(_0x2d239d[_0x3b6d('0xf')][_0x3b6d('0x11')]);}logger[_0x3b6d('0xf')](_0x3b6d('0xa'),_0x2a02a8,_0x2d239d['error'][_0x3b6d('0x11')]);return _0x5318da(_0x2d239d[_0x3b6d('0xf')]['message']);}else{logger['info'](_0x3b6d('0xa'),_0x2a02a8,'request\x20sent');_0x5318da(_0x2d239d[_0x3b6d('0x12')]['message']);}})[_0x3b6d('0x13')](function(_0x2dc763){logger[_0x3b6d('0xf')](_0x3b6d('0xa'),_0x2a02a8,_0x2dc763);_0x5b4946(_0x2dc763);});});}
\ No newline at end of file
+var _0x25d3=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x7058e5,_0x4304b8){var _0xcadefd=function(_0x105666){while(--_0x105666){_0x7058e5['push'](_0x7058e5['shift']());}};_0xcadefd(++_0x4304b8);}(_0x25d3,0x1b7));var _0x325d=function(_0x20365c,_0x25227d){_0x20365c=_0x20365c-0x0;var _0x5df8ba=_0x25d3[_0x20365c];return _0x5df8ba;};'use strict';var _=require(_0x325d('0x0'));var util=require(_0x325d('0x1'));var moment=require(_0x325d('0x2'));var BPromise=require(_0x325d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x325d('0x4'));var db=require(_0x325d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x325d('0x6'))(_0x325d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x325d('0x8')][_0x325d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x236ee2,_0x165a3c,_0x318b56){return new BPromise(function(_0x161acb,_0x3efc86){return client[_0x325d('0xa')](_0x236ee2,_0x318b56)[_0x325d('0xb')](function(_0x163c2b){logger[_0x325d('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x165a3c,_0x325d('0xd'));logger[_0x325d('0xe')](_0x325d('0xf'),_0x165a3c,_0x325d('0xd'),JSON['stringify'](_0x163c2b));if(_0x163c2b[_0x325d('0x10')]){if(_0x163c2b[_0x325d('0x10')][_0x325d('0x11')]===0x1f4){logger['error'](_0x325d('0x12'),_0x165a3c,_0x163c2b['error'][_0x325d('0x13')]);return _0x3efc86(_0x163c2b[_0x325d('0x10')][_0x325d('0x13')]);}logger['error'](_0x325d('0x12'),_0x165a3c,_0x163c2b[_0x325d('0x10')][_0x325d('0x13')]);return _0x161acb(_0x163c2b[_0x325d('0x10')][_0x325d('0x13')]);}else{logger[_0x325d('0xc')](_0x325d('0x12'),_0x165a3c,_0x325d('0xd'));_0x161acb(_0x163c2b['result'][_0x325d('0x13')]);}})[_0x325d('0x14')](function(_0x586194){logger['error'](_0x325d('0x12'),_0x165a3c,_0x586194);_0x3efc86(_0x586194);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 0ccca2c..1509918 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(_0x4f2f6f,_0x435d4c){var _0x3c14fc=function(_0x4700a7){while(--_0x4700a7){_0x4f2f6f['push'](_0x4f2f6f['shift']());}};_0x3c14fc(++_0x435d4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0xa059ea,_0x5cb91e){var _0x156a4c=function(_0x1b4717){while(--_0x1b4717){_0xa059ea['push'](_0xa059ea['shift']());}};_0x156a4c(++_0x5cb91e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 bd10deb..f19afc7 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 _0x0d74=['STRING','TEXT','sequelize','exports'];(function(_0x458d68,_0x1dbe12){var _0x3e4a4b=function(_0x3f7b04){while(--_0x3f7b04){_0x458d68['push'](_0x458d68['shift']());}};_0x3e4a4b(++_0x1dbe12);}(_0x0d74,0x146));var _0x40d7=function(_0x368502,_0x1b8bfb){_0x368502=_0x368502-0x0;var _0x44bc6e=_0x0d74[_0x368502];return _0x44bc6e;};'use strict';var Sequelize=require(_0x40d7('0x0'));module[_0x40d7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x40d7('0x2')]},'metric':{'type':Sequelize[_0x40d7('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xbdb7=['name','TEXT','sequelize','exports','STRING'];(function(_0x270323,_0x72160){var _0x48a027=function(_0x4cb12e){while(--_0x4cb12e){_0x270323['push'](_0x270323['shift']());}};_0x48a027(++_0x72160);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x37065a,_0xd1f059){_0x37065a=_0x37065a-0x0;var _0x293d11=_0xbdb7[_0x37065a];return _0x293d11;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'name':{'type':Sequelize[_0x7bdb('0x2')],'allowNull':![],'unique':_0x7bdb('0x3')},'table':{'type':Sequelize[_0x7bdb('0x2')]},'metric':{'type':Sequelize[_0x7bdb('0x4')]},'description':{'type':Sequelize[_0x7bdb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index b29113b..bff8ca2 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x2944a4,_0x21a845){var _0x46476e=function(_0x16e105){while(--_0x16e105){_0x2944a4['push'](_0x2944a4['shift']());}};_0x46476e(++_0x21a845);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x547a81,_0x4c2f32){_0x547a81=_0x547a81-0x0;var _0x262c48=_0x8d0e[_0x547a81];return _0x262c48;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
+var _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x7da7,0x10d));var _0x77da=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x7da7[_0x710815];return _0x5b3b89;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 0902df9..831a411 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 _0xdbb1=['../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','moment','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdbb1,0x105));var _0x1dbb=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xdbb1[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x1dbb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1dbb('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1dbb('0x2'));var rimraf=require('rimraf');var config=require(_0x1dbb('0x3'));var attributes=require(_0x1dbb('0x4'));module['exports']=function(_0x55df0f,_0xd43ce8){return _0x55df0f[_0x1dbb('0x5')](_0x1dbb('0x6'),attributes,{'tableName':_0x1dbb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6299=['analytics_metrics','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x4c619b,_0x28457f){var _0x39e0fd=function(_0x6436fd){while(--_0x6436fd){_0x4c619b['push'](_0x4c619b['shift']());}};_0x39e0fd(++_0x28457f);}(_0x6299,0x169));var _0x9629=function(_0x2c5238,_0x15312b){_0x2c5238=_0x2c5238-0x0;var _0x392df2=_0x6299[_0x2c5238];return _0x392df2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9629('0x0'))(_0x9629('0x1'));var moment=require(_0x9629('0x2'));var BPromise=require(_0x9629('0x3'));var rp=require(_0x9629('0x4'));var fs=require('fs');var path=require(_0x9629('0x5'));var rimraf=require('rimraf');var config=require(_0x9629('0x6'));var attributes=require(_0x9629('0x7'));module[_0x9629('0x8')]=function(_0x1edc13,_0x1206bf){return _0x1edc13['define']('AnalyticMetric',attributes,{'tableName':_0x9629('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 2527986..fdbc43c 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 _0x3f52=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','AnalyticMetric,\x20%s,\x20%s'];(function(_0x277f8b,_0x40720b){var _0xeaf56a=function(_0x1111db){while(--_0x1111db){_0x277f8b['push'](_0x277f8b['shift']());}};_0xeaf56a(++_0x40720b);}(_0x3f52,0xa3));var _0x23f5=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0x3f52[_0x218994];return _0x3f350b;};'use strict';var _=require('lodash');var util=require(_0x23f5('0x0'));var moment=require(_0x23f5('0x1'));var BPromise=require(_0x23f5('0x2'));var rs=require(_0x23f5('0x3'));var fs=require('fs');var Redis=require(_0x23f5('0x4'));var db=require(_0x23f5('0x5'))['db'];var utils=require(_0x23f5('0x6'));var logger=require(_0x23f5('0x7'))(_0x23f5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x23f5('0x9')][_0x23f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x504c08,_0x2ca367,_0x15294d){return new BPromise(function(_0x5c9ca0,_0x163da8){return client['request'](_0x504c08,_0x15294d)[_0x23f5('0xb')](function(_0x213003){logger['info'](_0x23f5('0xc'),_0x2ca367,'request\x20sent');logger[_0x23f5('0xd')](_0x23f5('0xe'),_0x2ca367,_0x23f5('0xf'),JSON[_0x23f5('0x10')](_0x213003));if(_0x213003[_0x23f5('0x11')]){if(_0x213003[_0x23f5('0x11')][_0x23f5('0x12')]===0x1f4){logger['error'](_0x23f5('0xc'),_0x2ca367,_0x213003[_0x23f5('0x11')][_0x23f5('0x13')]);return _0x163da8(_0x213003[_0x23f5('0x11')][_0x23f5('0x13')]);}logger[_0x23f5('0x11')](_0x23f5('0xc'),_0x2ca367,_0x213003['error']['message']);return _0x5c9ca0(_0x213003[_0x23f5('0x11')]['message']);}else{logger['info'](_0x23f5('0xc'),_0x2ca367,_0x23f5('0xf'));_0x5c9ca0(_0x213003[_0x23f5('0x14')]['message']);}})[_0x23f5('0x15')](function(_0x3c4c15){logger[_0x23f5('0x11')](_0x23f5('0xc'),_0x2ca367,_0x3c4c15);_0x163da8(_0x3c4c15);});});}
\ No newline at end of file
+var _0xf118=['../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5ebe76,_0x590dfc){var _0x2d0fdd=function(_0x5ef78e){while(--_0x5ef78e){_0x5ebe76['push'](_0x5ebe76['shift']());}};_0x2d0fdd(++_0x590dfc);}(_0xf118,0x116));var _0x8f11=function(_0xce3d93,_0x504f1c){_0xce3d93=_0xce3d93-0x0;var _0x16bcf8=_0xf118[_0xce3d93];return _0x16bcf8;};'use strict';var _=require(_0x8f11('0x0'));var util=require(_0x8f11('0x1'));var moment=require(_0x8f11('0x2'));var BPromise=require(_0x8f11('0x3'));var rs=require(_0x8f11('0x4'));var fs=require('fs');var Redis=require(_0x8f11('0x5'));var db=require(_0x8f11('0x6'))['db'];var utils=require(_0x8f11('0x7'));var logger=require(_0x8f11('0x8'))(_0x8f11('0x9'));var config=require(_0x8f11('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8f11('0xb')][_0x8f11('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x542890,_0xc1041a,_0x312d7f){return new BPromise(function(_0x55de07,_0x21b42c){return client[_0x8f11('0xd')](_0x542890,_0x312d7f)[_0x8f11('0xe')](function(_0x3bec4d){logger['info'](_0x8f11('0xf'),_0xc1041a,_0x8f11('0x10'));logger[_0x8f11('0x11')](_0x8f11('0x12'),_0xc1041a,_0x8f11('0x10'),JSON[_0x8f11('0x13')](_0x3bec4d));if(_0x3bec4d[_0x8f11('0x14')]){if(_0x3bec4d['error'][_0x8f11('0x15')]===0x1f4){logger['error'](_0x8f11('0xf'),_0xc1041a,_0x3bec4d[_0x8f11('0x14')]['message']);return _0x21b42c(_0x3bec4d['error'][_0x8f11('0x16')]);}logger[_0x8f11('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0xc1041a,_0x3bec4d[_0x8f11('0x14')][_0x8f11('0x16')]);return _0x55de07(_0x3bec4d[_0x8f11('0x14')]['message']);}else{logger[_0x8f11('0x17')](_0x8f11('0xf'),_0xc1041a,_0x8f11('0x10'));_0x55de07(_0x3bec4d[_0x8f11('0x18')][_0x8f11('0x16')]);}})[_0x8f11('0x19')](function(_0x183c98){logger[_0x8f11('0x14')](_0x8f11('0xf'),_0xc1041a,_0x183c98);_0x21b42c(_0x183c98);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 20dc9db..173ac63 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 _0xc23a=['put','exports','util','path','connect-timeout','Router','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','show','create'];(function(_0x1a8795,_0x4578f6){var _0xf8b5ae=function(_0x288762){while(--_0x288762){_0x1a8795['push'](_0x1a8795['shift']());}};_0xf8b5ae(++_0x4578f6);}(_0xc23a,0xd2));var _0xac23=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0xc23a[_0x337748];return _0x3bb03f;};'use strict';var multer=require('multer');var util=require(_0xac23('0x0'));var path=require(_0xac23('0x1'));var timeout=require(_0xac23('0x2'));var express=require('express');var router=express[_0xac23('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xac23('0x4'));var config=require('../../config/environment');var controller=require(_0xac23('0x5'));router[_0xac23('0x6')]('/',auth[_0xac23('0x7')](),controller['index']);router['get'](_0xac23('0x8'),auth[_0xac23('0x7')](),controller[_0xac23('0x9')]);router['post']('/',auth[_0xac23('0x7')](),controller[_0xac23('0xa')]);router[_0xac23('0xb')](_0xac23('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xac23('0x8'),auth[_0xac23('0x7')](),controller['destroy']);module[_0xac23('0xc')]=router;
\ No newline at end of file
+var _0xf52f=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x19e9fa,_0x512f17){var _0x4e7f68=function(_0x5b5e49){while(--_0x5b5e49){_0x19e9fa['push'](_0x19e9fa['shift']());}};_0x4e7f68(++_0x512f17);}(_0xf52f,0x113));var _0xff52=function(_0x365dbe,_0x4d3979){_0x365dbe=_0x365dbe-0x0;var _0xaa71bb=_0xf52f[_0x365dbe];return _0xaa71bb;};'use strict';var multer=require(_0xff52('0x0'));var util=require(_0xff52('0x1'));var path=require(_0xff52('0x2'));var timeout=require('connect-timeout');var express=require(_0xff52('0x3'));var router=express[_0xff52('0x4')]();var fs_extra=require(_0xff52('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xff52('0x6'));var config=require(_0xff52('0x7'));var controller=require('./analyticMetric.controller');router[_0xff52('0x8')]('/',auth[_0xff52('0x9')](),controller[_0xff52('0xa')]);router[_0xff52('0x8')](_0xff52('0xb'),auth[_0xff52('0x9')](),controller[_0xff52('0xc')]);router[_0xff52('0xd')]('/',auth[_0xff52('0x9')](),controller[_0xff52('0xe')]);router[_0xff52('0xf')](_0xff52('0xb'),auth[_0xff52('0x9')](),controller[_0xff52('0x10')]);router[_0xff52('0x11')](_0xff52('0xb'),auth[_0xff52('0x9')](),controller[_0xff52('0x12')]);module[_0xff52('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 765955c..161bf94 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 _0xcbf5=['TEXT','sequelize'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xcbf5,0x157));var _0x5cbf=function(_0x430282,_0x1cdd9d){_0x430282=_0x430282-0x0;var _0x55744b=_0xcbf5[_0x430282];return _0x55744b;};'use strict';var Sequelize=require(_0x5cbf('0x0'));module['exports']={'tree':{'type':Sequelize[_0x5cbf('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xe6bb=['exports','sequelize'];(function(_0x143368,_0x5d0b64){var _0x44c10a=function(_0x30c90c){while(--_0x30c90c){_0x143368['push'](_0x143368['shift']());}};_0x44c10a(++_0x5d0b64);}(_0xe6bb,0x133));var _0xbe6b=function(_0x49a264,_0x3e2dd7){_0x49a264=_0x49a264-0x0;var _0x255927=_0xe6bb[_0x49a264];return _0x255927;};'use strict';var Sequelize=require(_0xbe6b('0x0'));module[_0xbe6b('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index a177983..378cd0f 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 _0x416d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','find','create','body','catch','update','eml-format','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x47e232,_0x200fe7){var _0x516f61=function(_0x6e8e0a){while(--_0x6e8e0a){_0x47e232['push'](_0x47e232['shift']());}};_0x516f61(++_0x200fe7);}(_0x416d,0xda));var _0xd416=function(_0x5ccfa9,_0x415e4d){_0x5ccfa9=_0x5ccfa9-0x0;var _0x228ced=_0x416d[_0x5ccfa9];return _0x228ced;};'use strict';var emlformat=require(_0xd416('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd416('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd416('0x2'));var moment=require('moment');var BPromise=require(_0xd416('0x3'));var Mustache=require('mustache');var util=require(_0xd416('0x4'));var path=require(_0xd416('0x5'));var sox=require(_0xd416('0x6'));var csv=require('to-csv');var ejs=require(_0xd416('0x7'));var fs=require('fs');var fs_extra=require(_0xd416('0x8'));var _=require(_0xd416('0x9'));var squel=require(_0xd416('0xa'));var crypto=require(_0xd416('0xb'));var jsforce=require(_0xd416('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd416('0xd'));var querystring=require(_0xd416('0xe'));var Papa=require(_0xd416('0xf'));var Redis=require('ioredis');var authService=require(_0xd416('0x10'));var qs=require(_0xd416('0x11'));var as=require(_0xd416('0x12'));var hardwareService=require(_0xd416('0x13'));var logger=require(_0xd416('0x14'))(_0xd416('0x15'));var utils=require('../../config/utils');var config=require(_0xd416('0x16'));var licenseUtil=require(_0xd416('0x17'));var db=require(_0xd416('0x18'))['db'];function respondWithStatusCode(_0x28e499,_0x3238a1){_0x3238a1=_0x3238a1||0xcc;return function(_0x29920c){if(_0x29920c){return _0x28e499[_0xd416('0x19')](_0x3238a1);}return _0x28e499[_0xd416('0x1a')](_0x3238a1)[_0xd416('0x1b')]();};}function respondWithResult(_0x12a9c7,_0x5959cc){_0x5959cc=_0x5959cc||0xc8;return function(_0x2b6c86){if(_0x2b6c86){return _0x12a9c7[_0xd416('0x1a')](_0x5959cc)[_0xd416('0x1c')](_0x2b6c86);}};}function respondWithFilteredResult(_0x10fb66,_0x315abe){return function(_0x30cfc1){if(_0x30cfc1){var _0x28ce50=typeof _0x315abe['offset']===_0xd416('0x1d')&&typeof _0x315abe[_0xd416('0x1e')]===_0xd416('0x1d');var _0x519e7a=_0x30cfc1['count'];var _0x48f93e=_0x28ce50?0x0:_0x315abe[_0xd416('0x1f')];var _0x3286ec=_0x28ce50?_0x30cfc1[_0xd416('0x20')]:_0x315abe[_0xd416('0x1f')]+_0x315abe[_0xd416('0x1e')];var _0xc53c66;if(_0x3286ec>=_0x519e7a){_0x3286ec=_0x519e7a;_0xc53c66=0xc8;}else{_0xc53c66=0xce;}_0x10fb66[_0xd416('0x1a')](_0xc53c66);return _0x10fb66[_0xd416('0x21')](_0xd416('0x22'),_0x48f93e+'-'+_0x3286ec+'/'+_0x519e7a)[_0xd416('0x1c')](_0x30cfc1);}return null;};}function patchUpdates(_0x120852){return function(_0x11a613){try{jsonpatch['apply'](_0x11a613,_0x120852,!![]);}catch(_0x135747){return BPromise[_0xd416('0x23')](_0x135747);}return _0x11a613[_0xd416('0x24')]();};}function saveUpdates(_0x230d49,_0x26540c){return function(_0x10e625){if(_0x10e625){return _0x10e625['update'](_0x230d49)[_0xd416('0x25')](function(_0x5daea2){return _0x5daea2;});}return null;};}function removeEntity(_0x2d3ab8,_0x31ce02){return function(_0x415b91){if(_0x415b91){return _0x415b91[_0xd416('0x26')]()[_0xd416('0x25')](function(){_0x2d3ab8[_0xd416('0x1a')](0xcc)[_0xd416('0x1b')]();});}};}function handleEntityNotFound(_0x1e7cfb,_0x527b9d){return function(_0x10d534){if(!_0x10d534){_0x1e7cfb[_0xd416('0x19')](0x194);}return _0x10d534;};}function handleError(_0x3ca5e9,_0x19d228){_0x19d228=_0x19d228||0x1f4;return function(_0x430929){logger[_0xd416('0x27')](_0x430929[_0xd416('0x28')]);if(_0x430929[_0xd416('0x29')]){delete _0x430929[_0xd416('0x29')];}_0x3ca5e9[_0xd416('0x1a')](_0x19d228)[_0xd416('0x2a')](_0x430929);};}exports[_0xd416('0x2b')]=function(_0x5f27e7,_0x28a9dd){var _0x296c2e={},_0x127278={},_0x309c7e={'count':0x0,'rows':[]};var _0x5335a2=_[_0xd416('0x2c')](db[_0xd416('0x2d')]['rawAttributes'],function(_0xb10b8c){return{'name':_0xb10b8c[_0xd416('0x2e')],'type':_0xb10b8c[_0xd416('0x2f')][_0xd416('0x30')]};});_0x127278[_0xd416('0x31')]=_[_0xd416('0x2c')](_0x5335a2,_0xd416('0x29'));_0x127278[_0xd416('0x32')]=_['keys'](_0x5f27e7[_0xd416('0x32')]);_0x127278[_0xd416('0x33')]=_['intersection'](_0x127278[_0xd416('0x31')],_0x127278[_0xd416('0x32')]);_0x296c2e[_0xd416('0x34')]=_[_0xd416('0x35')](_0x127278[_0xd416('0x31')],qs[_0xd416('0x36')](_0x5f27e7[_0xd416('0x32')]['fields']));_0x296c2e[_0xd416('0x34')]=_0x296c2e[_0xd416('0x34')]['length']?_0x296c2e[_0xd416('0x34')]:_0x127278[_0xd416('0x31')];if(!_0x5f27e7[_0xd416('0x32')][_0xd416('0x37')](_0xd416('0x38'))){_0x296c2e[_0xd416('0x1e')]=qs[_0xd416('0x1e')](_0x5f27e7[_0xd416('0x32')][_0xd416('0x1e')]);_0x296c2e[_0xd416('0x1f')]=qs[_0xd416('0x1f')](_0x5f27e7[_0xd416('0x32')][_0xd416('0x1f')]);}_0x296c2e[_0xd416('0x39')]=qs[_0xd416('0x3a')](_0x5f27e7[_0xd416('0x32')][_0xd416('0x3a')]);_0x296c2e[_0xd416('0x3b')]=qs[_0xd416('0x33')](_['pick'](_0x5f27e7[_0xd416('0x32')],_0x127278['filters']),_0x5335a2);if(_0x5f27e7[_0xd416('0x32')]['filter']){_0x296c2e['where']=_[_0xd416('0x3c')](_0x296c2e[_0xd416('0x3b')],{'$or':_[_0xd416('0x2c')](_0x5335a2,function(_0xb11fad){if(_0xb11fad[_0xd416('0x2f')]!==_0xd416('0x3d')){var _0x5d08d2={};_0x5d08d2[_0xb11fad[_0xd416('0x29')]]={'$like':'%'+_0x5f27e7['query'][_0xd416('0x3e')]+'%'};return _0x5d08d2;}})});}_0x296c2e=_['merge']({},_0x296c2e,_0x5f27e7[_0xd416('0x3f')]);var _0x20a820={'where':_0x296c2e[_0xd416('0x3b')]};return db['AnalyticTreeReport']['count'](_0x20a820)['then'](function(_0x3533a1){_0x309c7e[_0xd416('0x20')]=_0x3533a1;if(_0x5f27e7['query'][_0xd416('0x40')]){_0x296c2e[_0xd416('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xd416('0x42')](_0x296c2e);})['then'](function(_0x5738c5){_0x309c7e[_0xd416('0x43')]=_0x5738c5;return _0x309c7e;})[_0xd416('0x25')](respondWithFilteredResult(_0x28a9dd,_0x296c2e))['catch'](handleError(_0x28a9dd,null));};exports[_0xd416('0x44')]=function(_0x4693bb,_0x1fb422){var _0x23aad8={'raw':!![],'where':{'id':_0x4693bb[_0xd416('0x45')]['id']}},_0x984ed2={};_0x984ed2[_0xd416('0x31')]=_[_0xd416('0x46')](db[_0xd416('0x2d')][_0xd416('0x47')]);_0x984ed2[_0xd416('0x32')]=_['keys'](_0x4693bb['query']);_0x984ed2['filters']=_[_0xd416('0x35')](_0x984ed2[_0xd416('0x31')],_0x984ed2['query']);_0x23aad8['attributes']=_[_0xd416('0x35')](_0x984ed2[_0xd416('0x31')],qs[_0xd416('0x36')](_0x4693bb['query'][_0xd416('0x36')]));_0x23aad8['attributes']=_0x23aad8[_0xd416('0x34')][_0xd416('0x48')]?_0x23aad8[_0xd416('0x34')]:_0x984ed2[_0xd416('0x31')];if(_0x4693bb[_0xd416('0x32')][_0xd416('0x40')]){_0x23aad8[_0xd416('0x41')]=[{'all':!![]}];}_0x23aad8=_[_0xd416('0x3c')]({},_0x23aad8,_0x4693bb[_0xd416('0x3f')]);return db[_0xd416('0x2d')][_0xd416('0x49')](_0x23aad8)[_0xd416('0x25')](handleEntityNotFound(_0x1fb422,null))['then'](respondWithResult(_0x1fb422,null))['catch'](handleError(_0x1fb422,null));};exports['create']=function(_0x3c6edb,_0x31d38f){return db[_0xd416('0x2d')][_0xd416('0x4a')](_0x3c6edb[_0xd416('0x4b')],{})['then'](respondWithResult(_0x31d38f,0xc9))[_0xd416('0x4c')](handleError(_0x31d38f,null));};exports[_0xd416('0x4d')]=function(_0x227f0a,_0x4719f8){if(_0x227f0a['body']['id']){delete _0x227f0a[_0xd416('0x4b')]['id'];}return db[_0xd416('0x2d')][_0xd416('0x49')]({'where':{'id':_0x227f0a[_0xd416('0x45')]['id']}})['then'](handleEntityNotFound(_0x4719f8,null))[_0xd416('0x25')](saveUpdates(_0x227f0a[_0xd416('0x4b')],null))['then'](respondWithResult(_0x4719f8,null))[_0xd416('0x4c')](handleError(_0x4719f8,null));};exports[_0xd416('0x26')]=function(_0x54d068,_0x4fa418){return db[_0xd416('0x2d')][_0xd416('0x49')]({'where':{'id':_0x54d068[_0xd416('0x45')]['id']}})[_0xd416('0x25')](handleEntityNotFound(_0x4fa418,null))[_0xd416('0x25')](removeEntity(_0x4fa418,null))['catch'](handleError(_0x4fa418,null));};
\ No newline at end of file
+var _0x1aae=['limit','count','set','save','update','then','error','stack','name','send','AnalyticTreeReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','fields','catch','create','body','find','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined'];(function(_0x18bef8,_0x1a7772){var _0x146dcb=function(_0x27a7c8){while(--_0x27a7c8){_0x18bef8['push'](_0x18bef8['shift']());}};_0x146dcb(++_0x1a7772);}(_0x1aae,0xfb));var _0xe1aa=function(_0x48f8b2,_0x464731){_0x48f8b2=_0x48f8b2-0x0;var _0x47ebb4=_0x1aae[_0x48f8b2];return _0x47ebb4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe1aa('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1aa('0x1'));var moment=require(_0xe1aa('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe1aa('0x3'));var util=require(_0xe1aa('0x4'));var path=require(_0xe1aa('0x5'));var sox=require(_0xe1aa('0x6'));var csv=require(_0xe1aa('0x7'));var ejs=require(_0xe1aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1aa('0x9'));var squel=require(_0xe1aa('0xa'));var crypto=require('crypto');var jsforce=require(_0xe1aa('0xb'));var deskjs=require(_0xe1aa('0xc'));var toCsv=require(_0xe1aa('0x7'));var querystring=require(_0xe1aa('0xd'));var Papa=require(_0xe1aa('0xe'));var Redis=require(_0xe1aa('0xf'));var authService=require(_0xe1aa('0x10'));var qs=require(_0xe1aa('0x11'));var as=require(_0xe1aa('0x12'));var hardwareService=require(_0xe1aa('0x13'));var logger=require(_0xe1aa('0x14'))(_0xe1aa('0x15'));var utils=require(_0xe1aa('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34c561,_0x13d989){_0x13d989=_0x13d989||0xcc;return function(_0x12fcb9){if(_0x12fcb9){return _0x34c561[_0xe1aa('0x17')](_0x13d989);}return _0x34c561[_0xe1aa('0x18')](_0x13d989)[_0xe1aa('0x19')]();};}function respondWithResult(_0x128070,_0x29061d){_0x29061d=_0x29061d||0xc8;return function(_0x1f9cf6){if(_0x1f9cf6){return _0x128070[_0xe1aa('0x18')](_0x29061d)[_0xe1aa('0x1a')](_0x1f9cf6);}};}function respondWithFilteredResult(_0xfe1274,_0x3e4e42){return function(_0x1056c6){if(_0x1056c6){var _0x227fa0=typeof _0x3e4e42[_0xe1aa('0x1b')]===_0xe1aa('0x1c')&&typeof _0x3e4e42[_0xe1aa('0x1d')]===_0xe1aa('0x1c');var _0x2bb125=_0x1056c6[_0xe1aa('0x1e')];var _0xc19bf4=_0x227fa0?0x0:_0x3e4e42[_0xe1aa('0x1b')];var _0x33135b=_0x227fa0?_0x1056c6[_0xe1aa('0x1e')]:_0x3e4e42[_0xe1aa('0x1b')]+_0x3e4e42[_0xe1aa('0x1d')];var _0x5b2c16;if(_0x33135b>=_0x2bb125){_0x33135b=_0x2bb125;_0x5b2c16=0xc8;}else{_0x5b2c16=0xce;}_0xfe1274[_0xe1aa('0x18')](_0x5b2c16);return _0xfe1274[_0xe1aa('0x1f')]('Content-Range',_0xc19bf4+'-'+_0x33135b+'/'+_0x2bb125)['json'](_0x1056c6);}return null;};}function patchUpdates(_0x39d49f){return function(_0x57efca){try{jsonpatch['apply'](_0x57efca,_0x39d49f,!![]);}catch(_0x37b650){return BPromise['reject'](_0x37b650);}return _0x57efca[_0xe1aa('0x20')]();};}function saveUpdates(_0x3bda1e,_0x191649){return function(_0x56aa38){if(_0x56aa38){return _0x56aa38[_0xe1aa('0x21')](_0x3bda1e)[_0xe1aa('0x22')](function(_0x20024e){return _0x20024e;});}return null;};}function removeEntity(_0x4c5b92,_0x3c7103){return function(_0x107618){if(_0x107618){return _0x107618['destroy']()[_0xe1aa('0x22')](function(){_0x4c5b92[_0xe1aa('0x18')](0xcc)[_0xe1aa('0x19')]();});}};}function handleEntityNotFound(_0x1e6655,_0x400adb){return function(_0x3d69f8){if(!_0x3d69f8){_0x1e6655[_0xe1aa('0x17')](0x194);}return _0x3d69f8;};}function handleError(_0x2c11cd,_0x456147){_0x456147=_0x456147||0x1f4;return function(_0x183cab){logger[_0xe1aa('0x23')](_0x183cab[_0xe1aa('0x24')]);if(_0x183cab[_0xe1aa('0x25')]){delete _0x183cab['name'];}_0x2c11cd[_0xe1aa('0x18')](_0x456147)[_0xe1aa('0x26')](_0x183cab);};}exports['index']=function(_0x5b927e,_0x2481bf){var _0x327c2b={},_0x53bffc={},_0x1c7f6d={'count':0x0,'rows':[]};var _0x846e5a=_['map'](db[_0xe1aa('0x27')][_0xe1aa('0x28')],function(_0x58bb53){return{'name':_0x58bb53['fieldName'],'type':_0x58bb53[_0xe1aa('0x29')][_0xe1aa('0x2a')]};});_0x53bffc[_0xe1aa('0x2b')]=_[_0xe1aa('0x2c')](_0x846e5a,_0xe1aa('0x25'));_0x53bffc[_0xe1aa('0x2d')]=_[_0xe1aa('0x2e')](_0x5b927e['query']);_0x53bffc[_0xe1aa('0x2f')]=_[_0xe1aa('0x30')](_0x53bffc[_0xe1aa('0x2b')],_0x53bffc[_0xe1aa('0x2d')]);_0x327c2b['attributes']=_['intersection'](_0x53bffc[_0xe1aa('0x2b')],qs['fields'](_0x5b927e[_0xe1aa('0x2d')]['fields']));_0x327c2b[_0xe1aa('0x31')]=_0x327c2b['attributes'][_0xe1aa('0x32')]?_0x327c2b[_0xe1aa('0x31')]:_0x53bffc[_0xe1aa('0x2b')];if(!_0x5b927e['query'][_0xe1aa('0x33')]('nolimit')){_0x327c2b[_0xe1aa('0x1d')]=qs[_0xe1aa('0x1d')](_0x5b927e[_0xe1aa('0x2d')][_0xe1aa('0x1d')]);_0x327c2b[_0xe1aa('0x1b')]=qs[_0xe1aa('0x1b')](_0x5b927e['query'][_0xe1aa('0x1b')]);}_0x327c2b[_0xe1aa('0x34')]=qs[_0xe1aa('0x35')](_0x5b927e[_0xe1aa('0x2d')][_0xe1aa('0x35')]);_0x327c2b[_0xe1aa('0x36')]=qs['filters'](_[_0xe1aa('0x37')](_0x5b927e['query'],_0x53bffc['filters']),_0x846e5a);if(_0x5b927e[_0xe1aa('0x2d')][_0xe1aa('0x38')]){_0x327c2b[_0xe1aa('0x36')]=_['merge'](_0x327c2b[_0xe1aa('0x36')],{'$or':_[_0xe1aa('0x2c')](_0x846e5a,function(_0x135548){if(_0x135548[_0xe1aa('0x29')]!==_0xe1aa('0x39')){var _0x1324fb={};_0x1324fb[_0x135548[_0xe1aa('0x25')]]={'$like':'%'+_0x5b927e[_0xe1aa('0x2d')]['filter']+'%'};return _0x1324fb;}})});}_0x327c2b=_[_0xe1aa('0x3a')]({},_0x327c2b,_0x5b927e[_0xe1aa('0x3b')]);var _0x34a217={'where':_0x327c2b['where']};return db[_0xe1aa('0x27')][_0xe1aa('0x1e')](_0x34a217)[_0xe1aa('0x22')](function(_0x22b7ab){_0x1c7f6d[_0xe1aa('0x1e')]=_0x22b7ab;if(_0x5b927e['query'][_0xe1aa('0x3c')]){_0x327c2b['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xe1aa('0x3d')](_0x327c2b);})[_0xe1aa('0x22')](function(_0x56e979){_0x1c7f6d[_0xe1aa('0x3e')]=_0x56e979;return _0x1c7f6d;})[_0xe1aa('0x22')](respondWithFilteredResult(_0x2481bf,_0x327c2b))['catch'](handleError(_0x2481bf,null));};exports[_0xe1aa('0x3f')]=function(_0x3a23f7,_0x21727f){var _0x2159a5={'raw':!![],'where':{'id':_0x3a23f7[_0xe1aa('0x40')]['id']}},_0x233741={};_0x233741['model']=_[_0xe1aa('0x2e')](db['AnalyticTreeReport'][_0xe1aa('0x28')]);_0x233741[_0xe1aa('0x2d')]=_[_0xe1aa('0x2e')](_0x3a23f7['query']);_0x233741['filters']=_[_0xe1aa('0x30')](_0x233741[_0xe1aa('0x2b')],_0x233741['query']);_0x2159a5[_0xe1aa('0x31')]=_['intersection'](_0x233741[_0xe1aa('0x2b')],qs['fields'](_0x3a23f7[_0xe1aa('0x2d')][_0xe1aa('0x41')]));_0x2159a5[_0xe1aa('0x31')]=_0x2159a5[_0xe1aa('0x31')]['length']?_0x2159a5[_0xe1aa('0x31')]:_0x233741[_0xe1aa('0x2b')];if(_0x3a23f7[_0xe1aa('0x2d')][_0xe1aa('0x3c')]){_0x2159a5['include']=[{'all':!![]}];}_0x2159a5=_[_0xe1aa('0x3a')]({},_0x2159a5,_0x3a23f7[_0xe1aa('0x3b')]);return db[_0xe1aa('0x27')]['find'](_0x2159a5)[_0xe1aa('0x22')](handleEntityNotFound(_0x21727f,null))[_0xe1aa('0x22')](respondWithResult(_0x21727f,null))[_0xe1aa('0x42')](handleError(_0x21727f,null));};exports['create']=function(_0x30b771,_0x31b5a7){return db[_0xe1aa('0x27')][_0xe1aa('0x43')](_0x30b771[_0xe1aa('0x44')],{})['then'](respondWithResult(_0x31b5a7,0xc9))['catch'](handleError(_0x31b5a7,null));};exports[_0xe1aa('0x21')]=function(_0x43cf16,_0x49e952){if(_0x43cf16[_0xe1aa('0x44')]['id']){delete _0x43cf16['body']['id'];}return db['AnalyticTreeReport'][_0xe1aa('0x45')]({'where':{'id':_0x43cf16[_0xe1aa('0x40')]['id']}})[_0xe1aa('0x22')](handleEntityNotFound(_0x49e952,null))[_0xe1aa('0x22')](saveUpdates(_0x43cf16[_0xe1aa('0x44')],null))['then'](respondWithResult(_0x49e952,null))[_0xe1aa('0x42')](handleError(_0x49e952,null));};exports['destroy']=function(_0xefed73,_0x5f5b81){return db[_0xe1aa('0x27')][_0xe1aa('0x45')]({'where':{'id':_0xefed73[_0xe1aa('0x40')]['id']}})[_0xe1aa('0x22')](handleEntityNotFound(_0x5f5b81,null))['then'](removeEntity(_0x5f5b81,null))[_0xe1aa('0x42')](handleError(_0x5f5b81,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index b939bdf..e07a19b 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 _0x6bc1=['analytics_report_trees','lodash','util','../../config/logger','api','moment','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x147ee9,_0x53aa54){var _0x3a441b=function(_0x1661a7){while(--_0x1661a7){_0x147ee9['push'](_0x147ee9['shift']());}};_0x3a441b(++_0x53aa54);}(_0x6bc1,0x1cf));var _0x16bc=function(_0x1c8c7b,_0x3806a0){_0x1c8c7b=_0x1c8c7b-0x0;var _0x2f1b76=_0x6bc1[_0x1c8c7b];return _0x2f1b76;};'use strict';var _=require(_0x16bc('0x0'));var util=require(_0x16bc('0x1'));var logger=require(_0x16bc('0x2'))(_0x16bc('0x3'));var moment=require(_0x16bc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x16bc('0x5'));var attributes=require(_0x16bc('0x6'));module[_0x16bc('0x7')]=function(_0x4d6423,_0x30e672){return _0x4d6423[_0x16bc('0x8')](_0x16bc('0x9'),attributes,{'tableName':_0x16bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb69a=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5f159a,_0x4d5a73){var _0x25349b=function(_0x107376){while(--_0x107376){_0x5f159a['push'](_0x5f159a['shift']());}};_0x25349b(++_0x4d5a73);}(_0xb69a,0x1f3));var _0xab69=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xb69a[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xab69('0x0'));var util=require(_0xab69('0x1'));var logger=require(_0xab69('0x2'))(_0xab69('0x3'));var moment=require(_0xab69('0x4'));var BPromise=require('bluebird');var rp=require(_0xab69('0x5'));var fs=require('fs');var path=require(_0xab69('0x6'));var rimraf=require(_0xab69('0x7'));var config=require(_0xab69('0x8'));var attributes=require(_0xab69('0x9'));module[_0xab69('0xa')]=function(_0xb1bf8f,_0x57cd46){return _0xb1bf8f['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index d76c363..f739da0 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x36c8ed,_0x53c549){var _0x5575c9=function(_0x159326){while(--_0x159326){_0x36c8ed['push'](_0x36c8ed['shift']());}};_0x5575c9(++_0x53c549);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x1dddf5,_0x5171a5){var _0x126fea=function(_0x500527){while(--_0x500527){_0x1dddf5['push'](_0x1dddf5['shift']());}};_0x126fea(++_0x5171a5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 6ccad4d..31a08cc 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 _0xd1cd=['show','post','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x58fe35,_0x20ae39){var _0x3534ea=function(_0xbc6d72){while(--_0xbc6d72){_0x58fe35['push'](_0x58fe35['shift']());}};_0x3534ea(++_0x20ae39);}(_0xd1cd,0x16b));var _0xdd1c=function(_0x47b98d,_0x39b836){_0x47b98d=_0x47b98d-0x0;var _0x46b628=_0xd1cd[_0x47b98d];return _0x46b628;};'use strict';var multer=require(_0xdd1c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdd1c('0x1'));var express=require(_0xdd1c('0x2'));var router=express[_0xdd1c('0x3')]();var fs_extra=require(_0xdd1c('0x4'));var auth=require(_0xdd1c('0x5'));var interaction=require(_0xdd1c('0x6'));var config=require(_0xdd1c('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xdd1c('0x8')]('/',auth[_0xdd1c('0x9')](),controller['index']);router[_0xdd1c('0x8')](_0xdd1c('0xa'),auth[_0xdd1c('0x9')](),controller[_0xdd1c('0xb')]);router[_0xdd1c('0xc')]('/',auth[_0xdd1c('0x9')](),controller[_0xdd1c('0xd')]);router['put']('/:id',auth[_0xdd1c('0x9')](),controller[_0xdd1c('0xe')]);router[_0xdd1c('0xf')]('/:id',auth[_0xdd1c('0x9')](),controller[_0xdd1c('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xeaca=['connect-timeout','express','Router','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','util','path'];(function(_0x3a9f98,_0x4f5a75){var _0x5cfc6d=function(_0x159532){while(--_0x159532){_0x3a9f98['push'](_0x3a9f98['shift']());}};_0x5cfc6d(++_0x4f5a75);}(_0xeaca,0x196));var _0xaeac=function(_0x301b70,_0x499177){_0x301b70=_0x301b70-0x0;var _0x1a2331=_0xeaca[_0x301b70];return _0x1a2331;};'use strict';var multer=require('multer');var util=require(_0xaeac('0x0'));var path=require(_0xaeac('0x1'));var timeout=require(_0xaeac('0x2'));var express=require(_0xaeac('0x3'));var router=express[_0xaeac('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaeac('0x5'));var config=require('../../config/environment');var controller=require(_0xaeac('0x6'));router[_0xaeac('0x7')]('/',auth[_0xaeac('0x8')](),controller[_0xaeac('0x9')]);router[_0xaeac('0x7')]('/:id',auth[_0xaeac('0x8')](),controller[_0xaeac('0xa')]);router[_0xaeac('0xb')]('/',auth[_0xaeac('0x8')](),controller[_0xaeac('0xc')]);router[_0xaeac('0xd')](_0xaeac('0xe'),auth[_0xaeac('0x8')](),controller[_0xaeac('0xf')]);router['delete'](_0xaeac('0xe'),auth[_0xaeac('0x8')](),controller[_0xaeac('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 9dba2b9..1d03c4c 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 _0xbeff=['exports','STRING'];(function(_0xf5fcdf,_0x3299a6){var _0x3fea1d=function(_0x53717a){while(--_0x53717a){_0xf5fcdf['push'](_0xf5fcdf['shift']());}};_0x3fea1d(++_0x3299a6);}(_0xbeff,0x8e));var _0xfbef=function(_0x2008c5,_0x4e0123){_0x2008c5=_0x2008c5-0x0;var _0x864651=_0xbeff[_0x2008c5];return _0x864651;};'use strict';var Sequelize=require('sequelize');module[_0xfbef('0x0')]={'name':{'type':Sequelize[_0xfbef('0x1')]},'basename':{'type':Sequelize[_0xfbef('0x1')]},'type':{'type':Sequelize[_0xfbef('0x1')]}};
\ No newline at end of file
+var _0xf197=['STRING','sequelize','exports'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0xf197,0x130));var _0x7f19=function(_0x26d4f9,_0x39fa0a){_0x26d4f9=_0x26d4f9-0x0;var _0x151fb6=_0xf197[_0x26d4f9];return _0x151fb6;};'use strict';var Sequelize=require(_0x7f19('0x0'));module[_0x7f19('0x1')]={'name':{'type':Sequelize[_0x7f19('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 1cc1042..c3c0390 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 _0x7977=['query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','show','params','length','includeAll','find','catch','rawAttributes','get','createdAt','updatedAt','body','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','Attachment','fieldName','type','model','keys'];(function(_0x1a6099,_0x515acd){var _0x54dd90=function(_0x5705aa){while(--_0x5705aa){_0x1a6099['push'](_0x1a6099['shift']());}};_0x54dd90(++_0x515acd);}(_0x7977,0x12c));var _0x7797=function(_0x17ebe2,_0x1072c9){_0x17ebe2=_0x17ebe2-0x0;var _0x2694d7=_0x7977[_0x17ebe2];return _0x2694d7;};'use strict';var emlformat=require(_0x7797('0x0'));var rimraf=require(_0x7797('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7797('0x2'));var rp=require(_0x7797('0x3'));var moment=require(_0x7797('0x4'));var BPromise=require(_0x7797('0x5'));var Mustache=require(_0x7797('0x6'));var util=require('util');var path=require(_0x7797('0x7'));var sox=require(_0x7797('0x8'));var csv=require('to-csv');var ejs=require(_0x7797('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7797('0xa'));var squel=require(_0x7797('0xb'));var crypto=require(_0x7797('0xc'));var jsforce=require(_0x7797('0xd'));var deskjs=require(_0x7797('0xe'));var toCsv=require(_0x7797('0xf'));var querystring=require('querystring');var Papa=require(_0x7797('0x10'));var Redis=require('ioredis');var authService=require(_0x7797('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7797('0x12'));var logger=require('../../config/logger')(_0x7797('0x13'));var utils=require(_0x7797('0x14'));var config=require(_0x7797('0x15'));var licenseUtil=require(_0x7797('0x16'));var db=require(_0x7797('0x17'))['db'];function respondWithStatusCode(_0x37e8c6,_0xc0a4b0){_0xc0a4b0=_0xc0a4b0||0xcc;return function(_0x4316b8){if(_0x4316b8){return _0x37e8c6[_0x7797('0x18')](_0xc0a4b0);}return _0x37e8c6[_0x7797('0x19')](_0xc0a4b0)[_0x7797('0x1a')]();};}function respondWithResult(_0x30595d,_0x41b81b){_0x41b81b=_0x41b81b||0xc8;return function(_0x257daa){if(_0x257daa){return _0x30595d[_0x7797('0x19')](_0x41b81b)[_0x7797('0x1b')](_0x257daa);}};}function respondWithFilteredResult(_0x5e0bc5,_0x38b720){return function(_0x4835be){if(_0x4835be){var _0x1f1b3c=typeof _0x38b720[_0x7797('0x1c')]===_0x7797('0x1d')&&typeof _0x38b720[_0x7797('0x1e')]===_0x7797('0x1d');var _0x34e0c0=_0x4835be[_0x7797('0x1f')];var _0x28bc22=_0x1f1b3c?0x0:_0x38b720['offset'];var _0x3fabcc=_0x1f1b3c?_0x4835be[_0x7797('0x1f')]:_0x38b720[_0x7797('0x1c')]+_0x38b720[_0x7797('0x1e')];var _0x4fa0d0;if(_0x3fabcc>=_0x34e0c0){_0x3fabcc=_0x34e0c0;_0x4fa0d0=0xc8;}else{_0x4fa0d0=0xce;}_0x5e0bc5['status'](_0x4fa0d0);return _0x5e0bc5[_0x7797('0x20')](_0x7797('0x21'),_0x28bc22+'-'+_0x3fabcc+'/'+_0x34e0c0)[_0x7797('0x1b')](_0x4835be);}return null;};}function patchUpdates(_0x58d469){return function(_0x4a96f7){try{jsonpatch[_0x7797('0x22')](_0x4a96f7,_0x58d469,!![]);}catch(_0x402e09){return BPromise['reject'](_0x402e09);}return _0x4a96f7[_0x7797('0x23')]();};}function saveUpdates(_0x6b2cfd,_0x1324ce){return function(_0x3b2753){if(_0x3b2753){return _0x3b2753['update'](_0x6b2cfd)[_0x7797('0x24')](function(_0x171ed9){return _0x171ed9;});}return null;};}function removeEntity(_0x48e0fb,_0x19bd63){return function(_0x394aa4){if(_0x394aa4){return _0x394aa4[_0x7797('0x25')]()['then'](function(){_0x48e0fb[_0x7797('0x19')](0xcc)[_0x7797('0x1a')]();});}};}function handleEntityNotFound(_0x5e71e9,_0x32ed3a){return function(_0x8ed9b9){if(!_0x8ed9b9){_0x5e71e9[_0x7797('0x18')](0x194);}return _0x8ed9b9;};}function handleError(_0xfeb464,_0xeff829){_0xeff829=_0xeff829||0x1f4;return function(_0x4c2eb5){logger[_0x7797('0x26')](_0x4c2eb5[_0x7797('0x27')]);if(_0x4c2eb5[_0x7797('0x28')]){delete _0x4c2eb5[_0x7797('0x28')];}_0xfeb464[_0x7797('0x19')](_0xeff829)['send'](_0x4c2eb5);};}exports[_0x7797('0x29')]=function(_0x154900,_0x411834){var _0x5f5d4a={},_0x43f1c6={},_0x3b3fd7={'count':0x0,'rows':[]};var _0x12ff25=_[_0x7797('0x2a')](db[_0x7797('0x2b')]['rawAttributes'],function(_0x1fcdc6){return{'name':_0x1fcdc6[_0x7797('0x2c')],'type':_0x1fcdc6[_0x7797('0x2d')]['key']};});_0x43f1c6[_0x7797('0x2e')]=_[_0x7797('0x2a')](_0x12ff25,_0x7797('0x28'));_0x43f1c6['query']=_[_0x7797('0x2f')](_0x154900[_0x7797('0x30')]);_0x43f1c6['filters']=_['intersection'](_0x43f1c6[_0x7797('0x2e')],_0x43f1c6['query']);_0x5f5d4a[_0x7797('0x31')]=_[_0x7797('0x32')](_0x43f1c6[_0x7797('0x2e')],qs[_0x7797('0x33')](_0x154900[_0x7797('0x30')][_0x7797('0x33')]));_0x5f5d4a[_0x7797('0x31')]=_0x5f5d4a[_0x7797('0x31')]['length']?_0x5f5d4a[_0x7797('0x31')]:_0x43f1c6[_0x7797('0x2e')];if(!_0x154900[_0x7797('0x30')][_0x7797('0x34')](_0x7797('0x35'))){_0x5f5d4a[_0x7797('0x1e')]=qs[_0x7797('0x1e')](_0x154900['query'][_0x7797('0x1e')]);_0x5f5d4a['offset']=qs[_0x7797('0x1c')](_0x154900[_0x7797('0x30')][_0x7797('0x1c')]);}_0x5f5d4a[_0x7797('0x36')]=qs[_0x7797('0x37')](_0x154900[_0x7797('0x30')][_0x7797('0x37')]);_0x5f5d4a[_0x7797('0x38')]=qs[_0x7797('0x39')](_[_0x7797('0x3a')](_0x154900[_0x7797('0x30')],_0x43f1c6['filters']),_0x12ff25);if(_0x154900[_0x7797('0x30')]['filter']){_0x5f5d4a['where']=_[_0x7797('0x3b')](_0x5f5d4a['where'],{'$or':_[_0x7797('0x2a')](_0x12ff25,function(_0x3ed6c1){if(_0x3ed6c1[_0x7797('0x2d')]!==_0x7797('0x3c')){var _0x1d5967={};_0x1d5967[_0x3ed6c1[_0x7797('0x28')]]={'$like':'%'+_0x154900[_0x7797('0x30')][_0x7797('0x3d')]+'%'};return _0x1d5967;}})});}_0x5f5d4a=_[_0x7797('0x3b')]({},_0x5f5d4a,_0x154900[_0x7797('0x3e')]);var _0x2ad37a={'where':_0x5f5d4a[_0x7797('0x38')]};return db[_0x7797('0x2b')][_0x7797('0x1f')](_0x2ad37a)[_0x7797('0x24')](function(_0x569e04){_0x3b3fd7[_0x7797('0x1f')]=_0x569e04;if(_0x154900[_0x7797('0x30')]['includeAll']){_0x5f5d4a[_0x7797('0x3f')]=[{'all':!![]}];}return db[_0x7797('0x2b')][_0x7797('0x40')](_0x5f5d4a);})[_0x7797('0x24')](function(_0x15f1b4){_0x3b3fd7['rows']=_0x15f1b4;return _0x3b3fd7;})[_0x7797('0x24')](respondWithFilteredResult(_0x411834,_0x5f5d4a))['catch'](handleError(_0x411834,null));};exports[_0x7797('0x41')]=function(_0x6f49e9,_0x20b06a){var _0x1ee93e={'raw':!![],'where':{'id':_0x6f49e9[_0x7797('0x42')]['id']}},_0x5cc56a={};_0x5cc56a['model']=_[_0x7797('0x2f')](db['Attachment']['rawAttributes']);_0x5cc56a[_0x7797('0x30')]=_[_0x7797('0x2f')](_0x6f49e9[_0x7797('0x30')]);_0x5cc56a[_0x7797('0x39')]=_['intersection'](_0x5cc56a['model'],_0x5cc56a[_0x7797('0x30')]);_0x1ee93e[_0x7797('0x31')]=_['intersection'](_0x5cc56a[_0x7797('0x2e')],qs[_0x7797('0x33')](_0x6f49e9[_0x7797('0x30')]['fields']));_0x1ee93e[_0x7797('0x31')]=_0x1ee93e[_0x7797('0x31')][_0x7797('0x43')]?_0x1ee93e[_0x7797('0x31')]:_0x5cc56a['model'];if(_0x6f49e9[_0x7797('0x30')][_0x7797('0x44')]){_0x1ee93e['include']=[{'all':!![]}];}_0x1ee93e=_[_0x7797('0x3b')]({},_0x1ee93e,_0x6f49e9[_0x7797('0x3e')]);return db[_0x7797('0x2b')][_0x7797('0x45')](_0x1ee93e)[_0x7797('0x24')](handleEntityNotFound(_0x20b06a,null))[_0x7797('0x24')](respondWithResult(_0x20b06a,null))[_0x7797('0x46')](handleError(_0x20b06a,null));};exports['clone']=function(_0x16b85b,_0x2d4ac6){var _0x42e4c7={'where':{'id':_0x16b85b[_0x7797('0x42')]['id']}},_0x17a464={};_0x17a464[_0x7797('0x2e')]=_[_0x7797('0x2f')](db[_0x7797('0x2b')][_0x7797('0x47')]);_0x42e4c7[_0x7797('0x31')]=_[_0x7797('0x32')](_0x17a464[_0x7797('0x2e')],qs[_0x7797('0x33')](_0x16b85b[_0x7797('0x30')]['fields']));_0x42e4c7[_0x7797('0x31')]=_0x42e4c7[_0x7797('0x31')][_0x7797('0x43')]?_0x42e4c7['attributes']:_0x17a464[_0x7797('0x2e')];if(_0x16b85b[_0x7797('0x30')][_0x7797('0x44')]){_0x42e4c7[_0x7797('0x3f')]=[{'all':!![]}];}_0x42e4c7=_[_0x7797('0x3b')]({},_0x42e4c7,_0x16b85b[_0x7797('0x3e')]);return db['Attachment'][_0x7797('0x45')](_0x42e4c7)['then'](handleEntityNotFound(_0x2d4ac6,null))[_0x7797('0x24')](function(_0x3141ca){if(_0x3141ca){var _0x141fc9=_0x3141ca[_0x7797('0x48')]({'plain':!![]});_0x141fc9=qs['omit'](_0x141fc9,['id',_0x7797('0x49'),_0x7797('0x4a')]);_0x16b85b[_0x7797('0x4b')]=_['omit'](_0x16b85b['body'],['id','createdAt',_0x7797('0x4a')]);return db[_0x7797('0x2b')][_0x7797('0x4c')](_[_0x7797('0x3b')](_0x141fc9,_0x16b85b['body']),{'include':_0x16b85b[_0x7797('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x7797('0x24')](respondWithResult(_0x2d4ac6,0xc9))[_0x7797('0x46')](handleError(_0x2d4ac6,null));};exports['update']=function(_0x1508f2,_0x43df10){if(_0x1508f2[_0x7797('0x4b')]['id']){delete _0x1508f2[_0x7797('0x4b')]['id'];}return db[_0x7797('0x2b')][_0x7797('0x45')]({'where':{'id':_0x1508f2[_0x7797('0x42')]['id']}})[_0x7797('0x24')](handleEntityNotFound(_0x43df10,null))[_0x7797('0x24')](saveUpdates(_0x1508f2[_0x7797('0x4b')],null))[_0x7797('0x24')](respondWithResult(_0x43df10,null))[_0x7797('0x46')](handleError(_0x43df10,null));};exports[_0x7797('0x25')]=function(_0x71cdbb,_0x1ea69f){return db[_0x7797('0x2b')][_0x7797('0x45')]({'where':{'id':_0x71cdbb[_0x7797('0x42')]['id']}})[_0x7797('0x24')](handleEntityNotFound(_0x1ea69f,null))[_0x7797('0x24')](removeEntity(_0x1ea69f,null))[_0x7797('0x46')](handleError(_0x1ea69f,null));};exports[_0x7797('0x4c')]=function(_0x396a1d,_0x40315a,_0x3c4c47){_0x396a1d[_0x7797('0x4b')][_0x7797('0x28')]=_0x396a1d[_0x7797('0x4d')][_0x7797('0x4e')];_0x396a1d[_0x7797('0x4b')][_0x7797('0x4f')]=_0x396a1d[_0x7797('0x4d')][_0x7797('0x50')];_0x396a1d[_0x7797('0x4b')]['type']=_0x396a1d[_0x7797('0x4d')]['mimetype'];return db['Attachment'][_0x7797('0x4c')](_0x396a1d['body'])['then'](respondWithResult(_0x40315a,0xc9))['catch'](handleError(_0x40315a,null));};exports[_0x7797('0x51')]=function(_0x213dda,_0x24d0e7,_0x10c85e){return db[_0x7797('0x2b')][_0x7797('0x52')]({'where':{'id':_0x213dda[_0x7797('0x42')]['id']},'raw':!![]})[_0x7797('0x24')](handleEntityNotFound(_0x24d0e7,null))[_0x7797('0x24')](function(_0x2b7fb4){if(_0x2b7fb4){var _0x5c2a5c=_0x2b7fb4[_0x7797('0x53')]!==null;var _0x2e6992=path[_0x7797('0x54')](config[_0x7797('0x55')],'server/files/attachments/');if(_0x5c2a5c){_0x2e6992=path[_0x7797('0x54')](_0x2e6992,_0x7797('0x56'));}var _0x3797b0=path[_0x7797('0x54')](_0x2e6992,_0x2b7fb4[_0x7797('0x4f')]);return _0x24d0e7[_0x7797('0x51')](_0x3797b0);}})['catch'](handleError(_0x24d0e7,null));};
\ No newline at end of file
+var _0xf0a5=['index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','includeAll','Attachment','findAll','rows','include','find','catch','clone','params','length','get','omit','createdAt','updatedAt','body','create','originalname','file','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','sendStatus','error','stack','send'];(function(_0x3f802e,_0x3ae1c7){var _0x2cbea2=function(_0x582642){while(--_0x582642){_0x3f802e['push'](_0x3f802e['shift']());}};_0x2cbea2(++_0x3ae1c7);}(_0xf0a5,0x8e));var _0x5f0a=function(_0x329cd9,_0x23a7e8){_0x329cd9=_0x329cd9-0x0;var _0x3fb7c3=_0xf0a5[_0x329cd9];return _0x3fb7c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f0a('0x0'));var zipdir=require(_0x5f0a('0x1'));var jsonpatch=require(_0x5f0a('0x2'));var rp=require(_0x5f0a('0x3'));var moment=require(_0x5f0a('0x4'));var BPromise=require(_0x5f0a('0x5'));var Mustache=require(_0x5f0a('0x6'));var util=require(_0x5f0a('0x7'));var path=require('path');var sox=require(_0x5f0a('0x8'));var csv=require(_0x5f0a('0x9'));var ejs=require(_0x5f0a('0xa'));var fs=require('fs');var fs_extra=require(_0x5f0a('0xb'));var _=require(_0x5f0a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5f0a('0xd'));var toCsv=require(_0x5f0a('0x9'));var querystring=require('querystring');var Papa=require(_0x5f0a('0xe'));var Redis=require('ioredis');var authService=require(_0x5f0a('0xf'));var qs=require(_0x5f0a('0x10'));var as=require(_0x5f0a('0x11'));var hardwareService=require(_0x5f0a('0x12'));var logger=require(_0x5f0a('0x13'))(_0x5f0a('0x14'));var utils=require(_0x5f0a('0x15'));var config=require(_0x5f0a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f0a('0x17'))['db'];function respondWithStatusCode(_0x309155,_0x547872){_0x547872=_0x547872||0xcc;return function(_0x1148a4){if(_0x1148a4){return _0x309155['sendStatus'](_0x547872);}return _0x309155[_0x5f0a('0x18')](_0x547872)[_0x5f0a('0x19')]();};}function respondWithResult(_0x2a09c4,_0x42452a){_0x42452a=_0x42452a||0xc8;return function(_0x3a22f3){if(_0x3a22f3){return _0x2a09c4[_0x5f0a('0x18')](_0x42452a)[_0x5f0a('0x1a')](_0x3a22f3);}};}function respondWithFilteredResult(_0x2c0e25,_0x39ebb2){return function(_0x3f7257){if(_0x3f7257){var _0x2f4f7b=typeof _0x39ebb2[_0x5f0a('0x1b')]===_0x5f0a('0x1c')&&typeof _0x39ebb2[_0x5f0a('0x1d')]===_0x5f0a('0x1c');var _0x1fa5d0=_0x3f7257['count'];var _0x75bca8=_0x2f4f7b?0x0:_0x39ebb2[_0x5f0a('0x1b')];var _0x5927e2=_0x2f4f7b?_0x3f7257[_0x5f0a('0x1e')]:_0x39ebb2[_0x5f0a('0x1b')]+_0x39ebb2[_0x5f0a('0x1d')];var _0x541824;if(_0x5927e2>=_0x1fa5d0){_0x5927e2=_0x1fa5d0;_0x541824=0xc8;}else{_0x541824=0xce;}_0x2c0e25[_0x5f0a('0x18')](_0x541824);return _0x2c0e25[_0x5f0a('0x1f')]('Content-Range',_0x75bca8+'-'+_0x5927e2+'/'+_0x1fa5d0)[_0x5f0a('0x1a')](_0x3f7257);}return null;};}function patchUpdates(_0x5347cd){return function(_0x28b5f3){try{jsonpatch['apply'](_0x28b5f3,_0x5347cd,!![]);}catch(_0x3a78e1){return BPromise[_0x5f0a('0x20')](_0x3a78e1);}return _0x28b5f3['save']();};}function saveUpdates(_0x201ba1,_0xeedb82){return function(_0x108258){if(_0x108258){return _0x108258[_0x5f0a('0x21')](_0x201ba1)[_0x5f0a('0x22')](function(_0x2088cd){return _0x2088cd;});}return null;};}function removeEntity(_0xd734c1,_0x1564a6){return function(_0x1b1176){if(_0x1b1176){return _0x1b1176[_0x5f0a('0x23')]()[_0x5f0a('0x22')](function(){_0xd734c1[_0x5f0a('0x18')](0xcc)[_0x5f0a('0x19')]();});}};}function handleEntityNotFound(_0x3ac41b,_0x2d14b7){return function(_0x1fd400){if(!_0x1fd400){_0x3ac41b[_0x5f0a('0x24')](0x194);}return _0x1fd400;};}function handleError(_0x3d56cb,_0x14df7d){_0x14df7d=_0x14df7d||0x1f4;return function(_0x158c62){logger[_0x5f0a('0x25')](_0x158c62[_0x5f0a('0x26')]);if(_0x158c62['name']){delete _0x158c62['name'];}_0x3d56cb[_0x5f0a('0x18')](_0x14df7d)[_0x5f0a('0x27')](_0x158c62);};}exports[_0x5f0a('0x28')]=function(_0x446ccd,_0x22658e){var _0x4d2d86={},_0x2097c6={},_0x22a798={'count':0x0,'rows':[]};var _0x4e639c=_[_0x5f0a('0x29')](db['Attachment'][_0x5f0a('0x2a')],function(_0x2a26a1){return{'name':_0x2a26a1[_0x5f0a('0x2b')],'type':_0x2a26a1['type'][_0x5f0a('0x2c')]};});_0x2097c6[_0x5f0a('0x2d')]=_['map'](_0x4e639c,'name');_0x2097c6[_0x5f0a('0x2e')]=_[_0x5f0a('0x2f')](_0x446ccd['query']);_0x2097c6[_0x5f0a('0x30')]=_['intersection'](_0x2097c6[_0x5f0a('0x2d')],_0x2097c6[_0x5f0a('0x2e')]);_0x4d2d86['attributes']=_[_0x5f0a('0x31')](_0x2097c6[_0x5f0a('0x2d')],qs[_0x5f0a('0x32')](_0x446ccd[_0x5f0a('0x2e')][_0x5f0a('0x32')]));_0x4d2d86[_0x5f0a('0x33')]=_0x4d2d86[_0x5f0a('0x33')]['length']?_0x4d2d86['attributes']:_0x2097c6['model'];if(!_0x446ccd['query'][_0x5f0a('0x34')](_0x5f0a('0x35'))){_0x4d2d86[_0x5f0a('0x1d')]=qs[_0x5f0a('0x1d')](_0x446ccd[_0x5f0a('0x2e')][_0x5f0a('0x1d')]);_0x4d2d86[_0x5f0a('0x1b')]=qs['offset'](_0x446ccd[_0x5f0a('0x2e')][_0x5f0a('0x1b')]);}_0x4d2d86[_0x5f0a('0x36')]=qs[_0x5f0a('0x37')](_0x446ccd[_0x5f0a('0x2e')][_0x5f0a('0x37')]);_0x4d2d86[_0x5f0a('0x38')]=qs[_0x5f0a('0x30')](_[_0x5f0a('0x39')](_0x446ccd[_0x5f0a('0x2e')],_0x2097c6['filters']),_0x4e639c);if(_0x446ccd['query'][_0x5f0a('0x3a')]){_0x4d2d86[_0x5f0a('0x38')]=_[_0x5f0a('0x3b')](_0x4d2d86['where'],{'$or':_['map'](_0x4e639c,function(_0x380367){if(_0x380367[_0x5f0a('0x3c')]!==_0x5f0a('0x3d')){var _0x45dc34={};_0x45dc34[_0x380367[_0x5f0a('0x3e')]]={'$like':'%'+_0x446ccd[_0x5f0a('0x2e')]['filter']+'%'};return _0x45dc34;}})});}_0x4d2d86=_[_0x5f0a('0x3b')]({},_0x4d2d86,_0x446ccd[_0x5f0a('0x3f')]);var _0xc83c79={'where':_0x4d2d86[_0x5f0a('0x38')]};return db['Attachment'][_0x5f0a('0x1e')](_0xc83c79)[_0x5f0a('0x22')](function(_0x50912f){_0x22a798['count']=_0x50912f;if(_0x446ccd['query'][_0x5f0a('0x40')]){_0x4d2d86['include']=[{'all':!![]}];}return db[_0x5f0a('0x41')][_0x5f0a('0x42')](_0x4d2d86);})[_0x5f0a('0x22')](function(_0x365d7a){_0x22a798[_0x5f0a('0x43')]=_0x365d7a;return _0x22a798;})['then'](respondWithFilteredResult(_0x22658e,_0x4d2d86))['catch'](handleError(_0x22658e,null));};exports['show']=function(_0x1fb3a0,_0x49d2ee){var _0x3ba569={'raw':!![],'where':{'id':_0x1fb3a0['params']['id']}},_0x5aa0de={};_0x5aa0de[_0x5f0a('0x2d')]=_[_0x5f0a('0x2f')](db[_0x5f0a('0x41')][_0x5f0a('0x2a')]);_0x5aa0de['query']=_[_0x5f0a('0x2f')](_0x1fb3a0[_0x5f0a('0x2e')]);_0x5aa0de[_0x5f0a('0x30')]=_[_0x5f0a('0x31')](_0x5aa0de[_0x5f0a('0x2d')],_0x5aa0de[_0x5f0a('0x2e')]);_0x3ba569[_0x5f0a('0x33')]=_[_0x5f0a('0x31')](_0x5aa0de['model'],qs[_0x5f0a('0x32')](_0x1fb3a0[_0x5f0a('0x2e')]['fields']));_0x3ba569[_0x5f0a('0x33')]=_0x3ba569['attributes']['length']?_0x3ba569[_0x5f0a('0x33')]:_0x5aa0de['model'];if(_0x1fb3a0[_0x5f0a('0x2e')][_0x5f0a('0x40')]){_0x3ba569[_0x5f0a('0x44')]=[{'all':!![]}];}_0x3ba569=_['merge']({},_0x3ba569,_0x1fb3a0[_0x5f0a('0x3f')]);return db[_0x5f0a('0x41')][_0x5f0a('0x45')](_0x3ba569)['then'](handleEntityNotFound(_0x49d2ee,null))[_0x5f0a('0x22')](respondWithResult(_0x49d2ee,null))[_0x5f0a('0x46')](handleError(_0x49d2ee,null));};exports[_0x5f0a('0x47')]=function(_0x4dc091,_0x33ed4b){var _0x5734fc={'where':{'id':_0x4dc091[_0x5f0a('0x48')]['id']}},_0x46c6be={};_0x46c6be[_0x5f0a('0x2d')]=_[_0x5f0a('0x2f')](db['Attachment'][_0x5f0a('0x2a')]);_0x5734fc[_0x5f0a('0x33')]=_['intersection'](_0x46c6be[_0x5f0a('0x2d')],qs[_0x5f0a('0x32')](_0x4dc091['query'][_0x5f0a('0x32')]));_0x5734fc[_0x5f0a('0x33')]=_0x5734fc[_0x5f0a('0x33')][_0x5f0a('0x49')]?_0x5734fc['attributes']:_0x46c6be[_0x5f0a('0x2d')];if(_0x4dc091[_0x5f0a('0x2e')]['includeAll']){_0x5734fc[_0x5f0a('0x44')]=[{'all':!![]}];}_0x5734fc=_[_0x5f0a('0x3b')]({},_0x5734fc,_0x4dc091[_0x5f0a('0x3f')]);return db[_0x5f0a('0x41')][_0x5f0a('0x45')](_0x5734fc)['then'](handleEntityNotFound(_0x33ed4b,null))['then'](function(_0x3bd637){if(_0x3bd637){var _0x42e274=_0x3bd637[_0x5f0a('0x4a')]({'plain':!![]});_0x42e274=qs[_0x5f0a('0x4b')](_0x42e274,['id',_0x5f0a('0x4c'),_0x5f0a('0x4d')]);_0x4dc091[_0x5f0a('0x4e')]=_[_0x5f0a('0x4b')](_0x4dc091[_0x5f0a('0x4e')],['id',_0x5f0a('0x4c'),_0x5f0a('0x4d')]);return db['Attachment'][_0x5f0a('0x4f')](_[_0x5f0a('0x3b')](_0x42e274,_0x4dc091[_0x5f0a('0x4e')]),{'include':_0x4dc091['query'][_0x5f0a('0x40')]?[{'all':!![]}]:undefined});}})[_0x5f0a('0x22')](respondWithResult(_0x33ed4b,0xc9))[_0x5f0a('0x46')](handleError(_0x33ed4b,null));};exports[_0x5f0a('0x21')]=function(_0x271080,_0x1d83bf){if(_0x271080[_0x5f0a('0x4e')]['id']){delete _0x271080['body']['id'];}return db[_0x5f0a('0x41')][_0x5f0a('0x45')]({'where':{'id':_0x271080['params']['id']}})[_0x5f0a('0x22')](handleEntityNotFound(_0x1d83bf,null))[_0x5f0a('0x22')](saveUpdates(_0x271080[_0x5f0a('0x4e')],null))[_0x5f0a('0x22')](respondWithResult(_0x1d83bf,null))[_0x5f0a('0x46')](handleError(_0x1d83bf,null));};exports[_0x5f0a('0x23')]=function(_0x57ef3d,_0x3c2cbd){return db[_0x5f0a('0x41')][_0x5f0a('0x45')]({'where':{'id':_0x57ef3d[_0x5f0a('0x48')]['id']}})[_0x5f0a('0x22')](handleEntityNotFound(_0x3c2cbd,null))[_0x5f0a('0x22')](removeEntity(_0x3c2cbd,null))[_0x5f0a('0x46')](handleError(_0x3c2cbd,null));};exports[_0x5f0a('0x4f')]=function(_0x43504c,_0x4c6121,_0x35f15a){_0x43504c[_0x5f0a('0x4e')][_0x5f0a('0x3e')]=_0x43504c['file'][_0x5f0a('0x50')];_0x43504c[_0x5f0a('0x4e')]['basename']=_0x43504c[_0x5f0a('0x51')]['filename'];_0x43504c[_0x5f0a('0x4e')]['type']=_0x43504c[_0x5f0a('0x51')][_0x5f0a('0x52')];return db[_0x5f0a('0x41')]['create'](_0x43504c['body'])['then'](respondWithResult(_0x4c6121,0xc9))[_0x5f0a('0x46')](handleError(_0x4c6121,null));};exports[_0x5f0a('0x53')]=function(_0x50bbd9,_0x2faf92,_0x265200){return db[_0x5f0a('0x41')][_0x5f0a('0x54')]({'where':{'id':_0x50bbd9[_0x5f0a('0x48')]['id']},'raw':!![]})[_0x5f0a('0x22')](handleEntityNotFound(_0x2faf92,null))['then'](function(_0x511c3e){if(_0x511c3e){var _0x169bd6=_0x511c3e[_0x5f0a('0x55')]!==null;var _0x3856f9=path[_0x5f0a('0x56')](config[_0x5f0a('0x57')],_0x5f0a('0x58'));if(_0x169bd6){_0x3856f9=path[_0x5f0a('0x56')](_0x3856f9,_0x5f0a('0x59'));}var _0x3ec80b=path[_0x5f0a('0x56')](_0x3856f9,_0x511c3e[_0x5f0a('0x5a')]);return _0x2faf92[_0x5f0a('0x53')](_0x3ec80b);}})['catch'](handleError(_0x2faf92,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index b19da3b..513373e 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 _0xe2f0=['lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./attachment.attributes','Attachment','attachments'];(function(_0x35acb9,_0x2826d9){var _0x3a4bcd=function(_0x3c5fd9){while(--_0x3c5fd9){_0x35acb9['push'](_0x35acb9['shift']());}};_0x3a4bcd(++_0x2826d9);}(_0xe2f0,0x6e));var _0x0e2f=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0xe2f0[_0x548d7d];return _0xb1c878;};'use strict';var _=require(_0x0e2f('0x0'));var util=require(_0x0e2f('0x1'));var logger=require(_0x0e2f('0x2'))(_0x0e2f('0x3'));var moment=require('moment');var BPromise=require(_0x0e2f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0e2f('0x5'));var config=require(_0x0e2f('0x6'));var attributes=require(_0x0e2f('0x7'));module['exports']=function(_0x5dee4b,_0x3a1ae5){return _0x5dee4b['define'](_0x0e2f('0x8'),attributes,{'tableName':_0x0e2f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22a2=['request-promise','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','util','../../config/logger','api'];(function(_0x4342a4,_0x364d50){var _0x290d36=function(_0x572a41){while(--_0x572a41){_0x4342a4['push'](_0x4342a4['shift']());}};_0x290d36(++_0x364d50);}(_0x22a2,0x13b));var _0x222a=function(_0x560638,_0x55cb9c){_0x560638=_0x560638-0x0;var _0x23b648=_0x22a2[_0x560638];return _0x23b648;};'use strict';var _=require(_0x222a('0x0'));var util=require(_0x222a('0x1'));var logger=require(_0x222a('0x2'))(_0x222a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x222a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x222a('0x5'));var config=require(_0x222a('0x6'));var attributes=require(_0x222a('0x7'));module['exports']=function(_0x53ae35,_0x301c80){return _0x53ae35[_0x222a('0x8')](_0x222a('0x9'),attributes,{'tableName':_0x222a('0xa'),'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 682cb9d..dcddd76 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 _0xeea4=['Attachment,\x20%s,\x20%s','message','result','CreateAttachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4f4a3c,_0x5eab0e){var _0x5a341d=function(_0x4956b5){while(--_0x4956b5){_0x4f4a3c['push'](_0x4f4a3c['shift']());}};_0x5a341d(++_0x5eab0e);}(_0xeea4,0x19e));var _0x4eea=function(_0x38ad33,_0x4f5ece){_0x38ad33=_0x38ad33-0x0;var _0x33ec62=_0xeea4[_0x38ad33];return _0x33ec62;};'use strict';var _=require(_0x4eea('0x0'));var util=require(_0x4eea('0x1'));var moment=require(_0x4eea('0x2'));var BPromise=require(_0x4eea('0x3'));var rs=require(_0x4eea('0x4'));var fs=require('fs');var Redis=require(_0x4eea('0x5'));var db=require(_0x4eea('0x6'))['db'];var utils=require(_0x4eea('0x7'));var logger=require(_0x4eea('0x8'))('rpc');var config=require(_0x4eea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4eea('0xa')][_0x4eea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d5aa8,_0x48538e,_0x1a2e5e){return new BPromise(function(_0x44116a,_0x4cc630){return client[_0x4eea('0xc')](_0x3d5aa8,_0x1a2e5e)[_0x4eea('0xd')](function(_0x2bba91){logger[_0x4eea('0xe')]('Attachment,\x20%s,\x20%s',_0x48538e,_0x4eea('0xf'));logger[_0x4eea('0x10')](_0x4eea('0x11'),_0x48538e,_0x4eea('0xf'),JSON[_0x4eea('0x12')](_0x2bba91));if(_0x2bba91[_0x4eea('0x13')]){if(_0x2bba91[_0x4eea('0x13')][_0x4eea('0x14')]===0x1f4){logger[_0x4eea('0x13')](_0x4eea('0x15'),_0x48538e,_0x2bba91['error']['message']);return _0x4cc630(_0x2bba91[_0x4eea('0x13')][_0x4eea('0x16')]);}logger[_0x4eea('0x13')](_0x4eea('0x15'),_0x48538e,_0x2bba91[_0x4eea('0x13')][_0x4eea('0x16')]);return _0x44116a(_0x2bba91[_0x4eea('0x13')][_0x4eea('0x16')]);}else{logger['info'](_0x4eea('0x15'),_0x48538e,_0x4eea('0xf'));_0x44116a(_0x2bba91[_0x4eea('0x17')][_0x4eea('0x16')]);}})['catch'](function(_0x446474){logger[_0x4eea('0x13')](_0x4eea('0x15'),_0x48538e,_0x446474);_0x4cc630(_0x446474);});});}exports[_0x4eea('0x18')]=function(_0x27a227){var _0x5bd90b=this;return new Promise(function(_0x1571f3,_0x29de0e){return db['Attachment'][_0x4eea('0x19')](_0x27a227[_0x4eea('0x1a')],{'raw':_0x27a227[_0x4eea('0x1b')]?_0x27a227[_0x4eea('0x1b')][_0x4eea('0x1c')]===undefined?!![]:![]:!![]})[_0x4eea('0xd')](function(_0x56fefc){logger[_0x4eea('0xe')](_0x4eea('0x18'),_0x27a227);logger[_0x4eea('0x10')](_0x4eea('0x18'),_0x27a227,JSON[_0x4eea('0x12')](_0x56fefc));_0x1571f3(_0x56fefc);})['catch'](function(_0x4898e8){logger[_0x4eea('0x13')]('CreateAttachment',_0x4898e8['message'],_0x27a227);_0x29de0e(_0x5bd90b['error'](0x1f4,_0x4898e8[_0x4eea('0x16')]));});});};
\ No newline at end of file
+var _0x26bc=['Attachment','create','body','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x134b7d,_0x4377fb){var _0x12d5e1=function(_0x5a4569){while(--_0x5a4569){_0x134b7d['push'](_0x134b7d['shift']());}};_0x12d5e1(++_0x4377fb);}(_0x26bc,0x162));var _0xc26b=function(_0x39843a,_0xf6ddc1){_0x39843a=_0x39843a-0x0;var _0x581f65=_0x26bc[_0x39843a];return _0x581f65;};'use strict';var _=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var moment=require(_0xc26b('0x2'));var BPromise=require(_0xc26b('0x3'));var rs=require(_0xc26b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc26b('0x5'))['db'];var utils=require(_0xc26b('0x6'));var logger=require(_0xc26b('0x7'))('rpc');var config=require(_0xc26b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc26b('0x9')][_0xc26b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13d90e,_0x5c2f6f,_0x11c6f5){return new BPromise(function(_0x453491,_0x465c89){return client[_0xc26b('0xb')](_0x13d90e,_0x11c6f5)[_0xc26b('0xc')](function(_0x1fb2b5){logger[_0xc26b('0xd')](_0xc26b('0xe'),_0x5c2f6f,_0xc26b('0xf'));logger[_0xc26b('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5c2f6f,_0xc26b('0xf'),JSON[_0xc26b('0x11')](_0x1fb2b5));if(_0x1fb2b5[_0xc26b('0x12')]){if(_0x1fb2b5[_0xc26b('0x12')][_0xc26b('0x13')]===0x1f4){logger[_0xc26b('0x12')]('Attachment,\x20%s,\x20%s',_0x5c2f6f,_0x1fb2b5[_0xc26b('0x12')]['message']);return _0x465c89(_0x1fb2b5['error'][_0xc26b('0x14')]);}logger[_0xc26b('0x12')](_0xc26b('0xe'),_0x5c2f6f,_0x1fb2b5[_0xc26b('0x12')]['message']);return _0x453491(_0x1fb2b5[_0xc26b('0x12')][_0xc26b('0x14')]);}else{logger[_0xc26b('0xd')](_0xc26b('0xe'),_0x5c2f6f,_0xc26b('0xf'));_0x453491(_0x1fb2b5[_0xc26b('0x15')]['message']);}})[_0xc26b('0x16')](function(_0x2713f6){logger['error'](_0xc26b('0xe'),_0x5c2f6f,_0x2713f6);_0x465c89(_0x2713f6);});});}exports['CreateAttachment']=function(_0x4802c7){var _0x7e6ed0=this;return new Promise(function(_0x47e75b,_0x47104f){return db[_0xc26b('0x17')][_0xc26b('0x18')](_0x4802c7[_0xc26b('0x19')],{'raw':_0x4802c7['options']?_0x4802c7[_0xc26b('0x1a')][_0xc26b('0x1b')]===undefined?!![]:![]:!![]})[_0xc26b('0xc')](function(_0x8531d6){logger[_0xc26b('0xd')](_0xc26b('0x1c'),_0x4802c7);logger['debug'](_0xc26b('0x1c'),_0x4802c7,JSON['stringify'](_0x8531d6));_0x47e75b(_0x8531d6);})[_0xc26b('0x16')](function(_0x129080){logger[_0xc26b('0x12')](_0xc26b('0x1c'),_0x129080['message'],_0x4802c7);_0x47104f(_0x7e6ed0[_0xc26b('0x12')](0x1f4,_0x129080[_0xc26b('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 7463245..6b9e8bd 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x275ff0,_0x3ebfd5){var _0xfa845d=function(_0x1482d6){while(--_0x1482d6){_0x275ff0['push'](_0x275ff0['shift']());}};_0xfa845d(++_0x3ebfd5);}(_0x2032,0xd9));var _0x2203=function(_0x7f8032,_0x1cbd5c){_0x7f8032=_0x7f8032-0x0;var _0xa91fb6=_0x2032[_0x7f8032];return _0xa91fb6;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x4dbe30,_0x1451e1){_0x4dbe30=_0x4dbe30-0x0;var _0x53f0fa=_0xdb28[_0x4dbe30];return _0x53f0fa;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index a3b975b..ca2b5c0 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e92=['getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','add','minutes'];(function(_0xa52fbe,_0x42c438){var _0x4297c8=function(_0x3a8a6e){while(--_0x3a8a6e){_0xa52fbe['push'](_0xa52fbe['shift']());}};_0x4297c8(++_0x42c438);}(_0x9e92,0x104));var _0x29e9=function(_0x1593ea,_0x4e0275){_0x1593ea=_0x1593ea-0x0;var _0x49d36a=_0x9e92[_0x1593ea];return _0x49d36a;};'use strict';var passport=require(_0x29e9('0x0'));var LocalStrategy=require(_0x29e9('0x1'))[_0x29e9('0x2')];var moment=require(_0x29e9('0x3'));var ActiveDirectory=require(_0x29e9('0x4'));var BPromise=require(_0x29e9('0x5'));var util=require(_0x29e9('0x6'));var db=require(_0x29e9('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x29e9('0x8'));var config=require(_0x29e9('0x9'));var logger=require(_0x29e9('0xa'))(_0x29e9('0xb'));function isActiveDirectoryConfigured(_0x35e0c0){var _0x11c460=![];if(typeof _0x35e0c0[_0x29e9('0xc')]!==_0x29e9('0xd')){_0x11c460=_0x35e0c0[_0x29e9('0xc')]['baseDN']&&_0x35e0c0[_0x29e9('0xc')][_0x29e9('0xe')]&&_0x35e0c0['activedirectory'][_0x29e9('0xf')];}return _0x11c460;}function adAuthenticate(_0x3d7f70,_0x302714,_0x485e25){return new BPromise(function(_0x525098,_0x3dca2f){try{var _0x191230=new ActiveDirectory(_0x3d7f70);_0x191230[_0x29e9('0x10')](_0x302714,_0x485e25,function(_0x5d4c05,_0x3b5f1d){if(_0x5d4c05){logger[_0x29e9('0x11')](_0x29e9('0x12'),_0x302714,util['inspect'](_0x5d4c05,{'showHidden':![],'depth':null}));_0x3dca2f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x3b5f1d){logger[_0x29e9('0x11')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x302714);_0x3dca2f(_0x29e9('0x13'));}else{_0x525098(_0x3b5f1d);}});}catch(_0x5f576d){_0x3dca2f(_0x5f576d);}});}function ActiveDirectoryAuthenticate(_0x4c23a1,_0x470312,_0x406068,_0x21ab78){var _0x155677,_0x4c3477;if(!isActiveDirectoryConfigured(config)){logger[_0x29e9('0x11')](_0x29e9('0x14'),_0x470312);return _0x21ab78(null,![],{'message':_0x29e9('0x13')});}return db[_0x29e9('0x15')]['findOne']({'where':{'id':0x1},'attributes':[_0x29e9('0x16'),_0x29e9('0x17')],'raw':!![]})[_0x29e9('0x18')](function(_0x53312f){_0x155677=_0x53312f;if(!_0x155677[_0x29e9('0x16')]){logger[_0x29e9('0x11')](_0x29e9('0x19'),_0x470312);throw new Error(_0x29e9('0x13'));}return _0x4c23a1[_0x29e9('0x1a')]({'attributes':['id',_0x29e9('0x1b'),_0x29e9('0x1c'),_0x29e9('0x1d'),_0x29e9('0x1e'),_0x29e9('0x1f'),_0x29e9('0x20'),_0x29e9('0x21'),_0x29e9('0x22')],'where':{'name':_0x470312,'role':{'$or':[_0x29e9('0x23'),_0x29e9('0x24'),_0x29e9('0x25')]},'adSsoEnabled':!![]}});})[_0x29e9('0x18')](function(_0x32dfc2){if(!_0x32dfc2||_0x32dfc2&&_0x32dfc2[_0x29e9('0x1b')]!==_0x470312){throw new Error(_0x29e9('0x13'));}_0x4c3477=_0x32dfc2;var _0x1d40db=_0x4c3477['name']+'@'+config[_0x29e9('0xc')][_0x29e9('0xf')];return adAuthenticate(config[_0x29e9('0xc')],_0x1d40db,_0x406068);})['then'](function(_0x3dfd0e){if(_0x4c3477['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x155677[_0x29e9('0x17')]>0x0){if(_0x4c3477['blocked']){if(moment(_0x4c3477[_0x29e9('0x21')])[_0x29e9('0x26')](_0x155677['blockDuration'],_0x29e9('0x27'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x4c3477,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4c3477);})[_0x29e9('0x18')](function(){return _0x21ab78(null,_0x4c3477);});}else{return utils['getLicense'](_0x4c3477)[_0x29e9('0x18')](function(){return _0x21ab78(null,_0x4c3477);});}}else{return utils[_0x29e9('0x28')](_0x4c3477)[_0x29e9('0x18')](function(){return _0x21ab78(null,_0x4c3477);});}})[_0x29e9('0x29')](function(_0x818f6d){return _0x21ab78(null,![],_0x818f6d);});}function handleError(_0x1f5466,_0x598196,_0x576c00){return _0x1f5466['status'](_0x598196||0x1f4)[_0x29e9('0x2a')]({'message':_0x576c00?_0x576c00[_0x29e9('0x2b')]||_0x576c00:''});}exports[_0x29e9('0x2c')]=function(_0x3c269b,_0x43c9b1,_0x308f11){passport['authenticate'](_0x29e9('0x2d'),function(_0x265382,_0x297ea1,_0xc81440){var _0xa82fc9=_0x265382||_0xc81440;if(_0xa82fc9){return handleError(_0x43c9b1,0x191,_0xa82fc9);}if(!_0x297ea1){return handleError(_0x43c9b1,0x194,{'message':_0x29e9('0x2e')});}else{var _0x1311cc={'payload':{'id':_0x297ea1['id'],'role':_0x297ea1[_0x29e9('0x1e')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1311cc)['then'](function(_0x3c5098){_0x43c9b1[_0x29e9('0x2f')]({'id':_0x297ea1['id'],'token':_0x3c5098,'statusCall':'','isAlreadyLogged':_0x297ea1['online']});});}})(_0x3c269b,_0x43c9b1,_0x308f11);};passport[_0x29e9('0x30')]('ad-login',new LocalStrategy({'usernameField':_0x29e9('0x1b'),'passwordField':_0x29e9('0x1c')},function(_0xe23067,_0x256d44,_0x4a266d){return ActiveDirectoryAuthenticate(db[_0x29e9('0x31')],_0xe23067,_0x256d44,_0x4a266d);}));
\ No newline at end of file
+var _0x7de8=['blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','role','blocked','online','user','agent','disabled','blockedAt','add','minutes','getLicense','catch','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','ad-login','User','passport','passport-local','Strategy','moment','bluebird','util','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled'];(function(_0x4f222e,_0x3cbb57){var _0x13afac=function(_0x215cad){while(--_0x215cad){_0x4f222e['push'](_0x4f222e['shift']());}};_0x13afac(++_0x3cbb57);}(_0x7de8,0x133));var _0x87de=function(_0x2b67b8,_0xb562d0){_0x2b67b8=_0x2b67b8-0x0;var _0x448d4c=_0x7de8[_0x2b67b8];return _0x448d4c;};'use strict';var passport=require(_0x87de('0x0'));var LocalStrategy=require(_0x87de('0x1'))[_0x87de('0x2')];var moment=require(_0x87de('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x87de('0x4'));var util=require(_0x87de('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x87de('0x6'));var utils=require('../../config/utils');var config=require(_0x87de('0x7'));var logger=require(_0x87de('0x8'))(_0x87de('0x9'));function isActiveDirectoryConfigured(_0x153f2c){var _0x1f38a9=![];if(typeof _0x153f2c[_0x87de('0xa')]!==_0x87de('0xb')){_0x1f38a9=_0x153f2c['activedirectory'][_0x87de('0xc')]&&_0x153f2c[_0x87de('0xa')]['url']&&_0x153f2c[_0x87de('0xa')][_0x87de('0xd')];}return _0x1f38a9;}function adAuthenticate(_0x3dc540,_0x2332e6,_0x8150dd){return new BPromise(function(_0x44f3bc,_0x127495){try{var _0xcca57d=new ActiveDirectory(_0x3dc540);_0xcca57d[_0x87de('0xe')](_0x2332e6,_0x8150dd,function(_0x9ff3a,_0x2773a8){if(_0x9ff3a){logger['error'](_0x87de('0xf'),_0x2332e6,util['inspect'](_0x9ff3a,{'showHidden':![],'depth':null}));_0x127495('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2773a8){logger[_0x87de('0x10')](_0x87de('0x11'),_0x2332e6);_0x127495(_0x87de('0x12'));}else{_0x44f3bc(_0x2773a8);}});}catch(_0x1c1b02){_0x127495(_0x1c1b02);}});}function ActiveDirectoryAuthenticate(_0x4ed36d,_0x10cb0e,_0x347d3d,_0x5eb575){var _0x398935,_0x409da1;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x87de('0x13'),_0x10cb0e);return _0x5eb575(null,![],{'message':_0x87de('0x12')});}return db[_0x87de('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0x87de('0x15'),_0x87de('0x16')],'raw':!![]})[_0x87de('0x17')](function(_0x11073a){_0x398935=_0x11073a;if(!_0x398935[_0x87de('0x15')]){logger[_0x87de('0x10')](_0x87de('0x18'),_0x10cb0e);throw new Error(_0x87de('0x12'));}return _0x4ed36d[_0x87de('0x19')]({'attributes':['id',_0x87de('0x1a'),_0x87de('0x1b'),'salt',_0x87de('0x1c'),'disabled',_0x87de('0x1d'),'blockedAt',_0x87de('0x1e')],'where':{'name':_0x10cb0e,'role':{'$or':['admin',_0x87de('0x1f'),_0x87de('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x4a7456){if(!_0x4a7456||_0x4a7456&&_0x4a7456[_0x87de('0x1a')]!==_0x10cb0e){throw new Error(_0x87de('0x12'));}_0x409da1=_0x4a7456;var _0x158c1b=_0x409da1[_0x87de('0x1a')]+'@'+config[_0x87de('0xa')][_0x87de('0xd')];return adAuthenticate(config['activedirectory'],_0x158c1b,_0x347d3d);})[_0x87de('0x17')](function(_0x4405a5){if(_0x409da1[_0x87de('0x21')]){throw new Error(_0x87de('0x12'));}if(_0x398935[_0x87de('0x16')]>0x0){if(_0x409da1['blocked']){if(moment(_0x409da1[_0x87de('0x22')])[_0x87de('0x23')](_0x398935[_0x87de('0x16')],_0x87de('0x24'))>moment()){throw new Error(_0x87de('0x12'));}return utils['clearBlockUser'](_0x409da1,0x0,![],null)['then'](function(){return utils[_0x87de('0x25')](_0x409da1);})['then'](function(){return _0x5eb575(null,_0x409da1);});}else{return utils[_0x87de('0x25')](_0x409da1)[_0x87de('0x17')](function(){return _0x5eb575(null,_0x409da1);});}}else{return utils[_0x87de('0x25')](_0x409da1)['then'](function(){return _0x5eb575(null,_0x409da1);});}})[_0x87de('0x26')](function(_0x4c27aa){return _0x5eb575(null,![],_0x4c27aa);});}function handleError(_0x5b4062,_0x3ab69a,_0x488b79){return _0x5b4062['status'](_0x3ab69a||0x1f4)[_0x87de('0x27')]({'message':_0x488b79?_0x488b79[_0x87de('0x28')]||_0x488b79:''});}exports[_0x87de('0x29')]=function(_0x460569,_0x2340f4,_0x5d72e9){passport['authenticate']('ad-login',function(_0x22e8de,_0x15b9c1,_0x516c89){var _0x2a94c2=_0x22e8de||_0x516c89;if(_0x2a94c2){return handleError(_0x2340f4,0x191,_0x2a94c2);}if(!_0x15b9c1){return handleError(_0x2340f4,0x194,{'message':_0x87de('0x2a')});}else{var _0x103af3={'payload':{'id':_0x15b9c1['id'],'role':_0x15b9c1[_0x87de('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x87de('0x2b')](_0x103af3)[_0x87de('0x17')](function(_0x59a4e8){_0x2340f4[_0x87de('0x2c')]({'id':_0x15b9c1['id'],'token':_0x59a4e8,'statusCall':'','isAlreadyLogged':_0x15b9c1[_0x87de('0x1e')]});});}})(_0x460569,_0x2340f4,_0x5d72e9);};passport['use'](_0x87de('0x2d'),new LocalStrategy({'usernameField':_0x87de('0x1a'),'passwordField':'password'},function(_0x4c00ce,_0xfa228,_0x5079b9){return ActiveDirectoryAuthenticate(db[_0x87de('0x2e')],_0x4c00ce,_0xfa228,_0x5079b9);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index bdfbc24..1805ce5 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x35ac=['express','Router','./authActiveDirectory.controller','post'];(function(_0x1f568c,_0x945bb0){var _0x594e6c=function(_0x52ca51){while(--_0x52ca51){_0x1f568c['push'](_0x1f568c['shift']());}};_0x594e6c(++_0x945bb0);}(_0x35ac,0x9c));var _0xc35a=function(_0x300971,_0x2e212a){_0x300971=_0x300971-0x0;var _0x31af27=_0x35ac[_0x300971];return _0x31af27;};'use strict';var express=require(_0xc35a('0x0'));var router=express[_0xc35a('0x1')]();var controller=require(_0xc35a('0x2'));router[_0xc35a('0x3')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
+var _0xd2b8=['express','./authActiveDirectory.controller','login','exports'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0xd2b8,0xac));var _0x8d2b=function(_0x100a03,_0x50a8f7){_0x100a03=_0x100a03-0x0;var _0x118ce1=_0xd2b8[_0x100a03];return _0x118ce1;};'use strict';var express=require(_0x8d2b('0x0'));var router=express['Router']();var controller=require(_0x8d2b('0x1'));router['post']('/',controller[_0x8d2b('0x2')]);module[_0x8d2b('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 7f95f0f..c0eb008 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x2cf1a4,_0x1bdc8d){_0x2cf1a4=_0x2cf1a4-0x0;var _0x577491=_0x7a54[_0x2cf1a4];return _0x577491;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7a54,0x106));var _0x47a5=function(_0x4796fc,_0x24556c){_0x4796fc=_0x4796fc-0x0;var _0x74360d=_0x7a54[_0x4796fc];return _0x74360d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 153e21d..09054c3 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 _0x9116=['setTokenCookie','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x256c58,_0x4aba43){var _0x296f3f=function(_0x5a009b){while(--_0x5a009b){_0x256c58['push'](_0x256c58['shift']());}};_0x296f3f(++_0x4aba43);}(_0x9116,0x10f));var _0x6911=function(_0x18b165,_0x40a7ea){_0x18b165=_0x18b165-0x0;var _0x1d8e19=_0x9116[_0x18b165];return _0x1d8e19;};'use strict';var express=require(_0x6911('0x0'));var passport=require('passport');var router=express[_0x6911('0x1')]();var controller=require(_0x6911('0x2'));var userController=require(_0x6911('0x3'));var authService=require(_0x6911('0x4'));router[_0x6911('0x5')]('/',controller[_0x6911('0x6')]);router['get'](_0x6911('0x7'),controller[_0x6911('0x8')],authService['isMiddleware'],userController[_0x6911('0x6')],authService[_0x6911('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0x5231=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express'];(function(_0x5d61b4,_0x4f7b91){var _0x183fc5=function(_0x5ecf92){while(--_0x5ecf92){_0x5d61b4['push'](_0x5d61b4['shift']());}};_0x183fc5(++_0x4f7b91);}(_0x5231,0x1af));var _0x1523=function(_0x56cacd,_0x10fb73){_0x56cacd=_0x56cacd-0x0;var _0x11ffdc=_0x5231[_0x56cacd];return _0x11ffdc;};'use strict';var express=require(_0x1523('0x0'));var passport=require(_0x1523('0x1'));var router=express[_0x1523('0x2')]();var controller=require(_0x1523('0x3'));var userController=require(_0x1523('0x4'));var authService=require(_0x1523('0x5'));router[_0x1523('0x6')]('/',controller[_0x1523('0x7')]);router[_0x1523('0x6')](_0x1523('0x8'),controller[_0x1523('0x9')],authService['isMiddleware'],userController[_0x1523('0x7')],authService[_0x1523('0xa')]);module[_0x1523('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index cfdbd17..6ea0e8f 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 _0x8f7f=['blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','message','stringify','status','send','login','local-login','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','save','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','Setting','allowedLoginAttempts','then','findOne','name','password','salt','blocked','blockedAt','loginAttempts','admin','user','agent','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x431ae1,_0x385f06){var _0x27fcbd=function(_0x16e71f){while(--_0x16e71f){_0x431ae1['push'](_0x431ae1['shift']());}};_0x27fcbd(++_0x385f06);}(_0x8f7f,0x1e5));var _0xf8f7=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x8f7f[_0x231e16];return _0x570a7c;};'use strict';var util=require(_0xf8f7('0x0'));var passport=require(_0xf8f7('0x1'));var LocalStrategy=require(_0xf8f7('0x2'))[_0xf8f7('0x3')];var jayson=require(_0xf8f7('0x4'));var _=require(_0xf8f7('0x5'));var rs=require(_0xf8f7('0x6'));var moment=require('moment');var db=require(_0xf8f7('0x7'))['db'];var authService=require(_0xf8f7('0x8'));var utils=require('../../config/utils');var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x295754,_0x48d57d,_0x41c512,_0x25aa42){var _0x1a0efb,_0xff680;return db[_0xf8f7('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xf8f7('0xa'),'blockDuration'],'raw':!![]})[_0xf8f7('0xb')](function(_0x16d65f){_0x1a0efb=_0x16d65f;return _0x295754[_0xf8f7('0xc')]({'attributes':['id',_0xf8f7('0xd'),_0xf8f7('0xe'),_0xf8f7('0xf'),'role','disabled',_0xf8f7('0x10'),_0xf8f7('0x11'),_0xf8f7('0x12')],'where':{'name':_0x48d57d,'role':{'$or':[_0xf8f7('0x13'),_0xf8f7('0x14'),_0xf8f7('0x15')]}}});})[_0xf8f7('0xb')](function(_0x292f48){if(!_0x292f48||_0x292f48&&_0x292f48['name']!==_0x48d57d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xff680=_0x292f48;return _0xff680;}})[_0xf8f7('0xb')](function(){_0xff680[_0xf8f7('0x16')](_0x41c512,function(_0x236eff,_0x1d200f){var _0x371653=_0xff680['loginAttempts']+0x1;if(_0x236eff){return _0x25aa42(_0x236eff);}else if(!_0x1d200f){if(_0xff680[_0xf8f7('0x17')]){return _0x25aa42(null,![],{'message':_0xf8f7('0x18')});}else if(_0x1a0efb['allowedLoginAttempts']>0x0){if(_0xff680[_0xf8f7('0x10')]){if(_0x1a0efb[_0xf8f7('0x19')]>0x0){if(moment(_0xff680[_0xf8f7('0x11')])[_0xf8f7('0x1a')](_0x1a0efb[_0xf8f7('0x19')],_0xf8f7('0x1b'))>moment()){return _0x25aa42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf8f7('0x1c')](_0xff680,_0x371653,![],null)[_0xf8f7('0xb')](function(){return _0x25aa42(null,![],{'message':_0xf8f7('0x18')});});}}else{return _0x25aa42(null,![],{'message':_0xf8f7('0x18')});}}else{if(_0x371653>=_0x1a0efb[_0xf8f7('0xa')]){return utils[_0xf8f7('0x1c')](_0xff680,0x0,!![],moment())[_0xf8f7('0xb')](function(){return _0x25aa42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf8f7('0x1c')](_0xff680,_0x371653,![],null)[_0xf8f7('0xb')](function(){return _0x25aa42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x25aa42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xff680['disabled']){return _0x25aa42(null,![],{'message':_0xf8f7('0x18')});}else if(_0x1a0efb[_0xf8f7('0xa')]>0x0){if(_0xff680[_0xf8f7('0x10')]){if(_0x1a0efb[_0xf8f7('0x19')]>0x0){if(moment(_0xff680[_0xf8f7('0x11')])[_0xf8f7('0x1a')](_0x1a0efb[_0xf8f7('0x19')],_0xf8f7('0x1b'))>moment()){return _0x25aa42(null,![],{'message':_0xf8f7('0x18')});}else{return utils[_0xf8f7('0x1c')](_0xff680,0x0,![],null)[_0xf8f7('0xb')](function(){return utils[_0xf8f7('0x1d')](_0xff680);})[_0xf8f7('0xb')](function(){return _0x25aa42(null,_0xff680);});}}else{return _0x25aa42(null,![],{'message':_0xf8f7('0x18')});}}else{return utils['clearBlockUser'](_0xff680,0x0,![],null)['then'](function(){return utils[_0xf8f7('0x1d')](_0xff680);})['then'](function(){return _0x25aa42(null,_0xff680);})[_0xf8f7('0x1e')](function(_0x540efe){return _0x25aa42(null,![],_0x540efe);});}}else{if(_0xff680[_0xf8f7('0x10')]){return _0x25aa42(null,![],{'message':_0xf8f7('0x18')});}else{return utils[_0xf8f7('0x1d')](_0xff680)[_0xf8f7('0xb')](function(){return _0x25aa42(null,_0xff680);});}}}});})[_0xf8f7('0x1e')](function(_0x45a8b5){return _0x25aa42(null,![],_0x45a8b5);});}function sendServiceMail(_0x4f562d){return db[_0xf8f7('0x1f')][_0xf8f7('0x20')]({'where':{'service':!![]},'attributes':['id',_0xf8f7('0xd'),'email'],'include':[{'model':db[_0xf8f7('0x21')],'as':_0xf8f7('0x22'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x1a15ab){if(!_0x1a15ab){throw new Error(_0xf8f7('0x23'));}var _0x2df372=_0x1a15ab[_0xf8f7('0x24')]();var _0x459d4a={'account':_0x2df372,'message':_[_0xf8f7('0x25')]({'from':util[_0xf8f7('0x26')](_0xf8f7('0x27'),_0x1a15ab[_0xf8f7('0xd')],_0x1a15ab[_0xf8f7('0x28')]||_0x1a15ab[_0xf8f7('0x22')][_0xf8f7('0x14')])},_0x4f562d)};return client[_0xf8f7('0x29')](_0xf8f7('0x2a'),_0x459d4a);})[_0xf8f7('0xb')](function(_0x3d3207){if(_0x3d3207[_0xf8f7('0x2b')]){throw new Error(util[_0xf8f7('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3d3207[_0xf8f7('0x2b')][_0xf8f7('0x2c')]||JSON[_0xf8f7('0x2d')](_0x3d3207[_0xf8f7('0x2b')])));}return!![];});}function handleError(_0x110697,_0x30ea2c,_0x35399b){return _0x110697[_0xf8f7('0x2e')](_0x30ea2c||0x1f4)[_0xf8f7('0x2f')]({'message':_0x35399b?_0x35399b['message']||_0x35399b:''});}exports[_0xf8f7('0x30')]=function(_0xb2c3e3,_0x25251,_0x314829){passport[_0xf8f7('0x16')](_0xf8f7('0x31'),function(_0x32e357,_0x52b0a4,_0x25ba65){var _0x23e69e=_0x32e357||_0x25ba65;if(_0x23e69e){return handleError(_0x25251,0x191,_0x23e69e);}if(!_0x52b0a4){return handleError(_0x25251,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x430b3c={'payload':{'id':_0x52b0a4['id'],'role':_0x52b0a4[_0xf8f7('0x32')]},'options':{'expiresIn':0x15180}};return authService[_0xf8f7('0x33')](_0x430b3c)[_0xf8f7('0xb')](function(_0x487d12){_0x25251[_0xf8f7('0x34')]({'id':_0x52b0a4['id'],'token':_0x487d12,'statusCall':'','isAlreadyLogged':_0x52b0a4[_0xf8f7('0x35')]});});}})(_0xb2c3e3,_0x25251,_0x314829);};exports[_0xf8f7('0x36')]=function(_0x4e14f0,_0x5cb579){if(!_0x4e14f0[_0xf8f7('0x37')]['email']){return handleError(_0x5cb579,0x1f4,{'message':_0xf8f7('0x38')});}var _0x38a705=rs['generate']();_0x4e14f0[_0xf8f7('0x37')][_0xf8f7('0x28')]=_0x4e14f0['body'][_0xf8f7('0x28')][_0xf8f7('0x39')]()[_0xf8f7('0x3a')]();var _0x355c6d;return db[_0xf8f7('0x9')][_0xf8f7('0xc')]({'where':{'id':0x1},'attributes':[_0xf8f7('0xa'),_0xf8f7('0x19')],'raw':!![]})['then'](function(_0x3826ed){_0x355c6d=_0x3826ed;return db[_0xf8f7('0x3b')][_0xf8f7('0x20')]({'where':{'email':_0x4e14f0[_0xf8f7('0x37')][_0xf8f7('0x28')]}});})['then'](function(_0x2189b7){if(!_0x2189b7){throw new Error(_0xf8f7('0x3c'));}if(_0x2189b7['disabled']){throw new Error(_0xf8f7('0x3d'));}if(_0x2189b7[_0xf8f7('0x10')]){if(moment(_0x2189b7[_0xf8f7('0x11')])['add'](_0x355c6d[_0xf8f7('0x19')],_0xf8f7('0x1b'))>moment()){throw new Error(_0xf8f7('0x3e'));}else{_0x2189b7['blocked']=![];_0x2189b7[_0xf8f7('0x11')]=null;}}_0x2189b7[_0xf8f7('0x3f')]=_0x38a705;_0x2189b7[_0xf8f7('0x40')]=Date[_0xf8f7('0x41')]()+0x36ee80;return _0x2189b7['save']();})['then'](function(){return sendServiceMail({'to':_0x4e14f0['body'][_0xf8f7('0x28')],'subject':_0xf8f7('0x42'),'text':_0xf8f7('0x43')+_0xf8f7('0x44')+_0xf8f7('0x45')+_0x4e14f0[_0xf8f7('0x46')][_0xf8f7('0x47')]+_0xf8f7('0x48')+_0x38a705+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xf8f7('0xb')](function(){_0x5cb579[_0xf8f7('0x2e')](0xc8)[_0xf8f7('0x2f')]({'message':_0xf8f7('0x49')});})[_0xf8f7('0x1e')](function(_0x3c4f84){return handleError(_0x5cb579,0x1f4,_0x3c4f84);});};exports[_0xf8f7('0x4a')]=function(_0x1fdd58,_0x20d62c){return db['User']['find']({'where':{'resetPasswordToken':_0x1fdd58[_0xf8f7('0x4b')][_0xf8f7('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xf8f7('0x41')]()}}})[_0xf8f7('0xb')](function(_0x358ae3){if(!_0x358ae3){throw new Error(_0xf8f7('0x4d'));}return db[_0xf8f7('0x9')][_0xf8f7('0xc')]({'attributes':['id',_0xf8f7('0x4e'),_0xf8f7('0x4f'),'passwordHistoryLimit']})[_0xf8f7('0xb')](function(_0x3c5969){if(_0x3c5969[_0xf8f7('0x4e')])authService[_0xf8f7('0x50')](_0x1fdd58[_0xf8f7('0x37')][_0xf8f7('0xe')]);if(!_0x3c5969[_0xf8f7('0x4f')]||!_0x358ae3[_0xf8f7('0x51')])return _0x358ae3;authService[_0xf8f7('0x52')](_0x1fdd58[_0xf8f7('0x37')][_0xf8f7('0xe')],_0x358ae3[_0xf8f7('0x51')],_0x3c5969[_0xf8f7('0x53')]);return _0x358ae3;})[_0xf8f7('0xb')](function(){_0x358ae3['password']=_0x1fdd58[_0xf8f7('0x37')][_0xf8f7('0xe')];_0x358ae3[_0xf8f7('0x3f')]=null;_0x358ae3[_0xf8f7('0x40')]=null;return _0x358ae3[_0xf8f7('0x54')]();});})[_0xf8f7('0xb')](function(){_0x20d62c[_0xf8f7('0x2e')](0xc8)[_0xf8f7('0x2f')]({'message':'Password\x20reset!'});})['catch'](function(_0x8d56ac){return handleError(_0x20d62c,0x1f4,_0x8d56ac);});};passport['use']('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0xf8f7('0xe')},function(_0x5d3942,_0x58cfa0,_0x56d64a){return localAuthenticate(db[_0xf8f7('0x3b')],_0x5d3942,_0x58cfa0,_0x56d64a);}));
\ No newline at end of file
+var _0x858a=['You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordToken','use','local-login','util','passport','passport-local','Strategy','lodash','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','disabled','blocked','loginAttempts','admin','user','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x858a,0x191));var _0xa858=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x858a[_0x18ab2a];return _0x16dcee;};'use strict';var util=require(_0xa858('0x0'));var passport=require(_0xa858('0x1'));var LocalStrategy=require(_0xa858('0x2'))[_0xa858('0x3')];var jayson=require('jayson/promise');var _=require(_0xa858('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xa858('0x5'))['db'];var authService=require(_0xa858('0x6'));var utils=require(_0xa858('0x7'));var client=jayson['client'][_0xa858('0x8')]({'port':0x232b});function localAuthenticate(_0x574e0e,_0x1f42e2,_0x572f97,_0x6ae260){var _0x9380a8,_0x1b542c;return db[_0xa858('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xa858('0xa'),_0xa858('0xb')],'raw':!![]})[_0xa858('0xc')](function(_0x296951){_0x9380a8=_0x296951;return _0x574e0e[_0xa858('0xd')]({'attributes':['id','name',_0xa858('0xe'),_0xa858('0xf'),_0xa858('0x10'),_0xa858('0x11'),_0xa858('0x12'),'blockedAt',_0xa858('0x13')],'where':{'name':_0x1f42e2,'role':{'$or':[_0xa858('0x14'),_0xa858('0x15'),'agent']}}});})[_0xa858('0xc')](function(_0x29bbdb){if(!_0x29bbdb||_0x29bbdb&&_0x29bbdb[_0xa858('0x16')]!==_0x1f42e2){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1b542c=_0x29bbdb;return _0x1b542c;}})['then'](function(){_0x1b542c[_0xa858('0x17')](_0x572f97,function(_0x349867,_0x5cbc03){var _0x29a5fc=_0x1b542c['loginAttempts']+0x1;if(_0x349867){return _0x6ae260(_0x349867);}else if(!_0x5cbc03){if(_0x1b542c[_0xa858('0x11')]){return _0x6ae260(null,![],{'message':_0xa858('0x18')});}else if(_0x9380a8[_0xa858('0xa')]>0x0){if(_0x1b542c['blocked']){if(_0x9380a8[_0xa858('0xb')]>0x0){if(moment(_0x1b542c[_0xa858('0x19')])['add'](_0x9380a8[_0xa858('0xb')],_0xa858('0x1a'))>moment()){return _0x6ae260(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x1b542c,_0x29a5fc,![],null)[_0xa858('0xc')](function(){return _0x6ae260(null,![],{'message':_0xa858('0x18')});});}}else{return _0x6ae260(null,![],{'message':_0xa858('0x18')});}}else{if(_0x29a5fc>=_0x9380a8[_0xa858('0xa')]){return utils['clearBlockUser'](_0x1b542c,0x0,!![],moment())[_0xa858('0xc')](function(){return _0x6ae260(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xa858('0x1b')](_0x1b542c,_0x29a5fc,![],null)['then'](function(){return _0x6ae260(null,![],{'message':_0xa858('0x18')});});}}}else{return _0x6ae260(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1b542c[_0xa858('0x11')]){return _0x6ae260(null,![],{'message':_0xa858('0x18')});}else if(_0x9380a8[_0xa858('0xa')]>0x0){if(_0x1b542c[_0xa858('0x12')]){if(_0x9380a8['blockDuration']>0x0){if(moment(_0x1b542c[_0xa858('0x19')])[_0xa858('0x1c')](_0x9380a8[_0xa858('0xb')],'minutes')>moment()){return _0x6ae260(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa858('0x1b')](_0x1b542c,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1b542c);})[_0xa858('0xc')](function(){return _0x6ae260(null,_0x1b542c);});}}else{return _0x6ae260(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xa858('0x1b')](_0x1b542c,0x0,![],null)[_0xa858('0xc')](function(){return utils[_0xa858('0x1d')](_0x1b542c);})[_0xa858('0xc')](function(){return _0x6ae260(null,_0x1b542c);})[_0xa858('0x1e')](function(_0x39a3ef){return _0x6ae260(null,![],_0x39a3ef);});}}else{if(_0x1b542c['blocked']){return _0x6ae260(null,![],{'message':_0xa858('0x18')});}else{return utils[_0xa858('0x1d')](_0x1b542c)[_0xa858('0xc')](function(){return _0x6ae260(null,_0x1b542c);});}}}});})[_0xa858('0x1e')](function(_0x4963f1){return _0x6ae260(null,![],_0x4963f1);});}function sendServiceMail(_0x6257f3){return db[_0xa858('0x1f')][_0xa858('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xa858('0x21')],'include':[{'model':db[_0xa858('0x22')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x5013f3){if(!_0x5013f3){throw new Error(_0xa858('0x23'));}var _0x118a0e=_0x5013f3[_0xa858('0x24')]();var _0x996c27={'account':_0x118a0e,'message':_['merge']({'from':util[_0xa858('0x25')](_0xa858('0x26'),_0x5013f3[_0xa858('0x16')],_0x5013f3[_0xa858('0x21')]||_0x5013f3[_0xa858('0x27')][_0xa858('0x15')])},_0x6257f3)};return client[_0xa858('0x28')](_0xa858('0x29'),_0x996c27);})['then'](function(_0x15b317){if(_0x15b317[_0xa858('0x2a')]){throw new Error(util[_0xa858('0x25')](_0xa858('0x2b'),_0x15b317[_0xa858('0x2a')]['message']||JSON[_0xa858('0x2c')](_0x15b317['error'])));}return!![];});}function handleError(_0x2a85d6,_0x797d59,_0x38d42f){return _0x2a85d6['status'](_0x797d59||0x1f4)[_0xa858('0x2d')]({'message':_0x38d42f?_0x38d42f[_0xa858('0x2e')]||_0x38d42f:''});}exports[_0xa858('0x2f')]=function(_0x1b78ef,_0x280cdf,_0x4da6d4){passport[_0xa858('0x17')]('local-login',function(_0x470c99,_0x2a76ba,_0x3c161e){var _0x185640=_0x470c99||_0x3c161e;if(_0x185640){return handleError(_0x280cdf,0x191,_0x185640);}if(!_0x2a76ba){return handleError(_0x280cdf,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2dee6f={'payload':{'id':_0x2a76ba['id'],'role':_0x2a76ba[_0xa858('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2dee6f)[_0xa858('0xc')](function(_0x305928){_0x280cdf['json']({'id':_0x2a76ba['id'],'token':_0x305928,'statusCall':'','isAlreadyLogged':_0x2a76ba[_0xa858('0x30')]});});}})(_0x1b78ef,_0x280cdf,_0x4da6d4);};exports[_0xa858('0x31')]=function(_0x410fec,_0x517e0d){if(!_0x410fec[_0xa858('0x32')]['email']){return handleError(_0x517e0d,0x1f4,{'message':_0xa858('0x33')});}var _0x4191ac=rs[_0xa858('0x34')]();_0x410fec[_0xa858('0x32')][_0xa858('0x21')]=_0x410fec[_0xa858('0x32')][_0xa858('0x21')][_0xa858('0x35')]()['toLowerCase']();var _0x1c9694;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xa858('0xa'),_0xa858('0xb')],'raw':!![]})[_0xa858('0xc')](function(_0x3c8969){_0x1c9694=_0x3c8969;return db[_0xa858('0x36')]['find']({'where':{'email':_0x410fec[_0xa858('0x32')][_0xa858('0x21')]}});})[_0xa858('0xc')](function(_0x193826){if(!_0x193826){throw new Error(_0xa858('0x37'));}if(_0x193826[_0xa858('0x11')]){throw new Error(_0xa858('0x38'));}if(_0x193826[_0xa858('0x12')]){if(moment(_0x193826['blockedAt'])['add'](_0x1c9694[_0xa858('0xb')],_0xa858('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x193826[_0xa858('0x12')]=![];_0x193826[_0xa858('0x19')]=null;}}_0x193826['resetPasswordToken']=_0x4191ac;_0x193826[_0xa858('0x39')]=Date[_0xa858('0x3a')]()+0x36ee80;return _0x193826[_0xa858('0x3b')]();})[_0xa858('0xc')](function(){return sendServiceMail({'to':_0x410fec['body'][_0xa858('0x21')],'subject':_0xa858('0x3c'),'text':_0xa858('0x3d')+_0xa858('0x3e')+'https://'+_0x410fec[_0xa858('0x3f')]['host']+'/reset/'+_0x4191ac+'\x0a\x0a'+_0xa858('0x40')});})[_0xa858('0xc')](function(){_0x517e0d[_0xa858('0x41')](0xc8)[_0xa858('0x2d')]({'message':_0xa858('0x42')});})[_0xa858('0x1e')](function(_0x797675){return handleError(_0x517e0d,0x1f4,_0x797675);});};exports[_0xa858('0x43')]=function(_0x390a21,_0x2de2b2){return db[_0xa858('0x36')][_0xa858('0x20')]({'where':{'resetPasswordToken':_0x390a21[_0xa858('0x44')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xa858('0xc')](function(_0x36f662){if(!_0x36f662){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xa858('0x9')]['findOne']({'attributes':['id',_0xa858('0x45'),_0xa858('0x46'),_0xa858('0x47')]})['then'](function(_0x392a80){if(_0x392a80[_0xa858('0x45')])authService['validatePasswordPattern'](_0x390a21['body']['password']);if(!_0x392a80[_0xa858('0x46')]||!_0x36f662[_0xa858('0x48')])return _0x36f662;authService[_0xa858('0x49')](_0x390a21[_0xa858('0x32')][_0xa858('0xe')],_0x36f662['previousPasswords'],_0x392a80[_0xa858('0x47')]);return _0x36f662;})[_0xa858('0xc')](function(){_0x36f662['password']=_0x390a21[_0xa858('0x32')][_0xa858('0xe')];_0x36f662[_0xa858('0x4a')]=null;_0x36f662[_0xa858('0x39')]=null;return _0x36f662['save']();});})[_0xa858('0xc')](function(){_0x2de2b2[_0xa858('0x41')](0xc8)[_0xa858('0x2d')]({'message':'Password\x20reset!'});})['catch'](function(_0x389bd3){return handleError(_0x2de2b2,0x1f4,_0x389bd3);});};passport[_0xa858('0x4b')](_0xa858('0x4c'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x22b280,_0x3bd78c,_0x42cab){return localAuthenticate(db[_0xa858('0x36')],_0x22b280,_0x3bd78c,_0x42cab);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 17cd8a0..a6518cd 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 _0x042f=['post','/forgot','forgot','/reset/:token','exports','express','Router'];(function(_0x4b5094,_0x425c2d){var _0x1a9961=function(_0x2047cc){while(--_0x2047cc){_0x4b5094['push'](_0x4b5094['shift']());}};_0x1a9961(++_0x425c2d);}(_0x042f,0x1a2));var _0xf042=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x042f[_0x12fc8d];return _0x3f9d04;};'use strict';var express=require(_0xf042('0x0'));var router=express[_0xf042('0x1')]();var controller=require('./authLocal.controller');router[_0xf042('0x2')]('/',controller['login']);router[_0xf042('0x2')](_0xf042('0x3'),controller[_0xf042('0x4')]);router[_0xf042('0x2')](_0xf042('0x5'),controller['reset']);module[_0xf042('0x6')]=router;
\ No newline at end of file
+var _0x25a8=['express','./authLocal.controller','/forgot','forgot','post','/reset/:token','reset','exports'];(function(_0x3d1ae4,_0x2857b4){var _0x2a7dee=function(_0x4d178f){while(--_0x4d178f){_0x3d1ae4['push'](_0x3d1ae4['shift']());}};_0x2a7dee(++_0x2857b4);}(_0x25a8,0x1a8));var _0x825a=function(_0x3f3724,_0x4ddfe8){_0x3f3724=_0x3f3724-0x0;var _0x324c7f=_0x25a8[_0x3f3724];return _0x324c7f;};'use strict';var express=require(_0x825a('0x0'));var router=express['Router']();var controller=require(_0x825a('0x1'));router['post']('/',controller['login']);router['post'](_0x825a('0x2'),controller[_0x825a('0x3')]);router[_0x825a('0x4')](_0x825a('0x5'),controller[_0x825a('0x6')]);module[_0x825a('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 3365e20..ca9def7 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 _0x073a=['STRING','INTEGER','exports'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0x073a,0x18b));var _0xa073=function(_0x981cd9,_0x37c0c1){_0x981cd9=_0x981cd9-0x0;var _0xe19602=_0x073a[_0x981cd9];return _0xe19602;};'use strict';var Sequelize=require('sequelize');module[_0xa073('0x0')]={'name':{'type':Sequelize[_0xa073('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa073('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa073('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x06ed=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x92fb0c,_0x5446af){var _0x4204c4=function(_0x534325){while(--_0x534325){_0x92fb0c['push'](_0x92fb0c['shift']());}};_0x4204c4(++_0x5446af);}(_0x06ed,0x1cd));var _0xd06e=function(_0x268bfc,_0x230a15){_0x268bfc=_0x268bfc-0x0;var _0xf47822=_0x06ed[_0x268bfc];return _0xf47822;};'use strict';var Sequelize=require(_0xd06e('0x0'));module[_0xd06e('0x1')]={'name':{'type':Sequelize[_0xd06e('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xd06e('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xd06e('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd06e('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 8156bd1..5986fec 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 _0x8b0c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','body','addConditions','Condition','ids','omit','findOne','getConditions','addActions','Action','getActions','eml-format','rimraf','request-promise','moment','bluebird','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x29ca5a,_0x17415d){var _0x311cbb=function(_0x57a31c){while(--_0x57a31c){_0x29ca5a['push'](_0x29ca5a['shift']());}};_0x311cbb(++_0x17415d);}(_0x8b0c,0x9d));var _0xc8b0=function(_0x33edc2,_0x4e3065){_0x33edc2=_0x33edc2-0x0;var _0x157e8f=_0x8b0c[_0x33edc2];return _0x157e8f;};'use strict';var emlformat=require(_0xc8b0('0x0'));var rimraf=require(_0xc8b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc8b0('0x2'));var moment=require(_0xc8b0('0x3'));var BPromise=require(_0xc8b0('0x4'));var Mustache=require('mustache');var util=require(_0xc8b0('0x5'));var path=require('path');var sox=require(_0xc8b0('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8b0('0x7'));var _=require(_0xc8b0('0x8'));var squel=require('squel');var crypto=require(_0xc8b0('0x9'));var jsforce=require(_0xc8b0('0xa'));var deskjs=require(_0xc8b0('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc8b0('0xc'));var Papa=require(_0xc8b0('0xd'));var Redis=require(_0xc8b0('0xe'));var authService=require(_0xc8b0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc8b0('0x10'));var hardwareService=require(_0xc8b0('0x11'));var logger=require(_0xc8b0('0x12'))(_0xc8b0('0x13'));var utils=require(_0xc8b0('0x14'));var config=require(_0xc8b0('0x15'));var licenseUtil=require(_0xc8b0('0x16'));var db=require(_0xc8b0('0x17'))['db'];function respondWithStatusCode(_0x48cf11,_0x450e09){_0x450e09=_0x450e09||0xcc;return function(_0x2d27e6){if(_0x2d27e6){return _0x48cf11[_0xc8b0('0x18')](_0x450e09);}return _0x48cf11[_0xc8b0('0x19')](_0x450e09)['end']();};}function respondWithResult(_0x3bfb3b,_0xcee6e){_0xcee6e=_0xcee6e||0xc8;return function(_0xf4f299){if(_0xf4f299){return _0x3bfb3b['status'](_0xcee6e)[_0xc8b0('0x1a')](_0xf4f299);}};}function respondWithFilteredResult(_0x34a146,_0x373613){return function(_0x1e80b8){if(_0x1e80b8){var _0x3b68f6=typeof _0x373613[_0xc8b0('0x1b')]===_0xc8b0('0x1c')&&typeof _0x373613['limit']===_0xc8b0('0x1c');var _0x122336=_0x1e80b8[_0xc8b0('0x1d')];var _0x354062=_0x3b68f6?0x0:_0x373613[_0xc8b0('0x1b')];var _0x5816b2=_0x3b68f6?_0x1e80b8[_0xc8b0('0x1d')]:_0x373613['offset']+_0x373613['limit'];var _0x5299e7;if(_0x5816b2>=_0x122336){_0x5816b2=_0x122336;_0x5299e7=0xc8;}else{_0x5299e7=0xce;}_0x34a146['status'](_0x5299e7);return _0x34a146[_0xc8b0('0x1e')](_0xc8b0('0x1f'),_0x354062+'-'+_0x5816b2+'/'+_0x122336)[_0xc8b0('0x1a')](_0x1e80b8);}return null;};}function patchUpdates(_0x5334d2){return function(_0x5ec1bf){try{jsonpatch[_0xc8b0('0x20')](_0x5ec1bf,_0x5334d2,!![]);}catch(_0x14c72c){return BPromise[_0xc8b0('0x21')](_0x14c72c);}return _0x5ec1bf[_0xc8b0('0x22')]();};}function saveUpdates(_0x555161,_0x32b4a7){return function(_0x2f9c8c){if(_0x2f9c8c){return _0x2f9c8c[_0xc8b0('0x23')](_0x555161)[_0xc8b0('0x24')](function(_0x4d9486){return _0x4d9486;});}return null;};}function removeEntity(_0x295256,_0x3a8e9d){return function(_0x2bdea3){if(_0x2bdea3){return _0x2bdea3[_0xc8b0('0x25')]()[_0xc8b0('0x24')](function(){_0x295256['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c128,_0x389772){return function(_0x5b57e1){if(!_0x5b57e1){_0x50c128[_0xc8b0('0x18')](0x194);}return _0x5b57e1;};}function handleError(_0x2d9c3f,_0x307429){_0x307429=_0x307429||0x1f4;return function(_0x18789f){logger[_0xc8b0('0x26')](_0x18789f[_0xc8b0('0x27')]);if(_0x18789f['name']){delete _0x18789f[_0xc8b0('0x28')];}_0x2d9c3f[_0xc8b0('0x19')](_0x307429)[_0xc8b0('0x29')](_0x18789f);};}exports[_0xc8b0('0x2a')]=function(_0x147f44,_0x4743f7){var _0x46422e={},_0x1d31a0={},_0x3518ba={'count':0x0,'rows':[]};var _0x35b0a8=_[_0xc8b0('0x2b')](db[_0xc8b0('0x2c')][_0xc8b0('0x2d')],function(_0xc3b0b1){return{'name':_0xc3b0b1[_0xc8b0('0x2e')],'type':_0xc3b0b1[_0xc8b0('0x2f')][_0xc8b0('0x30')]};});_0x1d31a0['model']=_[_0xc8b0('0x2b')](_0x35b0a8,_0xc8b0('0x28'));_0x1d31a0[_0xc8b0('0x31')]=_[_0xc8b0('0x32')](_0x147f44[_0xc8b0('0x31')]);_0x1d31a0[_0xc8b0('0x33')]=_[_0xc8b0('0x34')](_0x1d31a0[_0xc8b0('0x35')],_0x1d31a0[_0xc8b0('0x31')]);_0x46422e['attributes']=_[_0xc8b0('0x34')](_0x1d31a0[_0xc8b0('0x35')],qs['fields'](_0x147f44[_0xc8b0('0x31')][_0xc8b0('0x36')]));_0x46422e[_0xc8b0('0x37')]=_0x46422e[_0xc8b0('0x37')][_0xc8b0('0x38')]?_0x46422e[_0xc8b0('0x37')]:_0x1d31a0['model'];if(!_0x147f44[_0xc8b0('0x31')][_0xc8b0('0x39')](_0xc8b0('0x3a'))){_0x46422e[_0xc8b0('0x3b')]=qs[_0xc8b0('0x3b')](_0x147f44[_0xc8b0('0x31')][_0xc8b0('0x3b')]);_0x46422e[_0xc8b0('0x1b')]=qs[_0xc8b0('0x1b')](_0x147f44['query']['offset']);}_0x46422e[_0xc8b0('0x3c')]=qs[_0xc8b0('0x3d')](_0x147f44['query']['sort']);_0x46422e[_0xc8b0('0x3e')]=qs[_0xc8b0('0x33')](_[_0xc8b0('0x3f')](_0x147f44[_0xc8b0('0x31')],_0x1d31a0['filters']),_0x35b0a8);if(_0x147f44[_0xc8b0('0x31')][_0xc8b0('0x40')]){_0x46422e['where']=_[_0xc8b0('0x41')](_0x46422e[_0xc8b0('0x3e')],{'$or':_['map'](_0x35b0a8,function(_0x3e118a){if(_0x3e118a[_0xc8b0('0x2f')]!==_0xc8b0('0x42')){var _0x828852={};_0x828852[_0x3e118a[_0xc8b0('0x28')]]={'$like':'%'+_0x147f44['query'][_0xc8b0('0x40')]+'%'};return _0x828852;}})});}_0x46422e=_[_0xc8b0('0x41')]({},_0x46422e,_0x147f44[_0xc8b0('0x43')]);var _0x5157ea={'where':_0x46422e[_0xc8b0('0x3e')]};return db[_0xc8b0('0x2c')]['count'](_0x5157ea)[_0xc8b0('0x24')](function(_0x1bb165){_0x3518ba[_0xc8b0('0x1d')]=_0x1bb165;if(_0x147f44[_0xc8b0('0x31')]['includeAll']){_0x46422e[_0xc8b0('0x44')]=[{'all':!![]}];}return db[_0xc8b0('0x2c')][_0xc8b0('0x45')](_0x46422e);})[_0xc8b0('0x24')](function(_0x1ae978){_0x3518ba[_0xc8b0('0x46')]=_0x1ae978;return _0x3518ba;})[_0xc8b0('0x24')](respondWithFilteredResult(_0x4743f7,_0x46422e))[_0xc8b0('0x47')](handleError(_0x4743f7,null));};exports['show']=function(_0x55f0d0,_0x1e5044){var _0x3d66b0={'raw':![],'where':{'id':_0x55f0d0[_0xc8b0('0x48')]['id']}},_0x377fec={};_0x377fec[_0xc8b0('0x35')]=_['keys'](db[_0xc8b0('0x2c')][_0xc8b0('0x2d')]);_0x377fec[_0xc8b0('0x31')]=_['keys'](_0x55f0d0[_0xc8b0('0x31')]);_0x377fec[_0xc8b0('0x33')]=_[_0xc8b0('0x34')](_0x377fec['model'],_0x377fec[_0xc8b0('0x31')]);_0x3d66b0[_0xc8b0('0x37')]=_[_0xc8b0('0x34')](_0x377fec[_0xc8b0('0x35')],qs[_0xc8b0('0x36')](_0x55f0d0['query'][_0xc8b0('0x36')]));_0x3d66b0[_0xc8b0('0x37')]=_0x3d66b0['attributes']['length']?_0x3d66b0[_0xc8b0('0x37')]:_0x377fec[_0xc8b0('0x35')];if(_0x55f0d0['query'][_0xc8b0('0x49')]){_0x3d66b0[_0xc8b0('0x44')]=[{'all':!![]}];}_0x3d66b0=_['merge']({},_0x3d66b0,_0x55f0d0[_0xc8b0('0x43')]);return db[_0xc8b0('0x2c')][_0xc8b0('0x4a')](_0x3d66b0)[_0xc8b0('0x24')](handleEntityNotFound(_0x1e5044,null))['then'](respondWithResult(_0x1e5044,null))[_0xc8b0('0x47')](handleError(_0x1e5044,null));};exports['create']=function(_0x5da1bd,_0x1a23a8){return db['Automation']['create'](_0x5da1bd[_0xc8b0('0x4b')],{})['then'](respondWithResult(_0x1a23a8,0xc9))[_0xc8b0('0x47')](handleError(_0x1a23a8,null));};exports['update']=function(_0x465e9d,_0x1b623a){if(_0x465e9d[_0xc8b0('0x4b')]['id']){delete _0x465e9d[_0xc8b0('0x4b')]['id'];}return db[_0xc8b0('0x2c')][_0xc8b0('0x4a')]({'where':{'id':_0x465e9d[_0xc8b0('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b623a,null))[_0xc8b0('0x24')](saveUpdates(_0x465e9d[_0xc8b0('0x4b')],null))['then'](respondWithResult(_0x1b623a,null))[_0xc8b0('0x47')](handleError(_0x1b623a,null));};exports[_0xc8b0('0x25')]=function(_0x169ef2,_0x135cfe){return db['Automation'][_0xc8b0('0x4a')]({'where':{'id':_0x169ef2['params']['id']}})[_0xc8b0('0x24')](handleEntityNotFound(_0x135cfe,null))[_0xc8b0('0x24')](removeEntity(_0x135cfe,null))[_0xc8b0('0x47')](handleError(_0x135cfe,null));};exports[_0xc8b0('0x4c')]=function(_0x4b16dd,_0x3c63c3,_0x3d8d2d){return db[_0xc8b0('0x4d')]['find']({'where':{'id':_0x4b16dd[_0xc8b0('0x48')]['id']}})[_0xc8b0('0x24')](handleEntityNotFound(_0x3c63c3,null))[_0xc8b0('0x24')](function(_0x320438){if(_0x320438){return _0x320438['addConditions'](_0x4b16dd[_0xc8b0('0x4b')][_0xc8b0('0x4e')],_[_0xc8b0('0x4f')](_0x4b16dd[_0xc8b0('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x3c63c3,null))[_0xc8b0('0x47')](handleError(_0x3c63c3,null));};exports['getConditions']=function(_0x5613b7,_0x4c2541,_0x14188b){var _0x269473={};var _0x361092={};var _0x47d967;var _0x5c8448;return db[_0xc8b0('0x2c')][_0xc8b0('0x50')]({'where':{'id':_0x5613b7['params']['id']}})[_0xc8b0('0x24')](handleEntityNotFound(_0x4c2541,null))[_0xc8b0('0x24')](function(_0x29a2a1){if(_0x29a2a1){_0x47d967=_0x29a2a1;_0x361092[_0xc8b0('0x35')]=_['keys'](db['Condition'][_0xc8b0('0x2d')]);_0x361092[_0xc8b0('0x31')]=_[_0xc8b0('0x32')](_0x5613b7['query']);_0x361092['filters']=_[_0xc8b0('0x34')](_0x361092['model'],_0x361092[_0xc8b0('0x31')]);_0x269473['attributes']=_['intersection'](_0x361092['model'],qs[_0xc8b0('0x36')](_0x5613b7[_0xc8b0('0x31')]['fields']));_0x269473[_0xc8b0('0x37')]=_0x269473[_0xc8b0('0x37')][_0xc8b0('0x38')]?_0x269473[_0xc8b0('0x37')]:_0x361092[_0xc8b0('0x35')];_0x269473['order']=qs[_0xc8b0('0x3d')](_0x5613b7[_0xc8b0('0x31')][_0xc8b0('0x3d')]);_0x269473[_0xc8b0('0x3e')]=qs[_0xc8b0('0x33')](_[_0xc8b0('0x3f')](_0x5613b7[_0xc8b0('0x31')],_0x361092[_0xc8b0('0x33')]));if(_0x5613b7[_0xc8b0('0x31')]['filter']){_0x269473[_0xc8b0('0x3e')]=_[_0xc8b0('0x41')](_0x269473[_0xc8b0('0x3e')],{'$or':_[_0xc8b0('0x2b')](_0x269473[_0xc8b0('0x37')],function(_0x37d3fa){var _0x159092={};_0x159092[_0x37d3fa]={'$like':'%'+_0x5613b7[_0xc8b0('0x31')]['filter']+'%'};return _0x159092;})});}_0x269473=_[_0xc8b0('0x41')]({},_0x269473,_0x5613b7[_0xc8b0('0x43')]);return _0x47d967['getConditions'](_0x269473);}})[_0xc8b0('0x24')](function(_0x2b5a48){if(_0x2b5a48){_0x5c8448=_0x2b5a48[_0xc8b0('0x38')];if(!_0x5613b7[_0xc8b0('0x31')][_0xc8b0('0x39')](_0xc8b0('0x3a'))){_0x269473['limit']=qs['limit'](_0x5613b7[_0xc8b0('0x31')][_0xc8b0('0x3b')]);_0x269473[_0xc8b0('0x1b')]=qs['offset'](_0x5613b7[_0xc8b0('0x31')][_0xc8b0('0x1b')]);}return _0x47d967[_0xc8b0('0x51')](_0x269473);}})[_0xc8b0('0x24')](function(_0x40b6f8){if(_0x40b6f8){return _0x40b6f8?{'count':_0x5c8448,'rows':_0x40b6f8}:null;}})[_0xc8b0('0x24')](respondWithResult(_0x4c2541,null))[_0xc8b0('0x47')](handleError(_0x4c2541,null));};exports[_0xc8b0('0x52')]=function(_0x5dbe66,_0x2a0523,_0x510e20){return db[_0xc8b0('0x53')]['find']({'where':{'id':_0x5dbe66[_0xc8b0('0x48')]['id']}})[_0xc8b0('0x24')](handleEntityNotFound(_0x2a0523,null))[_0xc8b0('0x24')](function(_0x3732bb){if(_0x3732bb){return _0x3732bb[_0xc8b0('0x52')](_0x5dbe66[_0xc8b0('0x4b')]['ids'],_[_0xc8b0('0x4f')](_0x5dbe66[_0xc8b0('0x4b')],['ids','id'])||{});}})[_0xc8b0('0x24')](respondWithResult(_0x2a0523,null))[_0xc8b0('0x47')](handleError(_0x2a0523,null));};exports[_0xc8b0('0x54')]=function(_0x480b67,_0x2aa8a6,_0x314ad6){var _0xbbf63b={};var _0x58d245={};var _0x1401dd;var _0x5ab4c7;return db[_0xc8b0('0x2c')]['findOne']({'where':{'id':_0x480b67[_0xc8b0('0x48')]['id']}})[_0xc8b0('0x24')](handleEntityNotFound(_0x2aa8a6,null))[_0xc8b0('0x24')](function(_0x4eb0b8){if(_0x4eb0b8){_0x1401dd=_0x4eb0b8;_0x58d245['model']=_[_0xc8b0('0x32')](db[_0xc8b0('0x53')][_0xc8b0('0x2d')]);_0x58d245[_0xc8b0('0x31')]=_[_0xc8b0('0x32')](_0x480b67['query']);_0x58d245[_0xc8b0('0x33')]=_[_0xc8b0('0x34')](_0x58d245[_0xc8b0('0x35')],_0x58d245[_0xc8b0('0x31')]);_0xbbf63b[_0xc8b0('0x37')]=_[_0xc8b0('0x34')](_0x58d245[_0xc8b0('0x35')],qs[_0xc8b0('0x36')](_0x480b67['query'][_0xc8b0('0x36')]));_0xbbf63b[_0xc8b0('0x37')]=_0xbbf63b['attributes'][_0xc8b0('0x38')]?_0xbbf63b[_0xc8b0('0x37')]:_0x58d245[_0xc8b0('0x35')];_0xbbf63b[_0xc8b0('0x3c')]=qs[_0xc8b0('0x3d')](_0x480b67['query'][_0xc8b0('0x3d')]);_0xbbf63b['where']=qs['filters'](_[_0xc8b0('0x3f')](_0x480b67[_0xc8b0('0x31')],_0x58d245[_0xc8b0('0x33')]));if(_0x480b67['query'][_0xc8b0('0x40')]){_0xbbf63b['where']=_[_0xc8b0('0x41')](_0xbbf63b[_0xc8b0('0x3e')],{'$or':_[_0xc8b0('0x2b')](_0xbbf63b[_0xc8b0('0x37')],function(_0x21f815){var _0x57bd06={};_0x57bd06[_0x21f815]={'$like':'%'+_0x480b67['query'][_0xc8b0('0x40')]+'%'};return _0x57bd06;})});}_0xbbf63b=_[_0xc8b0('0x41')]({},_0xbbf63b,_0x480b67[_0xc8b0('0x43')]);return _0x1401dd[_0xc8b0('0x54')](_0xbbf63b);}})['then'](function(_0x127607){if(_0x127607){_0x5ab4c7=_0x127607[_0xc8b0('0x38')];if(!_0x480b67[_0xc8b0('0x31')][_0xc8b0('0x39')](_0xc8b0('0x3a'))){_0xbbf63b[_0xc8b0('0x3b')]=qs[_0xc8b0('0x3b')](_0x480b67[_0xc8b0('0x31')][_0xc8b0('0x3b')]);_0xbbf63b[_0xc8b0('0x1b')]=qs[_0xc8b0('0x1b')](_0x480b67[_0xc8b0('0x31')]['offset']);}return _0x1401dd[_0xc8b0('0x54')](_0xbbf63b);}})[_0xc8b0('0x24')](function(_0x170f13){if(_0x170f13){return _0x170f13?{'count':_0x5ab4c7,'rows':_0x170f13}:null;}})[_0xc8b0('0x24')](respondWithResult(_0x2aa8a6,null))['catch'](handleError(_0x2aa8a6,null));};
\ No newline at end of file
+var _0x5bf0=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','Automation','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','addConditions','ids','omit','getConditions','Condition','pick','addActions','Action','getActions','findOne','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x5bf0,0x98));var _0x05bf=function(_0x1c8606,_0x3b75f9){_0x1c8606=_0x1c8606-0x0;var _0x58ff61=_0x5bf0[_0x1c8606];return _0x58ff61;};'use strict';var emlformat=require(_0x05bf('0x0'));var rimraf=require(_0x05bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x05bf('0x2'));var moment=require(_0x05bf('0x3'));var BPromise=require(_0x05bf('0x4'));var Mustache=require(_0x05bf('0x5'));var util=require('util');var path=require(_0x05bf('0x6'));var sox=require(_0x05bf('0x7'));var csv=require(_0x05bf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x05bf('0x9'));var _=require(_0x05bf('0xa'));var squel=require(_0x05bf('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x05bf('0xc'));var toCsv=require(_0x05bf('0x8'));var querystring=require(_0x05bf('0xd'));var Papa=require('papaparse');var Redis=require(_0x05bf('0xe'));var authService=require(_0x05bf('0xf'));var qs=require(_0x05bf('0x10'));var as=require(_0x05bf('0x11'));var hardwareService=require(_0x05bf('0x12'));var logger=require(_0x05bf('0x13'))(_0x05bf('0x14'));var utils=require(_0x05bf('0x15'));var config=require(_0x05bf('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55c98e,_0x145006){_0x145006=_0x145006||0xcc;return function(_0xfbaea8){if(_0xfbaea8){return _0x55c98e[_0x05bf('0x17')](_0x145006);}return _0x55c98e[_0x05bf('0x18')](_0x145006)[_0x05bf('0x19')]();};}function respondWithResult(_0x544791,_0x21ea0f){_0x21ea0f=_0x21ea0f||0xc8;return function(_0x95b719){if(_0x95b719){return _0x544791[_0x05bf('0x18')](_0x21ea0f)[_0x05bf('0x1a')](_0x95b719);}};}function respondWithFilteredResult(_0x5a1dd8,_0x65481f){return function(_0x3eb6cf){if(_0x3eb6cf){var _0x4a8886=typeof _0x65481f[_0x05bf('0x1b')]===_0x05bf('0x1c')&&typeof _0x65481f['limit']===_0x05bf('0x1c');var _0x1b300a=_0x3eb6cf[_0x05bf('0x1d')];var _0x409d0b=_0x4a8886?0x0:_0x65481f[_0x05bf('0x1b')];var _0x48cdb4=_0x4a8886?_0x3eb6cf[_0x05bf('0x1d')]:_0x65481f[_0x05bf('0x1b')]+_0x65481f[_0x05bf('0x1e')];var _0x234918;if(_0x48cdb4>=_0x1b300a){_0x48cdb4=_0x1b300a;_0x234918=0xc8;}else{_0x234918=0xce;}_0x5a1dd8[_0x05bf('0x18')](_0x234918);return _0x5a1dd8[_0x05bf('0x1f')](_0x05bf('0x20'),_0x409d0b+'-'+_0x48cdb4+'/'+_0x1b300a)['json'](_0x3eb6cf);}return null;};}function patchUpdates(_0x50afb8){return function(_0x8478ec){try{jsonpatch['apply'](_0x8478ec,_0x50afb8,!![]);}catch(_0x824e99){return BPromise[_0x05bf('0x21')](_0x824e99);}return _0x8478ec[_0x05bf('0x22')]();};}function saveUpdates(_0x394e2b,_0x24a484){return function(_0x59a816){if(_0x59a816){return _0x59a816[_0x05bf('0x23')](_0x394e2b)[_0x05bf('0x24')](function(_0x2e0bce){return _0x2e0bce;});}return null;};}function removeEntity(_0xaa91cc,_0x49a027){return function(_0x2654b1){if(_0x2654b1){return _0x2654b1[_0x05bf('0x25')]()[_0x05bf('0x24')](function(){_0xaa91cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x546b15,_0x1701b2){return function(_0x1a1984){if(!_0x1a1984){_0x546b15[_0x05bf('0x17')](0x194);}return _0x1a1984;};}function handleError(_0x889a4e,_0x1dcf49){_0x1dcf49=_0x1dcf49||0x1f4;return function(_0x40f00b){logger[_0x05bf('0x26')](_0x40f00b[_0x05bf('0x27')]);if(_0x40f00b[_0x05bf('0x28')]){delete _0x40f00b[_0x05bf('0x28')];}_0x889a4e[_0x05bf('0x18')](_0x1dcf49)['send'](_0x40f00b);};}exports[_0x05bf('0x29')]=function(_0x2152c1,_0x4f1861){var _0x13e38c={},_0xbbbdd1={},_0x11f5d8={'count':0x0,'rows':[]};var _0x2d98d6=_[_0x05bf('0x2a')](db[_0x05bf('0x2b')]['rawAttributes'],function(_0x1fc136){return{'name':_0x1fc136[_0x05bf('0x2c')],'type':_0x1fc136[_0x05bf('0x2d')][_0x05bf('0x2e')]};});_0xbbbdd1[_0x05bf('0x2f')]=_[_0x05bf('0x2a')](_0x2d98d6,_0x05bf('0x28'));_0xbbbdd1[_0x05bf('0x30')]=_[_0x05bf('0x31')](_0x2152c1['query']);_0xbbbdd1[_0x05bf('0x32')]=_['intersection'](_0xbbbdd1[_0x05bf('0x2f')],_0xbbbdd1[_0x05bf('0x30')]);_0x13e38c[_0x05bf('0x33')]=_[_0x05bf('0x34')](_0xbbbdd1['model'],qs[_0x05bf('0x35')](_0x2152c1[_0x05bf('0x30')]['fields']));_0x13e38c[_0x05bf('0x33')]=_0x13e38c['attributes'][_0x05bf('0x36')]?_0x13e38c[_0x05bf('0x33')]:_0xbbbdd1[_0x05bf('0x2f')];if(!_0x2152c1[_0x05bf('0x30')][_0x05bf('0x37')](_0x05bf('0x38'))){_0x13e38c[_0x05bf('0x1e')]=qs['limit'](_0x2152c1[_0x05bf('0x30')][_0x05bf('0x1e')]);_0x13e38c[_0x05bf('0x1b')]=qs[_0x05bf('0x1b')](_0x2152c1[_0x05bf('0x30')]['offset']);}_0x13e38c[_0x05bf('0x39')]=qs[_0x05bf('0x3a')](_0x2152c1[_0x05bf('0x30')][_0x05bf('0x3a')]);_0x13e38c[_0x05bf('0x3b')]=qs[_0x05bf('0x32')](_['pick'](_0x2152c1[_0x05bf('0x30')],_0xbbbdd1[_0x05bf('0x32')]),_0x2d98d6);if(_0x2152c1[_0x05bf('0x30')][_0x05bf('0x3c')]){_0x13e38c[_0x05bf('0x3b')]=_['merge'](_0x13e38c[_0x05bf('0x3b')],{'$or':_[_0x05bf('0x2a')](_0x2d98d6,function(_0x121dda){if(_0x121dda[_0x05bf('0x2d')]!==_0x05bf('0x3d')){var _0x104ebb={};_0x104ebb[_0x121dda[_0x05bf('0x28')]]={'$like':'%'+_0x2152c1[_0x05bf('0x30')][_0x05bf('0x3c')]+'%'};return _0x104ebb;}})});}_0x13e38c=_[_0x05bf('0x3e')]({},_0x13e38c,_0x2152c1['options']);var _0x3eb50a={'where':_0x13e38c[_0x05bf('0x3b')]};return db[_0x05bf('0x2b')][_0x05bf('0x1d')](_0x3eb50a)['then'](function(_0x19c180){_0x11f5d8['count']=_0x19c180;if(_0x2152c1[_0x05bf('0x30')][_0x05bf('0x3f')]){_0x13e38c[_0x05bf('0x40')]=[{'all':!![]}];}return db[_0x05bf('0x2b')]['findAll'](_0x13e38c);})[_0x05bf('0x24')](function(_0x45aa2f){_0x11f5d8[_0x05bf('0x41')]=_0x45aa2f;return _0x11f5d8;})[_0x05bf('0x24')](respondWithFilteredResult(_0x4f1861,_0x13e38c))[_0x05bf('0x42')](handleError(_0x4f1861,null));};exports[_0x05bf('0x43')]=function(_0x1d6550,_0x3f1464){var _0x191425={'raw':![],'where':{'id':_0x1d6550[_0x05bf('0x44')]['id']}},_0x564ec4={};_0x564ec4[_0x05bf('0x2f')]=_['keys'](db[_0x05bf('0x2b')][_0x05bf('0x45')]);_0x564ec4[_0x05bf('0x30')]=_[_0x05bf('0x31')](_0x1d6550['query']);_0x564ec4[_0x05bf('0x32')]=_[_0x05bf('0x34')](_0x564ec4['model'],_0x564ec4[_0x05bf('0x30')]);_0x191425[_0x05bf('0x33')]=_[_0x05bf('0x34')](_0x564ec4['model'],qs[_0x05bf('0x35')](_0x1d6550[_0x05bf('0x30')][_0x05bf('0x35')]));_0x191425['attributes']=_0x191425[_0x05bf('0x33')][_0x05bf('0x36')]?_0x191425[_0x05bf('0x33')]:_0x564ec4[_0x05bf('0x2f')];if(_0x1d6550[_0x05bf('0x30')][_0x05bf('0x3f')]){_0x191425['include']=[{'all':!![]}];}_0x191425=_[_0x05bf('0x3e')]({},_0x191425,_0x1d6550[_0x05bf('0x46')]);return db['Automation'][_0x05bf('0x47')](_0x191425)[_0x05bf('0x24')](handleEntityNotFound(_0x3f1464,null))[_0x05bf('0x24')](respondWithResult(_0x3f1464,null))[_0x05bf('0x42')](handleError(_0x3f1464,null));};exports[_0x05bf('0x48')]=function(_0x4253c5,_0x48544b){return db['Automation'][_0x05bf('0x48')](_0x4253c5[_0x05bf('0x49')],{})['then'](respondWithResult(_0x48544b,0xc9))[_0x05bf('0x42')](handleError(_0x48544b,null));};exports[_0x05bf('0x23')]=function(_0x474058,_0x1c34cf){if(_0x474058[_0x05bf('0x49')]['id']){delete _0x474058[_0x05bf('0x49')]['id'];}return db[_0x05bf('0x2b')][_0x05bf('0x47')]({'where':{'id':_0x474058[_0x05bf('0x44')]['id']}})[_0x05bf('0x24')](handleEntityNotFound(_0x1c34cf,null))[_0x05bf('0x24')](saveUpdates(_0x474058['body'],null))[_0x05bf('0x24')](respondWithResult(_0x1c34cf,null))[_0x05bf('0x42')](handleError(_0x1c34cf,null));};exports['destroy']=function(_0x47c52b,_0x21621d){return db[_0x05bf('0x2b')]['find']({'where':{'id':_0x47c52b[_0x05bf('0x44')]['id']}})['then'](handleEntityNotFound(_0x21621d,null))['then'](removeEntity(_0x21621d,null))[_0x05bf('0x42')](handleError(_0x21621d,null));};exports[_0x05bf('0x4a')]=function(_0x1d6885,_0x109387,_0xbfd6e0){return db['Condition'][_0x05bf('0x47')]({'where':{'id':_0x1d6885[_0x05bf('0x44')]['id']}})['then'](handleEntityNotFound(_0x109387,null))[_0x05bf('0x24')](function(_0x11b125){if(_0x11b125){return _0x11b125[_0x05bf('0x4a')](_0x1d6885[_0x05bf('0x49')][_0x05bf('0x4b')],_[_0x05bf('0x4c')](_0x1d6885[_0x05bf('0x49')],['ids','id'])||{});}})[_0x05bf('0x24')](respondWithResult(_0x109387,null))['catch'](handleError(_0x109387,null));};exports[_0x05bf('0x4d')]=function(_0x72156c,_0x5d99f5,_0x5daced){var _0x1133b9={};var _0x5730f2={};var _0xbe29cb;var _0x16088c;return db[_0x05bf('0x2b')]['findOne']({'where':{'id':_0x72156c[_0x05bf('0x44')]['id']}})[_0x05bf('0x24')](handleEntityNotFound(_0x5d99f5,null))[_0x05bf('0x24')](function(_0x14889d){if(_0x14889d){_0xbe29cb=_0x14889d;_0x5730f2[_0x05bf('0x2f')]=_[_0x05bf('0x31')](db[_0x05bf('0x4e')]['rawAttributes']);_0x5730f2['query']=_[_0x05bf('0x31')](_0x72156c[_0x05bf('0x30')]);_0x5730f2[_0x05bf('0x32')]=_[_0x05bf('0x34')](_0x5730f2['model'],_0x5730f2[_0x05bf('0x30')]);_0x1133b9[_0x05bf('0x33')]=_[_0x05bf('0x34')](_0x5730f2[_0x05bf('0x2f')],qs[_0x05bf('0x35')](_0x72156c[_0x05bf('0x30')][_0x05bf('0x35')]));_0x1133b9['attributes']=_0x1133b9[_0x05bf('0x33')]['length']?_0x1133b9[_0x05bf('0x33')]:_0x5730f2[_0x05bf('0x2f')];_0x1133b9[_0x05bf('0x39')]=qs[_0x05bf('0x3a')](_0x72156c[_0x05bf('0x30')][_0x05bf('0x3a')]);_0x1133b9['where']=qs[_0x05bf('0x32')](_[_0x05bf('0x4f')](_0x72156c[_0x05bf('0x30')],_0x5730f2[_0x05bf('0x32')]));if(_0x72156c[_0x05bf('0x30')]['filter']){_0x1133b9[_0x05bf('0x3b')]=_['merge'](_0x1133b9[_0x05bf('0x3b')],{'$or':_[_0x05bf('0x2a')](_0x1133b9[_0x05bf('0x33')],function(_0x5a1036){var _0x101806={};_0x101806[_0x5a1036]={'$like':'%'+_0x72156c[_0x05bf('0x30')]['filter']+'%'};return _0x101806;})});}_0x1133b9=_[_0x05bf('0x3e')]({},_0x1133b9,_0x72156c[_0x05bf('0x46')]);return _0xbe29cb['getConditions'](_0x1133b9);}})[_0x05bf('0x24')](function(_0x3b28e4){if(_0x3b28e4){_0x16088c=_0x3b28e4[_0x05bf('0x36')];if(!_0x72156c['query'][_0x05bf('0x37')](_0x05bf('0x38'))){_0x1133b9[_0x05bf('0x1e')]=qs[_0x05bf('0x1e')](_0x72156c[_0x05bf('0x30')][_0x05bf('0x1e')]);_0x1133b9[_0x05bf('0x1b')]=qs['offset'](_0x72156c[_0x05bf('0x30')][_0x05bf('0x1b')]);}return _0xbe29cb[_0x05bf('0x4d')](_0x1133b9);}})['then'](function(_0xf97bf7){if(_0xf97bf7){return _0xf97bf7?{'count':_0x16088c,'rows':_0xf97bf7}:null;}})[_0x05bf('0x24')](respondWithResult(_0x5d99f5,null))[_0x05bf('0x42')](handleError(_0x5d99f5,null));};exports[_0x05bf('0x50')]=function(_0x5c5737,_0x507e2a,_0x43e430){return db[_0x05bf('0x51')][_0x05bf('0x47')]({'where':{'id':_0x5c5737['params']['id']}})[_0x05bf('0x24')](handleEntityNotFound(_0x507e2a,null))[_0x05bf('0x24')](function(_0x1a4252){if(_0x1a4252){return _0x1a4252[_0x05bf('0x50')](_0x5c5737[_0x05bf('0x49')][_0x05bf('0x4b')],_['omit'](_0x5c5737[_0x05bf('0x49')],['ids','id'])||{});}})[_0x05bf('0x24')](respondWithResult(_0x507e2a,null))[_0x05bf('0x42')](handleError(_0x507e2a,null));};exports[_0x05bf('0x52')]=function(_0x56ba5f,_0x50cea7,_0x34edaf){var _0x5248db={};var _0x38a42d={};var _0x31df52;var _0x3b3a1f;return db[_0x05bf('0x2b')][_0x05bf('0x53')]({'where':{'id':_0x56ba5f[_0x05bf('0x44')]['id']}})[_0x05bf('0x24')](handleEntityNotFound(_0x50cea7,null))[_0x05bf('0x24')](function(_0x2ef8cb){if(_0x2ef8cb){_0x31df52=_0x2ef8cb;_0x38a42d['model']=_['keys'](db[_0x05bf('0x51')][_0x05bf('0x45')]);_0x38a42d['query']=_['keys'](_0x56ba5f[_0x05bf('0x30')]);_0x38a42d['filters']=_[_0x05bf('0x34')](_0x38a42d[_0x05bf('0x2f')],_0x38a42d[_0x05bf('0x30')]);_0x5248db[_0x05bf('0x33')]=_[_0x05bf('0x34')](_0x38a42d[_0x05bf('0x2f')],qs[_0x05bf('0x35')](_0x56ba5f[_0x05bf('0x30')][_0x05bf('0x35')]));_0x5248db[_0x05bf('0x33')]=_0x5248db[_0x05bf('0x33')][_0x05bf('0x36')]?_0x5248db[_0x05bf('0x33')]:_0x38a42d[_0x05bf('0x2f')];_0x5248db[_0x05bf('0x39')]=qs[_0x05bf('0x3a')](_0x56ba5f[_0x05bf('0x30')][_0x05bf('0x3a')]);_0x5248db[_0x05bf('0x3b')]=qs[_0x05bf('0x32')](_[_0x05bf('0x4f')](_0x56ba5f[_0x05bf('0x30')],_0x38a42d[_0x05bf('0x32')]));if(_0x56ba5f[_0x05bf('0x30')][_0x05bf('0x3c')]){_0x5248db[_0x05bf('0x3b')]=_[_0x05bf('0x3e')](_0x5248db[_0x05bf('0x3b')],{'$or':_[_0x05bf('0x2a')](_0x5248db[_0x05bf('0x33')],function(_0x3ae49f){var _0x26fd8b={};_0x26fd8b[_0x3ae49f]={'$like':'%'+_0x56ba5f[_0x05bf('0x30')]['filter']+'%'};return _0x26fd8b;})});}_0x5248db=_[_0x05bf('0x3e')]({},_0x5248db,_0x56ba5f[_0x05bf('0x46')]);return _0x31df52[_0x05bf('0x52')](_0x5248db);}})[_0x05bf('0x24')](function(_0x347ee9){if(_0x347ee9){_0x3b3a1f=_0x347ee9[_0x05bf('0x36')];if(!_0x56ba5f[_0x05bf('0x30')][_0x05bf('0x37')](_0x05bf('0x38'))){_0x5248db[_0x05bf('0x1e')]=qs[_0x05bf('0x1e')](_0x56ba5f[_0x05bf('0x30')][_0x05bf('0x1e')]);_0x5248db[_0x05bf('0x1b')]=qs['offset'](_0x56ba5f[_0x05bf('0x30')][_0x05bf('0x1b')]);}return _0x31df52[_0x05bf('0x52')](_0x5248db);}})['then'](function(_0x44a0db){if(_0x44a0db){return _0x44a0db?{'count':_0x3b3a1f,'rows':_0x44a0db}:null;}})[_0x05bf('0x24')](respondWithResult(_0x50cea7,null))[_0x05bf('0x42')](handleError(_0x50cea7,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 99455d7..d8935de 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 _0x5355=['rimraf','./automation.attributes','exports','define','Automation','lodash','util','../../config/logger','api','path'];(function(_0x154419,_0x28ca63){var _0x241beb=function(_0x27ece5){while(--_0x27ece5){_0x154419['push'](_0x154419['shift']());}};_0x241beb(++_0x28ca63);}(_0x5355,0x113));var _0x5535=function(_0x5d8afd,_0xd7f769){_0x5d8afd=_0x5d8afd-0x0;var _0x336c61=_0x5355[_0x5d8afd];return _0x336c61;};'use strict';var _=require(_0x5535('0x0'));var util=require(_0x5535('0x1'));var logger=require(_0x5535('0x2'))(_0x5535('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5535('0x4'));var rimraf=require(_0x5535('0x5'));var config=require('../../config/environment');var attributes=require(_0x5535('0x6'));module[_0x5535('0x7')]=function(_0x339db7,_0x15471b){return _0x339db7[_0x5535('0x8')](_0x5535('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10bd=['exports','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./automation.attributes'];(function(_0x215d5b,_0xce342a){var _0x41466b=function(_0x52a8c8){while(--_0x52a8c8){_0x215d5b['push'](_0x215d5b['shift']());}};_0x41466b(++_0xce342a);}(_0x10bd,0x1ca));var _0xd10b=function(_0x1b3d60,_0x51583b){_0x1b3d60=_0x1b3d60-0x0;var _0x4abc3d=_0x10bd[_0x1b3d60];return _0x4abc3d;};'use strict';var _=require(_0xd10b('0x0'));var util=require(_0xd10b('0x1'));var logger=require(_0xd10b('0x2'))(_0xd10b('0x3'));var moment=require(_0xd10b('0x4'));var BPromise=require(_0xd10b('0x5'));var rp=require(_0xd10b('0x6'));var fs=require('fs');var path=require(_0xd10b('0x7'));var rimraf=require(_0xd10b('0x8'));var config=require('../../config/environment');var attributes=require(_0xd10b('0x9'));module[_0xd10b('0xa')]=function(_0x3cedda,_0xa2b51c){return _0x3cedda['define'](_0xd10b('0xb'),attributes,{'tableName':_0xd10b('0xc'),'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 4528d1e..54af947 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x620af0,_0x3374dd){var _0x14e1a5=function(_0x1861cf){while(--_0x1861cf){_0x620af0['push'](_0x620af0['shift']());}};_0x14e1a5(++_0x3374dd);}(_0xdb28,0x106));var _0x8db2=function(_0x4fc2d2,_0x43038e){_0x4fc2d2=_0x4fc2d2-0x0;var _0x3ec0fb=_0xdb28[_0x4fc2d2];return _0x3ec0fb;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0x4910=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x5eecc0,_0x43ae17){var _0x1887ad=function(_0x32b1a4){while(--_0x32b1a4){_0x5eecc0['push'](_0x5eecc0['shift']());}};_0x1887ad(++_0x43ae17);}(_0x4910,0x1d9));var _0x0491=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4910[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require('bluebird');var rs=require(_0x0491('0x3'));var fs=require('fs');var Redis=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))('rpc');var config=require(_0x0491('0x8'));var jayson=require(_0x0491('0x9'));var client=jayson[_0x0491('0xa')][_0x0491('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27e7d5,_0x4ba9e5,_0x3b7b10){return new BPromise(function(_0x29c0d0,_0xf50a53){return client[_0x0491('0xc')](_0x27e7d5,_0x3b7b10)[_0x0491('0xd')](function(_0x4822d5){logger[_0x0491('0xe')]('Automation,\x20%s,\x20%s',_0x4ba9e5,_0x0491('0xf'));logger[_0x0491('0x10')](_0x0491('0x11'),_0x4ba9e5,_0x0491('0xf'),JSON[_0x0491('0x12')](_0x4822d5));if(_0x4822d5[_0x0491('0x13')]){if(_0x4822d5[_0x0491('0x13')][_0x0491('0x14')]===0x1f4){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x4822d5['error'][_0x0491('0x16')]);return _0xf50a53(_0x4822d5['error'][_0x0491('0x16')]);}logger['error']('Automation,\x20%s,\x20%s',_0x4ba9e5,_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);return _0x29c0d0(_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);}else{logger[_0x0491('0xe')](_0x0491('0x15'),_0x4ba9e5,_0x0491('0xf'));_0x29c0d0(_0x4822d5[_0x0491('0x17')][_0x0491('0x16')]);}})[_0x0491('0x18')](function(_0x527415){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x527415);_0xf50a53(_0x527415);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index df51f5f..3af0e63 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 _0x861a=['Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','create','post','addConditions','/:id/actions','addActions','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5a7c96,_0x5038f4){var _0x3f4639=function(_0x1079de){while(--_0x1079de){_0x5a7c96['push'](_0x5a7c96['shift']());}};_0x3f4639(++_0x5038f4);}(_0x861a,0x194));var _0xa861=function(_0x2b167d,_0x127fa8){_0x2b167d=_0x2b167d-0x0;var _0x361155=_0x861a[_0x2b167d];return _0x361155;};'use strict';var multer=require(_0xa861('0x0'));var util=require('util');var path=require(_0xa861('0x1'));var timeout=require(_0xa861('0x2'));var express=require(_0xa861('0x3'));var router=express[_0xa861('0x4')]();var fs_extra=require(_0xa861('0x5'));var auth=require(_0xa861('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa861('0x7'));var controller=require(_0xa861('0x8'));router[_0xa861('0x9')]('/',auth[_0xa861('0xa')](),controller[_0xa861('0xb')]);router['get'](_0xa861('0xc'),auth[_0xa861('0xa')](),controller[_0xa861('0xd')]);router[_0xa861('0x9')](_0xa861('0xe'),auth[_0xa861('0xa')](),controller[_0xa861('0xf')]);router[_0xa861('0x9')]('/:id/actions',auth['isAuthenticated'](),controller[_0xa861('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa861('0x11')]);router[_0xa861('0x12')](_0xa861('0xe'),auth['isAuthenticated'](),controller[_0xa861('0x13')]);router[_0xa861('0x12')](_0xa861('0x14'),auth[_0xa861('0xa')](),controller[_0xa861('0x15')]);router['put']('/:id',auth[_0xa861('0xa')](),controller['update']);router['delete'](_0xa861('0xc'),auth[_0xa861('0xa')](),controller[_0xa861('0x16')]);module[_0xa861('0x17')]=router;
\ No newline at end of file
+var _0x7bbd=['show','/:id/conditions','getConditions','getActions','addConditions','post','/:id/actions','addActions','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','isAuthenticated'];(function(_0x48a73e,_0x39f1ac){var _0x390c0b=function(_0x369beb){while(--_0x369beb){_0x48a73e['push'](_0x48a73e['shift']());}};_0x390c0b(++_0x39f1ac);}(_0x7bbd,0x12c));var _0xd7bb=function(_0x4ecf9d,_0x5e9b0){_0x4ecf9d=_0x4ecf9d-0x0;var _0x49c780=_0x7bbd[_0x4ecf9d];return _0x49c780;};'use strict';var multer=require(_0xd7bb('0x0'));var util=require('util');var path=require(_0xd7bb('0x1'));var timeout=require(_0xd7bb('0x2'));var express=require(_0xd7bb('0x3'));var router=express['Router']();var fs_extra=require(_0xd7bb('0x4'));var auth=require(_0xd7bb('0x5'));var interaction=require(_0xd7bb('0x6'));var config=require(_0xd7bb('0x7'));var controller=require(_0xd7bb('0x8'));router[_0xd7bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd7bb('0x9')](_0xd7bb('0xa'),auth[_0xd7bb('0xb')](),controller[_0xd7bb('0xc')]);router[_0xd7bb('0x9')](_0xd7bb('0xd'),auth['isAuthenticated'](),controller[_0xd7bb('0xe')]);router['get']('/:id/actions',auth[_0xd7bb('0xb')](),controller[_0xd7bb('0xf')]);router['post']('/',auth[_0xd7bb('0xb')](),controller['create']);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0xd7bb('0x10')]);router[_0xd7bb('0x11')](_0xd7bb('0x12'),auth[_0xd7bb('0xb')](),controller[_0xd7bb('0x13')]);router[_0xd7bb('0x14')]('/:id',auth[_0xd7bb('0xb')](),controller['update']);router[_0xd7bb('0x15')](_0xd7bb('0xa'),auth[_0xd7bb('0xb')](),controller[_0xd7bb('0x16')]);module[_0xd7bb('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 43c1030..5e3d503 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 _0x5d9d=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','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\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x56ae00,_0x586edb){var _0x5dd1b5=function(_0x55e20b){while(--_0x55e20b){_0x56ae00['push'](_0x56ae00['shift']());}};_0x5dd1b5(++_0x586edb);}(_0x5d9d,0x9e));var _0xd5d9=function(_0x311c28,_0x56e16b){_0x311c28=_0x311c28-0x0;var _0x5df64b=_0x5d9d[_0x311c28];return _0x5df64b;};'use strict';var Sequelize=require(_0xd5d9('0x0'));module['exports']={'name':{'type':Sequelize[_0xd5d9('0x1')],'unique':_0xd5d9('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd5d9('0x3')](_0xd5d9('0x4')),'allowNull':![],'defaultValue':_0xd5d9('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd5d9('0x5')},'limitCalls':{'type':Sequelize[_0xd5d9('0x6')](0x4)[_0xd5d9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd5d9('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd5d9('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd5d9('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd5d9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5d9('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd5d9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5d9('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd5d9('0x6')](0x5)[_0xd5d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5d9('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xd5d9('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5d9('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5d9('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd5d9('0x6')](0x3)[_0xd5d9('0x7')],'defaultValue':0x3,'comment':_0xd5d9('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd5d9('0x6')](0x5)[_0xd5d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd5d9('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd5d9('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd5d9('0x1')],'defaultValue':_0xd5d9('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xd5d9('0x11'),_0xd5d9('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xd5d9('0x13')],'defaultValue':0x0,'comment':_0xd5d9('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xd5d9('0x6')](0x9)[_0xd5d9('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd5d9('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xd5d9('0x6')](0x9)[_0xd5d9('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd5d9('0x6')](0x9)[_0xd5d9('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd5d9('0x6')](0x9)[_0xd5d9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd5d9('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd5d9('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd5d9('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd5d9('0x6')](0x9)[_0xd5d9('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd5d9('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd5d9('0x6')](0x9)[_0xd5d9('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd5d9('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd5d9('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd5d9('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd5d9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xd5d9('0x3')](_0xd5d9('0x1b'),_0xd5d9('0x1c')),'defaultValue':_0xd5d9('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd5d9('0x6')](0x3)[_0xd5d9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd5d9('0x1d')},'dialCutDigit':{'type':Sequelize[_0xd5d9('0x6')](0x3)[_0xd5d9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd5d9('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5d9('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd5d9('0x6')](0x5)[_0xd5d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5d9('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xd5d9('0x6')](0x3)[_0xd5d9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xd5d9('0x6')](0x5)[_0xd5d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd5d9('0x6')](0x3)[_0xd5d9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5d9('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd5d9('0x6')](0x5)[_0xd5d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5d9('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xd5d9('0x6')](0x3)[_0xd5d9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5d9('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd5d9('0x6')](0x5)[_0xd5d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5d9('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd5d9('0x6')](0x3)[_0xd5d9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5d9('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd5d9('0x6')](0x5)[_0xd5d9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5d9('0x25')}};
\ No newline at end of file
+var _0x9b30=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x48ed45,_0x5d4828){var _0x31c7c5=function(_0x81bd45){while(--_0x81bd45){_0x48ed45['push'](_0x48ed45['shift']());}};_0x31c7c5(++_0x5d4828);}(_0x9b30,0x19b));var _0x09b3=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x9b30[_0x4a3898];return _0x25ceb0;};'use strict';var Sequelize=require(_0x09b3('0x0'));module[_0x09b3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x09b3('0x2')),'allowNull':![],'defaultValue':_0x09b3('0x2')},'description':{'type':Sequelize[_0x09b3('0x3')]},'active':{'type':Sequelize[_0x09b3('0x4')],'defaultValue':0x0,'comment':_0x09b3('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x09b3('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x09b3('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x09b3('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x09b3('0x7')](0x3)[_0x09b3('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b3('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x09b3('0x7')](0x3)[_0x09b3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x09b3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b3('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x09b3('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b3('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x09b3('0x7')](0x5)[_0x09b3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x09b3('0x7')](0x3)[_0x09b3('0x8')],'defaultValue':0x3,'comment':_0x09b3('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x09b3('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x09b3('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x09b3('0xd')},'dialTimezone':{'type':Sequelize[_0x09b3('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x09b3('0x3')],'defaultValue':_0x09b3('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x09b3('0xf')](_0x09b3('0x10'),_0x09b3('0x11'),_0x09b3('0x12')),'defaultValue':_0x09b3('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x09b3('0x7')](0x9)[_0x09b3('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x09b3('0x7')](0x9)[_0x09b3('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x09b3('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x09b3('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x09b3('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x09b3('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x09b3('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x09b3('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x09b3('0x7')](0x9)[_0x09b3('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x09b3('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x09b3('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x09b3('0xf')]('DESC',_0x09b3('0x18')),'defaultValue':_0x09b3('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x09b3('0x7')](0x3)[_0x09b3('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x09b3('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x09b3('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x09b3('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x09b3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b3('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x09b3('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b3('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x09b3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b3('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x09b3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b3('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x09b3('0x7')](0x3)[_0x09b3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b3('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x09b3('0x7')](0x3)[_0x09b3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09b3('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x09b3('0x7')](0x5)[_0x09b3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b3('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x09b3('0x7')](0x3)[_0x09b3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x09b3('0x7')](0x5)[_0x09b3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09b3('0x23')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index ce222ac..e4bd7cd 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 _0xe0dd=['updatedAt','IvrCampaigns','UserProfileSection','getHoppers','findOne','CmHopper','where','pick','CampaignId','filter','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','insert','into','cm_hopper','COALESCE(phone,\x27\x27)','NOW()','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','Campaign','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt'];(function(_0x585a0f,_0x5a137d){var _0xd4cccd=function(_0x52ceee){while(--_0x52ceee){_0x585a0f['push'](_0x585a0f['shift']());}};_0xd4cccd(++_0x5a137d);}(_0xe0dd,0x163));var _0xde0d=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xe0dd[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require(_0xde0d('0x0'));var rimraf=require(_0xde0d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde0d('0x2'));var rp=require(_0xde0d('0x3'));var moment=require(_0xde0d('0x4'));var BPromise=require(_0xde0d('0x5'));var Mustache=require(_0xde0d('0x6'));var util=require(_0xde0d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xde0d('0x8'));var ejs=require(_0xde0d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde0d('0xa'));var squel=require(_0xde0d('0xb'));var crypto=require(_0xde0d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xde0d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xde0d('0xe'));var Papa=require('papaparse');var Redis=require(_0xde0d('0xf'));var authService=require(_0xde0d('0x10'));var qs=require(_0xde0d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde0d('0x12'));var utils=require(_0xde0d('0x13'));var config=require(_0xde0d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xde0d('0x15'))['db'];function respondWithStatusCode(_0x1df78b,_0x596e92){_0x596e92=_0x596e92||0xcc;return function(_0x413c76){if(_0x413c76){return _0x1df78b[_0xde0d('0x16')](_0x596e92);}return _0x1df78b[_0xde0d('0x17')](_0x596e92)[_0xde0d('0x18')]();};}function respondWithResult(_0x13e887,_0x52a3d5){_0x52a3d5=_0x52a3d5||0xc8;return function(_0x146f2e){if(_0x146f2e){return _0x13e887['status'](_0x52a3d5)[_0xde0d('0x19')](_0x146f2e);}};}function respondWithFilteredResult(_0x5cedb6,_0x3994e7){return function(_0x578a3c){if(_0x578a3c){var _0x11abe9=typeof _0x3994e7[_0xde0d('0x1a')]===_0xde0d('0x1b')&&typeof _0x3994e7[_0xde0d('0x1c')]===_0xde0d('0x1b');var _0x33e5df=_0x578a3c[_0xde0d('0x1d')];var _0x5ee4f9=_0x11abe9?0x0:_0x3994e7[_0xde0d('0x1a')];var _0x2a8d60=_0x11abe9?_0x578a3c[_0xde0d('0x1d')]:_0x3994e7['offset']+_0x3994e7[_0xde0d('0x1c')];var _0x3c9639;if(_0x2a8d60>=_0x33e5df){_0x2a8d60=_0x33e5df;_0x3c9639=0xc8;}else{_0x3c9639=0xce;}_0x5cedb6['status'](_0x3c9639);return _0x5cedb6['set'](_0xde0d('0x1e'),_0x5ee4f9+'-'+_0x2a8d60+'/'+_0x33e5df)[_0xde0d('0x19')](_0x578a3c);}return null;};}function patchUpdates(_0x11437e){return function(_0x45d127){try{jsonpatch[_0xde0d('0x1f')](_0x45d127,_0x11437e,!![]);}catch(_0x5ec167){return BPromise['reject'](_0x5ec167);}return _0x45d127[_0xde0d('0x20')]();};}function saveUpdates(_0x5ef8fa,_0x2e52aa){return function(_0xe42298){if(_0xe42298){return _0xe42298[_0xde0d('0x21')](_0x5ef8fa)['then'](function(_0x47d3f4){return _0x47d3f4;});}return null;};}function removeEntity(_0x51425a,_0x375abf){return function(_0x3b11e9){if(_0x3b11e9){return _0x3b11e9['destroy']()[_0xde0d('0x22')](function(){var _0x1ccb8d=_0x3b11e9[_0xde0d('0x23')]({'plain':!![]});var _0x2acb5a='IvrCampaigns';return db[_0xde0d('0x24')][_0xde0d('0x25')]({'where':{'type':_0x2acb5a,'resourceId':_0x1ccb8d['id']}})[_0xde0d('0x22')](function(){return _0x3b11e9;});})[_0xde0d('0x22')](function(){_0x51425a[_0xde0d('0x17')](0xcc)[_0xde0d('0x18')]();});}};}function handleEntityNotFound(_0x10f114,_0xf081af){return function(_0x26e30b){if(!_0x26e30b){_0x10f114['sendStatus'](0x194);}return _0x26e30b;};}function handleError(_0x80fb59,_0x3a50f4){_0x3a50f4=_0x3a50f4||0x1f4;return function(_0x32f65c){logger[_0xde0d('0x26')](_0x32f65c[_0xde0d('0x27')]);if(_0x32f65c[_0xde0d('0x28')]){delete _0x32f65c[_0xde0d('0x28')];}_0x80fb59[_0xde0d('0x17')](_0x3a50f4)[_0xde0d('0x29')](_0x32f65c);};}exports['index']=function(_0x5d6a16,_0x486914){var _0x48684a={},_0x5f3ea3={},_0x4154bd={'count':0x0,'rows':[]};var _0x272230=_[_0xde0d('0x2a')](db[_0xde0d('0x2b')]['rawAttributes'],function(_0x19bf37){return{'name':_0x19bf37[_0xde0d('0x2c')],'type':_0x19bf37[_0xde0d('0x2d')]['key']};});_0x5f3ea3[_0xde0d('0x2e')]=_[_0xde0d('0x2a')](_0x272230,'name');_0x5f3ea3[_0xde0d('0x2f')]=_[_0xde0d('0x30')](_0x5d6a16['query']);_0x5f3ea3[_0xde0d('0x31')]=_['intersection'](_0x5f3ea3[_0xde0d('0x2e')],_0x5f3ea3[_0xde0d('0x2f')]);_0x48684a[_0xde0d('0x32')]=_[_0xde0d('0x33')](_0x5f3ea3[_0xde0d('0x2e')],qs[_0xde0d('0x34')](_0x5d6a16[_0xde0d('0x2f')][_0xde0d('0x34')]));_0x48684a[_0xde0d('0x32')]=_0x48684a[_0xde0d('0x32')][_0xde0d('0x35')]?_0x48684a[_0xde0d('0x32')]:_0x5f3ea3[_0xde0d('0x2e')];if(!_0x5d6a16[_0xde0d('0x2f')][_0xde0d('0x36')](_0xde0d('0x37'))){_0x48684a[_0xde0d('0x1c')]=qs[_0xde0d('0x1c')](_0x5d6a16[_0xde0d('0x2f')]['limit']);_0x48684a['offset']=qs[_0xde0d('0x1a')](_0x5d6a16[_0xde0d('0x2f')]['offset']);}_0x48684a['order']=qs['sort'](_0x5d6a16[_0xde0d('0x2f')][_0xde0d('0x38')]);_0x48684a['where']=qs[_0xde0d('0x31')](_['pick'](_0x5d6a16[_0xde0d('0x2f')],_0x5f3ea3['filters']),_0x272230);if(_0x5d6a16[_0xde0d('0x2f')]['filter']){_0x48684a['where']=_[_0xde0d('0x39')](_0x48684a['where'],{'$or':_[_0xde0d('0x2a')](_0x272230,function(_0x494f01){if(_0x494f01[_0xde0d('0x2d')]!==_0xde0d('0x3a')){var _0x3403e8={};_0x3403e8[_0x494f01[_0xde0d('0x28')]]={'$like':'%'+_0x5d6a16[_0xde0d('0x2f')]['filter']+'%'};return _0x3403e8;}})});}_0x48684a=_[_0xde0d('0x39')]({},_0x48684a,_0x5d6a16[_0xde0d('0x3b')]);var _0x2f0065={'where':_0x48684a['where']};return db[_0xde0d('0x2b')][_0xde0d('0x1d')](_0x2f0065)[_0xde0d('0x22')](function(_0x438503){_0x4154bd[_0xde0d('0x1d')]=_0x438503;if(_0x5d6a16[_0xde0d('0x2f')][_0xde0d('0x3c')]){_0x48684a[_0xde0d('0x3d')]=[{'all':!![]}];}return db[_0xde0d('0x2b')][_0xde0d('0x3e')](_0x48684a);})['then'](function(_0x1d95e1){_0x4154bd[_0xde0d('0x3f')]=_0x1d95e1;return _0x4154bd;})['then'](respondWithFilteredResult(_0x486914,_0x48684a))['catch'](handleError(_0x486914,null));};exports[_0xde0d('0x40')]=function(_0x3069d6,_0x5e8837){var _0x5dc2b1={'raw':![],'where':{'id':_0x3069d6[_0xde0d('0x41')]['id']}},_0xd6e240={};_0xd6e240[_0xde0d('0x2e')]=_['keys'](db[_0xde0d('0x2b')][_0xde0d('0x42')]);_0xd6e240[_0xde0d('0x2f')]=_[_0xde0d('0x30')](_0x3069d6[_0xde0d('0x2f')]);_0xd6e240[_0xde0d('0x31')]=_[_0xde0d('0x33')](_0xd6e240[_0xde0d('0x2e')],_0xd6e240['query']);_0x5dc2b1['attributes']=_['intersection'](_0xd6e240[_0xde0d('0x2e')],qs[_0xde0d('0x34')](_0x3069d6[_0xde0d('0x2f')][_0xde0d('0x34')]));_0x5dc2b1[_0xde0d('0x32')]=_0x5dc2b1['attributes']['length']?_0x5dc2b1[_0xde0d('0x32')]:_0xd6e240[_0xde0d('0x2e')];if(_0x3069d6[_0xde0d('0x2f')]['includeAll']){_0x5dc2b1[_0xde0d('0x3d')]=[{'all':!![]}];}_0x5dc2b1=_['merge']({},_0x5dc2b1,_0x3069d6[_0xde0d('0x3b')]);return db['Campaign'][_0xde0d('0x43')](_0x5dc2b1)[_0xde0d('0x22')](handleEntityNotFound(_0x5e8837,null))[_0xde0d('0x22')](respondWithResult(_0x5e8837,null))['catch'](handleError(_0x5e8837,null));};exports[_0xde0d('0x44')]=function(_0x4c4c98,_0x50ae04){return db[_0xde0d('0x2b')][_0xde0d('0x44')](_0x4c4c98[_0xde0d('0x45')],{})[_0xde0d('0x22')](function(_0x3909d2){var _0x2f5777=_0x4c4c98[_0xde0d('0x46')][_0xde0d('0x23')]({'plain':!![]});if(!_0x2f5777)throw new Error(_0xde0d('0x47'));if(_0x2f5777[_0xde0d('0x48')]===_0xde0d('0x46')){var _0x2986aa=_0x3909d2[_0xde0d('0x23')]({'plain':!![]});var _0x3691eb='IvrCampaigns';return db['UserProfileSection'][_0xde0d('0x43')]({'where':{'name':_0x3691eb,'userProfileId':_0x2f5777[_0xde0d('0x49')]},'raw':!![]})[_0xde0d('0x22')](function(_0x187c2a){if(_0x187c2a&&_0x187c2a[_0xde0d('0x4a')]===0x0){return db[_0xde0d('0x24')][_0xde0d('0x44')]({'name':_0x2986aa[_0xde0d('0x28')],'resourceId':_0x2986aa['id'],'type':_0x187c2a[_0xde0d('0x28')],'sectionId':_0x187c2a['id']},{})['then'](function(){return _0x3909d2;});}else{return _0x3909d2;}})[_0xde0d('0x4b')](function(_0x1b15f7){logger[_0xde0d('0x26')](_0xde0d('0x4c'),_0x1b15f7);throw _0x1b15f7;});}return _0x3909d2;})[_0xde0d('0x22')](respondWithResult(_0x50ae04,0xc9))['catch'](handleError(_0x50ae04,null));};exports[_0xde0d('0x4d')]=function(_0x51c925,_0x495341){var _0x33e771={'where':{'id':_0x51c925['params']['id']}},_0x449cf9={};_0x449cf9[_0xde0d('0x2e')]=_['keys'](db['Campaign'][_0xde0d('0x42')]);_0x33e771[_0xde0d('0x32')]=_[_0xde0d('0x33')](_0x449cf9[_0xde0d('0x2e')],qs[_0xde0d('0x34')](_0x51c925['query'][_0xde0d('0x34')]));_0x33e771['attributes']=_0x33e771['attributes'][_0xde0d('0x35')]?_0x33e771[_0xde0d('0x32')]:_0x449cf9[_0xde0d('0x2e')];if(_0x51c925[_0xde0d('0x2f')][_0xde0d('0x3c')]){_0x33e771['include']=[{'all':!![]}];}_0x33e771=_[_0xde0d('0x39')]({},_0x33e771,_0x51c925[_0xde0d('0x3b')]);return db[_0xde0d('0x2b')][_0xde0d('0x43')](_0x33e771)['then'](handleEntityNotFound(_0x495341,null))[_0xde0d('0x22')](function(_0x30bdfe){if(_0x30bdfe){var _0x2d5ff8=_0x30bdfe[_0xde0d('0x23')]({'plain':!![]});_0x2d5ff8=qs[_0xde0d('0x4e')](_0x2d5ff8,['id',_0xde0d('0x4f'),_0xde0d('0x50')]);_0x51c925['body']=_[_0xde0d('0x4e')](_0x51c925['body'],['id','createdAt',_0xde0d('0x50')]);return db['Campaign'][_0xde0d('0x44')](_[_0xde0d('0x39')](_0x2d5ff8,_0x51c925[_0xde0d('0x45')]),{'include':_0x51c925[_0xde0d('0x2f')][_0xde0d('0x3c')]?[{'all':!![]}]:undefined})['then'](function(_0x5cf550){var _0x4bfd87=_0x51c925['user'][_0xde0d('0x23')]({'plain':!![]});if(!_0x4bfd87)throw new Error(_0xde0d('0x47'));if(_0x4bfd87[_0xde0d('0x48')]===_0xde0d('0x46')){var _0x4e2049=_0x5cf550[_0xde0d('0x23')]({'plain':!![]});var _0x30eff4=_0xde0d('0x51');return db[_0xde0d('0x52')][_0xde0d('0x43')]({'where':{'name':_0x30eff4,'userProfileId':_0x4bfd87[_0xde0d('0x49')]},'raw':!![]})[_0xde0d('0x22')](function(_0xa78b92){if(_0xa78b92&&_0xa78b92[_0xde0d('0x4a')]===0x0){return db[_0xde0d('0x24')][_0xde0d('0x44')]({'name':_0x4e2049[_0xde0d('0x28')],'resourceId':_0x4e2049['id'],'type':_0xa78b92[_0xde0d('0x28')],'sectionId':_0xa78b92['id']},{})[_0xde0d('0x22')](function(){return _0x5cf550;});}else{return _0x5cf550;}})[_0xde0d('0x4b')](function(_0x57cde6){logger[_0xde0d('0x26')](_0xde0d('0x4c'),_0x57cde6);throw _0x57cde6;});}return _0x5cf550;});}})['then'](respondWithResult(_0x495341,0xc9))[_0xde0d('0x4b')](handleError(_0x495341,null));};exports[_0xde0d('0x21')]=function(_0x9bb3c0,_0x8e6a63){if(_0x9bb3c0[_0xde0d('0x45')]['id']){delete _0x9bb3c0[_0xde0d('0x45')]['id'];}return db[_0xde0d('0x2b')]['find']({'where':{'id':_0x9bb3c0[_0xde0d('0x41')]['id']}})[_0xde0d('0x22')](handleEntityNotFound(_0x8e6a63,null))[_0xde0d('0x22')](saveUpdates(_0x9bb3c0[_0xde0d('0x45')],null))[_0xde0d('0x22')](respondWithResult(_0x8e6a63,null))['catch'](handleError(_0x8e6a63,null));};exports[_0xde0d('0x25')]=function(_0x16a0e3,_0x484c6d){return db[_0xde0d('0x2b')][_0xde0d('0x43')]({'where':{'id':_0x16a0e3[_0xde0d('0x41')]['id']}})[_0xde0d('0x22')](handleEntityNotFound(_0x484c6d,null))['then'](removeEntity(_0x484c6d,null))[_0xde0d('0x4b')](handleError(_0x484c6d,null));};exports[_0xde0d('0x53')]=function(_0x21ac2f,_0x3a325b,_0x1e2c4c){var _0x216ed1={'raw':!![],'where':{}};var _0x327f36={};var _0x47a6eb={'count':0x0,'rows':[]};return db[_0xde0d('0x2b')][_0xde0d('0x54')]({'where':{'id':_0x21ac2f[_0xde0d('0x41')]['id']}})['then'](handleEntityNotFound(_0x3a325b,null))['then'](function(_0x17ae5c){if(_0x17ae5c){_0x327f36[_0xde0d('0x2e')]=_['keys'](db[_0xde0d('0x55')]['rawAttributes']);_0x327f36[_0xde0d('0x2f')]=_[_0xde0d('0x30')](_0x21ac2f[_0xde0d('0x2f')]);_0x327f36[_0xde0d('0x31')]=_[_0xde0d('0x33')](_0x327f36['model'],_0x327f36[_0xde0d('0x2f')]);_0x216ed1[_0xde0d('0x32')]=_[_0xde0d('0x33')](_0x327f36[_0xde0d('0x2e')],qs['fields'](_0x21ac2f[_0xde0d('0x2f')][_0xde0d('0x34')]));_0x216ed1[_0xde0d('0x32')]=_0x216ed1[_0xde0d('0x32')][_0xde0d('0x35')]?_0x216ed1[_0xde0d('0x32')]:_0x327f36[_0xde0d('0x2e')];if(!_0x21ac2f[_0xde0d('0x2f')][_0xde0d('0x36')]('nolimit')){_0x216ed1['limit']=qs['limit'](_0x21ac2f[_0xde0d('0x2f')][_0xde0d('0x1c')]);_0x216ed1['offset']=qs[_0xde0d('0x1a')](_0x21ac2f[_0xde0d('0x2f')][_0xde0d('0x1a')]);}_0x216ed1['order']=qs[_0xde0d('0x38')](_0x21ac2f[_0xde0d('0x2f')]['sort']);_0x216ed1[_0xde0d('0x56')]=qs['filters'](_[_0xde0d('0x57')](_0x21ac2f['query'],_0x327f36[_0xde0d('0x31')]));_0x216ed1[_0xde0d('0x56')][_0xde0d('0x58')]=_0x17ae5c['id'];if(_0x21ac2f[_0xde0d('0x2f')][_0xde0d('0x59')]){_0x216ed1['where']=_[_0xde0d('0x39')](_0x216ed1[_0xde0d('0x56')],{'$or':_[_0xde0d('0x2a')](_0x216ed1['attributes'],function(_0x5d1ebb){var _0x19b866={};_0x19b866[_0x5d1ebb]={'$like':'%'+_0x21ac2f[_0xde0d('0x2f')][_0xde0d('0x59')]+'%'};return _0x19b866;})});}_0x216ed1=_[_0xde0d('0x39')]({},_0x216ed1,_0x21ac2f[_0xde0d('0x3b')]);return db['CmHopper']['count']({'where':_0x216ed1[_0xde0d('0x56')]})[_0xde0d('0x22')](function(_0x348a73){_0x47a6eb['count']=_0x348a73;if(_0x21ac2f[_0xde0d('0x2f')]['includeAll']){_0x216ed1[_0xde0d('0x3d')]=[{'all':!![]}];}return db['CmHopper'][_0xde0d('0x3e')](_0x216ed1);})[_0xde0d('0x22')](function(_0x5bc44e){_0x47a6eb[_0xde0d('0x3f')]=_0x5bc44e;return _0x47a6eb;});}})[_0xde0d('0x22')](respondWithFilteredResult(_0x3a325b,_0x216ed1))['catch'](handleError(_0x3a325b,null));};exports[_0xde0d('0x5a')]=function(_0x440d7f,_0x3be93c,_0x22c093){var _0x22db16={'raw':!![],'where':{}};var _0x5ab1a3={};var _0x3c5c4c={'count':0x0,'rows':[]};return db['Campaign'][_0xde0d('0x54')]({'where':{'id':_0x440d7f[_0xde0d('0x41')]['id']}})[_0xde0d('0x22')](handleEntityNotFound(_0x3be93c,null))[_0xde0d('0x22')](function(_0x1b4d09){if(_0x1b4d09){_0x5ab1a3[_0xde0d('0x2e')]=_[_0xde0d('0x30')](db[_0xde0d('0x5b')]['rawAttributes']);_0x5ab1a3['query']=_[_0xde0d('0x30')](_0x440d7f[_0xde0d('0x2f')]);_0x5ab1a3[_0xde0d('0x31')]=_['intersection'](_0x5ab1a3[_0xde0d('0x2e')],_0x5ab1a3[_0xde0d('0x2f')]);_0x22db16[_0xde0d('0x32')]=_['intersection'](_0x5ab1a3[_0xde0d('0x2e')],qs['fields'](_0x440d7f['query'][_0xde0d('0x34')]));_0x22db16['attributes']=_0x22db16[_0xde0d('0x32')][_0xde0d('0x35')]?_0x22db16[_0xde0d('0x32')]:_0x5ab1a3[_0xde0d('0x2e')];if(!_0x440d7f[_0xde0d('0x2f')][_0xde0d('0x36')](_0xde0d('0x37'))){_0x22db16['limit']=qs[_0xde0d('0x1c')](_0x440d7f[_0xde0d('0x2f')]['limit']);_0x22db16[_0xde0d('0x1a')]=qs['offset'](_0x440d7f[_0xde0d('0x2f')][_0xde0d('0x1a')]);}_0x22db16['order']=qs[_0xde0d('0x38')](_0x440d7f[_0xde0d('0x2f')][_0xde0d('0x38')]);_0x22db16[_0xde0d('0x56')]=qs[_0xde0d('0x31')](_[_0xde0d('0x57')](_0x440d7f[_0xde0d('0x2f')],_0x5ab1a3[_0xde0d('0x31')]));_0x22db16[_0xde0d('0x56')][_0xde0d('0x58')]=_0x1b4d09['id'];if(_0x440d7f[_0xde0d('0x2f')][_0xde0d('0x59')]){_0x22db16[_0xde0d('0x56')]=_[_0xde0d('0x39')](_0x22db16[_0xde0d('0x56')],{'$or':_['map'](_0x22db16[_0xde0d('0x32')],function(_0x3a73fb){var _0x162cba={};_0x162cba[_0x3a73fb]={'$like':'%'+_0x440d7f[_0xde0d('0x2f')]['filter']+'%'};return _0x162cba;})});}_0x22db16=_[_0xde0d('0x39')]({},_0x22db16,_0x440d7f[_0xde0d('0x3b')]);return db[_0xde0d('0x5b')][_0xde0d('0x1d')]({'where':_0x22db16[_0xde0d('0x56')]})[_0xde0d('0x22')](function(_0x3d56c4){_0x3c5c4c[_0xde0d('0x1d')]=_0x3d56c4;if(_0x440d7f[_0xde0d('0x2f')][_0xde0d('0x3c')]){_0x22db16[_0xde0d('0x3d')]=[{'all':!![]}];}return db[_0xde0d('0x5b')][_0xde0d('0x3e')](_0x22db16);})[_0xde0d('0x22')](function(_0x2c4a0a){_0x3c5c4c[_0xde0d('0x3f')]=_0x2c4a0a;return _0x3c5c4c;});}})[_0xde0d('0x22')](respondWithFilteredResult(_0x3be93c,_0x22db16))[_0xde0d('0x4b')](handleError(_0x3be93c,null));};exports[_0xde0d('0x5c')]=function(_0x2b8bc3,_0x42fef8,_0x4321ad){var _0x5ba724={'raw':!![],'where':{}};var _0x33e80d={};var _0x4fb2f3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2b8bc3[_0xde0d('0x41')]['id']}})[_0xde0d('0x22')](handleEntityNotFound(_0x42fef8,null))[_0xde0d('0x22')](function(_0x4341b9){if(_0x4341b9){_0x33e80d[_0xde0d('0x2e')]=_[_0xde0d('0x30')](db[_0xde0d('0x5d')][_0xde0d('0x42')]);_0x33e80d['query']=_[_0xde0d('0x30')](_0x2b8bc3['query']);_0x33e80d['filters']=_[_0xde0d('0x33')](_0x33e80d[_0xde0d('0x2e')],_0x33e80d[_0xde0d('0x2f')]);_0x5ba724['attributes']=_[_0xde0d('0x33')](_0x33e80d[_0xde0d('0x2e')],qs['fields'](_0x2b8bc3[_0xde0d('0x2f')][_0xde0d('0x34')]));_0x5ba724[_0xde0d('0x32')]=_0x5ba724[_0xde0d('0x32')][_0xde0d('0x35')]?_0x5ba724[_0xde0d('0x32')]:_0x33e80d['model'];if(!_0x2b8bc3[_0xde0d('0x2f')][_0xde0d('0x36')](_0xde0d('0x37'))){_0x5ba724[_0xde0d('0x1c')]=qs['limit'](_0x2b8bc3['query'][_0xde0d('0x1c')]);_0x5ba724['offset']=qs[_0xde0d('0x1a')](_0x2b8bc3[_0xde0d('0x2f')][_0xde0d('0x1a')]);}_0x5ba724[_0xde0d('0x5e')]=qs['sort'](_0x2b8bc3[_0xde0d('0x2f')][_0xde0d('0x38')]);_0x5ba724[_0xde0d('0x56')]=qs[_0xde0d('0x31')](_[_0xde0d('0x57')](_0x2b8bc3[_0xde0d('0x2f')],_0x33e80d[_0xde0d('0x31')]));_0x5ba724['where'][_0xde0d('0x58')]=_0x4341b9['id'];if(_0x2b8bc3['query'][_0xde0d('0x59')]){_0x5ba724['where']=_[_0xde0d('0x39')](_0x5ba724['where'],{'$or':_[_0xde0d('0x2a')](_0x5ba724[_0xde0d('0x32')],function(_0x281ccf){var _0x25b27a={};_0x25b27a[_0x281ccf]={'$like':'%'+_0x2b8bc3[_0xde0d('0x2f')][_0xde0d('0x59')]+'%'};return _0x25b27a;})});}_0x5ba724=_[_0xde0d('0x39')]({},_0x5ba724,_0x2b8bc3['options']);return db[_0xde0d('0x5d')][_0xde0d('0x1d')]({'where':_0x5ba724[_0xde0d('0x56')]})[_0xde0d('0x22')](function(_0x33c833){_0x4fb2f3['count']=_0x33c833;if(_0x2b8bc3['query'][_0xde0d('0x3c')]){_0x5ba724['include']=[{'all':!![]}];}return db[_0xde0d('0x5d')][_0xde0d('0x3e')](_0x5ba724);})[_0xde0d('0x22')](function(_0x3145ed){_0x4fb2f3[_0xde0d('0x3f')]=_0x3145ed;return _0x4fb2f3;});}})[_0xde0d('0x22')](respondWithFilteredResult(_0x42fef8,_0x5ba724))[_0xde0d('0x4b')](handleError(_0x42fef8,null));};exports[_0xde0d('0x5f')]=function(_0x2776aa,_0x86eb0b,_0x1533fd){var _0x15c8b5={'raw':!![],'where':{}};var _0xca52f0={};var _0x1be377={'count':0x0,'rows':[]};return db[_0xde0d('0x2b')][_0xde0d('0x54')]({'where':{'id':_0x2776aa['params']['id']}})[_0xde0d('0x22')](handleEntityNotFound(_0x86eb0b,null))[_0xde0d('0x22')](function(_0xcd29d0){if(_0xcd29d0){_0xca52f0[_0xde0d('0x2e')]=_[_0xde0d('0x30')](db['CmHopperBlack']['rawAttributes']);_0xca52f0[_0xde0d('0x2f')]=_[_0xde0d('0x30')](_0x2776aa['query']);_0xca52f0[_0xde0d('0x31')]=_[_0xde0d('0x33')](_0xca52f0[_0xde0d('0x2e')],_0xca52f0[_0xde0d('0x2f')]);_0x15c8b5[_0xde0d('0x32')]=_[_0xde0d('0x33')](_0xca52f0[_0xde0d('0x2e')],qs[_0xde0d('0x34')](_0x2776aa[_0xde0d('0x2f')][_0xde0d('0x34')]));_0x15c8b5[_0xde0d('0x32')]=_0x15c8b5[_0xde0d('0x32')][_0xde0d('0x35')]?_0x15c8b5[_0xde0d('0x32')]:_0xca52f0[_0xde0d('0x2e')];if(!_0x2776aa[_0xde0d('0x2f')][_0xde0d('0x36')](_0xde0d('0x37'))){_0x15c8b5['limit']=qs[_0xde0d('0x1c')](_0x2776aa['query'][_0xde0d('0x1c')]);_0x15c8b5['offset']=qs[_0xde0d('0x1a')](_0x2776aa[_0xde0d('0x2f')]['offset']);}_0x15c8b5[_0xde0d('0x5e')]=qs[_0xde0d('0x38')](_0x2776aa[_0xde0d('0x2f')][_0xde0d('0x38')]);_0x15c8b5['where']=qs['filters'](_[_0xde0d('0x57')](_0x2776aa[_0xde0d('0x2f')],_0xca52f0['filters']));_0x15c8b5[_0xde0d('0x56')][_0xde0d('0x58')]=_0xcd29d0['id'];if(_0x2776aa['query'][_0xde0d('0x59')]){_0x15c8b5[_0xde0d('0x56')]=_[_0xde0d('0x39')](_0x15c8b5[_0xde0d('0x56')],{'$or':_[_0xde0d('0x2a')](_0x15c8b5[_0xde0d('0x32')],function(_0x3d510d){var _0x54adfa={};_0x54adfa[_0x3d510d]={'$like':'%'+_0x2776aa[_0xde0d('0x2f')][_0xde0d('0x59')]+'%'};return _0x54adfa;})});}_0x15c8b5=_[_0xde0d('0x39')]({},_0x15c8b5,_0x2776aa['options']);return db[_0xde0d('0x60')][_0xde0d('0x1d')]({'where':_0x15c8b5[_0xde0d('0x56')]})['then'](function(_0x29c242){_0x1be377[_0xde0d('0x1d')]=_0x29c242;if(_0x2776aa[_0xde0d('0x2f')][_0xde0d('0x3c')]){_0x15c8b5[_0xde0d('0x3d')]=[{'all':!![]}];}return db[_0xde0d('0x60')]['findAll'](_0x15c8b5);})[_0xde0d('0x22')](function(_0x379002){_0x1be377['rows']=_0x379002;return _0x1be377;});}})['then'](respondWithFilteredResult(_0x86eb0b,_0x15c8b5))[_0xde0d('0x4b')](handleError(_0x86eb0b,null));};exports['getLists']=function(_0x411bb3,_0x1e822b,_0x13ba4e){var _0x15a475={};var _0x200ff4={};var _0x226408;var _0x2a31fa;return db['Campaign'][_0xde0d('0x54')]({'where':{'id':_0x411bb3[_0xde0d('0x41')]['id']}})['then'](handleEntityNotFound(_0x1e822b,null))['then'](function(_0x9786e9){if(_0x9786e9){_0x226408=_0x9786e9;_0x200ff4['model']=_['keys'](db[_0xde0d('0x61')][_0xde0d('0x42')]);_0x200ff4[_0xde0d('0x2f')]=_['keys'](_0x411bb3[_0xde0d('0x2f')]);_0x200ff4['filters']=_[_0xde0d('0x33')](_0x200ff4[_0xde0d('0x2e')],_0x200ff4[_0xde0d('0x2f')]);_0x15a475[_0xde0d('0x32')]=_[_0xde0d('0x33')](_0x200ff4[_0xde0d('0x2e')],qs[_0xde0d('0x34')](_0x411bb3[_0xde0d('0x2f')][_0xde0d('0x34')]));_0x15a475[_0xde0d('0x32')]=_0x15a475[_0xde0d('0x32')]['length']?_0x15a475[_0xde0d('0x32')]:_0x200ff4[_0xde0d('0x2e')];_0x15a475['order']=qs[_0xde0d('0x38')](_0x411bb3[_0xde0d('0x2f')]['sort']);_0x15a475[_0xde0d('0x56')]=qs['filters'](_['pick'](_0x411bb3[_0xde0d('0x2f')],_0x200ff4[_0xde0d('0x31')]));if(_0x411bb3[_0xde0d('0x2f')][_0xde0d('0x59')]){_0x15a475['where']=_['merge'](_0x15a475[_0xde0d('0x56')],{'$or':_[_0xde0d('0x2a')](_0x15a475[_0xde0d('0x32')],function(_0x59d04b){var _0x28857d={};_0x28857d[_0x59d04b]={'$like':'%'+_0x411bb3[_0xde0d('0x2f')][_0xde0d('0x59')]+'%'};return _0x28857d;})});}_0x15a475=_[_0xde0d('0x39')]({},_0x15a475,_0x411bb3[_0xde0d('0x3b')]);return _0x226408[_0xde0d('0x62')](_0x15a475);}})[_0xde0d('0x22')](function(_0x28f874){if(_0x28f874){_0x2a31fa=_0x28f874['length'];if(!_0x411bb3[_0xde0d('0x2f')]['hasOwnProperty'](_0xde0d('0x37'))){_0x15a475['limit']=qs[_0xde0d('0x1c')](_0x411bb3[_0xde0d('0x2f')]['limit']);_0x15a475[_0xde0d('0x1a')]=qs['offset'](_0x411bb3[_0xde0d('0x2f')][_0xde0d('0x1a')]);}return _0x226408[_0xde0d('0x62')](_0x15a475);}})['then'](function(_0x58d8dc){if(_0x58d8dc){return _0x58d8dc?{'count':_0x2a31fa,'rows':_0x58d8dc}:null;}})[_0xde0d('0x22')](respondWithResult(_0x1e822b,null))[_0xde0d('0x4b')](handleError(_0x1e822b,null));};exports[_0xde0d('0x63')]=function(_0xf50e1b,_0x452468,_0x29757e){var _0x10999f,_0xab2ae9;var _0x59a9b7=[];var _0x2da48d=moment()['format'](_0xde0d('0x64'));return db[_0xde0d('0x2b')][_0xde0d('0x43')]({'where':{'id':_0xf50e1b[_0xde0d('0x41')]['id']}})[_0xde0d('0x22')](handleEntityNotFound(_0x452468,null))[_0xde0d('0x22')](function(_0x4fb76d){if(_0x4fb76d){_0xab2ae9=_0x4fb76d;return _0x4fb76d[_0xde0d('0x63')](_0xf50e1b[_0xde0d('0x45')][_0xde0d('0x65')],_[_0xde0d('0x4e')](_0xf50e1b['body'],[_0xde0d('0x65'),'id'])||{});}return null;})['spread'](function(_0x8d49ca){var _0x2dcd30;var _0x58e348;_0x10999f=_0x8d49ca||[];var _0x620811=[];if(_0x8d49ca){for(var _0x1c165d=0x0;_0x1c165d<_0x8d49ca['length'];_0x1c165d+=0x1){var _0xaa671b=_0x8d49ca[_0x1c165d][_0xde0d('0x23')]({'plain':!![]});_0xab2ae9[_0xde0d('0x66')]=_0xf50e1b['body']['dialCheckDuplicateType']?_0xf50e1b['body']['dialCheckDuplicateType']:_0xab2ae9[_0xde0d('0x66')];switch(_0xab2ae9[_0xde0d('0x66')]){case _0xde0d('0x67'):_0x2dcd30=squel['insert']()['into']('cm_hopper')[_0xde0d('0x68')](['phone',_0xde0d('0x69'),_0xde0d('0x6a'),_0xde0d('0x6b'),'CampaignId',_0xde0d('0x4f'),_0xde0d('0x50')],squel[_0xde0d('0x6c')]()[_0xde0d('0x6d')]('phone',_0xde0d('0x6e'))[_0xde0d('0x6d')]('NOW()',_0xde0d('0x69'))[_0xde0d('0x6d')]('id',_0xde0d('0x6a'))['field'](_0xaa671b[_0xde0d('0x6f')][_0xde0d('0x70')](),_0xde0d('0x6b'))['field'](_0xf50e1b['params']['id'][_0xde0d('0x70')](),_0xde0d('0x58'))[_0xde0d('0x6d')]('\x27'+_0x2da48d+'\x27',_0xde0d('0x4f'))[_0xde0d('0x6d')]('\x27'+_0x2da48d+'\x27',_0xde0d('0x50'))[_0xde0d('0x71')](_0xde0d('0x72'))[_0xde0d('0x56')](_0xde0d('0x73'))[_0xde0d('0x56')](_0xde0d('0x74'),_0xaa671b[_0xde0d('0x6f')][_0xde0d('0x70')]())[_0xde0d('0x56')]('phone\x20IS\x20NOT\x20NULL')[_0xde0d('0x56')]('phone\x20NOT\x20IN\x20(?)',squel[_0xde0d('0x6c')]()[_0xde0d('0x6d')](_0xde0d('0x75'))[_0xde0d('0x71')](_0xde0d('0x76'))['where'](_0xde0d('0x77'),_0xf50e1b[_0xde0d('0x41')]['id']['toString']()))[_0xde0d('0x56')](_0xde0d('0x78'),squel['select']()[_0xde0d('0x6d')]('COALESCE(phone,\x27\x27)')[_0xde0d('0x71')]('cm_hopper')[_0xde0d('0x56')](_0xde0d('0x77'),_0xf50e1b[_0xde0d('0x41')]['id'][_0xde0d('0x70')]())))[_0xde0d('0x70')]();break;case _0xde0d('0x79'):_0x2dcd30=squel[_0xde0d('0x7a')]()[_0xde0d('0x7b')](_0xde0d('0x7c'))[_0xde0d('0x68')]([_0xde0d('0x6e'),_0xde0d('0x69'),'ContactId','ListId',_0xde0d('0x58'),_0xde0d('0x4f'),_0xde0d('0x50')],squel['select']()[_0xde0d('0x6d')](_0xde0d('0x6e'),_0xde0d('0x6e'))['field']('NOW()','scheduledAt')[_0xde0d('0x6d')]('id','ContactId')[_0xde0d('0x6d')](_0xaa671b[_0xde0d('0x6f')][_0xde0d('0x70')](),_0xde0d('0x6b'))[_0xde0d('0x6d')](_0xf50e1b[_0xde0d('0x41')]['id']['toString'](),_0xde0d('0x58'))[_0xde0d('0x6d')]('\x27'+_0x2da48d+'\x27','createdAt')[_0xde0d('0x6d')]('\x27'+_0x2da48d+'\x27',_0xde0d('0x50'))[_0xde0d('0x71')](_0xde0d('0x72'))['where'](_0xde0d('0x73'))[_0xde0d('0x56')](_0xde0d('0x74'),_0xaa671b[_0xde0d('0x6f')]['toString']())[_0xde0d('0x56')]('phone\x20IS\x20NOT\x20NULL')[_0xde0d('0x56')](_0xde0d('0x78'),squel['select']()['field'](_0xde0d('0x7d'))[_0xde0d('0x71')](_0xde0d('0x7c'))[_0xde0d('0x56')]('CampaignId\x20=\x20?',_0xf50e1b[_0xde0d('0x41')]['id'][_0xde0d('0x70')]())))[_0xde0d('0x70')]();break;default:_0x2dcd30=squel['insert']()[_0xde0d('0x7b')](_0xde0d('0x7c'))[_0xde0d('0x68')]([_0xde0d('0x6e'),_0xde0d('0x69'),_0xde0d('0x6a'),_0xde0d('0x6b'),'CampaignId',_0xde0d('0x4f'),_0xde0d('0x50')],squel['select']()['field']('phone','phone')[_0xde0d('0x6d')](_0xde0d('0x7e'),'scheduledAt')[_0xde0d('0x6d')]('id',_0xde0d('0x6a'))[_0xde0d('0x6d')](_0xaa671b['CmListId'][_0xde0d('0x70')](),_0xde0d('0x6b'))[_0xde0d('0x6d')](_0xf50e1b[_0xde0d('0x41')]['id'][_0xde0d('0x70')](),'CampaignId')['field']('\x27'+_0x2da48d+'\x27',_0xde0d('0x4f'))['field']('\x27'+_0x2da48d+'\x27',_0xde0d('0x50'))[_0xde0d('0x71')](_0xde0d('0x72'))[_0xde0d('0x56')](_0xde0d('0x73'))['where'](_0xde0d('0x74'),_0xaa671b[_0xde0d('0x6f')][_0xde0d('0x70')]())[_0xde0d('0x56')](_0xde0d('0x7f')))[_0xde0d('0x70')]();}_0x58e348=squel['insert']()[_0xde0d('0x7b')](_0xde0d('0x80'))['fromQuery'](['cmHopperId',_0xde0d('0x69'),_0xde0d('0x6e'),_0xde0d('0x81'),'createdAt',_0xde0d('0x50')],squel[_0xde0d('0x6c')]()[_0xde0d('0x6d')]('h.id','id')['field'](_0xde0d('0x7e'),_0xde0d('0x69'))[_0xde0d('0x6d')]('ci.item',_0xde0d('0x6e'))[_0xde0d('0x6d')](_0xde0d('0x82'),_0xde0d('0x81'))['field']('\x27'+_0x2da48d+'\x27','createdAt')[_0xde0d('0x6d')]('\x27'+_0x2da48d+'\x27',_0xde0d('0x50'))[_0xde0d('0x71')]('cm_contact_has_items','ci')[_0xde0d('0x83')]('cm_hopper','h',_0xde0d('0x84'))[_0xde0d('0x56')]('h.ListId\x20=\x20?',_0xaa671b['CmListId']['toString']())[_0xde0d('0x56')](_0xde0d('0x85'),_0xf50e1b[_0xde0d('0x41')]['id']['toString']())[_0xde0d('0x56')](_0xde0d('0x86'),_0x2da48d))[_0xde0d('0x70')]();_0x620811[_0xde0d('0x87')](db['sequelize'][_0xde0d('0x2f')](_0x2dcd30));_0x59a9b7[_0xde0d('0x87')](db[_0xde0d('0x88')][_0xde0d('0x2f')](_0x58e348));}return BPromise[_0xde0d('0x89')](_0x620811);}})[_0xde0d('0x22')](function(){return BPromise[_0xde0d('0x89')](_0x59a9b7);})[_0xde0d('0x22')](function(){return _0x10999f;})[_0xde0d('0x22')](respondWithResult(_0x452468,null))['catch'](handleError(_0x452468,null));};exports[_0xde0d('0x8a')]=function(_0x1e71fd,_0xcddba9,_0x19a25b){return db[_0xde0d('0x2b')][_0xde0d('0x43')]({'where':{'id':_0x1e71fd['params']['id']}})['then'](handleEntityNotFound(_0xcddba9,null))[_0xde0d('0x22')](function(_0x256500){if(_0x256500){return _0x256500['removeLists'](_0x1e71fd[_0xde0d('0x2f')][_0xde0d('0x65')]);}})[_0xde0d('0x22')](function(_0x1a455a){if(_0x1a455a){return db[_0xde0d('0x55')][_0xde0d('0x25')]({'where':{'ListId':_0x1e71fd[_0xde0d('0x2f')]['ids'],'CampaignId':_0x1e71fd['params']['id']}})[_0xde0d('0x22')](function(){return _0x1a455a;});}})[_0xde0d('0x22')](respondWithStatusCode(_0xcddba9,null))['catch'](handleError(_0xcddba9,null));};exports[_0xde0d('0x8b')]=function(_0x29eec1,_0x522b7f,_0x271d92){var _0x2bdc21={};var _0x56c85f={};var _0x422cc8;var _0x54ef09;return db[_0xde0d('0x2b')][_0xde0d('0x54')]({'where':{'id':_0x29eec1[_0xde0d('0x41')]['id']}})[_0xde0d('0x22')](handleEntityNotFound(_0x522b7f,null))[_0xde0d('0x22')](function(_0x527052){if(_0x527052){_0x422cc8=_0x527052;_0x56c85f[_0xde0d('0x2e')]=_['keys'](db[_0xde0d('0x61')][_0xde0d('0x42')]);_0x56c85f[_0xde0d('0x2f')]=_[_0xde0d('0x30')](_0x29eec1['query']);_0x56c85f[_0xde0d('0x31')]=_[_0xde0d('0x33')](_0x56c85f[_0xde0d('0x2e')],_0x56c85f[_0xde0d('0x2f')]);_0x2bdc21[_0xde0d('0x32')]=_[_0xde0d('0x33')](_0x56c85f['model'],qs['fields'](_0x29eec1['query']['fields']));_0x2bdc21[_0xde0d('0x32')]=_0x2bdc21[_0xde0d('0x32')]['length']?_0x2bdc21[_0xde0d('0x32')]:_0x56c85f['model'];_0x2bdc21[_0xde0d('0x5e')]=qs[_0xde0d('0x38')](_0x29eec1[_0xde0d('0x2f')]['sort']);_0x2bdc21[_0xde0d('0x56')]=qs[_0xde0d('0x31')](_['pick'](_0x29eec1[_0xde0d('0x2f')],_0x56c85f[_0xde0d('0x31')]));if(_0x29eec1[_0xde0d('0x2f')]['filter']){_0x2bdc21['where']=_[_0xde0d('0x39')](_0x2bdc21['where'],{'$or':_[_0xde0d('0x2a')](_0x2bdc21[_0xde0d('0x32')],function(_0x2e3b0e){var _0x41a221={};_0x41a221[_0x2e3b0e]={'$like':'%'+_0x29eec1[_0xde0d('0x2f')][_0xde0d('0x59')]+'%'};return _0x41a221;})});}_0x2bdc21=_['merge']({},_0x2bdc21,_0x29eec1[_0xde0d('0x3b')]);return _0x422cc8[_0xde0d('0x8b')](_0x2bdc21);}})[_0xde0d('0x22')](function(_0x765d86){if(_0x765d86){_0x54ef09=_0x765d86[_0xde0d('0x35')];if(!_0x29eec1[_0xde0d('0x2f')][_0xde0d('0x36')]('nolimit')){_0x2bdc21[_0xde0d('0x1c')]=qs[_0xde0d('0x1c')](_0x29eec1[_0xde0d('0x2f')][_0xde0d('0x1c')]);_0x2bdc21[_0xde0d('0x1a')]=qs['offset'](_0x29eec1['query'][_0xde0d('0x1a')]);}return _0x422cc8[_0xde0d('0x8b')](_0x2bdc21);}})[_0xde0d('0x22')](function(_0x1a852c){if(_0x1a852c){return _0x1a852c?{'count':_0x54ef09,'rows':_0x1a852c}:null;}})[_0xde0d('0x22')](respondWithResult(_0x522b7f,null))[_0xde0d('0x4b')](handleError(_0x522b7f,null));};exports[_0xde0d('0x8c')]=function(_0x37fb95,_0x24e159,_0x387d2d){var _0x1d462a,_0x34268e;var _0x20d8d4=[];var _0x34ccf9=moment()[_0xde0d('0x8d')](_0xde0d('0x64'));return db[_0xde0d('0x2b')]['find']({'where':{'id':_0x37fb95[_0xde0d('0x41')]['id']}})[_0xde0d('0x22')](handleEntityNotFound(_0x24e159,null))[_0xde0d('0x22')](function(_0x3adec8){if(_0x3adec8){_0x34268e=_0x3adec8;return _0x3adec8['addBlackLists'](_0x37fb95[_0xde0d('0x45')][_0xde0d('0x65')],_['omit'](_0x37fb95[_0xde0d('0x45')],[_0xde0d('0x65'),'id'])||{});}return null;})[_0xde0d('0x8e')](function(_0x2d230a){var _0x10f292;var _0x1fbbfd;_0x1d462a=_0x2d230a||[];var _0x701d20=[];if(_0x2d230a){for(var _0x4b6f47=0x0;_0x4b6f47<_0x2d230a[_0xde0d('0x35')];_0x4b6f47+=0x1){var _0x2ed715=_0x2d230a[_0x4b6f47][_0xde0d('0x23')]({'plain':!![]});_0x10f292=squel[_0xde0d('0x7a')]()['into'](_0xde0d('0x8f'))[_0xde0d('0x68')]([_0xde0d('0x6e'),_0xde0d('0x6a'),'ListId',_0xde0d('0x58'),_0xde0d('0x4f'),_0xde0d('0x50')],squel['select']()[_0xde0d('0x6d')](_0xde0d('0x6e'),_0xde0d('0x6e'))[_0xde0d('0x6d')]('id',_0xde0d('0x6a'))[_0xde0d('0x6d')](_0x2ed715[_0xde0d('0x6f')][_0xde0d('0x70')](),_0xde0d('0x6b'))[_0xde0d('0x6d')](_0x37fb95[_0xde0d('0x41')]['id'][_0xde0d('0x70')](),'CampaignId')['field']('NOW()',_0xde0d('0x4f'))[_0xde0d('0x6d')](_0xde0d('0x7e'),_0xde0d('0x50'))[_0xde0d('0x71')](_0xde0d('0x72'))[_0xde0d('0x56')](_0xde0d('0x73'))[_0xde0d('0x56')](_0xde0d('0x74'),_0x2ed715[_0xde0d('0x6f')][_0xde0d('0x70')]())[_0xde0d('0x56')](_0xde0d('0x7f')))[_0xde0d('0x70')]();_0x701d20[_0xde0d('0x87')](db[_0xde0d('0x88')][_0xde0d('0x2f')](_0x10f292));}return BPromise[_0xde0d('0x89')](_0x701d20);}})[_0xde0d('0x22')](function(){return _0x1d462a;})[_0xde0d('0x22')](respondWithResult(_0x24e159,null))['catch'](handleError(_0x24e159,null));};exports[_0xde0d('0x90')]=function(_0x41507b,_0x9751d7,_0x545d78){return db[_0xde0d('0x2b')][_0xde0d('0x43')]({'where':{'id':_0x41507b[_0xde0d('0x41')]['id']}})[_0xde0d('0x22')](handleEntityNotFound(_0x9751d7,null))[_0xde0d('0x22')](function(_0x236410){if(_0x236410){return _0x236410['removeBlackLists'](_0x41507b[_0xde0d('0x2f')]['ids']);}})[_0xde0d('0x22')](function(_0x514699){if(_0x514699){return db[_0xde0d('0x60')]['destroy']({'where':{'ListId':_0x41507b[_0xde0d('0x2f')][_0xde0d('0x65')],'CampaignId':_0x41507b[_0xde0d('0x41')]['id']}})[_0xde0d('0x22')](function(){return _0x514699;});}})[_0xde0d('0x22')](respondWithStatusCode(_0x9751d7,null))[_0xde0d('0x4b')](handleError(_0x9751d7,null));};
\ No newline at end of file
+var _0x15f9=['rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','destroy','getHoppers','findOne','CmHopper','hasOwnProperty','order','CampaignId','filter','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','from','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','cm_hopper','scheduledAt','phone\x20IS\x20NOT\x20NULL','cmHopperId','OrderBy','ci.OrderBY','join','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','get','IvrCampaigns','UserProfileResource','sendStatus','stack','name','send','index','map','Campaign'];(function(_0x1cfd07,_0x42cdb5){var _0x3d7c1f=function(_0x5b4be1){while(--_0x5b4be1){_0x1cfd07['push'](_0x1cfd07['shift']());}};_0x3d7c1f(++_0x42cdb5);}(_0x15f9,0xf7));var _0x915f=function(_0x379ae3,_0x16a555){_0x379ae3=_0x379ae3-0x0;var _0x80c32e=_0x15f9[_0x379ae3];return _0x80c32e;};'use strict';var emlformat=require(_0x915f('0x0'));var rimraf=require(_0x915f('0x1'));var zipdir=require(_0x915f('0x2'));var jsonpatch=require(_0x915f('0x3'));var rp=require(_0x915f('0x4'));var moment=require(_0x915f('0x5'));var BPromise=require(_0x915f('0x6'));var Mustache=require(_0x915f('0x7'));var util=require(_0x915f('0x8'));var path=require('path');var sox=require(_0x915f('0x9'));var csv=require(_0x915f('0xa'));var ejs=require(_0x915f('0xb'));var fs=require('fs');var fs_extra=require(_0x915f('0xc'));var _=require('lodash');var squel=require(_0x915f('0xd'));var crypto=require(_0x915f('0xe'));var jsforce=require(_0x915f('0xf'));var deskjs=require(_0x915f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x915f('0x11'));var Papa=require(_0x915f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x915f('0x13'));var as=require(_0x915f('0x14'));var hardwareService=require(_0x915f('0x15'));var logger=require(_0x915f('0x16'))(_0x915f('0x17'));var utils=require(_0x915f('0x18'));var config=require(_0x915f('0x19'));var licenseUtil=require(_0x915f('0x1a'));var db=require(_0x915f('0x1b'))['db'];function respondWithStatusCode(_0x35b29f,_0x2a9a10){_0x2a9a10=_0x2a9a10||0xcc;return function(_0x5b9080){if(_0x5b9080){return _0x35b29f['sendStatus'](_0x2a9a10);}return _0x35b29f[_0x915f('0x1c')](_0x2a9a10)[_0x915f('0x1d')]();};}function respondWithResult(_0x25de94,_0x370a91){_0x370a91=_0x370a91||0xc8;return function(_0x53de49){if(_0x53de49){return _0x25de94[_0x915f('0x1c')](_0x370a91)['json'](_0x53de49);}};}function respondWithFilteredResult(_0x80a30f,_0x42c125){return function(_0x5a05cf){if(_0x5a05cf){var _0x1782b0=typeof _0x42c125[_0x915f('0x1e')]==='undefined'&&typeof _0x42c125[_0x915f('0x1f')]===_0x915f('0x20');var _0x28eca1=_0x5a05cf['count'];var _0x18a53b=_0x1782b0?0x0:_0x42c125['offset'];var _0x2d711d=_0x1782b0?_0x5a05cf[_0x915f('0x21')]:_0x42c125['offset']+_0x42c125[_0x915f('0x1f')];var _0x29f228;if(_0x2d711d>=_0x28eca1){_0x2d711d=_0x28eca1;_0x29f228=0xc8;}else{_0x29f228=0xce;}_0x80a30f[_0x915f('0x1c')](_0x29f228);return _0x80a30f[_0x915f('0x22')](_0x915f('0x23'),_0x18a53b+'-'+_0x2d711d+'/'+_0x28eca1)[_0x915f('0x24')](_0x5a05cf);}return null;};}function patchUpdates(_0x2ba00c){return function(_0x57a6b7){try{jsonpatch[_0x915f('0x25')](_0x57a6b7,_0x2ba00c,!![]);}catch(_0x1572ab){return BPromise['reject'](_0x1572ab);}return _0x57a6b7[_0x915f('0x26')]();};}function saveUpdates(_0x2c6db9,_0x16acd2){return function(_0x4f6d8d){if(_0x4f6d8d){return _0x4f6d8d[_0x915f('0x27')](_0x2c6db9)[_0x915f('0x28')](function(_0xed9c88){return _0xed9c88;});}return null;};}function removeEntity(_0x334e01,_0x31932c){return function(_0xfd479b){if(_0xfd479b){return _0xfd479b['destroy']()[_0x915f('0x28')](function(){var _0x1b2067=_0xfd479b[_0x915f('0x29')]({'plain':!![]});var _0x142482=_0x915f('0x2a');return db[_0x915f('0x2b')]['destroy']({'where':{'type':_0x142482,'resourceId':_0x1b2067['id']}})[_0x915f('0x28')](function(){return _0xfd479b;});})['then'](function(){_0x334e01['status'](0xcc)[_0x915f('0x1d')]();});}};}function handleEntityNotFound(_0x4ef141,_0x4c61e0){return function(_0x19e5fc){if(!_0x19e5fc){_0x4ef141[_0x915f('0x2c')](0x194);}return _0x19e5fc;};}function handleError(_0x28e6b9,_0xa4bda4){_0xa4bda4=_0xa4bda4||0x1f4;return function(_0x5a5ee2){logger['error'](_0x5a5ee2[_0x915f('0x2d')]);if(_0x5a5ee2[_0x915f('0x2e')]){delete _0x5a5ee2[_0x915f('0x2e')];}_0x28e6b9[_0x915f('0x1c')](_0xa4bda4)[_0x915f('0x2f')](_0x5a5ee2);};}exports[_0x915f('0x30')]=function(_0x5d3b3f,_0x19822f){var _0x5ed30e={},_0x3cc1e0={},_0x5de558={'count':0x0,'rows':[]};var _0x2df733=_[_0x915f('0x31')](db[_0x915f('0x32')][_0x915f('0x33')],function(_0x171267){return{'name':_0x171267[_0x915f('0x34')],'type':_0x171267['type'][_0x915f('0x35')]};});_0x3cc1e0[_0x915f('0x36')]=_['map'](_0x2df733,_0x915f('0x2e'));_0x3cc1e0['query']=_[_0x915f('0x37')](_0x5d3b3f[_0x915f('0x38')]);_0x3cc1e0[_0x915f('0x39')]=_[_0x915f('0x3a')](_0x3cc1e0[_0x915f('0x36')],_0x3cc1e0['query']);_0x5ed30e[_0x915f('0x3b')]=_[_0x915f('0x3a')](_0x3cc1e0[_0x915f('0x36')],qs['fields'](_0x5d3b3f[_0x915f('0x38')][_0x915f('0x3c')]));_0x5ed30e[_0x915f('0x3b')]=_0x5ed30e[_0x915f('0x3b')][_0x915f('0x3d')]?_0x5ed30e[_0x915f('0x3b')]:_0x3cc1e0['model'];if(!_0x5d3b3f[_0x915f('0x38')]['hasOwnProperty'](_0x915f('0x3e'))){_0x5ed30e['limit']=qs[_0x915f('0x1f')](_0x5d3b3f[_0x915f('0x38')][_0x915f('0x1f')]);_0x5ed30e['offset']=qs[_0x915f('0x1e')](_0x5d3b3f[_0x915f('0x38')][_0x915f('0x1e')]);}_0x5ed30e['order']=qs[_0x915f('0x3f')](_0x5d3b3f[_0x915f('0x38')]['sort']);_0x5ed30e[_0x915f('0x40')]=qs['filters'](_[_0x915f('0x41')](_0x5d3b3f[_0x915f('0x38')],_0x3cc1e0[_0x915f('0x39')]),_0x2df733);if(_0x5d3b3f[_0x915f('0x38')]['filter']){_0x5ed30e[_0x915f('0x40')]=_[_0x915f('0x42')](_0x5ed30e[_0x915f('0x40')],{'$or':_[_0x915f('0x31')](_0x2df733,function(_0x47a01b){if(_0x47a01b['type']!==_0x915f('0x43')){var _0x1a74de={};_0x1a74de[_0x47a01b[_0x915f('0x2e')]]={'$like':'%'+_0x5d3b3f[_0x915f('0x38')]['filter']+'%'};return _0x1a74de;}})});}_0x5ed30e=_[_0x915f('0x42')]({},_0x5ed30e,_0x5d3b3f[_0x915f('0x44')]);var _0x1462c9={'where':_0x5ed30e[_0x915f('0x40')]};return db[_0x915f('0x32')][_0x915f('0x21')](_0x1462c9)[_0x915f('0x28')](function(_0x384763){_0x5de558['count']=_0x384763;if(_0x5d3b3f[_0x915f('0x38')][_0x915f('0x45')]){_0x5ed30e[_0x915f('0x46')]=[{'all':!![]}];}return db[_0x915f('0x32')]['findAll'](_0x5ed30e);})[_0x915f('0x28')](function(_0x92f97d){_0x5de558[_0x915f('0x47')]=_0x92f97d;return _0x5de558;})[_0x915f('0x28')](respondWithFilteredResult(_0x19822f,_0x5ed30e))[_0x915f('0x48')](handleError(_0x19822f,null));};exports[_0x915f('0x49')]=function(_0x5e20ea,_0x283307){var _0x146680={'raw':![],'where':{'id':_0x5e20ea[_0x915f('0x4a')]['id']}},_0x12bfe8={};_0x12bfe8[_0x915f('0x36')]=_[_0x915f('0x37')](db['Campaign'][_0x915f('0x33')]);_0x12bfe8[_0x915f('0x38')]=_['keys'](_0x5e20ea[_0x915f('0x38')]);_0x12bfe8[_0x915f('0x39')]=_[_0x915f('0x3a')](_0x12bfe8[_0x915f('0x36')],_0x12bfe8[_0x915f('0x38')]);_0x146680[_0x915f('0x3b')]=_['intersection'](_0x12bfe8[_0x915f('0x36')],qs[_0x915f('0x3c')](_0x5e20ea['query'][_0x915f('0x3c')]));_0x146680[_0x915f('0x3b')]=_0x146680[_0x915f('0x3b')][_0x915f('0x3d')]?_0x146680['attributes']:_0x12bfe8['model'];if(_0x5e20ea['query'][_0x915f('0x45')]){_0x146680[_0x915f('0x46')]=[{'all':!![]}];}_0x146680=_[_0x915f('0x42')]({},_0x146680,_0x5e20ea[_0x915f('0x44')]);return db['Campaign'][_0x915f('0x4b')](_0x146680)[_0x915f('0x28')](handleEntityNotFound(_0x283307,null))['then'](respondWithResult(_0x283307,null))['catch'](handleError(_0x283307,null));};exports[_0x915f('0x4c')]=function(_0x288400,_0x3cd5d8){return db[_0x915f('0x32')][_0x915f('0x4c')](_0x288400[_0x915f('0x4d')],{})[_0x915f('0x28')](function(_0x5c7fc3){var _0x2d6743=_0x288400[_0x915f('0x4e')][_0x915f('0x29')]({'plain':!![]});if(!_0x2d6743)throw new Error(_0x915f('0x4f'));if(_0x2d6743[_0x915f('0x50')]===_0x915f('0x4e')){var _0x5a13f1=_0x5c7fc3[_0x915f('0x29')]({'plain':!![]});var _0x2d3da6=_0x915f('0x2a');return db[_0x915f('0x51')]['find']({'where':{'name':_0x2d3da6,'userProfileId':_0x2d6743[_0x915f('0x52')]},'raw':!![]})[_0x915f('0x28')](function(_0xc3d4f7){if(_0xc3d4f7&&_0xc3d4f7[_0x915f('0x53')]===0x0){return db['UserProfileResource'][_0x915f('0x4c')]({'name':_0x5a13f1[_0x915f('0x2e')],'resourceId':_0x5a13f1['id'],'type':_0xc3d4f7[_0x915f('0x2e')],'sectionId':_0xc3d4f7['id']},{})['then'](function(){return _0x5c7fc3;});}else{return _0x5c7fc3;}})[_0x915f('0x48')](function(_0x45219b){logger[_0x915f('0x54')](_0x915f('0x55'),_0x45219b);throw _0x45219b;});}return _0x5c7fc3;})[_0x915f('0x28')](respondWithResult(_0x3cd5d8,0xc9))[_0x915f('0x48')](handleError(_0x3cd5d8,null));};exports[_0x915f('0x56')]=function(_0x16d409,_0x47e1df){var _0x37455c={'where':{'id':_0x16d409[_0x915f('0x4a')]['id']}},_0x49664a={};_0x49664a[_0x915f('0x36')]=_[_0x915f('0x37')](db[_0x915f('0x32')]['rawAttributes']);_0x37455c[_0x915f('0x3b')]=_['intersection'](_0x49664a[_0x915f('0x36')],qs['fields'](_0x16d409['query']['fields']));_0x37455c[_0x915f('0x3b')]=_0x37455c[_0x915f('0x3b')][_0x915f('0x3d')]?_0x37455c[_0x915f('0x3b')]:_0x49664a[_0x915f('0x36')];if(_0x16d409['query'][_0x915f('0x45')]){_0x37455c['include']=[{'all':!![]}];}_0x37455c=_['merge']({},_0x37455c,_0x16d409['options']);return db[_0x915f('0x32')]['find'](_0x37455c)[_0x915f('0x28')](handleEntityNotFound(_0x47e1df,null))['then'](function(_0x431214){if(_0x431214){var _0x7c0119=_0x431214[_0x915f('0x29')]({'plain':!![]});_0x7c0119=qs['omit'](_0x7c0119,['id',_0x915f('0x57'),'updatedAt']);_0x16d409[_0x915f('0x4d')]=_[_0x915f('0x58')](_0x16d409[_0x915f('0x4d')],['id',_0x915f('0x57'),_0x915f('0x59')]);return db['Campaign'][_0x915f('0x4c')](_['merge'](_0x7c0119,_0x16d409[_0x915f('0x4d')]),{'include':_0x16d409[_0x915f('0x38')][_0x915f('0x45')]?[{'all':!![]}]:undefined})[_0x915f('0x28')](function(_0x21b68f){var _0x79840b=_0x16d409[_0x915f('0x4e')][_0x915f('0x29')]({'plain':!![]});if(!_0x79840b)throw new Error(_0x915f('0x4f'));if(_0x79840b['role']===_0x915f('0x4e')){var _0x1c02e3=_0x21b68f['get']({'plain':!![]});var _0xc44c40=_0x915f('0x2a');return db[_0x915f('0x51')][_0x915f('0x4b')]({'where':{'name':_0xc44c40,'userProfileId':_0x79840b[_0x915f('0x52')]},'raw':!![]})[_0x915f('0x28')](function(_0x5062a4){if(_0x5062a4&&_0x5062a4[_0x915f('0x53')]===0x0){return db[_0x915f('0x2b')][_0x915f('0x4c')]({'name':_0x1c02e3[_0x915f('0x2e')],'resourceId':_0x1c02e3['id'],'type':_0x5062a4[_0x915f('0x2e')],'sectionId':_0x5062a4['id']},{})[_0x915f('0x28')](function(){return _0x21b68f;});}else{return _0x21b68f;}})['catch'](function(_0x3ff040){logger[_0x915f('0x54')](_0x915f('0x55'),_0x3ff040);throw _0x3ff040;});}return _0x21b68f;});}})[_0x915f('0x28')](respondWithResult(_0x47e1df,0xc9))[_0x915f('0x48')](handleError(_0x47e1df,null));};exports['update']=function(_0x201001,_0x4270cb){if(_0x201001['body']['id']){delete _0x201001['body']['id'];}return db[_0x915f('0x32')][_0x915f('0x4b')]({'where':{'id':_0x201001['params']['id']}})['then'](handleEntityNotFound(_0x4270cb,null))['then'](saveUpdates(_0x201001[_0x915f('0x4d')],null))[_0x915f('0x28')](respondWithResult(_0x4270cb,null))[_0x915f('0x48')](handleError(_0x4270cb,null));};exports[_0x915f('0x5a')]=function(_0x1fc2e4,_0x59358f){return db[_0x915f('0x32')]['find']({'where':{'id':_0x1fc2e4[_0x915f('0x4a')]['id']}})[_0x915f('0x28')](handleEntityNotFound(_0x59358f,null))['then'](removeEntity(_0x59358f,null))[_0x915f('0x48')](handleError(_0x59358f,null));};exports[_0x915f('0x5b')]=function(_0x2eef84,_0x43da65,_0x273660){var _0xc56e7b={'raw':!![],'where':{}};var _0x5a7bd4={};var _0x1b9f25={'count':0x0,'rows':[]};return db['Campaign'][_0x915f('0x5c')]({'where':{'id':_0x2eef84[_0x915f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x43da65,null))[_0x915f('0x28')](function(_0x1481e4){if(_0x1481e4){_0x5a7bd4['model']=_['keys'](db[_0x915f('0x5d')][_0x915f('0x33')]);_0x5a7bd4[_0x915f('0x38')]=_[_0x915f('0x37')](_0x2eef84[_0x915f('0x38')]);_0x5a7bd4[_0x915f('0x39')]=_['intersection'](_0x5a7bd4[_0x915f('0x36')],_0x5a7bd4[_0x915f('0x38')]);_0xc56e7b['attributes']=_['intersection'](_0x5a7bd4[_0x915f('0x36')],qs['fields'](_0x2eef84[_0x915f('0x38')][_0x915f('0x3c')]));_0xc56e7b[_0x915f('0x3b')]=_0xc56e7b[_0x915f('0x3b')][_0x915f('0x3d')]?_0xc56e7b[_0x915f('0x3b')]:_0x5a7bd4['model'];if(!_0x2eef84[_0x915f('0x38')][_0x915f('0x5e')](_0x915f('0x3e'))){_0xc56e7b[_0x915f('0x1f')]=qs['limit'](_0x2eef84[_0x915f('0x38')][_0x915f('0x1f')]);_0xc56e7b[_0x915f('0x1e')]=qs[_0x915f('0x1e')](_0x2eef84['query']['offset']);}_0xc56e7b[_0x915f('0x5f')]=qs[_0x915f('0x3f')](_0x2eef84[_0x915f('0x38')][_0x915f('0x3f')]);_0xc56e7b[_0x915f('0x40')]=qs[_0x915f('0x39')](_[_0x915f('0x41')](_0x2eef84['query'],_0x5a7bd4[_0x915f('0x39')]));_0xc56e7b[_0x915f('0x40')][_0x915f('0x60')]=_0x1481e4['id'];if(_0x2eef84[_0x915f('0x38')][_0x915f('0x61')]){_0xc56e7b[_0x915f('0x40')]=_[_0x915f('0x42')](_0xc56e7b[_0x915f('0x40')],{'$or':_[_0x915f('0x31')](_0xc56e7b[_0x915f('0x3b')],function(_0x31cf3e){var _0x217646={};_0x217646[_0x31cf3e]={'$like':'%'+_0x2eef84[_0x915f('0x38')]['filter']+'%'};return _0x217646;})});}_0xc56e7b=_[_0x915f('0x42')]({},_0xc56e7b,_0x2eef84[_0x915f('0x44')]);return db[_0x915f('0x5d')][_0x915f('0x21')]({'where':_0xc56e7b[_0x915f('0x40')]})[_0x915f('0x28')](function(_0x5a9c96){_0x1b9f25[_0x915f('0x21')]=_0x5a9c96;if(_0x2eef84[_0x915f('0x38')]['includeAll']){_0xc56e7b['include']=[{'all':!![]}];}return db[_0x915f('0x5d')][_0x915f('0x62')](_0xc56e7b);})[_0x915f('0x28')](function(_0x1f0093){_0x1b9f25['rows']=_0x1f0093;return _0x1b9f25;});}})['then'](respondWithFilteredResult(_0x43da65,_0xc56e7b))[_0x915f('0x48')](handleError(_0x43da65,null));};exports[_0x915f('0x63')]=function(_0x4749c4,_0x557169,_0xc3c58f){var _0x13c868={'raw':!![],'where':{}};var _0x3f200f={};var _0x403670={'count':0x0,'rows':[]};return db['Campaign'][_0x915f('0x5c')]({'where':{'id':_0x4749c4[_0x915f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x557169,null))['then'](function(_0x4ab31d){if(_0x4ab31d){_0x3f200f[_0x915f('0x36')]=_[_0x915f('0x37')](db[_0x915f('0x64')][_0x915f('0x33')]);_0x3f200f['query']=_[_0x915f('0x37')](_0x4749c4[_0x915f('0x38')]);_0x3f200f[_0x915f('0x39')]=_['intersection'](_0x3f200f[_0x915f('0x36')],_0x3f200f['query']);_0x13c868[_0x915f('0x3b')]=_[_0x915f('0x3a')](_0x3f200f['model'],qs[_0x915f('0x3c')](_0x4749c4['query']['fields']));_0x13c868[_0x915f('0x3b')]=_0x13c868[_0x915f('0x3b')]['length']?_0x13c868[_0x915f('0x3b')]:_0x3f200f[_0x915f('0x36')];if(!_0x4749c4['query'][_0x915f('0x5e')](_0x915f('0x3e'))){_0x13c868[_0x915f('0x1f')]=qs[_0x915f('0x1f')](_0x4749c4[_0x915f('0x38')][_0x915f('0x1f')]);_0x13c868['offset']=qs[_0x915f('0x1e')](_0x4749c4[_0x915f('0x38')][_0x915f('0x1e')]);}_0x13c868[_0x915f('0x5f')]=qs['sort'](_0x4749c4['query'][_0x915f('0x3f')]);_0x13c868[_0x915f('0x40')]=qs[_0x915f('0x39')](_[_0x915f('0x41')](_0x4749c4[_0x915f('0x38')],_0x3f200f[_0x915f('0x39')]));_0x13c868[_0x915f('0x40')][_0x915f('0x60')]=_0x4ab31d['id'];if(_0x4749c4[_0x915f('0x38')]['filter']){_0x13c868[_0x915f('0x40')]=_[_0x915f('0x42')](_0x13c868[_0x915f('0x40')],{'$or':_[_0x915f('0x31')](_0x13c868[_0x915f('0x3b')],function(_0x193b1a){var _0x3ac1c0={};_0x3ac1c0[_0x193b1a]={'$like':'%'+_0x4749c4[_0x915f('0x38')]['filter']+'%'};return _0x3ac1c0;})});}_0x13c868=_['merge']({},_0x13c868,_0x4749c4['options']);return db[_0x915f('0x64')][_0x915f('0x21')]({'where':_0x13c868[_0x915f('0x40')]})['then'](function(_0x2829f9){_0x403670[_0x915f('0x21')]=_0x2829f9;if(_0x4749c4[_0x915f('0x38')][_0x915f('0x45')]){_0x13c868[_0x915f('0x46')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x13c868);})[_0x915f('0x28')](function(_0x54eaec){_0x403670[_0x915f('0x47')]=_0x54eaec;return _0x403670;});}})[_0x915f('0x28')](respondWithFilteredResult(_0x557169,_0x13c868))[_0x915f('0x48')](handleError(_0x557169,null));};exports['getHopperFinals']=function(_0x1bfbef,_0x58e793,_0x556207){var _0x55ce1d={'raw':!![],'where':{}};var _0x132c25={};var _0x55a329={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1bfbef[_0x915f('0x4a')]['id']}})[_0x915f('0x28')](handleEntityNotFound(_0x58e793,null))[_0x915f('0x28')](function(_0x2d38e0){if(_0x2d38e0){_0x132c25[_0x915f('0x36')]=_[_0x915f('0x37')](db[_0x915f('0x65')][_0x915f('0x33')]);_0x132c25[_0x915f('0x38')]=_[_0x915f('0x37')](_0x1bfbef[_0x915f('0x38')]);_0x132c25[_0x915f('0x39')]=_['intersection'](_0x132c25[_0x915f('0x36')],_0x132c25[_0x915f('0x38')]);_0x55ce1d[_0x915f('0x3b')]=_[_0x915f('0x3a')](_0x132c25[_0x915f('0x36')],qs[_0x915f('0x3c')](_0x1bfbef['query'][_0x915f('0x3c')]));_0x55ce1d[_0x915f('0x3b')]=_0x55ce1d['attributes']['length']?_0x55ce1d[_0x915f('0x3b')]:_0x132c25[_0x915f('0x36')];if(!_0x1bfbef[_0x915f('0x38')]['hasOwnProperty'](_0x915f('0x3e'))){_0x55ce1d[_0x915f('0x1f')]=qs[_0x915f('0x1f')](_0x1bfbef[_0x915f('0x38')][_0x915f('0x1f')]);_0x55ce1d[_0x915f('0x1e')]=qs[_0x915f('0x1e')](_0x1bfbef[_0x915f('0x38')]['offset']);}_0x55ce1d[_0x915f('0x5f')]=qs['sort'](_0x1bfbef[_0x915f('0x38')]['sort']);_0x55ce1d[_0x915f('0x40')]=qs[_0x915f('0x39')](_[_0x915f('0x41')](_0x1bfbef[_0x915f('0x38')],_0x132c25['filters']));_0x55ce1d['where'][_0x915f('0x60')]=_0x2d38e0['id'];if(_0x1bfbef[_0x915f('0x38')]['filter']){_0x55ce1d[_0x915f('0x40')]=_['merge'](_0x55ce1d[_0x915f('0x40')],{'$or':_['map'](_0x55ce1d[_0x915f('0x3b')],function(_0x5f3d66){var _0x3c2e40={};_0x3c2e40[_0x5f3d66]={'$like':'%'+_0x1bfbef[_0x915f('0x38')][_0x915f('0x61')]+'%'};return _0x3c2e40;})});}_0x55ce1d=_[_0x915f('0x42')]({},_0x55ce1d,_0x1bfbef[_0x915f('0x44')]);return db['CmHopperFinal'][_0x915f('0x21')]({'where':_0x55ce1d[_0x915f('0x40')]})[_0x915f('0x28')](function(_0x56718a){_0x55a329[_0x915f('0x21')]=_0x56718a;if(_0x1bfbef['query']['includeAll']){_0x55ce1d[_0x915f('0x46')]=[{'all':!![]}];}return db[_0x915f('0x65')][_0x915f('0x62')](_0x55ce1d);})[_0x915f('0x28')](function(_0x245da2){_0x55a329[_0x915f('0x47')]=_0x245da2;return _0x55a329;});}})[_0x915f('0x28')](respondWithFilteredResult(_0x58e793,_0x55ce1d))['catch'](handleError(_0x58e793,null));};exports[_0x915f('0x66')]=function(_0x409c45,_0x2a210d,_0x1adbad){var _0x5df74e={'raw':!![],'where':{}};var _0x1e1dad={};var _0x5b678b={'count':0x0,'rows':[]};return db[_0x915f('0x32')][_0x915f('0x5c')]({'where':{'id':_0x409c45[_0x915f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2a210d,null))['then'](function(_0x2364d9){if(_0x2364d9){_0x1e1dad['model']=_[_0x915f('0x37')](db[_0x915f('0x67')][_0x915f('0x33')]);_0x1e1dad[_0x915f('0x38')]=_[_0x915f('0x37')](_0x409c45[_0x915f('0x38')]);_0x1e1dad[_0x915f('0x39')]=_[_0x915f('0x3a')](_0x1e1dad[_0x915f('0x36')],_0x1e1dad[_0x915f('0x38')]);_0x5df74e['attributes']=_['intersection'](_0x1e1dad['model'],qs['fields'](_0x409c45[_0x915f('0x38')]['fields']));_0x5df74e[_0x915f('0x3b')]=_0x5df74e[_0x915f('0x3b')][_0x915f('0x3d')]?_0x5df74e[_0x915f('0x3b')]:_0x1e1dad[_0x915f('0x36')];if(!_0x409c45[_0x915f('0x38')][_0x915f('0x5e')]('nolimit')){_0x5df74e[_0x915f('0x1f')]=qs[_0x915f('0x1f')](_0x409c45[_0x915f('0x38')][_0x915f('0x1f')]);_0x5df74e[_0x915f('0x1e')]=qs['offset'](_0x409c45[_0x915f('0x38')]['offset']);}_0x5df74e[_0x915f('0x5f')]=qs[_0x915f('0x3f')](_0x409c45['query'][_0x915f('0x3f')]);_0x5df74e[_0x915f('0x40')]=qs[_0x915f('0x39')](_[_0x915f('0x41')](_0x409c45['query'],_0x1e1dad[_0x915f('0x39')]));_0x5df74e[_0x915f('0x40')][_0x915f('0x60')]=_0x2364d9['id'];if(_0x409c45[_0x915f('0x38')]['filter']){_0x5df74e[_0x915f('0x40')]=_[_0x915f('0x42')](_0x5df74e['where'],{'$or':_['map'](_0x5df74e['attributes'],function(_0xd2f34f){var _0x132bc2={};_0x132bc2[_0xd2f34f]={'$like':'%'+_0x409c45[_0x915f('0x38')]['filter']+'%'};return _0x132bc2;})});}_0x5df74e=_[_0x915f('0x42')]({},_0x5df74e,_0x409c45[_0x915f('0x44')]);return db[_0x915f('0x67')][_0x915f('0x21')]({'where':_0x5df74e[_0x915f('0x40')]})[_0x915f('0x28')](function(_0x481e6d){_0x5b678b[_0x915f('0x21')]=_0x481e6d;if(_0x409c45[_0x915f('0x38')]['includeAll']){_0x5df74e[_0x915f('0x46')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x915f('0x62')](_0x5df74e);})['then'](function(_0x1a4763){_0x5b678b[_0x915f('0x47')]=_0x1a4763;return _0x5b678b;});}})[_0x915f('0x28')](respondWithFilteredResult(_0x2a210d,_0x5df74e))['catch'](handleError(_0x2a210d,null));};exports[_0x915f('0x68')]=function(_0x2380b6,_0x2ffa64,_0x338262){var _0x4c08a6={};var _0x1c1906={};var _0xed7df2;var _0x2310aa;return db[_0x915f('0x32')][_0x915f('0x5c')]({'where':{'id':_0x2380b6['params']['id']}})[_0x915f('0x28')](handleEntityNotFound(_0x2ffa64,null))['then'](function(_0xd14085){if(_0xd14085){_0xed7df2=_0xd14085;_0x1c1906[_0x915f('0x36')]=_['keys'](db[_0x915f('0x69')][_0x915f('0x33')]);_0x1c1906[_0x915f('0x38')]=_[_0x915f('0x37')](_0x2380b6[_0x915f('0x38')]);_0x1c1906[_0x915f('0x39')]=_['intersection'](_0x1c1906[_0x915f('0x36')],_0x1c1906['query']);_0x4c08a6['attributes']=_[_0x915f('0x3a')](_0x1c1906['model'],qs[_0x915f('0x3c')](_0x2380b6[_0x915f('0x38')][_0x915f('0x3c')]));_0x4c08a6[_0x915f('0x3b')]=_0x4c08a6[_0x915f('0x3b')][_0x915f('0x3d')]?_0x4c08a6[_0x915f('0x3b')]:_0x1c1906['model'];_0x4c08a6['order']=qs['sort'](_0x2380b6['query']['sort']);_0x4c08a6['where']=qs[_0x915f('0x39')](_[_0x915f('0x41')](_0x2380b6[_0x915f('0x38')],_0x1c1906['filters']));if(_0x2380b6['query'][_0x915f('0x61')]){_0x4c08a6[_0x915f('0x40')]=_['merge'](_0x4c08a6[_0x915f('0x40')],{'$or':_[_0x915f('0x31')](_0x4c08a6[_0x915f('0x3b')],function(_0x29f063){var _0x21043e={};_0x21043e[_0x29f063]={'$like':'%'+_0x2380b6[_0x915f('0x38')][_0x915f('0x61')]+'%'};return _0x21043e;})});}_0x4c08a6=_[_0x915f('0x42')]({},_0x4c08a6,_0x2380b6[_0x915f('0x44')]);return _0xed7df2[_0x915f('0x68')](_0x4c08a6);}})[_0x915f('0x28')](function(_0x3aefb0){if(_0x3aefb0){_0x2310aa=_0x3aefb0[_0x915f('0x3d')];if(!_0x2380b6[_0x915f('0x38')][_0x915f('0x5e')]('nolimit')){_0x4c08a6[_0x915f('0x1f')]=qs[_0x915f('0x1f')](_0x2380b6[_0x915f('0x38')][_0x915f('0x1f')]);_0x4c08a6[_0x915f('0x1e')]=qs[_0x915f('0x1e')](_0x2380b6['query']['offset']);}return _0xed7df2[_0x915f('0x68')](_0x4c08a6);}})[_0x915f('0x28')](function(_0x2dda1a){if(_0x2dda1a){return _0x2dda1a?{'count':_0x2310aa,'rows':_0x2dda1a}:null;}})[_0x915f('0x28')](respondWithResult(_0x2ffa64,null))[_0x915f('0x48')](handleError(_0x2ffa64,null));};exports[_0x915f('0x6a')]=function(_0x4f85de,_0x932613,_0x45078b){var _0x5b7496,_0xee1403;var _0xdcb422=[];var _0x5aed6f=moment()[_0x915f('0x6b')](_0x915f('0x6c'));return db[_0x915f('0x32')]['find']({'where':{'id':_0x4f85de[_0x915f('0x4a')]['id']}})[_0x915f('0x28')](handleEntityNotFound(_0x932613,null))[_0x915f('0x28')](function(_0x37d698){if(_0x37d698){_0xee1403=_0x37d698;return _0x37d698[_0x915f('0x6a')](_0x4f85de['body'][_0x915f('0x6d')],_[_0x915f('0x58')](_0x4f85de[_0x915f('0x4d')],[_0x915f('0x6d'),'id'])||{});}return null;})[_0x915f('0x6e')](function(_0x4cb21b){var _0x4ef740;var _0x2b49fb;_0x5b7496=_0x4cb21b||[];var _0x55c5b1=[];if(_0x4cb21b){for(var _0x427957=0x0;_0x427957<_0x4cb21b[_0x915f('0x3d')];_0x427957+=0x1){var _0x5ce0c0=_0x4cb21b[_0x427957][_0x915f('0x29')]({'plain':!![]});_0xee1403[_0x915f('0x6f')]=_0x4f85de['body'][_0x915f('0x6f')]?_0x4f85de[_0x915f('0x4d')]['dialCheckDuplicateType']:_0xee1403[_0x915f('0x6f')];switch(_0xee1403['dialCheckDuplicateType']){case _0x915f('0x70'):_0x4ef740=squel[_0x915f('0x71')]()[_0x915f('0x72')]('cm_hopper')[_0x915f('0x73')]([_0x915f('0x74'),'scheduledAt',_0x915f('0x75'),_0x915f('0x76'),'CampaignId',_0x915f('0x57'),_0x915f('0x59')],squel['select']()[_0x915f('0x77')]('phone',_0x915f('0x74'))[_0x915f('0x77')](_0x915f('0x78'),'scheduledAt')['field']('id','ContactId')[_0x915f('0x77')](_0x5ce0c0[_0x915f('0x79')][_0x915f('0x7a')](),'ListId')[_0x915f('0x77')](_0x4f85de[_0x915f('0x4a')]['id'][_0x915f('0x7a')](),_0x915f('0x60'))[_0x915f('0x77')]('\x27'+_0x5aed6f+'\x27','createdAt')[_0x915f('0x77')]('\x27'+_0x5aed6f+'\x27',_0x915f('0x59'))['from'](_0x915f('0x7b'))[_0x915f('0x40')](_0x915f('0x7c'))[_0x915f('0x40')](_0x915f('0x7d'),_0x5ce0c0[_0x915f('0x79')][_0x915f('0x7a')]())[_0x915f('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x915f('0x40')](_0x915f('0x7e'),squel[_0x915f('0x7f')]()[_0x915f('0x77')]('COALESCE(calleridnum,\x27\x27)')[_0x915f('0x80')](_0x915f('0x81'))[_0x915f('0x40')](_0x915f('0x82'),_0x4f85de[_0x915f('0x4a')]['id'][_0x915f('0x7a')]()))[_0x915f('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x915f('0x7f')]()['field']('COALESCE(phone,\x27\x27)')[_0x915f('0x80')]('cm_hopper')['where'](_0x915f('0x82'),_0x4f85de[_0x915f('0x4a')]['id'][_0x915f('0x7a')]())))[_0x915f('0x7a')]();break;case _0x915f('0x83'):_0x4ef740=squel[_0x915f('0x71')]()[_0x915f('0x72')](_0x915f('0x84'))['fromQuery']([_0x915f('0x74'),_0x915f('0x85'),'ContactId',_0x915f('0x76'),_0x915f('0x60'),'createdAt','updatedAt'],squel[_0x915f('0x7f')]()[_0x915f('0x77')](_0x915f('0x74'),_0x915f('0x74'))[_0x915f('0x77')](_0x915f('0x78'),_0x915f('0x85'))[_0x915f('0x77')]('id',_0x915f('0x75'))[_0x915f('0x77')](_0x5ce0c0['CmListId'][_0x915f('0x7a')](),_0x915f('0x76'))[_0x915f('0x77')](_0x4f85de[_0x915f('0x4a')]['id']['toString'](),_0x915f('0x60'))['field']('\x27'+_0x5aed6f+'\x27',_0x915f('0x57'))[_0x915f('0x77')]('\x27'+_0x5aed6f+'\x27',_0x915f('0x59'))[_0x915f('0x80')](_0x915f('0x7b'))[_0x915f('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0x915f('0x7d'),_0x5ce0c0[_0x915f('0x79')][_0x915f('0x7a')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x915f('0x40')](_0x915f('0x7e'),squel[_0x915f('0x7f')]()[_0x915f('0x77')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x915f('0x40')]('CampaignId\x20=\x20?',_0x4f85de[_0x915f('0x4a')]['id'][_0x915f('0x7a')]())))[_0x915f('0x7a')]();break;default:_0x4ef740=squel['insert']()[_0x915f('0x72')]('cm_hopper')[_0x915f('0x73')]([_0x915f('0x74'),'scheduledAt',_0x915f('0x75'),'ListId',_0x915f('0x60'),_0x915f('0x57'),'updatedAt'],squel[_0x915f('0x7f')]()[_0x915f('0x77')]('phone','phone')[_0x915f('0x77')](_0x915f('0x78'),'scheduledAt')[_0x915f('0x77')]('id',_0x915f('0x75'))[_0x915f('0x77')](_0x5ce0c0[_0x915f('0x79')]['toString'](),_0x915f('0x76'))[_0x915f('0x77')](_0x4f85de[_0x915f('0x4a')]['id'][_0x915f('0x7a')](),_0x915f('0x60'))[_0x915f('0x77')]('\x27'+_0x5aed6f+'\x27','createdAt')[_0x915f('0x77')]('\x27'+_0x5aed6f+'\x27',_0x915f('0x59'))[_0x915f('0x80')](_0x915f('0x7b'))[_0x915f('0x40')](_0x915f('0x7c'))['where'](_0x915f('0x7d'),_0x5ce0c0['CmListId'][_0x915f('0x7a')]())[_0x915f('0x40')](_0x915f('0x86')))['toString']();}_0x2b49fb=squel[_0x915f('0x71')]()[_0x915f('0x72')]('cm_hopper_additional_phones')[_0x915f('0x73')]([_0x915f('0x87'),_0x915f('0x85'),_0x915f('0x74'),_0x915f('0x88'),'createdAt',_0x915f('0x59')],squel[_0x915f('0x7f')]()[_0x915f('0x77')]('h.id','id')[_0x915f('0x77')](_0x915f('0x78'),_0x915f('0x85'))[_0x915f('0x77')]('ci.item',_0x915f('0x74'))[_0x915f('0x77')](_0x915f('0x89'),_0x915f('0x88'))[_0x915f('0x77')]('\x27'+_0x5aed6f+'\x27',_0x915f('0x57'))[_0x915f('0x77')]('\x27'+_0x5aed6f+'\x27','updatedAt')[_0x915f('0x80')]('cm_contact_has_items','ci')[_0x915f('0x8a')](_0x915f('0x84'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x915f('0x40')](_0x915f('0x8b'),_0x5ce0c0[_0x915f('0x79')][_0x915f('0x7a')]())[_0x915f('0x40')]('h.CampaignId=?',_0x4f85de[_0x915f('0x4a')]['id']['toString']())['where'](_0x915f('0x8c'),_0x5aed6f))[_0x915f('0x7a')]();_0x55c5b1['push'](db[_0x915f('0x8d')][_0x915f('0x38')](_0x4ef740));_0xdcb422[_0x915f('0x8e')](db[_0x915f('0x8d')][_0x915f('0x38')](_0x2b49fb));}return BPromise['all'](_0x55c5b1);}})[_0x915f('0x28')](function(){return BPromise[_0x915f('0x8f')](_0xdcb422);})[_0x915f('0x28')](function(){return _0x5b7496;})[_0x915f('0x28')](respondWithResult(_0x932613,null))[_0x915f('0x48')](handleError(_0x932613,null));};exports[_0x915f('0x90')]=function(_0x42939c,_0x446307,_0x2fb922){return db[_0x915f('0x32')]['find']({'where':{'id':_0x42939c[_0x915f('0x4a')]['id']}})[_0x915f('0x28')](handleEntityNotFound(_0x446307,null))[_0x915f('0x28')](function(_0x501154){if(_0x501154){return _0x501154[_0x915f('0x90')](_0x42939c[_0x915f('0x38')]['ids']);}})['then'](function(_0x3c2473){if(_0x3c2473){return db[_0x915f('0x5d')][_0x915f('0x5a')]({'where':{'ListId':_0x42939c[_0x915f('0x38')][_0x915f('0x6d')],'CampaignId':_0x42939c[_0x915f('0x4a')]['id']}})[_0x915f('0x28')](function(){return _0x3c2473;});}})[_0x915f('0x28')](respondWithStatusCode(_0x446307,null))[_0x915f('0x48')](handleError(_0x446307,null));};exports[_0x915f('0x91')]=function(_0x522828,_0x27fdbd,_0x519bf7){var _0xbdd9ec={};var _0xc5950c={};var _0x500829;var _0x36d61d;return db[_0x915f('0x32')][_0x915f('0x5c')]({'where':{'id':_0x522828[_0x915f('0x4a')]['id']}})[_0x915f('0x28')](handleEntityNotFound(_0x27fdbd,null))[_0x915f('0x28')](function(_0x1048b1){if(_0x1048b1){_0x500829=_0x1048b1;_0xc5950c[_0x915f('0x36')]=_[_0x915f('0x37')](db['CmList'][_0x915f('0x33')]);_0xc5950c[_0x915f('0x38')]=_[_0x915f('0x37')](_0x522828['query']);_0xc5950c[_0x915f('0x39')]=_[_0x915f('0x3a')](_0xc5950c[_0x915f('0x36')],_0xc5950c['query']);_0xbdd9ec[_0x915f('0x3b')]=_[_0x915f('0x3a')](_0xc5950c[_0x915f('0x36')],qs[_0x915f('0x3c')](_0x522828[_0x915f('0x38')][_0x915f('0x3c')]));_0xbdd9ec[_0x915f('0x3b')]=_0xbdd9ec['attributes']['length']?_0xbdd9ec[_0x915f('0x3b')]:_0xc5950c[_0x915f('0x36')];_0xbdd9ec[_0x915f('0x5f')]=qs[_0x915f('0x3f')](_0x522828['query'][_0x915f('0x3f')]);_0xbdd9ec[_0x915f('0x40')]=qs[_0x915f('0x39')](_[_0x915f('0x41')](_0x522828['query'],_0xc5950c[_0x915f('0x39')]));if(_0x522828['query'][_0x915f('0x61')]){_0xbdd9ec['where']=_[_0x915f('0x42')](_0xbdd9ec[_0x915f('0x40')],{'$or':_[_0x915f('0x31')](_0xbdd9ec[_0x915f('0x3b')],function(_0x44eeef){var _0x2527d8={};_0x2527d8[_0x44eeef]={'$like':'%'+_0x522828[_0x915f('0x38')][_0x915f('0x61')]+'%'};return _0x2527d8;})});}_0xbdd9ec=_[_0x915f('0x42')]({},_0xbdd9ec,_0x522828[_0x915f('0x44')]);return _0x500829[_0x915f('0x91')](_0xbdd9ec);}})[_0x915f('0x28')](function(_0x973ec9){if(_0x973ec9){_0x36d61d=_0x973ec9[_0x915f('0x3d')];if(!_0x522828['query']['hasOwnProperty']('nolimit')){_0xbdd9ec[_0x915f('0x1f')]=qs['limit'](_0x522828['query'][_0x915f('0x1f')]);_0xbdd9ec['offset']=qs[_0x915f('0x1e')](_0x522828[_0x915f('0x38')]['offset']);}return _0x500829[_0x915f('0x91')](_0xbdd9ec);}})[_0x915f('0x28')](function(_0x20928d){if(_0x20928d){return _0x20928d?{'count':_0x36d61d,'rows':_0x20928d}:null;}})[_0x915f('0x28')](respondWithResult(_0x27fdbd,null))[_0x915f('0x48')](handleError(_0x27fdbd,null));};exports[_0x915f('0x92')]=function(_0x791b5e,_0x3df3c2,_0x386017){var _0x155b6d,_0x4428e1;var _0x4acce3=[];var _0xb8c9ed=moment()[_0x915f('0x6b')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x915f('0x4b')]({'where':{'id':_0x791b5e[_0x915f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3df3c2,null))[_0x915f('0x28')](function(_0x2130ca){if(_0x2130ca){_0x4428e1=_0x2130ca;return _0x2130ca[_0x915f('0x92')](_0x791b5e[_0x915f('0x4d')][_0x915f('0x6d')],_[_0x915f('0x58')](_0x791b5e[_0x915f('0x4d')],[_0x915f('0x6d'),'id'])||{});}return null;})[_0x915f('0x6e')](function(_0x24ffb1){var _0x4733cf;var _0x14f3f3;_0x155b6d=_0x24ffb1||[];var _0xb9d645=[];if(_0x24ffb1){for(var _0x240753=0x0;_0x240753<_0x24ffb1[_0x915f('0x3d')];_0x240753+=0x1){var _0x21a228=_0x24ffb1[_0x240753]['get']({'plain':!![]});_0x4733cf=squel[_0x915f('0x71')]()[_0x915f('0x72')](_0x915f('0x93'))[_0x915f('0x73')]([_0x915f('0x74'),_0x915f('0x75'),'ListId','CampaignId',_0x915f('0x57'),'updatedAt'],squel[_0x915f('0x7f')]()['field']('phone',_0x915f('0x74'))[_0x915f('0x77')]('id',_0x915f('0x75'))['field'](_0x21a228['CmListId']['toString'](),_0x915f('0x76'))[_0x915f('0x77')](_0x791b5e[_0x915f('0x4a')]['id']['toString'](),_0x915f('0x60'))[_0x915f('0x77')](_0x915f('0x78'),'createdAt')[_0x915f('0x77')](_0x915f('0x78'),_0x915f('0x59'))[_0x915f('0x80')](_0x915f('0x7b'))[_0x915f('0x40')](_0x915f('0x7c'))[_0x915f('0x40')](_0x915f('0x7d'),_0x21a228[_0x915f('0x79')][_0x915f('0x7a')]())[_0x915f('0x40')](_0x915f('0x86')))[_0x915f('0x7a')]();_0xb9d645[_0x915f('0x8e')](db[_0x915f('0x8d')][_0x915f('0x38')](_0x4733cf));}return BPromise[_0x915f('0x8f')](_0xb9d645);}})[_0x915f('0x28')](function(){return _0x155b6d;})[_0x915f('0x28')](respondWithResult(_0x3df3c2,null))[_0x915f('0x48')](handleError(_0x3df3c2,null));};exports[_0x915f('0x94')]=function(_0x2b7129,_0x5c8333,_0x194c2c){return db['Campaign'][_0x915f('0x4b')]({'where':{'id':_0x2b7129[_0x915f('0x4a')]['id']}})[_0x915f('0x28')](handleEntityNotFound(_0x5c8333,null))['then'](function(_0x267a98){if(_0x267a98){return _0x267a98[_0x915f('0x94')](_0x2b7129[_0x915f('0x38')][_0x915f('0x6d')]);}})[_0x915f('0x28')](function(_0x1fcbf8){if(_0x1fcbf8){return db[_0x915f('0x67')][_0x915f('0x5a')]({'where':{'ListId':_0x2b7129[_0x915f('0x38')]['ids'],'CampaignId':_0x2b7129[_0x915f('0x4a')]['id']}})['then'](function(){return _0x1fcbf8;});}})[_0x915f('0x28')](respondWithStatusCode(_0x5c8333,null))[_0x915f('0x48')](handleError(_0x5c8333,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 069c4c5..cbbd169 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 6cbac6e..3be3c61 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 _0x8d53=['Campaign','raw','options','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetCampaign'];(function(_0x11ede6,_0x3b50bc){var _0x1bfaf3=function(_0x5917ee){while(--_0x5917ee){_0x11ede6['push'](_0x11ede6['shift']());}};_0x1bfaf3(++_0x3b50bc);}(_0x8d53,0x1c2));var _0x38d5=function(_0x3f946b,_0xbd1ebe){_0x3f946b=_0x3f946b-0x0;var _0x2a2ea1=_0x8d53[_0x3f946b];return _0x2a2ea1;};'use strict';var _=require(_0x38d5('0x0'));var util=require(_0x38d5('0x1'));var moment=require('moment');var BPromise=require(_0x38d5('0x2'));var rs=require(_0x38d5('0x3'));var fs=require('fs');var Redis=require(_0x38d5('0x4'));var db=require(_0x38d5('0x5'))['db'];var utils=require(_0x38d5('0x6'));var logger=require(_0x38d5('0x7'))(_0x38d5('0x8'));var config=require(_0x38d5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38d5('0xa')][_0x38d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xeb7913,_0x5aa1ca,_0x5ebf9a){return new BPromise(function(_0x284f7b,_0x3883e0){return client[_0x38d5('0xc')](_0xeb7913,_0x5ebf9a)[_0x38d5('0xd')](function(_0x4e18c0){logger[_0x38d5('0xe')](_0x38d5('0xf'),_0x5aa1ca,'request\x20sent');logger[_0x38d5('0x10')](_0x38d5('0x11'),_0x5aa1ca,_0x38d5('0x12'),JSON[_0x38d5('0x13')](_0x4e18c0));if(_0x4e18c0['error']){if(_0x4e18c0['error'][_0x38d5('0x14')]===0x1f4){logger[_0x38d5('0x15')]('Campaign,\x20%s,\x20%s',_0x5aa1ca,_0x4e18c0[_0x38d5('0x15')]['message']);return _0x3883e0(_0x4e18c0[_0x38d5('0x15')][_0x38d5('0x16')]);}logger[_0x38d5('0x15')](_0x38d5('0xf'),_0x5aa1ca,_0x4e18c0[_0x38d5('0x15')][_0x38d5('0x16')]);return _0x284f7b(_0x4e18c0['error'][_0x38d5('0x16')]);}else{logger['info'](_0x38d5('0xf'),_0x5aa1ca,'request\x20sent');_0x284f7b(_0x4e18c0[_0x38d5('0x17')][_0x38d5('0x16')]);}})[_0x38d5('0x18')](function(_0x4e98df){logger[_0x38d5('0x15')](_0x38d5('0xf'),_0x5aa1ca,_0x4e98df);_0x3883e0(_0x4e98df);});});}exports[_0x38d5('0x19')]=function(_0xdc1374){var _0x2d1cd9=this;return new Promise(function(_0x380904,_0x519bb1){return db[_0x38d5('0x1a')]['findAll']({'raw':_0xdc1374['options']?_0xdc1374['options'][_0x38d5('0x1b')]===undefined?!![]:![]:!![],'where':_0xdc1374[_0x38d5('0x1c')]?_0xdc1374[_0x38d5('0x1c')]['where']||null:null,'attributes':_0xdc1374['options']?_0xdc1374[_0x38d5('0x1c')][_0x38d5('0x1d')]||null:null,'limit':_0xdc1374[_0x38d5('0x1c')]?_0xdc1374['options'][_0x38d5('0x1e')]||null:null,'include':_0xdc1374['options']?_0xdc1374[_0x38d5('0x1c')][_0x38d5('0x1f')]?_['map'](_0xdc1374['options'][_0x38d5('0x1f')],function(_0x4e1b5f){return{'model':db[_0x4e1b5f[_0x38d5('0x20')]],'as':_0x4e1b5f['as'],'attributes':_0x4e1b5f['attributes'],'include':_0x4e1b5f[_0x38d5('0x1f')]?_[_0x38d5('0x21')](_0x4e1b5f[_0x38d5('0x1f')],function(_0x5b9552){return{'model':db[_0x5b9552[_0x38d5('0x20')]],'as':_0x5b9552['as'],'attributes':_0x5b9552[_0x38d5('0x1d')],'include':_0x5b9552['include']?_[_0x38d5('0x21')](_0x5b9552[_0x38d5('0x1f')],function(_0x12d220){return{'model':db[_0x12d220[_0x38d5('0x20')]],'as':_0x12d220['as'],'attributes':_0x12d220[_0x38d5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x38d5('0xd')](function(_0xbe992b){logger[_0x38d5('0xe')](_0x38d5('0x19'),_0xdc1374);logger[_0x38d5('0x10')](_0x38d5('0x19'),_0xdc1374,JSON[_0x38d5('0x13')](_0xbe992b));_0x380904(_0xbe992b);})[_0x38d5('0x18')](function(_0x5dd0c1){logger['error']('GetCampaign',_0x5dd0c1[_0x38d5('0x16')],_0xdc1374);_0x519bb1(_0x2d1cd9[_0x38d5('0x15')](0x1f4,_0x5dd0c1['message']));});});};
\ No newline at end of file
+var _0x18a5=['../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','catch','lodash','util','randomstring','../../mysqldb'];(function(_0x2408d4,_0x137e4b){var _0x3fdac1=function(_0x32ea32){while(--_0x32ea32){_0x2408d4['push'](_0x2408d4['shift']());}};_0x3fdac1(++_0x137e4b);}(_0x18a5,0x164));var _0x518a=function(_0x3557ce,_0x6e74c9){_0x3557ce=_0x3557ce-0x0;var _0x3bcff7=_0x18a5[_0x3557ce];return _0x3bcff7;};'use strict';var _=require(_0x518a('0x0'));var util=require(_0x518a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x518a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x518a('0x3'))['db'];var utils=require(_0x518a('0x4'));var logger=require(_0x518a('0x5'))(_0x518a('0x6'));var config=require(_0x518a('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea311,_0x1d4199,_0x19a2df){return new BPromise(function(_0x2a5fa6,_0x8bd966){return client[_0x518a('0x8')](_0x2ea311,_0x19a2df)[_0x518a('0x9')](function(_0xb996c3){logger[_0x518a('0xa')](_0x518a('0xb'),_0x1d4199,_0x518a('0xc'));logger[_0x518a('0xd')](_0x518a('0xe'),_0x1d4199,_0x518a('0xc'),JSON[_0x518a('0xf')](_0xb996c3));if(_0xb996c3['error']){if(_0xb996c3[_0x518a('0x10')]['code']===0x1f4){logger[_0x518a('0x10')]('Campaign,\x20%s,\x20%s',_0x1d4199,_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);return _0x8bd966(_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);}logger[_0x518a('0x10')](_0x518a('0xb'),_0x1d4199,_0xb996c3[_0x518a('0x10')]['message']);return _0x2a5fa6(_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);}else{logger[_0x518a('0xa')]('Campaign,\x20%s,\x20%s',_0x1d4199,_0x518a('0xc'));_0x2a5fa6(_0xb996c3[_0x518a('0x12')]['message']);}})['catch'](function(_0x177882){logger['error'](_0x518a('0xb'),_0x1d4199,_0x177882);_0x8bd966(_0x177882);});});}exports[_0x518a('0x13')]=function(_0x244e66){var _0x336da8=this;return new Promise(function(_0xa5f6ac,_0x26330e){return db[_0x518a('0x14')][_0x518a('0x15')]({'raw':_0x244e66[_0x518a('0x16')]?_0x244e66[_0x518a('0x16')][_0x518a('0x17')]===undefined?!![]:![]:!![],'where':_0x244e66[_0x518a('0x16')]?_0x244e66[_0x518a('0x16')]['where']||null:null,'attributes':_0x244e66[_0x518a('0x16')]?_0x244e66['options'][_0x518a('0x18')]||null:null,'limit':_0x244e66['options']?_0x244e66[_0x518a('0x16')][_0x518a('0x19')]||null:null,'include':_0x244e66[_0x518a('0x16')]?_0x244e66[_0x518a('0x16')][_0x518a('0x1a')]?_[_0x518a('0x1b')](_0x244e66['options']['include'],function(_0x590fc2){return{'model':db[_0x590fc2[_0x518a('0x1c')]],'as':_0x590fc2['as'],'attributes':_0x590fc2['attributes'],'include':_0x590fc2[_0x518a('0x1a')]?_[_0x518a('0x1b')](_0x590fc2[_0x518a('0x1a')],function(_0x941f58){return{'model':db[_0x941f58[_0x518a('0x1c')]],'as':_0x941f58['as'],'attributes':_0x941f58[_0x518a('0x18')],'include':_0x941f58[_0x518a('0x1a')]?_[_0x518a('0x1b')](_0x941f58[_0x518a('0x1a')],function(_0x262260){return{'model':db[_0x262260[_0x518a('0x1c')]],'as':_0x262260['as'],'attributes':_0x262260[_0x518a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x518a('0x9')](function(_0x3eadb2){logger['info']('GetCampaign',_0x244e66);logger['debug'](_0x518a('0x13'),_0x244e66,JSON[_0x518a('0xf')](_0x3eadb2));_0xa5f6ac(_0x3eadb2);})[_0x518a('0x1d')](function(_0x4cf043){logger['error'](_0x518a('0x13'),_0x4cf043['message'],_0x244e66);_0x26330e(_0x336da8['error'](0x1f4,_0x4cf043[_0x518a('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 55663b6..39d7504 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 _0x675e=['removeBlackLists','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','update','destroy','delete','removeLists'];(function(_0x1400d1,_0x4213c8){var _0x44c4b9=function(_0x57a3fd){while(--_0x57a3fd){_0x1400d1['push'](_0x1400d1['shift']());}};_0x44c4b9(++_0x4213c8);}(_0x675e,0xc1));var _0xe675=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0x675e[_0x13f980];return _0x27153c;};'use strict';var multer=require(_0xe675('0x0'));var util=require(_0xe675('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe675('0x2'));var router=express[_0xe675('0x3')]();var fs_extra=require(_0xe675('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe675('0x5'));var config=require(_0xe675('0x6'));var controller=require('./campaign.controller');router[_0xe675('0x7')]('/',auth[_0xe675('0x8')](),controller[_0xe675('0x9')]);router[_0xe675('0x7')]('/:id',auth[_0xe675('0x8')](),controller[_0xe675('0xa')]);router[_0xe675('0x7')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0xe675('0xb')]);router[_0xe675('0x7')](_0xe675('0xc'),auth['isAuthenticated'](),controller[_0xe675('0xd')]);router[_0xe675('0x7')](_0xe675('0xe'),auth[_0xe675('0x8')](),controller[_0xe675('0xf')]);router['get'](_0xe675('0x10'),auth[_0xe675('0x8')](),controller[_0xe675('0x11')]);router['get'](_0xe675('0x12'),auth['isAuthenticated'](),controller['getLists']);router[_0xe675('0x7')](_0xe675('0x13'),auth['isAuthenticated'](),controller[_0xe675('0x14')]);router[_0xe675('0x15')]('/',auth[_0xe675('0x8')](),controller[_0xe675('0x16')]);router['post'](_0xe675('0x17'),auth[_0xe675('0x8')](),controller[_0xe675('0x18')]);router['post'](_0xe675('0x12'),auth[_0xe675('0x8')](),controller[_0xe675('0x19')]);router[_0xe675('0x15')](_0xe675('0x13'),auth[_0xe675('0x8')](),controller['addBlackLists']);router[_0xe675('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xe675('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe675('0x1c')]);router[_0xe675('0x1d')](_0xe675('0x12'),auth[_0xe675('0x8')](),controller[_0xe675('0x1e')]);router[_0xe675('0x1d')]('/:id/blacklists',auth[_0xe675('0x8')](),controller[_0xe675('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0x11db=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id'];(function(_0x50a889,_0x2a32f9){var _0x3ff87f=function(_0x2de24b){while(--_0x2de24b){_0x50a889['push'](_0x50a889['shift']());}};_0x3ff87f(++_0x2a32f9);}(_0x11db,0x146));var _0xb11d=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x11db[_0x12f688];return _0x59c3de;};'use strict';var multer=require(_0xb11d('0x0'));var util=require(_0xb11d('0x1'));var path=require(_0xb11d('0x2'));var timeout=require(_0xb11d('0x3'));var express=require(_0xb11d('0x4'));var router=express['Router']();var fs_extra=require(_0xb11d('0x5'));var auth=require(_0xb11d('0x6'));var interaction=require(_0xb11d('0x7'));var config=require(_0xb11d('0x8'));var controller=require(_0xb11d('0x9'));router[_0xb11d('0xa')]('/',auth[_0xb11d('0xb')](),controller[_0xb11d('0xc')]);router[_0xb11d('0xa')](_0xb11d('0xd'),auth['isAuthenticated'](),controller[_0xb11d('0xe')]);router[_0xb11d('0xa')](_0xb11d('0xf'),auth['isAuthenticated'](),controller[_0xb11d('0x10')]);router[_0xb11d('0xa')](_0xb11d('0x11'),auth[_0xb11d('0xb')](),controller[_0xb11d('0x12')]);router[_0xb11d('0xa')]('/:id/hopper_finals',auth[_0xb11d('0xb')](),controller['getHopperFinals']);router[_0xb11d('0xa')]('/:id/hopper_black',auth[_0xb11d('0xb')](),controller[_0xb11d('0x13')]);router[_0xb11d('0xa')](_0xb11d('0x14'),auth['isAuthenticated'](),controller[_0xb11d('0x15')]);router[_0xb11d('0xa')](_0xb11d('0x16'),auth[_0xb11d('0xb')](),controller[_0xb11d('0x17')]);router[_0xb11d('0x18')]('/',auth[_0xb11d('0xb')](),controller[_0xb11d('0x19')]);router['post'](_0xb11d('0x1a'),auth['isAuthenticated'](),controller[_0xb11d('0x1b')]);router[_0xb11d('0x18')]('/:id/lists',auth[_0xb11d('0xb')](),controller[_0xb11d('0x1c')]);router[_0xb11d('0x18')](_0xb11d('0x16'),auth[_0xb11d('0xb')](),controller[_0xb11d('0x1d')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb11d('0x1e')]);router[_0xb11d('0x1f')](_0xb11d('0xd'),auth[_0xb11d('0xb')](),controller[_0xb11d('0x20')]);router[_0xb11d('0x1f')](_0xb11d('0x14'),auth[_0xb11d('0xb')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0xb11d('0xb')](),controller['removeBlackLists']);module[_0xb11d('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 1d1d770..e303ea6 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 _0x2ead=['getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0xba8470,_0x127be1){var _0x146695=function(_0x158ffa){while(--_0x158ffa){_0xba8470['push'](_0xba8470['shift']());}};_0x146695(++_0x127be1);}(_0x2ead,0xbc));var _0xd2ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ead[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd2ea('0x0'));module[_0xd2ea('0x1')]={'key':{'type':Sequelize[_0xd2ea('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xd2ea('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xd2ea('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd2ea('0x4')](_0xd2ea('0x5'));}}};
\ No newline at end of file
+var _0x0f12=['exports','STRING','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x0f12,0xd1));var _0x20f1=function(_0x53e85e,_0x3f9f42){_0x53e85e=_0x53e85e-0x0;var _0xf2f1e2=_0x0f12[_0x53e85e];return _0xf2f1e2;};'use strict';var Sequelize=require(_0x20f1('0x0'));module[_0x20f1('0x1')]={'key':{'type':Sequelize[_0x20f1('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x20f1('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x20f1('0x2')]},'name':{'type':Sequelize[_0x20f1('0x4')],'get':function(){return this[_0x20f1('0x5')](_0x20f1('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index a62a20e..234796d 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 _0x8761=['key','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','catch','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x8761,0xcf));var _0x1876=function(_0x4ea6a7,_0x723b3a){_0x4ea6a7=_0x4ea6a7-0x0;var _0x4b7a1c=_0x8761[_0x4ea6a7];return _0x4b7a1c;};'use strict';var emlformat=require(_0x1876('0x0'));var rimraf=require(_0x1876('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1876('0x2'));var moment=require('moment');var BPromise=require(_0x1876('0x3'));var Mustache=require(_0x1876('0x4'));var util=require(_0x1876('0x5'));var path=require(_0x1876('0x6'));var sox=require(_0x1876('0x7'));var csv=require(_0x1876('0x8'));var ejs=require(_0x1876('0x9'));var fs=require('fs');var fs_extra=require(_0x1876('0xa'));var _=require('lodash');var squel=require(_0x1876('0xb'));var crypto=require(_0x1876('0xc'));var jsforce=require(_0x1876('0xd'));var deskjs=require(_0x1876('0xe'));var toCsv=require(_0x1876('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1876('0xf'));var authService=require(_0x1876('0x10'));var qs=require(_0x1876('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1876('0x12'));var logger=require(_0x1876('0x13'))(_0x1876('0x14'));var utils=require('../../config/utils');var config=require(_0x1876('0x15'));var licenseUtil=require(_0x1876('0x16'));var db=require(_0x1876('0x17'))['db'];function respondWithStatusCode(_0x298922,_0xb61084){_0xb61084=_0xb61084||0xcc;return function(_0xb593f){if(_0xb593f){return _0x298922[_0x1876('0x18')](_0xb61084);}return _0x298922[_0x1876('0x19')](_0xb61084)[_0x1876('0x1a')]();};}function respondWithResult(_0x52b2f8,_0x570765){_0x570765=_0x570765||0xc8;return function(_0x17c9cd){if(_0x17c9cd){return _0x52b2f8[_0x1876('0x19')](_0x570765)[_0x1876('0x1b')](_0x17c9cd);}};}function respondWithFilteredResult(_0x2a5d6a,_0x177203){return function(_0x385801){if(_0x385801){var _0x54db50=typeof _0x177203[_0x1876('0x1c')]===_0x1876('0x1d')&&typeof _0x177203['limit']==='undefined';var _0x4f9e91=_0x385801[_0x1876('0x1e')];var _0x56f593=_0x54db50?0x0:_0x177203[_0x1876('0x1c')];var _0x2e4e0f=_0x54db50?_0x385801[_0x1876('0x1e')]:_0x177203[_0x1876('0x1c')]+_0x177203[_0x1876('0x1f')];var _0x3a5389;if(_0x2e4e0f>=_0x4f9e91){_0x2e4e0f=_0x4f9e91;_0x3a5389=0xc8;}else{_0x3a5389=0xce;}_0x2a5d6a[_0x1876('0x19')](_0x3a5389);return _0x2a5d6a[_0x1876('0x20')](_0x1876('0x21'),_0x56f593+'-'+_0x2e4e0f+'/'+_0x4f9e91)[_0x1876('0x1b')](_0x385801);}return null;};}function patchUpdates(_0x5b93df){return function(_0x526e11){try{jsonpatch['apply'](_0x526e11,_0x5b93df,!![]);}catch(_0x3ce141){return BPromise[_0x1876('0x22')](_0x3ce141);}return _0x526e11[_0x1876('0x23')]();};}function saveUpdates(_0x14f821,_0x485639){return function(_0x5bd78a){if(_0x5bd78a){return _0x5bd78a[_0x1876('0x24')](_0x14f821)[_0x1876('0x25')](function(_0x1cb258){return _0x1cb258;});}return null;};}function removeEntity(_0x17fc7e,_0x3ecb78){return function(_0x20c392){if(_0x20c392){return _0x20c392[_0x1876('0x26')]()['then'](function(){var _0x2e958c=_0x20c392[_0x1876('0x27')]({'plain':!![]});var _0xba6f39=_0x1876('0x28');return db[_0x1876('0x29')]['destroy']({'where':{'type':_0xba6f39,'resourceId':_0x2e958c['id']}})[_0x1876('0x25')](function(){return _0x20c392;});})[_0x1876('0x25')](function(){_0x17fc7e[_0x1876('0x19')](0xcc)[_0x1876('0x1a')]();});}};}function handleEntityNotFound(_0x25f365,_0x3f4ba3){return function(_0x4a84a3){if(!_0x4a84a3){_0x25f365['sendStatus'](0x194);}return _0x4a84a3;};}function handleError(_0x228c26,_0x51e894){_0x51e894=_0x51e894||0x1f4;return function(_0x180772){logger[_0x1876('0x2a')](_0x180772[_0x1876('0x2b')]);if(_0x180772[_0x1876('0x2c')]){delete _0x180772[_0x1876('0x2c')];}_0x228c26[_0x1876('0x19')](_0x51e894)[_0x1876('0x2d')](_0x180772);};}exports['index']=function(_0x2314e9,_0xbb572b){var _0x4fd074={},_0x2eb0cd={},_0x460638={'count':0x0,'rows':[]};var _0x5ac4fb=_[_0x1876('0x2e')](db[_0x1876('0x2f')][_0x1876('0x30')],function(_0x123d4b){return{'name':_0x123d4b[_0x1876('0x31')],'type':_0x123d4b[_0x1876('0x32')][_0x1876('0x33')]};});_0x2eb0cd['model']=_[_0x1876('0x2e')](_0x5ac4fb,'name');_0x2eb0cd[_0x1876('0x34')]=_[_0x1876('0x35')](_0x2314e9[_0x1876('0x34')]);_0x2eb0cd['filters']=_[_0x1876('0x36')](_0x2eb0cd['model'],_0x2eb0cd['query']);_0x4fd074[_0x1876('0x37')]=_[_0x1876('0x36')](_0x2eb0cd[_0x1876('0x38')],qs[_0x1876('0x39')](_0x2314e9['query'][_0x1876('0x39')]));_0x4fd074[_0x1876('0x37')]=_0x4fd074['attributes'][_0x1876('0x3a')]?_0x4fd074['attributes']:_0x2eb0cd[_0x1876('0x38')];if(!_0x2314e9['query']['hasOwnProperty'](_0x1876('0x3b'))){_0x4fd074[_0x1876('0x1f')]=qs[_0x1876('0x1f')](_0x2314e9[_0x1876('0x34')][_0x1876('0x1f')]);_0x4fd074[_0x1876('0x1c')]=qs[_0x1876('0x1c')](_0x2314e9[_0x1876('0x34')][_0x1876('0x1c')]);}_0x4fd074[_0x1876('0x3c')]=qs[_0x1876('0x3d')](_0x2314e9[_0x1876('0x34')][_0x1876('0x3d')]);_0x4fd074[_0x1876('0x3e')]=qs[_0x1876('0x3f')](_[_0x1876('0x40')](_0x2314e9[_0x1876('0x34')],_0x2eb0cd[_0x1876('0x3f')]),_0x5ac4fb);if(_0x2314e9[_0x1876('0x34')][_0x1876('0x41')]){_0x4fd074[_0x1876('0x3e')]=_[_0x1876('0x42')](_0x4fd074[_0x1876('0x3e')],{'$or':[{'key':{'$like':'%'+_0x2314e9[_0x1876('0x34')][_0x1876('0x41')]+'%'}},{'value':{'$like':'%'+_0x2314e9[_0x1876('0x34')][_0x1876('0x41')]+'%'}}]});}_0x4fd074=_[_0x1876('0x42')]({},_0x4fd074,_0x2314e9[_0x1876('0x43')]);var _0x63c981={'where':_0x4fd074[_0x1876('0x3e')]};return db[_0x1876('0x2f')][_0x1876('0x1e')](_0x63c981)['then'](function(_0x5ad688){_0x460638[_0x1876('0x1e')]=_0x5ad688;if(_0x2314e9['query'][_0x1876('0x44')]){_0x4fd074['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4fd074);})[_0x1876('0x25')](function(_0x56b3ea){_0x460638['rows']=_0x56b3ea;return _0x460638;})[_0x1876('0x25')](respondWithFilteredResult(_0xbb572b,_0x4fd074))[_0x1876('0x45')](handleError(_0xbb572b,null));};exports['show']=function(_0x3a86d4,_0x5a6e65){var _0x1afb97={'raw':!![],'where':{'id':_0x3a86d4[_0x1876('0x46')]['id']}},_0x3c1d19={};_0x3c1d19[_0x1876('0x38')]=_['keys'](db['CannedAnswer'][_0x1876('0x30')]);_0x3c1d19['query']=_['keys'](_0x3a86d4['query']);_0x3c1d19['filters']=_[_0x1876('0x36')](_0x3c1d19['model'],_0x3c1d19['query']);_0x1afb97[_0x1876('0x37')]=_[_0x1876('0x36')](_0x3c1d19[_0x1876('0x38')],qs[_0x1876('0x39')](_0x3a86d4[_0x1876('0x34')]['fields']));_0x1afb97[_0x1876('0x37')]=_0x1afb97['attributes']['length']?_0x1afb97[_0x1876('0x37')]:_0x3c1d19[_0x1876('0x38')];if(_0x3a86d4[_0x1876('0x34')]['includeAll']){_0x1afb97[_0x1876('0x47')]=[{'all':!![]}];}_0x1afb97=_[_0x1876('0x42')]({},_0x1afb97,_0x3a86d4['options']);return db[_0x1876('0x2f')][_0x1876('0x48')](_0x1afb97)[_0x1876('0x25')](handleEntityNotFound(_0x5a6e65,null))[_0x1876('0x25')](respondWithResult(_0x5a6e65,null))[_0x1876('0x45')](handleError(_0x5a6e65,null));};exports[_0x1876('0x24')]=function(_0x2e4a51,_0x3203c7){if(_0x2e4a51[_0x1876('0x49')]['id']){delete _0x2e4a51[_0x1876('0x49')]['id'];}return db[_0x1876('0x2f')][_0x1876('0x48')]({'where':{'id':_0x2e4a51[_0x1876('0x46')]['id']}})[_0x1876('0x25')](handleEntityNotFound(_0x3203c7,null))[_0x1876('0x25')](saveUpdates(_0x2e4a51[_0x1876('0x49')],null))[_0x1876('0x25')](respondWithResult(_0x3203c7,null))[_0x1876('0x45')](handleError(_0x3203c7,null));};exports[_0x1876('0x26')]=function(_0x50b526,_0x190ee4){return db[_0x1876('0x2f')][_0x1876('0x48')]({'where':{'id':_0x50b526[_0x1876('0x46')]['id']}})['then'](handleEntityNotFound(_0x190ee4,null))['then'](removeEntity(_0x190ee4,null))[_0x1876('0x45')](handleError(_0x190ee4,null));};exports[_0x1876('0x4a')]=function(_0x3faf5b,_0x32614a){var _0x53ee7a={'key':_0x3faf5b['body'][_0x1876('0x33')]};if(_0x3faf5b[_0x1876('0x49')]['MailAccountId']){_0x53ee7a[_0x1876('0x4b')]=_0x3faf5b[_0x1876('0x49')]['MailAccountId'];}else if(_0x3faf5b['body']['SmsAccountId']){_0x53ee7a[_0x1876('0x4c')]=_0x3faf5b['body']['SmsAccountId'];}else if(_0x3faf5b[_0x1876('0x49')][_0x1876('0x4d')]){_0x53ee7a['OpenchannelAccountId']=_0x3faf5b[_0x1876('0x49')][_0x1876('0x4d')];}else if(_0x3faf5b[_0x1876('0x49')]['ChatWebsiteId']){_0x53ee7a[_0x1876('0x4e')]=_0x3faf5b[_0x1876('0x49')][_0x1876('0x4e')];}return db[_0x1876('0x2f')][_0x1876('0x48')]({'where':_0x53ee7a})[_0x1876('0x25')](function(_0x1a7a9a){if(_0x1a7a9a){throw new db['Sequelize'][(_0x1876('0x4f'))](_0x1876('0x50'));}return db['CannedAnswer'][_0x1876('0x4a')](_0x3faf5b['body']);})[_0x1876('0x25')](function(_0x404194){var _0x4dd0e5=_0x3faf5b[_0x1876('0x51')]['get']({'plain':!![]});if(!_0x4dd0e5)throw new Error(_0x1876('0x52'));if(_0x4dd0e5['role']===_0x1876('0x51')){var _0x2882c4=_0x404194['get']({'plain':!![]});return db['UserProfileSection'][_0x1876('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x4dd0e5[_0x1876('0x53')]},'raw':!![]})[_0x1876('0x25')](function(_0x1a5f37){if(_0x1a5f37&&_0x1a5f37[_0x1876('0x54')]===0x0){return db['UserProfileResource'][_0x1876('0x4a')]({'name':_0x2882c4[_0x1876('0x2c')],'resourceId':_0x2882c4['id'],'type':_0x1a5f37[_0x1876('0x2c')],'sectionId':_0x1a5f37['id']},{})['then'](function(){return _0x404194;});}else{return _0x404194;}})[_0x1876('0x45')](function(_0x4873ee){logger[_0x1876('0x2a')](_0x1876('0x55'),_0x4873ee);throw _0x4873ee;});}return _0x404194;})[_0x1876('0x25')](respondWithResult(_0x32614a,0xc9))[_0x1876('0x45')](handleError(_0x32614a,null));};
\ No newline at end of file
+var _0xcd0c=['../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','keys','rawAttributes','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x1c1804,_0x58de42){var _0x13df22=function(_0x427ee6){while(--_0x427ee6){_0x1c1804['push'](_0x1c1804['shift']());}};_0x13df22(++_0x58de42);}(_0xcd0c,0x1aa));var _0xccd0=function(_0xe9c8e4,_0x3aa2f6){_0xe9c8e4=_0xe9c8e4-0x0;var _0x2037fa=_0xcd0c[_0xe9c8e4];return _0x2037fa;};'use strict';var emlformat=require(_0xccd0('0x0'));var rimraf=require(_0xccd0('0x1'));var zipdir=require(_0xccd0('0x2'));var jsonpatch=require(_0xccd0('0x3'));var rp=require('request-promise');var moment=require(_0xccd0('0x4'));var BPromise=require(_0xccd0('0x5'));var Mustache=require(_0xccd0('0x6'));var util=require(_0xccd0('0x7'));var path=require('path');var sox=require(_0xccd0('0x8'));var csv=require('to-csv');var ejs=require(_0xccd0('0x9'));var fs=require('fs');var fs_extra=require(_0xccd0('0xa'));var _=require(_0xccd0('0xb'));var squel=require(_0xccd0('0xc'));var crypto=require('crypto');var jsforce=require(_0xccd0('0xd'));var deskjs=require(_0xccd0('0xe'));var toCsv=require(_0xccd0('0xf'));var querystring=require(_0xccd0('0x10'));var Papa=require('papaparse');var Redis=require(_0xccd0('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xccd0('0x12'));var hardwareService=require(_0xccd0('0x13'));var logger=require(_0xccd0('0x14'))(_0xccd0('0x15'));var utils=require(_0xccd0('0x16'));var config=require(_0xccd0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xccd0('0x18'))['db'];function respondWithStatusCode(_0x5861b6,_0x29644a){_0x29644a=_0x29644a||0xcc;return function(_0x268c84){if(_0x268c84){return _0x5861b6['sendStatus'](_0x29644a);}return _0x5861b6[_0xccd0('0x19')](_0x29644a)[_0xccd0('0x1a')]();};}function respondWithResult(_0x52af9f,_0x270856){_0x270856=_0x270856||0xc8;return function(_0x570e23){if(_0x570e23){return _0x52af9f[_0xccd0('0x19')](_0x270856)[_0xccd0('0x1b')](_0x570e23);}};}function respondWithFilteredResult(_0x4ea865,_0x3448aa){return function(_0x1b10f4){if(_0x1b10f4){var _0x5e1eda=typeof _0x3448aa['offset']===_0xccd0('0x1c')&&typeof _0x3448aa[_0xccd0('0x1d')]===_0xccd0('0x1c');var _0xaed907=_0x1b10f4[_0xccd0('0x1e')];var _0x4f5804=_0x5e1eda?0x0:_0x3448aa['offset'];var _0x3cc938=_0x5e1eda?_0x1b10f4['count']:_0x3448aa[_0xccd0('0x1f')]+_0x3448aa['limit'];var _0x443df5;if(_0x3cc938>=_0xaed907){_0x3cc938=_0xaed907;_0x443df5=0xc8;}else{_0x443df5=0xce;}_0x4ea865[_0xccd0('0x19')](_0x443df5);return _0x4ea865[_0xccd0('0x20')](_0xccd0('0x21'),_0x4f5804+'-'+_0x3cc938+'/'+_0xaed907)['json'](_0x1b10f4);}return null;};}function patchUpdates(_0x1f485b){return function(_0x22fb21){try{jsonpatch['apply'](_0x22fb21,_0x1f485b,!![]);}catch(_0x34f571){return BPromise[_0xccd0('0x22')](_0x34f571);}return _0x22fb21[_0xccd0('0x23')]();};}function saveUpdates(_0x53b40f,_0x47b524){return function(_0x379feb){if(_0x379feb){return _0x379feb[_0xccd0('0x24')](_0x53b40f)[_0xccd0('0x25')](function(_0x3b9194){return _0x3b9194;});}return null;};}function removeEntity(_0x41bc85,_0x225a5d){return function(_0x44ba85){if(_0x44ba85){return _0x44ba85[_0xccd0('0x26')]()[_0xccd0('0x25')](function(){var _0x9579=_0x44ba85[_0xccd0('0x27')]({'plain':!![]});var _0x4671de=_0xccd0('0x28');return db[_0xccd0('0x29')][_0xccd0('0x26')]({'where':{'type':_0x4671de,'resourceId':_0x9579['id']}})[_0xccd0('0x25')](function(){return _0x44ba85;});})['then'](function(){_0x41bc85[_0xccd0('0x19')](0xcc)[_0xccd0('0x1a')]();});}};}function handleEntityNotFound(_0x3fdf49,_0xba71f2){return function(_0x328523){if(!_0x328523){_0x3fdf49[_0xccd0('0x2a')](0x194);}return _0x328523;};}function handleError(_0x584efd,_0x5c40b1){_0x5c40b1=_0x5c40b1||0x1f4;return function(_0x36cde0){logger[_0xccd0('0x2b')](_0x36cde0[_0xccd0('0x2c')]);if(_0x36cde0[_0xccd0('0x2d')]){delete _0x36cde0[_0xccd0('0x2d')];}_0x584efd['status'](_0x5c40b1)[_0xccd0('0x2e')](_0x36cde0);};}exports[_0xccd0('0x2f')]=function(_0x200b83,_0x171294){var _0xf2c2b9={},_0x56282c={},_0x2cfce5={'count':0x0,'rows':[]};var _0x4c2cf8=_[_0xccd0('0x30')](db['CannedAnswer']['rawAttributes'],function(_0x59df45){return{'name':_0x59df45[_0xccd0('0x31')],'type':_0x59df45[_0xccd0('0x32')][_0xccd0('0x33')]};});_0x56282c[_0xccd0('0x34')]=_[_0xccd0('0x30')](_0x4c2cf8,_0xccd0('0x2d'));_0x56282c[_0xccd0('0x35')]=_['keys'](_0x200b83[_0xccd0('0x35')]);_0x56282c['filters']=_[_0xccd0('0x36')](_0x56282c[_0xccd0('0x34')],_0x56282c[_0xccd0('0x35')]);_0xf2c2b9[_0xccd0('0x37')]=_['intersection'](_0x56282c[_0xccd0('0x34')],qs['fields'](_0x200b83[_0xccd0('0x35')][_0xccd0('0x38')]));_0xf2c2b9[_0xccd0('0x37')]=_0xf2c2b9['attributes'][_0xccd0('0x39')]?_0xf2c2b9[_0xccd0('0x37')]:_0x56282c[_0xccd0('0x34')];if(!_0x200b83[_0xccd0('0x35')]['hasOwnProperty'](_0xccd0('0x3a'))){_0xf2c2b9['limit']=qs['limit'](_0x200b83['query'][_0xccd0('0x1d')]);_0xf2c2b9['offset']=qs[_0xccd0('0x1f')](_0x200b83[_0xccd0('0x35')][_0xccd0('0x1f')]);}_0xf2c2b9[_0xccd0('0x3b')]=qs[_0xccd0('0x3c')](_0x200b83[_0xccd0('0x35')][_0xccd0('0x3c')]);_0xf2c2b9[_0xccd0('0x3d')]=qs[_0xccd0('0x3e')](_[_0xccd0('0x3f')](_0x200b83[_0xccd0('0x35')],_0x56282c[_0xccd0('0x3e')]),_0x4c2cf8);if(_0x200b83[_0xccd0('0x35')][_0xccd0('0x40')]){_0xf2c2b9[_0xccd0('0x3d')]=_[_0xccd0('0x41')](_0xf2c2b9[_0xccd0('0x3d')],{'$or':[{'key':{'$like':'%'+_0x200b83[_0xccd0('0x35')][_0xccd0('0x40')]+'%'}},{'value':{'$like':'%'+_0x200b83[_0xccd0('0x35')]['filter']+'%'}}]});}_0xf2c2b9=_[_0xccd0('0x41')]({},_0xf2c2b9,_0x200b83[_0xccd0('0x42')]);var _0x128cc0={'where':_0xf2c2b9[_0xccd0('0x3d')]};return db[_0xccd0('0x43')][_0xccd0('0x1e')](_0x128cc0)['then'](function(_0x50f0d2){_0x2cfce5[_0xccd0('0x1e')]=_0x50f0d2;if(_0x200b83[_0xccd0('0x35')][_0xccd0('0x44')]){_0xf2c2b9[_0xccd0('0x45')]=[{'all':!![]}];}return db['CannedAnswer'][_0xccd0('0x46')](_0xf2c2b9);})['then'](function(_0x4768df){_0x2cfce5[_0xccd0('0x47')]=_0x4768df;return _0x2cfce5;})[_0xccd0('0x25')](respondWithFilteredResult(_0x171294,_0xf2c2b9))[_0xccd0('0x48')](handleError(_0x171294,null));};exports['show']=function(_0x4dde38,_0x1dc91c){var _0x1f6387={'raw':!![],'where':{'id':_0x4dde38['params']['id']}},_0x2a035f={};_0x2a035f[_0xccd0('0x34')]=_[_0xccd0('0x49')](db['CannedAnswer'][_0xccd0('0x4a')]);_0x2a035f[_0xccd0('0x35')]=_['keys'](_0x4dde38[_0xccd0('0x35')]);_0x2a035f[_0xccd0('0x3e')]=_[_0xccd0('0x36')](_0x2a035f[_0xccd0('0x34')],_0x2a035f[_0xccd0('0x35')]);_0x1f6387[_0xccd0('0x37')]=_['intersection'](_0x2a035f[_0xccd0('0x34')],qs['fields'](_0x4dde38[_0xccd0('0x35')]['fields']));_0x1f6387[_0xccd0('0x37')]=_0x1f6387[_0xccd0('0x37')][_0xccd0('0x39')]?_0x1f6387[_0xccd0('0x37')]:_0x2a035f[_0xccd0('0x34')];if(_0x4dde38[_0xccd0('0x35')][_0xccd0('0x44')]){_0x1f6387['include']=[{'all':!![]}];}_0x1f6387=_[_0xccd0('0x41')]({},_0x1f6387,_0x4dde38['options']);return db[_0xccd0('0x43')][_0xccd0('0x4b')](_0x1f6387)[_0xccd0('0x25')](handleEntityNotFound(_0x1dc91c,null))[_0xccd0('0x25')](respondWithResult(_0x1dc91c,null))[_0xccd0('0x48')](handleError(_0x1dc91c,null));};exports[_0xccd0('0x24')]=function(_0x2369c2,_0xbdeb45){if(_0x2369c2[_0xccd0('0x4c')]['id']){delete _0x2369c2[_0xccd0('0x4c')]['id'];}return db[_0xccd0('0x43')][_0xccd0('0x4b')]({'where':{'id':_0x2369c2[_0xccd0('0x4d')]['id']}})['then'](handleEntityNotFound(_0xbdeb45,null))[_0xccd0('0x25')](saveUpdates(_0x2369c2[_0xccd0('0x4c')],null))[_0xccd0('0x25')](respondWithResult(_0xbdeb45,null))[_0xccd0('0x48')](handleError(_0xbdeb45,null));};exports[_0xccd0('0x26')]=function(_0x2fa3f8,_0x56de5f){return db['CannedAnswer']['find']({'where':{'id':_0x2fa3f8[_0xccd0('0x4d')]['id']}})[_0xccd0('0x25')](handleEntityNotFound(_0x56de5f,null))[_0xccd0('0x25')](removeEntity(_0x56de5f,null))['catch'](handleError(_0x56de5f,null));};exports[_0xccd0('0x4e')]=function(_0x193b21,_0x2ffaf){var _0x23e644={'key':_0x193b21['body'][_0xccd0('0x33')]};if(_0x193b21[_0xccd0('0x4c')]['MailAccountId']){_0x23e644[_0xccd0('0x4f')]=_0x193b21[_0xccd0('0x4c')][_0xccd0('0x4f')];}else if(_0x193b21[_0xccd0('0x4c')][_0xccd0('0x50')]){_0x23e644[_0xccd0('0x50')]=_0x193b21['body'][_0xccd0('0x50')];}else if(_0x193b21[_0xccd0('0x4c')][_0xccd0('0x51')]){_0x23e644['OpenchannelAccountId']=_0x193b21[_0xccd0('0x4c')][_0xccd0('0x51')];}else if(_0x193b21['body'][_0xccd0('0x52')]){_0x23e644['ChatWebsiteId']=_0x193b21[_0xccd0('0x4c')]['ChatWebsiteId'];}return db[_0xccd0('0x43')][_0xccd0('0x4b')]({'where':_0x23e644})['then'](function(_0x2b0ebf){if(_0x2b0ebf){throw new db[(_0xccd0('0x53'))][(_0xccd0('0x54'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xccd0('0x43')][_0xccd0('0x4e')](_0x193b21[_0xccd0('0x4c')]);})[_0xccd0('0x25')](function(_0x43eb1c){var _0x495d8d=_0x193b21['user'][_0xccd0('0x27')]({'plain':!![]});if(!_0x495d8d)throw new Error(_0xccd0('0x55'));if(_0x495d8d[_0xccd0('0x56')]===_0xccd0('0x57')){var _0x998d26=_0x43eb1c[_0xccd0('0x27')]({'plain':!![]});return db[_0xccd0('0x58')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x495d8d[_0xccd0('0x59')]},'raw':!![]})[_0xccd0('0x25')](function(_0x42f0b7){if(_0x42f0b7&&_0x42f0b7['autoAssociation']===0x0){return db['UserProfileResource'][_0xccd0('0x4e')]({'name':_0x998d26[_0xccd0('0x2d')],'resourceId':_0x998d26['id'],'type':_0x42f0b7[_0xccd0('0x2d')],'sectionId':_0x42f0b7['id']},{})[_0xccd0('0x25')](function(){return _0x43eb1c;});}else{return _0x43eb1c;}})['catch'](function(_0x5405fc){logger[_0xccd0('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5405fc);throw _0x5405fc;});}return _0x43eb1c;})[_0xccd0('0x25')](respondWithResult(_0x2ffaf,0xc9))[_0xccd0('0x48')](handleError(_0x2ffaf,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index b3e6c00..c970a1f 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 _0x8bc6=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x227fc1,_0x51e5b8){var _0x24b7ee=function(_0xda33bb){while(--_0xda33bb){_0x227fc1['push'](_0x227fc1['shift']());}};_0x24b7ee(++_0x51e5b8);}(_0x8bc6,0x137));var _0x68bc=function(_0x2f9eeb,_0x53b0b6){_0x2f9eeb=_0x2f9eeb-0x0;var _0xcf83bc=_0x8bc6[_0x2f9eeb];return _0xcf83bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x68bc('0x0'));var moment=require(_0x68bc('0x1'));var BPromise=require(_0x68bc('0x2'));var rp=require(_0x68bc('0x3'));var fs=require('fs');var path=require(_0x68bc('0x4'));var rimraf=require(_0x68bc('0x5'));var config=require(_0x68bc('0x6'));var attributes=require(_0x68bc('0x7'));module[_0x68bc('0x8')]=function(_0x504bbb,_0x5113f1){return _0x504bbb[_0x68bc('0x9')](_0x68bc('0xa'),attributes,{'tableName':_0x68bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x68bc('0xc'),'collate':_0x68bc('0xd')});};
\ No newline at end of file
+var _0x5423=['util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','utf8mb4_unicode_ci','lodash'];(function(_0x4f24d6,_0x3573bb){var _0x9a09a1=function(_0x3b48ff){while(--_0x3b48ff){_0x4f24d6['push'](_0x4f24d6['shift']());}};_0x9a09a1(++_0x3573bb);}(_0x5423,0xe3));var _0x3542=function(_0x4b7917,_0x55d679){_0x4b7917=_0x4b7917-0x0;var _0x28fc5b=_0x5423[_0x4b7917];return _0x28fc5b;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var logger=require('../../config/logger')(_0x3542('0x2'));var moment=require(_0x3542('0x3'));var BPromise=require('bluebird');var rp=require(_0x3542('0x4'));var fs=require('fs');var path=require(_0x3542('0x5'));var rimraf=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x3542('0x8')]=function(_0x2d2ae9,_0x15ee3b){return _0x2d2ae9[_0x3542('0x9')](_0x3542('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3542('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index b610668..09185f1 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(_0x559136,_0x4a4494){var _0x4750f7=function(_0x3c6aba){while(--_0x3c6aba){_0x559136['push'](_0x559136['shift']());}};_0x4750f7(++_0x4a4494);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x55a1c6,_0xd4e324){var _0x569af0=function(_0x260fa8){while(--_0x260fa8){_0x55a1c6['push'](_0x55a1c6['shift']());}};_0x569af0(++_0xd4e324);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 fcd20dd..fc8eb78 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 _0xde4c=['post','create','put','update','delete','exports','multer','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','index','get','/:id','isAuthenticated','show'];(function(_0x586500,_0x9b000a){var _0x1b7b14=function(_0x2b8ed8){while(--_0x2b8ed8){_0x586500['push'](_0x586500['shift']());}};_0x1b7b14(++_0x9b000a);}(_0xde4c,0x1e2));var _0xcde4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde4c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcde4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcde4('0x1'));var router=express[_0xcde4('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcde4('0x3'));var config=require(_0xcde4('0x4'));var controller=require(_0xcde4('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xcde4('0x6')]);router[_0xcde4('0x7')](_0xcde4('0x8'),auth[_0xcde4('0x9')](),controller[_0xcde4('0xa')]);router[_0xcde4('0xb')]('/',auth[_0xcde4('0x9')](),controller[_0xcde4('0xc')]);router[_0xcde4('0xd')](_0xcde4('0x8'),auth[_0xcde4('0x9')](),controller[_0xcde4('0xe')]);router[_0xcde4('0xf')](_0xcde4('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xcde4('0x10')]=router;
\ No newline at end of file
+var _0xff84=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','post','put','update','delete','multer'];(function(_0x36ee63,_0x54f46d){var _0x27e9bc=function(_0x5bf89b){while(--_0x5bf89b){_0x36ee63['push'](_0x36ee63['shift']());}};_0x27e9bc(++_0x54f46d);}(_0xff84,0x167));var _0x4ff8=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xff84[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x4ff8('0x0'));var util=require(_0x4ff8('0x1'));var path=require(_0x4ff8('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ff8('0x3'));var router=express[_0x4ff8('0x4')]();var fs_extra=require(_0x4ff8('0x5'));var auth=require(_0x4ff8('0x6'));var interaction=require(_0x4ff8('0x7'));var config=require(_0x4ff8('0x8'));var controller=require(_0x4ff8('0x9'));router[_0x4ff8('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4ff8('0xa')](_0x4ff8('0xb'),auth[_0x4ff8('0xc')](),controller[_0x4ff8('0xd')]);router[_0x4ff8('0xe')]('/',auth[_0x4ff8('0xc')](),controller['create']);router[_0x4ff8('0xf')](_0x4ff8('0xb'),auth['isAuthenticated'](),controller[_0x4ff8('0x10')]);router[_0x4ff8('0x11')](_0x4ff8('0xb'),auth[_0x4ff8('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 41e09ea..6ae4c05 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 _0x0834=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x0834,0x18e));var _0x4083=function(_0x46a808,_0x298b77){_0x46a808=_0x46a808-0x0;var _0x263a34=_0x0834[_0x46a808];return _0x263a34;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x4083('0x0')],'allowNull':![],'defaultValue':_0x4083('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x4083('0x2')]},'channel':{'type':Sequelize[_0x4083('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x4083('0x2')]},'lastdata':{'type':Sequelize[_0x4083('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4083('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x4083('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4083('0x2')]},'userfield':{'type':Sequelize[_0x4083('0x2')]},'uniqueid':{'type':Sequelize[_0x4083('0x2')]},'linkedid':{'type':Sequelize[_0x4083('0x2')]},'sequence':{'type':Sequelize[_0x4083('0x2')]},'peeraccount':{'type':Sequelize[_0x4083('0x2')]},'type':{'type':Sequelize[_0x4083('0x2')]},'tag':{'type':Sequelize[_0x4083('0x2')]}};
\ No newline at end of file
+var _0x6475=['STRING','INTEGER','sequelize','exports','DATE'];(function(_0x38037d,_0x414e99){var _0xc69f8=function(_0x50d820){while(--_0x50d820){_0x38037d['push'](_0x38037d['shift']());}};_0xc69f8(++_0x414e99);}(_0x6475,0x133));var _0x5647=function(_0x27e811,_0x1fad22){_0x27e811=_0x27e811-0x0;var _0x1bfe61=_0x6475[_0x27e811];return _0x1bfe61;};'use strict';var Sequelize=require(_0x5647('0x0'));module[_0x5647('0x1')]={'calldate':{'type':Sequelize[_0x5647('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x5647('0x3')]},'src':{'type':Sequelize[_0x5647('0x3')]},'dst':{'type':Sequelize[_0x5647('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5647('0x3')]},'dstchannel':{'type':Sequelize[_0x5647('0x3')]},'lastapp':{'type':Sequelize[_0x5647('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x5647('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5647('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x5647('0x3')]},'uniqueid':{'type':Sequelize[_0x5647('0x3')]},'linkedid':{'type':Sequelize[_0x5647('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5647('0x3')]},'tag':{'type':Sequelize[_0x5647('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index c688ae0..4985908 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 _0x3248=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','Cdr','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service'];(function(_0x40f50f,_0x49df69){var _0x5e82b8=function(_0x47120a){while(--_0x47120a){_0x40f50f['push'](_0x40f50f['shift']());}};_0x5e82b8(++_0x49df69);}(_0x3248,0x1b0));var _0x8324=function(_0x4d1938,_0x45460e){_0x4d1938=_0x4d1938-0x0;var _0x451946=_0x3248[_0x4d1938];return _0x451946;};'use strict';var emlformat=require(_0x8324('0x0'));var rimraf=require(_0x8324('0x1'));var zipdir=require(_0x8324('0x2'));var jsonpatch=require(_0x8324('0x3'));var rp=require(_0x8324('0x4'));var moment=require(_0x8324('0x5'));var BPromise=require(_0x8324('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8324('0x7'));var sox=require(_0x8324('0x8'));var csv=require('to-csv');var ejs=require(_0x8324('0x9'));var fs=require('fs');var fs_extra=require(_0x8324('0xa'));var _=require(_0x8324('0xb'));var squel=require(_0x8324('0xc'));var crypto=require(_0x8324('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8324('0xe'));var toCsv=require(_0x8324('0xf'));var querystring=require(_0x8324('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8324('0x11'));var qs=require(_0x8324('0x12'));var as=require(_0x8324('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8324('0x14'))(_0x8324('0x15'));var utils=require(_0x8324('0x16'));var config=require(_0x8324('0x17'));var licenseUtil=require(_0x8324('0x18'));var db=require(_0x8324('0x19'))['db'];function respondWithStatusCode(_0x4f000e,_0x59d3b1){_0x59d3b1=_0x59d3b1||0xcc;return function(_0x55e203){if(_0x55e203){return _0x4f000e[_0x8324('0x1a')](_0x59d3b1);}return _0x4f000e['status'](_0x59d3b1)['end']();};}function respondWithResult(_0x3bb793,_0xdd6c0e){_0xdd6c0e=_0xdd6c0e||0xc8;return function(_0x13131d){if(_0x13131d){return _0x3bb793['status'](_0xdd6c0e)[_0x8324('0x1b')](_0x13131d);}};}function respondWithFilteredResult(_0x1ab2eb,_0xb94f60){return function(_0x578c0d){if(_0x578c0d){var _0x297035=typeof _0xb94f60[_0x8324('0x1c')]===_0x8324('0x1d')&&typeof _0xb94f60[_0x8324('0x1e')]===_0x8324('0x1d');var _0x3f067c=_0x578c0d['count'];var _0x4ef97c=_0x297035?0x0:_0xb94f60[_0x8324('0x1c')];var _0x404d16=_0x297035?_0x578c0d[_0x8324('0x1f')]:_0xb94f60['offset']+_0xb94f60[_0x8324('0x1e')];var _0x19a888;if(_0x404d16>=_0x3f067c){_0x404d16=_0x3f067c;_0x19a888=0xc8;}else{_0x19a888=0xce;}_0x1ab2eb[_0x8324('0x20')](_0x19a888);return _0x1ab2eb[_0x8324('0x21')](_0x8324('0x22'),_0x4ef97c+'-'+_0x404d16+'/'+_0x3f067c)['json'](_0x578c0d);}return null;};}function patchUpdates(_0xbafbed){return function(_0x5e07b5){try{jsonpatch[_0x8324('0x23')](_0x5e07b5,_0xbafbed,!![]);}catch(_0x5aba37){return BPromise[_0x8324('0x24')](_0x5aba37);}return _0x5e07b5['save']();};}function saveUpdates(_0x71f390,_0xb31584){return function(_0xb248c6){if(_0xb248c6){return _0xb248c6[_0x8324('0x25')](_0x71f390)[_0x8324('0x26')](function(_0x354842){return _0x354842;});}return null;};}function removeEntity(_0x44042f,_0x10fc10){return function(_0x2f44f0){if(_0x2f44f0){return _0x2f44f0[_0x8324('0x27')]()[_0x8324('0x26')](function(){_0x44042f[_0x8324('0x20')](0xcc)[_0x8324('0x28')]();});}};}function handleEntityNotFound(_0x38a09a,_0x3904b0){return function(_0x1fd50e){if(!_0x1fd50e){_0x38a09a[_0x8324('0x1a')](0x194);}return _0x1fd50e;};}function handleError(_0x32510a,_0x3a94fe){_0x3a94fe=_0x3a94fe||0x1f4;return function(_0x2b77e4){logger[_0x8324('0x29')](_0x2b77e4[_0x8324('0x2a')]);if(_0x2b77e4[_0x8324('0x2b')]){delete _0x2b77e4[_0x8324('0x2b')];}_0x32510a[_0x8324('0x20')](_0x3a94fe)['send'](_0x2b77e4);};}exports[_0x8324('0x2c')]=function(_0x43e43d,_0x38cae6){var _0x17bda7={},_0x4ee093={},_0x2fda80={'count':0x0,'rows':[]};var _0x268345=_[_0x8324('0x2d')](db[_0x8324('0x2e')][_0x8324('0x2f')],function(_0x7dc4c9){return{'name':_0x7dc4c9[_0x8324('0x30')],'type':_0x7dc4c9['type'][_0x8324('0x31')]};});_0x4ee093[_0x8324('0x32')]=_[_0x8324('0x2d')](_0x268345,_0x8324('0x2b'));_0x4ee093[_0x8324('0x33')]=_[_0x8324('0x34')](_0x43e43d['query']);_0x4ee093[_0x8324('0x35')]=_[_0x8324('0x36')](_0x4ee093['model'],_0x4ee093[_0x8324('0x33')]);_0x17bda7[_0x8324('0x37')]=_[_0x8324('0x36')](_0x4ee093['model'],qs[_0x8324('0x38')](_0x43e43d[_0x8324('0x33')]['fields']));_0x17bda7['attributes']=_0x17bda7[_0x8324('0x37')][_0x8324('0x39')]?_0x17bda7[_0x8324('0x37')]:_0x4ee093['model'];if(!_0x43e43d['query']['hasOwnProperty'](_0x8324('0x3a'))){_0x17bda7[_0x8324('0x1e')]=qs[_0x8324('0x1e')](_0x43e43d[_0x8324('0x33')]['limit']);_0x17bda7[_0x8324('0x1c')]=qs[_0x8324('0x1c')](_0x43e43d[_0x8324('0x33')][_0x8324('0x1c')]);}_0x17bda7['order']=qs[_0x8324('0x3b')](_0x43e43d[_0x8324('0x33')][_0x8324('0x3b')]);_0x17bda7[_0x8324('0x3c')]=qs['filters'](_[_0x8324('0x3d')](_0x43e43d[_0x8324('0x33')],_0x4ee093[_0x8324('0x35')]),_0x268345);if(_0x43e43d[_0x8324('0x33')][_0x8324('0x3e')]){_0x17bda7[_0x8324('0x3c')]=_[_0x8324('0x3f')](_0x17bda7[_0x8324('0x3c')],{'$or':_[_0x8324('0x2d')](_0x268345,function(_0x50097f){if(_0x50097f['type']!=='VIRTUAL'){var _0x127ebf={};_0x127ebf[_0x50097f[_0x8324('0x2b')]]={'$like':'%'+_0x43e43d[_0x8324('0x33')][_0x8324('0x3e')]+'%'};return _0x127ebf;}})});}_0x17bda7=_['merge']({},_0x17bda7,_0x43e43d[_0x8324('0x40')]);var _0x5f2c9d={'where':_0x17bda7[_0x8324('0x3c')]};return db[_0x8324('0x2e')]['count'](_0x5f2c9d)[_0x8324('0x26')](function(_0x21113d){_0x2fda80[_0x8324('0x1f')]=_0x21113d;if(_0x43e43d[_0x8324('0x33')][_0x8324('0x41')]){_0x17bda7[_0x8324('0x42')]=[{'all':!![]}];}return db[_0x8324('0x2e')][_0x8324('0x43')](_0x17bda7);})[_0x8324('0x26')](function(_0x145b52){_0x2fda80[_0x8324('0x44')]=_0x145b52;return _0x2fda80;})[_0x8324('0x26')](respondWithFilteredResult(_0x38cae6,_0x17bda7))[_0x8324('0x45')](handleError(_0x38cae6,null));};exports['show']=function(_0x172b4d,_0x270e95){var _0x587e4c={'raw':!![],'where':{'id':_0x172b4d['params']['id']}},_0x34506c={};_0x34506c[_0x8324('0x32')]=_['keys'](db[_0x8324('0x2e')][_0x8324('0x2f')]);_0x34506c[_0x8324('0x33')]=_[_0x8324('0x34')](_0x172b4d[_0x8324('0x33')]);_0x34506c['filters']=_['intersection'](_0x34506c[_0x8324('0x32')],_0x34506c[_0x8324('0x33')]);_0x587e4c[_0x8324('0x37')]=_[_0x8324('0x36')](_0x34506c['model'],qs[_0x8324('0x38')](_0x172b4d['query'][_0x8324('0x38')]));_0x587e4c[_0x8324('0x37')]=_0x587e4c[_0x8324('0x37')][_0x8324('0x39')]?_0x587e4c['attributes']:_0x34506c[_0x8324('0x32')];if(_0x172b4d['query'][_0x8324('0x41')]){_0x587e4c[_0x8324('0x42')]=[{'all':!![]}];}_0x587e4c=_[_0x8324('0x3f')]({},_0x587e4c,_0x172b4d[_0x8324('0x40')]);return db['Cdr'][_0x8324('0x46')](_0x587e4c)[_0x8324('0x26')](handleEntityNotFound(_0x270e95,null))[_0x8324('0x26')](respondWithResult(_0x270e95,null))['catch'](handleError(_0x270e95,null));};exports[_0x8324('0x47')]=function(_0x5a4816,_0x226e8c){return db[_0x8324('0x2e')][_0x8324('0x47')](_0x5a4816[_0x8324('0x48')],{})['then'](respondWithResult(_0x226e8c,0xc9))[_0x8324('0x45')](handleError(_0x226e8c,null));};exports[_0x8324('0x25')]=function(_0x119b8c,_0x18f459){if(_0x119b8c[_0x8324('0x48')]['id']){delete _0x119b8c['body']['id'];}return db[_0x8324('0x2e')][_0x8324('0x46')]({'where':{'id':_0x119b8c['params']['id']}})['then'](handleEntityNotFound(_0x18f459,null))[_0x8324('0x26')](saveUpdates(_0x119b8c['body'],null))['then'](respondWithResult(_0x18f459,null))[_0x8324('0x45')](handleError(_0x18f459,null));};exports[_0x8324('0x27')]=function(_0x5ded79,_0x1951e8){return db['Cdr']['find']({'where':{'id':_0x5ded79[_0x8324('0x49')]['id']}})['then'](handleEntityNotFound(_0x1951e8,null))[_0x8324('0x26')](removeEntity(_0x1951e8,null))[_0x8324('0x45')](handleError(_0x1951e8,null));};exports[_0x8324('0x4a')]=function(_0x32a8f5,_0x4c2b56){return db[_0x8324('0x2e')][_0x8324('0x4a')]()[_0x8324('0x26')](respondWithResult(_0x4c2b56,null))[_0x8324('0x45')](handleError(_0x4c2b56,null));};
\ No newline at end of file
+var _0xcb81=['save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x4b6622,_0x141e17){var _0x357399=function(_0xf43376){while(--_0xf43376){_0x4b6622['push'](_0x4b6622['shift']());}};_0x357399(++_0x141e17);}(_0xcb81,0x154));var _0x1cb8=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0xcb81[_0x4c2dfc];return _0xfd728d;};'use strict';var emlformat=require(_0x1cb8('0x0'));var rimraf=require(_0x1cb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cb8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1cb8('0x3'));var util=require(_0x1cb8('0x4'));var path=require(_0x1cb8('0x5'));var sox=require(_0x1cb8('0x6'));var csv=require(_0x1cb8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb8('0x8'));var _=require(_0x1cb8('0x9'));var squel=require('squel');var crypto=require(_0x1cb8('0xa'));var jsforce=require(_0x1cb8('0xb'));var deskjs=require(_0x1cb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1cb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cb8('0xe'));var qs=require(_0x1cb8('0xf'));var as=require(_0x1cb8('0x10'));var hardwareService=require(_0x1cb8('0x11'));var logger=require(_0x1cb8('0x12'))(_0x1cb8('0x13'));var utils=require(_0x1cb8('0x14'));var config=require(_0x1cb8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cb8('0x16'))['db'];function respondWithStatusCode(_0x1ffe94,_0x1938ee){_0x1938ee=_0x1938ee||0xcc;return function(_0x299eea){if(_0x299eea){return _0x1ffe94[_0x1cb8('0x17')](_0x1938ee);}return _0x1ffe94['status'](_0x1938ee)[_0x1cb8('0x18')]();};}function respondWithResult(_0x2c600,_0xcb6ad1){_0xcb6ad1=_0xcb6ad1||0xc8;return function(_0x14d84d){if(_0x14d84d){return _0x2c600[_0x1cb8('0x19')](_0xcb6ad1)[_0x1cb8('0x1a')](_0x14d84d);}};}function respondWithFilteredResult(_0x339ad0,_0x243930){return function(_0x5af4a3){if(_0x5af4a3){var _0x17a95d=typeof _0x243930['offset']===_0x1cb8('0x1b')&&typeof _0x243930[_0x1cb8('0x1c')]===_0x1cb8('0x1b');var _0x46abd0=_0x5af4a3[_0x1cb8('0x1d')];var _0x308088=_0x17a95d?0x0:_0x243930[_0x1cb8('0x1e')];var _0x9f0adb=_0x17a95d?_0x5af4a3[_0x1cb8('0x1d')]:_0x243930[_0x1cb8('0x1e')]+_0x243930[_0x1cb8('0x1c')];var _0x3cda27;if(_0x9f0adb>=_0x46abd0){_0x9f0adb=_0x46abd0;_0x3cda27=0xc8;}else{_0x3cda27=0xce;}_0x339ad0['status'](_0x3cda27);return _0x339ad0[_0x1cb8('0x1f')](_0x1cb8('0x20'),_0x308088+'-'+_0x9f0adb+'/'+_0x46abd0)[_0x1cb8('0x1a')](_0x5af4a3);}return null;};}function patchUpdates(_0x3d1682){return function(_0x4abf3a){try{jsonpatch[_0x1cb8('0x21')](_0x4abf3a,_0x3d1682,!![]);}catch(_0x4f9220){return BPromise[_0x1cb8('0x22')](_0x4f9220);}return _0x4abf3a[_0x1cb8('0x23')]();};}function saveUpdates(_0x40b914,_0x38ff3a){return function(_0x559916){if(_0x559916){return _0x559916['update'](_0x40b914)[_0x1cb8('0x24')](function(_0x4040be){return _0x4040be;});}return null;};}function removeEntity(_0x22dafe,_0x44a00d){return function(_0x2473b8){if(_0x2473b8){return _0x2473b8[_0x1cb8('0x25')]()[_0x1cb8('0x24')](function(){_0x22dafe['status'](0xcc)[_0x1cb8('0x18')]();});}};}function handleEntityNotFound(_0x4554d5,_0x35c890){return function(_0xeeb21d){if(!_0xeeb21d){_0x4554d5[_0x1cb8('0x17')](0x194);}return _0xeeb21d;};}function handleError(_0x41ab56,_0x4ca3be){_0x4ca3be=_0x4ca3be||0x1f4;return function(_0x1ec995){logger[_0x1cb8('0x26')](_0x1ec995[_0x1cb8('0x27')]);if(_0x1ec995[_0x1cb8('0x28')]){delete _0x1ec995[_0x1cb8('0x28')];}_0x41ab56['status'](_0x4ca3be)[_0x1cb8('0x29')](_0x1ec995);};}exports[_0x1cb8('0x2a')]=function(_0x3a8b53,_0x21c17a){var _0x4fda96={},_0x2a79e0={},_0x2ba8c8={'count':0x0,'rows':[]};var _0x3a6a67=_['map'](db[_0x1cb8('0x2b')][_0x1cb8('0x2c')],function(_0x17abe1){return{'name':_0x17abe1['fieldName'],'type':_0x17abe1[_0x1cb8('0x2d')][_0x1cb8('0x2e')]};});_0x2a79e0[_0x1cb8('0x2f')]=_[_0x1cb8('0x30')](_0x3a6a67,_0x1cb8('0x28'));_0x2a79e0['query']=_[_0x1cb8('0x31')](_0x3a8b53[_0x1cb8('0x32')]);_0x2a79e0[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],_0x2a79e0[_0x1cb8('0x32')]);_0x4fda96[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],qs['fields'](_0x3a8b53['query'][_0x1cb8('0x36')]));_0x4fda96[_0x1cb8('0x35')]=_0x4fda96[_0x1cb8('0x35')]['length']?_0x4fda96['attributes']:_0x2a79e0[_0x1cb8('0x2f')];if(!_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x37')](_0x1cb8('0x38'))){_0x4fda96[_0x1cb8('0x1c')]=qs[_0x1cb8('0x1c')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1c')]);_0x4fda96['offset']=qs[_0x1cb8('0x1e')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1e')]);}_0x4fda96[_0x1cb8('0x39')]=qs[_0x1cb8('0x3a')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x3a')]);_0x4fda96[_0x1cb8('0x3b')]=qs[_0x1cb8('0x33')](_['pick'](_0x3a8b53[_0x1cb8('0x32')],_0x2a79e0[_0x1cb8('0x33')]),_0x3a6a67);if(_0x3a8b53['query'][_0x1cb8('0x3c')]){_0x4fda96[_0x1cb8('0x3b')]=_[_0x1cb8('0x3d')](_0x4fda96[_0x1cb8('0x3b')],{'$or':_[_0x1cb8('0x30')](_0x3a6a67,function(_0x5dc4c0){if(_0x5dc4c0[_0x1cb8('0x2d')]!==_0x1cb8('0x3e')){var _0x2989c6={};_0x2989c6[_0x5dc4c0['name']]={'$like':'%'+_0x3a8b53['query']['filter']+'%'};return _0x2989c6;}})});}_0x4fda96=_[_0x1cb8('0x3d')]({},_0x4fda96,_0x3a8b53[_0x1cb8('0x3f')]);var _0x328f7e={'where':_0x4fda96[_0x1cb8('0x3b')]};return db['Cdr']['count'](_0x328f7e)[_0x1cb8('0x24')](function(_0x25f0a3){_0x2ba8c8[_0x1cb8('0x1d')]=_0x25f0a3;if(_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x4fda96[_0x1cb8('0x41')]=[{'all':!![]}];}return db[_0x1cb8('0x2b')][_0x1cb8('0x42')](_0x4fda96);})['then'](function(_0x2044d1){_0x2ba8c8[_0x1cb8('0x43')]=_0x2044d1;return _0x2ba8c8;})[_0x1cb8('0x24')](respondWithFilteredResult(_0x21c17a,_0x4fda96))[_0x1cb8('0x44')](handleError(_0x21c17a,null));};exports['show']=function(_0x156298,_0x47c18a){var _0x2060a6={'raw':!![],'where':{'id':_0x156298['params']['id']}},_0x37230e={};_0x37230e[_0x1cb8('0x2f')]=_[_0x1cb8('0x31')](db[_0x1cb8('0x2b')]['rawAttributes']);_0x37230e['query']=_[_0x1cb8('0x31')](_0x156298['query']);_0x37230e[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],_0x37230e[_0x1cb8('0x32')]);_0x2060a6[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],qs['fields'](_0x156298[_0x1cb8('0x32')][_0x1cb8('0x36')]));_0x2060a6[_0x1cb8('0x35')]=_0x2060a6[_0x1cb8('0x35')]['length']?_0x2060a6[_0x1cb8('0x35')]:_0x37230e[_0x1cb8('0x2f')];if(_0x156298[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x2060a6[_0x1cb8('0x41')]=[{'all':!![]}];}_0x2060a6=_['merge']({},_0x2060a6,_0x156298[_0x1cb8('0x3f')]);return db[_0x1cb8('0x2b')][_0x1cb8('0x45')](_0x2060a6)[_0x1cb8('0x24')](handleEntityNotFound(_0x47c18a,null))[_0x1cb8('0x24')](respondWithResult(_0x47c18a,null))['catch'](handleError(_0x47c18a,null));};exports[_0x1cb8('0x46')]=function(_0x3a4ec4,_0x5598b1){return db[_0x1cb8('0x2b')][_0x1cb8('0x46')](_0x3a4ec4[_0x1cb8('0x47')],{})[_0x1cb8('0x24')](respondWithResult(_0x5598b1,0xc9))[_0x1cb8('0x44')](handleError(_0x5598b1,null));};exports[_0x1cb8('0x48')]=function(_0x3b063c,_0x219541){if(_0x3b063c[_0x1cb8('0x47')]['id']){delete _0x3b063c[_0x1cb8('0x47')]['id'];}return db[_0x1cb8('0x2b')][_0x1cb8('0x45')]({'where':{'id':_0x3b063c[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x219541,null))['then'](saveUpdates(_0x3b063c[_0x1cb8('0x47')],null))[_0x1cb8('0x24')](respondWithResult(_0x219541,null))[_0x1cb8('0x44')](handleError(_0x219541,null));};exports[_0x1cb8('0x25')]=function(_0x21aba7,_0x15f0ba){return db[_0x1cb8('0x2b')]['find']({'where':{'id':_0x21aba7[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x15f0ba,null))[_0x1cb8('0x24')](removeEntity(_0x15f0ba,null))['catch'](handleError(_0x15f0ba,null));};exports['describe']=function(_0x1c12aa,_0x42cc81){return db[_0x1cb8('0x2b')][_0x1cb8('0x4a')]()[_0x1cb8('0x24')](respondWithResult(_0x42cc81,null))['catch'](handleError(_0x42cc81,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index b948869..021e9f3 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(_0x1b0d62,_0x254753){var _0x419da6=function(_0x500d90){while(--_0x500d90){_0x1b0d62['push'](_0x1b0d62['shift']());}};_0x419da6(++_0x254753);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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(_0x1cf525,_0x2285fe){var _0x185d92=function(_0x37be96){while(--_0x37be96){_0x1cf525['push'](_0x1cf525['shift']());}};_0x185d92(++_0x2285fe);}(_0x7a54,0x106));var _0x47a5=function(_0x5bb09b,_0x203a69){_0x5bb09b=_0x5bb09b-0x0;var _0x12c0bf=_0x7a54[_0x5bb09b];return _0x12c0bf;};'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 6eb8f72..298f264 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 _0xe26e=['http','request','then','request\x20sent','stringify','error','Cdr,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x27b1aa,_0x298ee9){var _0xa0883c=function(_0xf7ffc3){while(--_0xf7ffc3){_0x27b1aa['push'](_0x27b1aa['shift']());}};_0xa0883c(++_0x298ee9);}(_0xe26e,0x1c3));var _0xee26=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe26e[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xee26('0x0'));var util=require(_0xee26('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xee26('0x2'));var fs=require('fs');var Redis=require(_0xee26('0x3'));var db=require(_0xee26('0x4'))['db'];var utils=require(_0xee26('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xee26('0x6'));var jayson=require(_0xee26('0x7'));var client=jayson[_0xee26('0x8')][_0xee26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51da25,_0x110121,_0x2038f4){return new BPromise(function(_0x38ff6a,_0x49ed6a){return client[_0xee26('0xa')](_0x51da25,_0x2038f4)[_0xee26('0xb')](function(_0x2d8fb2){logger['info']('Cdr,\x20%s,\x20%s',_0x110121,_0xee26('0xc'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x110121,_0xee26('0xc'),JSON[_0xee26('0xd')](_0x2d8fb2));if(_0x2d8fb2[_0xee26('0xe')]){if(_0x2d8fb2[_0xee26('0xe')]['code']===0x1f4){logger[_0xee26('0xe')](_0xee26('0xf'),_0x110121,_0x2d8fb2[_0xee26('0xe')]['message']);return _0x49ed6a(_0x2d8fb2['error'][_0xee26('0x10')]);}logger[_0xee26('0xe')](_0xee26('0xf'),_0x110121,_0x2d8fb2[_0xee26('0xe')][_0xee26('0x10')]);return _0x38ff6a(_0x2d8fb2[_0xee26('0xe')][_0xee26('0x10')]);}else{logger[_0xee26('0x11')](_0xee26('0xf'),_0x110121,_0xee26('0xc'));_0x38ff6a(_0x2d8fb2[_0xee26('0x12')][_0xee26('0x10')]);}})[_0xee26('0x13')](function(_0x4af713){logger[_0xee26('0xe')](_0xee26('0xf'),_0x110121,_0x4af713);_0x49ed6a(_0x4af713);});});}
\ No newline at end of file
+var _0xc5bf=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment'];(function(_0x564c35,_0x2399e6){var _0x3040b5=function(_0x4d1bb0){while(--_0x4d1bb0){_0x564c35['push'](_0x564c35['shift']());}};_0x3040b5(++_0x2399e6);}(_0xc5bf,0x1e1));var _0xfc5b=function(_0x10708c,_0x1a12d1){_0x10708c=_0x10708c-0x0;var _0x2254c4=_0xc5bf[_0x10708c];return _0x2254c4;};'use strict';var _=require('lodash');var util=require(_0xfc5b('0x0'));var moment=require(_0xfc5b('0x1'));var BPromise=require(_0xfc5b('0x2'));var rs=require(_0xfc5b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc5b('0x4'))['db'];var utils=require(_0xfc5b('0x5'));var logger=require(_0xfc5b('0x6'))(_0xfc5b('0x7'));var config=require(_0xfc5b('0x8'));var jayson=require(_0xfc5b('0x9'));var client=jayson['client'][_0xfc5b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a9f3e,_0x4add52,_0x1fb0e2){return new BPromise(function(_0x5259c6,_0x715a70){return client[_0xfc5b('0xb')](_0x2a9f3e,_0x1fb0e2)[_0xfc5b('0xc')](function(_0x1d25cb){logger[_0xfc5b('0xd')](_0xfc5b('0xe'),_0x4add52,_0xfc5b('0xf'));logger['debug'](_0xfc5b('0x10'),_0x4add52,_0xfc5b('0xf'),JSON['stringify'](_0x1d25cb));if(_0x1d25cb[_0xfc5b('0x11')]){if(_0x1d25cb['error']['code']===0x1f4){logger[_0xfc5b('0x11')]('Cdr,\x20%s,\x20%s',_0x4add52,_0x1d25cb[_0xfc5b('0x11')][_0xfc5b('0x12')]);return _0x715a70(_0x1d25cb[_0xfc5b('0x11')][_0xfc5b('0x12')]);}logger[_0xfc5b('0x11')](_0xfc5b('0xe'),_0x4add52,_0x1d25cb[_0xfc5b('0x11')][_0xfc5b('0x12')]);return _0x5259c6(_0x1d25cb[_0xfc5b('0x11')]['message']);}else{logger[_0xfc5b('0xd')](_0xfc5b('0xe'),_0x4add52,'request\x20sent');_0x5259c6(_0x1d25cb[_0xfc5b('0x13')]['message']);}})[_0xfc5b('0x14')](function(_0xabbf29){logger[_0xfc5b('0x11')](_0xfc5b('0xe'),_0x4add52,_0xabbf29);_0x715a70(_0xabbf29);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 1cdc89a..eedd9d4 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5ea5aa,_0x12eabf){var _0xc28c46=function(_0x5b0803){while(--_0x5b0803){_0x5ea5aa['push'](_0x5ea5aa['shift']());}};_0xc28c46(++_0x12eabf);}(_0xb10b,0x12a));var _0xbb10=function(_0x500211,_0x1a0367){_0x500211=_0x500211-0x0;var _0x48f4e0=_0xb10b[_0x500211];return _0x48f4e0;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+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(_0x26fc3b,_0x2b1be3){var _0x380e31=function(_0x391a02){while(--_0x391a02){_0x26fc3b['push'](_0x26fc3b['shift']());}};_0x380e31(++_0x2b1be3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 97f8ecf..1e2e59a 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 _0xfabe=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0xa3400,_0x3a980a){var _0x33dba2=function(_0x5e988b){while(--_0x5e988b){_0xa3400['push'](_0xa3400['shift']());}};_0x33dba2(++_0x3a980a);}(_0xfabe,0x12c));var _0xefab=function(_0x462703,_0x606f46){_0x462703=_0x462703-0x0;var _0x4a32d0=_0xfabe[_0x462703];return _0x4a32d0;};'use strict';var Sequelize=require(_0xefab('0x0'));module[_0xefab('0x1')]={'priority':{'type':Sequelize[_0xefab('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xefab('0x3')],'allowNull':![],'defaultValue':_0xefab('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xefab('0x3')]},'interval':{'type':Sequelize[_0xefab('0x3')],'defaultValue':_0xefab('0x5')}};
\ No newline at end of file
+var _0xc822=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x15f644,_0x1f0a82){var _0xd954a1=function(_0x4e0fd3){while(--_0x4e0fd3){_0x15f644['push'](_0x15f644['shift']());}};_0xd954a1(++_0x1f0a82);}(_0xc822,0xd7));var _0x2c82=function(_0x5a26db,_0x2c5ccd){_0x5a26db=_0x5a26db-0x0;var _0x4619dd=_0xc822[_0x5a26db];return _0x4619dd;};'use strict';var Sequelize=require(_0x2c82('0x0'));module[_0x2c82('0x1')]={'priority':{'type':Sequelize[_0x2c82('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2c82('0x3')],'allowNull':![],'defaultValue':_0x2c82('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2c82('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2c82('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 355d63f..9aceb7f 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 _0x8d37=['ChatApplication','find','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','Content-Range','update','then','end','error','stack','name','show','params','model','keys','query','intersection','attributes','fields','length','include','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d37,0x1d5));var _0x78d3=function(_0x17ced6,_0x254484){_0x17ced6=_0x17ced6-0x0;var _0x43aa2c=_0x8d37[_0x17ced6];return _0x43aa2c;};'use strict';var emlformat=require(_0x78d3('0x0'));var rimraf=require(_0x78d3('0x1'));var zipdir=require(_0x78d3('0x2'));var jsonpatch=require(_0x78d3('0x3'));var rp=require(_0x78d3('0x4'));var moment=require('moment');var BPromise=require(_0x78d3('0x5'));var Mustache=require(_0x78d3('0x6'));var util=require(_0x78d3('0x7'));var path=require(_0x78d3('0x8'));var sox=require(_0x78d3('0x9'));var csv=require(_0x78d3('0xa'));var ejs=require(_0x78d3('0xb'));var fs=require('fs');var fs_extra=require(_0x78d3('0xc'));var _=require('lodash');var squel=require(_0x78d3('0xd'));var crypto=require(_0x78d3('0xe'));var jsforce=require(_0x78d3('0xf'));var deskjs=require(_0x78d3('0x10'));var toCsv=require(_0x78d3('0xa'));var querystring=require(_0x78d3('0x11'));var Papa=require(_0x78d3('0x12'));var Redis=require(_0x78d3('0x13'));var authService=require(_0x78d3('0x14'));var qs=require(_0x78d3('0x15'));var as=require(_0x78d3('0x16'));var hardwareService=require(_0x78d3('0x17'));var logger=require(_0x78d3('0x18'))(_0x78d3('0x19'));var utils=require(_0x78d3('0x1a'));var config=require(_0x78d3('0x1b'));var licenseUtil=require(_0x78d3('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57c685,_0x3c5e07){_0x3c5e07=_0x3c5e07||0xcc;return function(_0x214962){if(_0x214962){return _0x57c685['sendStatus'](_0x3c5e07);}return _0x57c685[_0x78d3('0x1d')](_0x3c5e07)['end']();};}function respondWithResult(_0x3de55b,_0x1ca726){_0x1ca726=_0x1ca726||0xc8;return function(_0x189aa2){if(_0x189aa2){return _0x3de55b[_0x78d3('0x1d')](_0x1ca726)[_0x78d3('0x1e')](_0x189aa2);}};}function respondWithFilteredResult(_0x3835fc,_0x2a88aa){return function(_0x3fe932){if(_0x3fe932){var _0x516657=typeof _0x2a88aa[_0x78d3('0x1f')]===_0x78d3('0x20')&&typeof _0x2a88aa['limit']===_0x78d3('0x20');var _0x3ef220=_0x3fe932[_0x78d3('0x21')];var _0x32c53e=_0x516657?0x0:_0x2a88aa[_0x78d3('0x1f')];var _0x4ffecd=_0x516657?_0x3fe932[_0x78d3('0x21')]:_0x2a88aa[_0x78d3('0x1f')]+_0x2a88aa[_0x78d3('0x22')];var _0x454455;if(_0x4ffecd>=_0x3ef220){_0x4ffecd=_0x3ef220;_0x454455=0xc8;}else{_0x454455=0xce;}_0x3835fc[_0x78d3('0x1d')](_0x454455);return _0x3835fc['set'](_0x78d3('0x23'),_0x32c53e+'-'+_0x4ffecd+'/'+_0x3ef220)[_0x78d3('0x1e')](_0x3fe932);}return null;};}function patchUpdates(_0x2fa1a9){return function(_0x2c0e28){try{jsonpatch['apply'](_0x2c0e28,_0x2fa1a9,!![]);}catch(_0x7857fc){return BPromise['reject'](_0x7857fc);}return _0x2c0e28['save']();};}function saveUpdates(_0x48612e,_0x4d3ebd){return function(_0x40a7a2){if(_0x40a7a2){return _0x40a7a2[_0x78d3('0x24')](_0x48612e)['then'](function(_0x2abe9b){return _0x2abe9b;});}return null;};}function removeEntity(_0x3ef49b,_0x34594f){return function(_0x317f67){if(_0x317f67){return _0x317f67['destroy']()[_0x78d3('0x25')](function(){_0x3ef49b[_0x78d3('0x1d')](0xcc)[_0x78d3('0x26')]();});}};}function handleEntityNotFound(_0x12a317,_0x216970){return function(_0x11bcf8){if(!_0x11bcf8){_0x12a317['sendStatus'](0x194);}return _0x11bcf8;};}function handleError(_0x96f908,_0x171bda){_0x171bda=_0x171bda||0x1f4;return function(_0x166cd7){logger[_0x78d3('0x27')](_0x166cd7[_0x78d3('0x28')]);if(_0x166cd7[_0x78d3('0x29')]){delete _0x166cd7[_0x78d3('0x29')];}_0x96f908['status'](_0x171bda)['send'](_0x166cd7);};}exports[_0x78d3('0x2a')]=function(_0x208886,_0x5125b6){var _0x2970e4={'raw':!![],'where':{'id':_0x208886[_0x78d3('0x2b')]['id']}},_0x128c00={};_0x128c00[_0x78d3('0x2c')]=_[_0x78d3('0x2d')](db['ChatApplication']['rawAttributes']);_0x128c00[_0x78d3('0x2e')]=_['keys'](_0x208886['query']);_0x128c00['filters']=_[_0x78d3('0x2f')](_0x128c00['model'],_0x128c00[_0x78d3('0x2e')]);_0x2970e4[_0x78d3('0x30')]=_[_0x78d3('0x2f')](_0x128c00[_0x78d3('0x2c')],qs['fields'](_0x208886[_0x78d3('0x2e')][_0x78d3('0x31')]));_0x2970e4[_0x78d3('0x30')]=_0x2970e4[_0x78d3('0x30')][_0x78d3('0x32')]?_0x2970e4['attributes']:_0x128c00[_0x78d3('0x2c')];if(_0x208886[_0x78d3('0x2e')]['includeAll']){_0x2970e4[_0x78d3('0x33')]=[{'all':!![]}];}_0x2970e4=_[_0x78d3('0x34')]({},_0x2970e4,_0x208886['options']);return db[_0x78d3('0x35')][_0x78d3('0x36')](_0x2970e4)[_0x78d3('0x25')](handleEntityNotFound(_0x5125b6,null))['then'](respondWithResult(_0x5125b6,null))[_0x78d3('0x37')](handleError(_0x5125b6,null));};exports[_0x78d3('0x24')]=function(_0x18e78a,_0x381824){if(_0x18e78a[_0x78d3('0x38')]['id']){delete _0x18e78a['body']['id'];}return db['ChatApplication'][_0x78d3('0x36')]({'where':{'id':_0x18e78a[_0x78d3('0x2b')]['id']}})['then'](handleEntityNotFound(_0x381824,null))['then'](saveUpdates(_0x18e78a[_0x78d3('0x38')],null))[_0x78d3('0x25')](respondWithResult(_0x381824,null))[_0x78d3('0x37')](handleError(_0x381824,null));};exports[_0x78d3('0x39')]=function(_0xe04647,_0x57dd9b){return db[_0x78d3('0x35')][_0x78d3('0x36')]({'where':{'id':_0xe04647[_0x78d3('0x2b')]['id']}})[_0x78d3('0x25')](handleEntityNotFound(_0x57dd9b,null))[_0x78d3('0x25')](removeEntity(_0x57dd9b,null))[_0x78d3('0x37')](handleError(_0x57dd9b,null));};
\ No newline at end of file
+var _0x7b05=['ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','set','reject','save','update','then','sendStatus','error','stack','name','send','show','params','model','rawAttributes','keys','intersection','attributes','fields','query','length','ChatApplication','find','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','papaparse'];(function(_0x40490a,_0x3b4813){var _0x5e4469=function(_0x366d3a){while(--_0x366d3a){_0x40490a['push'](_0x40490a['shift']());}};_0x5e4469(++_0x3b4813);}(_0x7b05,0x91));var _0x57b0=function(_0x3a16d4,_0x23ecda){_0x3a16d4=_0x3a16d4-0x0;var _0x31ea9c=_0x7b05[_0x3a16d4];return _0x31ea9c;};'use strict';var emlformat=require(_0x57b0('0x0'));var rimraf=require(_0x57b0('0x1'));var zipdir=require(_0x57b0('0x2'));var jsonpatch=require(_0x57b0('0x3'));var rp=require('request-promise');var moment=require(_0x57b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x57b0('0x5'));var util=require(_0x57b0('0x6'));var path=require(_0x57b0('0x7'));var sox=require(_0x57b0('0x8'));var csv=require(_0x57b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57b0('0xa'));var _=require('lodash');var squel=require(_0x57b0('0xb'));var crypto=require(_0x57b0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x57b0('0xd'));var Redis=require(_0x57b0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57b0('0xf'));var logger=require(_0x57b0('0x10'))(_0x57b0('0x11'));var utils=require(_0x57b0('0x12'));var config=require(_0x57b0('0x13'));var licenseUtil=require(_0x57b0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x363096,_0x145eae){_0x145eae=_0x145eae||0xcc;return function(_0xee8335){if(_0xee8335){return _0x363096['sendStatus'](_0x145eae);}return _0x363096['status'](_0x145eae)[_0x57b0('0x15')]();};}function respondWithResult(_0x3f95e3,_0xc9044f){_0xc9044f=_0xc9044f||0xc8;return function(_0x3b48a3){if(_0x3b48a3){return _0x3f95e3['status'](_0xc9044f)[_0x57b0('0x16')](_0x3b48a3);}};}function respondWithFilteredResult(_0x5c46a5,_0x235d4a){return function(_0xa20423){if(_0xa20423){var _0x55fd9c=typeof _0x235d4a[_0x57b0('0x17')]===_0x57b0('0x18')&&typeof _0x235d4a[_0x57b0('0x19')]===_0x57b0('0x18');var _0x3eb198=_0xa20423['count'];var _0x37bd5d=_0x55fd9c?0x0:_0x235d4a['offset'];var _0x592b2d=_0x55fd9c?_0xa20423[_0x57b0('0x1a')]:_0x235d4a[_0x57b0('0x17')]+_0x235d4a[_0x57b0('0x19')];var _0x3e14f5;if(_0x592b2d>=_0x3eb198){_0x592b2d=_0x3eb198;_0x3e14f5=0xc8;}else{_0x3e14f5=0xce;}_0x5c46a5[_0x57b0('0x1b')](_0x3e14f5);return _0x5c46a5[_0x57b0('0x1c')]('Content-Range',_0x37bd5d+'-'+_0x592b2d+'/'+_0x3eb198)[_0x57b0('0x16')](_0xa20423);}return null;};}function patchUpdates(_0x1d81ff){return function(_0x35a457){try{jsonpatch['apply'](_0x35a457,_0x1d81ff,!![]);}catch(_0x12f2f6){return BPromise[_0x57b0('0x1d')](_0x12f2f6);}return _0x35a457[_0x57b0('0x1e')]();};}function saveUpdates(_0x149056,_0x2ffc0a){return function(_0x22b11e){if(_0x22b11e){return _0x22b11e[_0x57b0('0x1f')](_0x149056)[_0x57b0('0x20')](function(_0x3497e4){return _0x3497e4;});}return null;};}function removeEntity(_0x5c60b9,_0x55b870){return function(_0x40c279){if(_0x40c279){return _0x40c279['destroy']()[_0x57b0('0x20')](function(){_0x5c60b9[_0x57b0('0x1b')](0xcc)[_0x57b0('0x15')]();});}};}function handleEntityNotFound(_0x38e3a0,_0x3e75e8){return function(_0xbf54ac){if(!_0xbf54ac){_0x38e3a0[_0x57b0('0x21')](0x194);}return _0xbf54ac;};}function handleError(_0x1eb523,_0xacd07c){_0xacd07c=_0xacd07c||0x1f4;return function(_0x109678){logger[_0x57b0('0x22')](_0x109678[_0x57b0('0x23')]);if(_0x109678[_0x57b0('0x24')]){delete _0x109678['name'];}_0x1eb523[_0x57b0('0x1b')](_0xacd07c)[_0x57b0('0x25')](_0x109678);};}exports[_0x57b0('0x26')]=function(_0x228dfe,_0x5e046c){var _0x552f3e={'raw':!![],'where':{'id':_0x228dfe[_0x57b0('0x27')]['id']}},_0x325e39={};_0x325e39[_0x57b0('0x28')]=_['keys'](db['ChatApplication'][_0x57b0('0x29')]);_0x325e39['query']=_[_0x57b0('0x2a')](_0x228dfe['query']);_0x325e39['filters']=_[_0x57b0('0x2b')](_0x325e39[_0x57b0('0x28')],_0x325e39['query']);_0x552f3e[_0x57b0('0x2c')]=_[_0x57b0('0x2b')](_0x325e39['model'],qs[_0x57b0('0x2d')](_0x228dfe[_0x57b0('0x2e')][_0x57b0('0x2d')]));_0x552f3e['attributes']=_0x552f3e[_0x57b0('0x2c')][_0x57b0('0x2f')]?_0x552f3e[_0x57b0('0x2c')]:_0x325e39[_0x57b0('0x28')];if(_0x228dfe[_0x57b0('0x2e')]['includeAll']){_0x552f3e['include']=[{'all':!![]}];}_0x552f3e=_['merge']({},_0x552f3e,_0x228dfe['options']);return db[_0x57b0('0x30')][_0x57b0('0x31')](_0x552f3e)[_0x57b0('0x20')](handleEntityNotFound(_0x5e046c,null))[_0x57b0('0x20')](respondWithResult(_0x5e046c,null))[_0x57b0('0x32')](handleError(_0x5e046c,null));};exports['update']=function(_0x85fdfe,_0x879623){if(_0x85fdfe[_0x57b0('0x33')]['id']){delete _0x85fdfe[_0x57b0('0x33')]['id'];}return db['ChatApplication'][_0x57b0('0x31')]({'where':{'id':_0x85fdfe[_0x57b0('0x27')]['id']}})['then'](handleEntityNotFound(_0x879623,null))[_0x57b0('0x20')](saveUpdates(_0x85fdfe[_0x57b0('0x33')],null))['then'](respondWithResult(_0x879623,null))['catch'](handleError(_0x879623,null));};exports[_0x57b0('0x34')]=function(_0x1b1d95,_0x3acf43){return db[_0x57b0('0x30')][_0x57b0('0x31')]({'where':{'id':_0x1b1d95[_0x57b0('0x27')]['id']}})[_0x57b0('0x20')](handleEntityNotFound(_0x3acf43,null))[_0x57b0('0x20')](removeEntity(_0x3acf43,null))[_0x57b0('0x32')](handleError(_0x3acf43,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index fb008e8..01a4147 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 _0x9bc9=['bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x2483ab,_0x4ad54a){var _0x4c2c4b=function(_0x3635ad){while(--_0x3635ad){_0x2483ab['push'](_0x2483ab['shift']());}};_0x4c2c4b(++_0x4ad54a);}(_0x9bc9,0x183));var _0x99bc=function(_0x21eca5,_0x1b289b){_0x21eca5=_0x21eca5-0x0;var _0x1e2441=_0x9bc9[_0x21eca5];return _0x1e2441;};'use strict';var _=require(_0x99bc('0x0'));var util=require(_0x99bc('0x1'));var logger=require(_0x99bc('0x2'))(_0x99bc('0x3'));var moment=require(_0x99bc('0x4'));var BPromise=require(_0x99bc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99bc('0x6'));var rimraf=require(_0x99bc('0x7'));var config=require(_0x99bc('0x8'));var attributes=require(_0x99bc('0x9'));module[_0x99bc('0xa')]=function(_0x578fb4,_0x2b9faf){return _0x578fb4[_0x99bc('0xb')](_0x99bc('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x99bc('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xadd2=['path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise'];(function(_0x41df41,_0x370874){var _0x3f4702=function(_0x5101cc){while(--_0x5101cc){_0x41df41['push'](_0x41df41['shift']());}};_0x3f4702(++_0x370874);}(_0xadd2,0xa5));var _0x2add=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xadd2[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2add('0x0'))('api');var moment=require(_0x2add('0x1'));var BPromise=require(_0x2add('0x2'));var rp=require(_0x2add('0x3'));var fs=require('fs');var path=require(_0x2add('0x4'));var rimraf=require(_0x2add('0x5'));var config=require(_0x2add('0x6'));var attributes=require(_0x2add('0x7'));module[_0x2add('0x8')]=function(_0x30d864,_0x53a89d){return _0x30d864['define'](_0x2add('0x9'),attributes,{'tableName':_0x2add('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2add('0xb'),'collate':_0x2add('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 60bd25b..f3a4f8d 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 _0xa793=['info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0xa793,0x6b));var _0x3a79=function(_0x336264,_0x32e1d9){_0x336264=_0x336264-0x0;var _0x53cf91=_0xa793[_0x336264];return _0x53cf91;};'use strict';var _=require('lodash');var util=require(_0x3a79('0x0'));var moment=require('moment');var BPromise=require(_0x3a79('0x1'));var rs=require(_0x3a79('0x2'));var fs=require('fs');var Redis=require(_0x3a79('0x3'));var db=require(_0x3a79('0x4'))['db'];var utils=require(_0x3a79('0x5'));var logger=require(_0x3a79('0x6'))('rpc');var config=require(_0x3a79('0x7'));var jayson=require(_0x3a79('0x8'));var client=jayson[_0x3a79('0x9')][_0x3a79('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ec760,_0xc1206d,_0x549cba){return new BPromise(function(_0x502aae,_0x5ca8d7){return client[_0x3a79('0xb')](_0x5ec760,_0x549cba)[_0x3a79('0xc')](function(_0x3fa763){logger[_0x3a79('0xd')]('ChatApplication,\x20%s,\x20%s',_0xc1206d,_0x3a79('0xe'));logger[_0x3a79('0xf')](_0x3a79('0x10'),_0xc1206d,_0x3a79('0xe'),JSON[_0x3a79('0x11')](_0x3fa763));if(_0x3fa763[_0x3a79('0x12')]){if(_0x3fa763['error'][_0x3a79('0x13')]===0x1f4){logger['error'](_0x3a79('0x14'),_0xc1206d,_0x3fa763[_0x3a79('0x12')][_0x3a79('0x15')]);return _0x5ca8d7(_0x3fa763[_0x3a79('0x12')][_0x3a79('0x15')]);}logger['error'](_0x3a79('0x14'),_0xc1206d,_0x3fa763[_0x3a79('0x12')][_0x3a79('0x15')]);return _0x502aae(_0x3fa763[_0x3a79('0x12')][_0x3a79('0x15')]);}else{logger[_0x3a79('0xd')](_0x3a79('0x14'),_0xc1206d,'request\x20sent');_0x502aae(_0x3fa763[_0x3a79('0x16')][_0x3a79('0x15')]);}})[_0x3a79('0x17')](function(_0x1806e3){logger[_0x3a79('0x12')](_0x3a79('0x14'),_0xc1206d,_0x1806e3);_0x5ca8d7(_0x1806e3);});});}
\ No newline at end of file
+var _0x63c1=['rpc','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x63c1,0x1c1));var _0x163c=function(_0x10da7d,_0x437c3c){_0x10da7d=_0x10da7d-0x0;var _0x10b314=_0x63c1[_0x10da7d];return _0x10b314;};'use strict';var _=require(_0x163c('0x0'));var util=require(_0x163c('0x1'));var moment=require('moment');var BPromise=require(_0x163c('0x2'));var rs=require(_0x163c('0x3'));var fs=require('fs');var Redis=require(_0x163c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x163c('0x5'));var logger=require(_0x163c('0x6'))(_0x163c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x163c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x289ae7,_0xa0efb,_0x4f5113){return new BPromise(function(_0x4d737f,_0x568328){return client[_0x163c('0x9')](_0x289ae7,_0x4f5113)['then'](function(_0xbf13be){logger[_0x163c('0xa')](_0x163c('0xb'),_0xa0efb,_0x163c('0xc'));logger['debug'](_0x163c('0xd'),_0xa0efb,_0x163c('0xc'),JSON[_0x163c('0xe')](_0xbf13be));if(_0xbf13be['error']){if(_0xbf13be[_0x163c('0xf')][_0x163c('0x10')]===0x1f4){logger[_0x163c('0xf')]('ChatApplication,\x20%s,\x20%s',_0xa0efb,_0xbf13be['error'][_0x163c('0x11')]);return _0x568328(_0xbf13be[_0x163c('0xf')][_0x163c('0x11')]);}logger[_0x163c('0xf')](_0x163c('0xb'),_0xa0efb,_0xbf13be[_0x163c('0xf')][_0x163c('0x11')]);return _0x4d737f(_0xbf13be['error'][_0x163c('0x11')]);}else{logger[_0x163c('0xa')](_0x163c('0xb'),_0xa0efb,_0x163c('0xc'));_0x4d737f(_0xbf13be['result'][_0x163c('0x11')]);}})[_0x163c('0x12')](function(_0x2a3c77){logger['error'](_0x163c('0xb'),_0xa0efb,_0x2a3c77);_0x568328(_0x2a3c77);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index a8617af..9b60555 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 _0xae79=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update','destroy','exports'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0xae79,0xd2));var _0x9ae7=function(_0x2e3c61,_0x59babd){_0x2e3c61=_0x2e3c61-0x0;var _0x3f6697=_0xae79[_0x2e3c61];return _0x3f6697;};'use strict';var multer=require('multer');var util=require(_0x9ae7('0x0'));var path=require('path');var timeout=require(_0x9ae7('0x1'));var express=require(_0x9ae7('0x2'));var router=express[_0x9ae7('0x3')]();var fs_extra=require(_0x9ae7('0x4'));var auth=require(_0x9ae7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ae7('0x6'));var controller=require(_0x9ae7('0x7'));router[_0x9ae7('0x8')](_0x9ae7('0x9'),auth[_0x9ae7('0xa')](),controller['show']);router[_0x9ae7('0xb')](_0x9ae7('0x9'),auth[_0x9ae7('0xa')](),controller[_0x9ae7('0xc')]);router['delete'](_0x9ae7('0x9'),auth[_0x9ae7('0xa')](),controller[_0x9ae7('0xd')]);module[_0x9ae7('0xe')]=router;
\ No newline at end of file
+var _0x522e=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','isAuthenticated','delete','destroy','exports'];(function(_0x1b794,_0x2ba0b1){var _0x5949cd=function(_0x257f39){while(--_0x257f39){_0x1b794['push'](_0x1b794['shift']());}};_0x5949cd(++_0x2ba0b1);}(_0x522e,0x120));var _0xe522=function(_0x5c6a8e,_0x51f16d){_0x5c6a8e=_0x5c6a8e-0x0;var _0x6d27de=_0x522e[_0x5c6a8e];return _0x6d27de;};'use strict';var multer=require(_0xe522('0x0'));var util=require(_0xe522('0x1'));var path=require(_0xe522('0x2'));var timeout=require('connect-timeout');var express=require(_0xe522('0x3'));var router=express['Router']();var fs_extra=require(_0xe522('0x4'));var auth=require(_0xe522('0x5'));var interaction=require(_0xe522('0x6'));var config=require(_0xe522('0x7'));var controller=require(_0xe522('0x8'));router[_0xe522('0x9')](_0xe522('0xa'),auth['isAuthenticated'](),controller[_0xe522('0xb')]);router['put'](_0xe522('0xa'),auth[_0xe522('0xc')](),controller['update']);router[_0xe522('0xd')](_0xe522('0xa'),auth['isAuthenticated'](),controller[_0xe522('0xe')]);module[_0xe522('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index f8278eb..fe65214 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 _0x2c70=['STRING','sequelize'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x2c70,0x19f));var _0x02c7=function(_0xd8c807,_0x456197){_0xd8c807=_0xd8c807-0x0;var _0x13bd30=_0x2c70[_0xd8c807];return _0x13bd30;};'use strict';var Sequelize=require(_0x02c7('0x0'));module['exports']={'name':{'type':Sequelize[_0x02c7('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xc12c=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2150b7,_0x1b7bbb){var _0x5bd131=function(_0x4be2de){while(--_0x4be2de){_0x2150b7['push'](_0x2150b7['shift']());}};_0x5bd131(++_0x1b7bbb);}(_0xc12c,0x1ae));var _0xcc12=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xc12c[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0xcc12('0x0'));module[_0xcc12('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xcc12('0x2')]},'write':{'type':Sequelize[_0xcc12('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 5a1b55f..990a192 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 _0x1ba8=['../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','findAll','rows','show','include','find','create','body','catch','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','length','order','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1c55f1,_0x3669ca){var _0x44dd27=function(_0x531d3e){while(--_0x531d3e){_0x1c55f1['push'](_0x1c55f1['shift']());}};_0x44dd27(++_0x3669ca);}(_0x1ba8,0x1c8));var _0x81ba=function(_0x4e5e67,_0x20d5bb){_0x4e5e67=_0x4e5e67-0x0;var _0x3103bb=_0x1ba8[_0x4e5e67];return _0x3103bb;};'use strict';var emlformat=require(_0x81ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x81ba('0x1'));var rp=require(_0x81ba('0x2'));var moment=require(_0x81ba('0x3'));var BPromise=require(_0x81ba('0x4'));var Mustache=require(_0x81ba('0x5'));var util=require(_0x81ba('0x6'));var path=require(_0x81ba('0x7'));var sox=require('sox');var csv=require(_0x81ba('0x8'));var ejs=require(_0x81ba('0x9'));var fs=require('fs');var fs_extra=require(_0x81ba('0xa'));var _=require(_0x81ba('0xb'));var squel=require(_0x81ba('0xc'));var crypto=require(_0x81ba('0xd'));var jsforce=require(_0x81ba('0xe'));var deskjs=require(_0x81ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0x81ba('0x10'));var Papa=require(_0x81ba('0x11'));var Redis=require(_0x81ba('0x12'));var authService=require(_0x81ba('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81ba('0x14'));var logger=require(_0x81ba('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x81ba('0x16'));var licenseUtil=require(_0x81ba('0x17'));var db=require(_0x81ba('0x18'))['db'];config[_0x81ba('0x19')]=_['defaults'](config['redis'],{'host':_0x81ba('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x81ba('0x19')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x7cd23b,_0x1dfecb){_0x1dfecb=_0x1dfecb||0xcc;return function(_0x36456e){if(_0x36456e){return _0x7cd23b[_0x81ba('0x1b')](_0x1dfecb);}return _0x7cd23b[_0x81ba('0x1c')](_0x1dfecb)[_0x81ba('0x1d')]();};}function respondWithResult(_0x22bec1,_0x3ae432){_0x3ae432=_0x3ae432||0xc8;return function(_0x469876){if(_0x469876){return _0x22bec1[_0x81ba('0x1c')](_0x3ae432)[_0x81ba('0x1e')](_0x469876);}};}function respondWithFilteredResult(_0x153752,_0x252757){return function(_0x2cf133){if(_0x2cf133){var _0x22e056=typeof _0x252757['offset']===_0x81ba('0x1f')&&typeof _0x252757['limit']===_0x81ba('0x1f');var _0x460d6e=_0x2cf133[_0x81ba('0x20')];var _0xf41e9b=_0x22e056?0x0:_0x252757['offset'];var _0x136993=_0x22e056?_0x2cf133['count']:_0x252757[_0x81ba('0x21')]+_0x252757[_0x81ba('0x22')];var _0x13199e;if(_0x136993>=_0x460d6e){_0x136993=_0x460d6e;_0x13199e=0xc8;}else{_0x13199e=0xce;}_0x153752[_0x81ba('0x1c')](_0x13199e);return _0x153752['set']('Content-Range',_0xf41e9b+'-'+_0x136993+'/'+_0x460d6e)[_0x81ba('0x1e')](_0x2cf133);}return null;};}function patchUpdates(_0x30c113){return function(_0x544e30){try{jsonpatch[_0x81ba('0x23')](_0x544e30,_0x30c113,!![]);}catch(_0x2bb760){return BPromise[_0x81ba('0x24')](_0x2bb760);}return _0x544e30[_0x81ba('0x25')]();};}function saveUpdates(_0x484150,_0x4ca501){return function(_0x5a6d7b){if(_0x5a6d7b){return _0x5a6d7b['update'](_0x484150)[_0x81ba('0x26')](function(_0x7910ff){return _0x7910ff;});}return null;};}function removeEntity(_0x4812ed,_0x126273){return function(_0x3943c2){if(_0x3943c2){return _0x3943c2[_0x81ba('0x27')]()[_0x81ba('0x26')](function(){_0x4812ed[_0x81ba('0x1c')](0xcc)[_0x81ba('0x1d')]();});}};}function handleEntityNotFound(_0x4af7f1,_0x15874d){return function(_0x31ea07){if(!_0x31ea07){_0x4af7f1[_0x81ba('0x1b')](0x194);}return _0x31ea07;};}function handleError(_0x2f7e5d,_0x58b988){_0x58b988=_0x58b988||0x1f4;return function(_0x382cf1){logger[_0x81ba('0x28')](_0x382cf1[_0x81ba('0x29')]);if(_0x382cf1[_0x81ba('0x2a')]){delete _0x382cf1[_0x81ba('0x2a')];}_0x2f7e5d[_0x81ba('0x1c')](_0x58b988)[_0x81ba('0x2b')](_0x382cf1);};}exports[_0x81ba('0x2c')]=function(_0x9a2e98,_0x858a74){var _0x2100ab={},_0x50e61b={},_0x45bfcb={'count':0x0,'rows':[]};var _0x33e7e5=_[_0x81ba('0x2d')](db[_0x81ba('0x2e')][_0x81ba('0x2f')],function(_0x232c73){return{'name':_0x232c73[_0x81ba('0x30')],'type':_0x232c73[_0x81ba('0x31')]['key']};});_0x50e61b[_0x81ba('0x32')]=_['map'](_0x33e7e5,_0x81ba('0x2a'));_0x50e61b['query']=_[_0x81ba('0x33')](_0x9a2e98[_0x81ba('0x34')]);_0x50e61b['filters']=_[_0x81ba('0x35')](_0x50e61b[_0x81ba('0x32')],_0x50e61b[_0x81ba('0x34')]);_0x2100ab[_0x81ba('0x36')]=_[_0x81ba('0x35')](_0x50e61b['model'],qs[_0x81ba('0x37')](_0x9a2e98[_0x81ba('0x34')][_0x81ba('0x37')]));_0x2100ab[_0x81ba('0x36')]=_0x2100ab[_0x81ba('0x36')]['length']?_0x2100ab[_0x81ba('0x36')]:_0x50e61b['model'];if(!_0x9a2e98['query'][_0x81ba('0x38')](_0x81ba('0x39'))){_0x2100ab[_0x81ba('0x22')]=qs[_0x81ba('0x22')](_0x9a2e98[_0x81ba('0x34')]['limit']);_0x2100ab[_0x81ba('0x21')]=qs[_0x81ba('0x21')](_0x9a2e98[_0x81ba('0x34')][_0x81ba('0x21')]);}_0x2100ab['order']=qs[_0x81ba('0x3a')](_0x9a2e98[_0x81ba('0x34')][_0x81ba('0x3a')]);_0x2100ab[_0x81ba('0x3b')]=qs['filters'](_[_0x81ba('0x3c')](_0x9a2e98[_0x81ba('0x34')],_0x50e61b[_0x81ba('0x3d')]),_0x33e7e5);if(_0x9a2e98['query'][_0x81ba('0x3e')]){_0x2100ab[_0x81ba('0x3b')]=_[_0x81ba('0x3f')](_0x2100ab[_0x81ba('0x3b')],{'$or':_[_0x81ba('0x2d')](_0x33e7e5,function(_0x3379ef){if(_0x3379ef[_0x81ba('0x31')]!=='VIRTUAL'){var _0x361ae7={};_0x361ae7[_0x3379ef['name']]={'$like':'%'+_0x9a2e98[_0x81ba('0x34')]['filter']+'%'};return _0x361ae7;}})});}_0x2100ab=_[_0x81ba('0x3f')]({},_0x2100ab,_0x9a2e98[_0x81ba('0x40')]);var _0x81952={'where':_0x2100ab[_0x81ba('0x3b')]};return db['ChatGroup']['count'](_0x81952)[_0x81ba('0x26')](function(_0x5654ea){_0x45bfcb[_0x81ba('0x20')]=_0x5654ea;if(_0x9a2e98['query'][_0x81ba('0x41')]){_0x2100ab['include']=[{'all':!![]}];}return db['ChatGroup'][_0x81ba('0x42')](_0x2100ab);})[_0x81ba('0x26')](function(_0x14cada){_0x45bfcb[_0x81ba('0x43')]=_0x14cada;return _0x45bfcb;})[_0x81ba('0x26')](respondWithFilteredResult(_0x858a74,_0x2100ab))['catch'](handleError(_0x858a74,null));};exports[_0x81ba('0x44')]=function(_0x3af704,_0x496b16){var _0x1443a0={'raw':!![],'where':{'id':_0x3af704['params']['id']}},_0x2bee01={};_0x2bee01[_0x81ba('0x32')]=_[_0x81ba('0x33')](db[_0x81ba('0x2e')][_0x81ba('0x2f')]);_0x2bee01['query']=_[_0x81ba('0x33')](_0x3af704[_0x81ba('0x34')]);_0x2bee01[_0x81ba('0x3d')]=_[_0x81ba('0x35')](_0x2bee01[_0x81ba('0x32')],_0x2bee01['query']);_0x1443a0[_0x81ba('0x36')]=_['intersection'](_0x2bee01['model'],qs[_0x81ba('0x37')](_0x3af704[_0x81ba('0x34')]['fields']));_0x1443a0['attributes']=_0x1443a0[_0x81ba('0x36')]['length']?_0x1443a0[_0x81ba('0x36')]:_0x2bee01[_0x81ba('0x32')];if(_0x3af704['query']['includeAll']){_0x1443a0[_0x81ba('0x45')]=[{'all':!![]}];}_0x1443a0=_[_0x81ba('0x3f')]({},_0x1443a0,_0x3af704['options']);return db[_0x81ba('0x2e')][_0x81ba('0x46')](_0x1443a0)[_0x81ba('0x26')](handleEntityNotFound(_0x496b16,null))[_0x81ba('0x26')](respondWithResult(_0x496b16,null))['catch'](handleError(_0x496b16,null));};exports[_0x81ba('0x47')]=function(_0x523ca8,_0x125dff){return db[_0x81ba('0x2e')][_0x81ba('0x47')](_0x523ca8[_0x81ba('0x48')],{})[_0x81ba('0x26')](respondWithResult(_0x125dff,0xc9))[_0x81ba('0x49')](handleError(_0x125dff,null));};exports['update']=function(_0x547e94,_0x32f37c){if(_0x547e94[_0x81ba('0x48')]['id']){delete _0x547e94[_0x81ba('0x48')]['id'];}return db['ChatGroup'][_0x81ba('0x46')]({'where':{'id':_0x547e94[_0x81ba('0x4a')]['id']}})[_0x81ba('0x26')](handleEntityNotFound(_0x32f37c,null))[_0x81ba('0x26')](saveUpdates(_0x547e94['body'],null))['then'](respondWithResult(_0x32f37c,null))[_0x81ba('0x49')](handleError(_0x32f37c,null));};exports[_0x81ba('0x27')]=function(_0x20fa53,_0x33d8a7){return db[_0x81ba('0x2e')][_0x81ba('0x46')]({'where':{'id':_0x20fa53['params']['id']}})[_0x81ba('0x26')](handleEntityNotFound(_0x33d8a7,null))[_0x81ba('0x26')](removeEntity(_0x33d8a7,null))[_0x81ba('0x49')](handleError(_0x33d8a7,null));};exports[_0x81ba('0x4b')]=function(_0x5967f2,_0x227d5d){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x227d5d,null))[_0x81ba('0x49')](handleError(_0x227d5d,null));};exports[_0x81ba('0x4c')]=function(_0x2ad127,_0x34b87f,_0x21d67f){return db[_0x81ba('0x4d')]['count']({'where':{'ChatGroupId':_0x2ad127[_0x81ba('0x4a')]['id'],'ToId':_0x2ad127[_0x81ba('0x4e')]['id'],'read':![]}})[_0x81ba('0x26')](function(_0x18a5c1){return{'id':_[_0x81ba('0x4f')](_0x2ad127[_0x81ba('0x4a')]['id']),'count':_0x18a5c1};})['then'](respondWithResult(_0x34b87f,null))['catch'](handleError(_0x34b87f,null));};exports[_0x81ba('0x50')]=function(_0x97da50,_0x48d41d,_0x4c7394){return db[_0x81ba('0x2e')][_0x81ba('0x46')]({'where':{'id':_0x97da50[_0x81ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x48d41d,null))[_0x81ba('0x26')](function(_0x32810c){if(_0x32810c){return _0x32810c['addMembers'](_0x97da50[_0x81ba('0x48')][_0x81ba('0x51')],_[_0x81ba('0x52')](_0x97da50['body'],[_0x81ba('0x51'),'id'])||{});}})['then'](respondWithResult(_0x48d41d,null))[_0x81ba('0x49')](handleError(_0x48d41d,null));};exports[_0x81ba('0x53')]=function(_0x1f8183,_0x6d2e27,_0x25d0e4){var _0x3721ef={};var _0xa8ea9f={};var _0x1ade18;var _0x1d4ac2;return db[_0x81ba('0x2e')][_0x81ba('0x54')]({'where':{'id':_0x1f8183['params']['id']}})['then'](handleEntityNotFound(_0x6d2e27,null))[_0x81ba('0x26')](function(_0x190eb1){if(_0x190eb1){_0x1ade18=_0x190eb1;_0xa8ea9f['model']=_[_0x81ba('0x33')](db[_0x81ba('0x55')][_0x81ba('0x2f')]);_0xa8ea9f[_0x81ba('0x34')]=_[_0x81ba('0x33')](_0x1f8183[_0x81ba('0x34')]);_0xa8ea9f[_0x81ba('0x3d')]=_[_0x81ba('0x35')](_0xa8ea9f[_0x81ba('0x32')],_0xa8ea9f[_0x81ba('0x34')]);_0x3721ef[_0x81ba('0x36')]=_[_0x81ba('0x35')](_0xa8ea9f['model'],qs[_0x81ba('0x37')](_0x1f8183[_0x81ba('0x34')][_0x81ba('0x37')]));_0x3721ef[_0x81ba('0x36')]=_0x3721ef['attributes'][_0x81ba('0x56')]?_0x3721ef[_0x81ba('0x36')]:_0xa8ea9f[_0x81ba('0x32')];_0x3721ef[_0x81ba('0x57')]=qs[_0x81ba('0x3a')](_0x1f8183['query']['sort']);_0x3721ef[_0x81ba('0x3b')]=qs[_0x81ba('0x3d')](_['pick'](_0x1f8183[_0x81ba('0x34')],_0xa8ea9f[_0x81ba('0x3d')]));if(_0x1f8183[_0x81ba('0x34')][_0x81ba('0x3e')]){_0x3721ef[_0x81ba('0x3b')]=_['merge'](_0x3721ef[_0x81ba('0x3b')],{'$or':_['map'](_0x3721ef['attributes'],function(_0x3fbd94){var _0x6bc1a7={};_0x6bc1a7[_0x3fbd94]={'$like':'%'+_0x1f8183[_0x81ba('0x34')]['filter']+'%'};return _0x6bc1a7;})});}_0x3721ef=_[_0x81ba('0x3f')]({},_0x3721ef,_0x1f8183[_0x81ba('0x40')]);return _0x1ade18[_0x81ba('0x53')](_0x3721ef);}})[_0x81ba('0x26')](function(_0x24580d){if(_0x24580d){_0x1d4ac2=_0x24580d[_0x81ba('0x56')];if(!_0x1f8183[_0x81ba('0x34')][_0x81ba('0x38')](_0x81ba('0x39'))){_0x3721ef[_0x81ba('0x22')]=qs[_0x81ba('0x22')](_0x1f8183[_0x81ba('0x34')][_0x81ba('0x22')]);_0x3721ef[_0x81ba('0x21')]=qs['offset'](_0x1f8183[_0x81ba('0x34')][_0x81ba('0x21')]);}return _0x1ade18[_0x81ba('0x53')](_0x3721ef);}})[_0x81ba('0x26')](function(_0x118349){if(_0x118349){return _0x118349?{'count':_0x1d4ac2,'rows':_0x118349}:null;}})['then'](respondWithResult(_0x6d2e27,null))[_0x81ba('0x49')](handleError(_0x6d2e27,null));};exports['removeMembers']=function(_0x298e7e,_0x3d6ee2,_0x19e2e8){return db[_0x81ba('0x2e')]['find']({'where':{'id':_0x298e7e['params']['id']}})[_0x81ba('0x26')](handleEntityNotFound(_0x3d6ee2,null))[_0x81ba('0x26')](function(_0x5a1ba3){if(_0x5a1ba3){return _0x5a1ba3[_0x81ba('0x58')](_0x298e7e[_0x81ba('0x34')][_0x81ba('0x51')]);}})[_0x81ba('0x26')](respondWithStatusCode(_0x3d6ee2,null))[_0x81ba('0x49')](handleError(_0x3d6ee2,null));};exports[_0x81ba('0x59')]=function(_0x5fe7d8,_0x3d4af8,_0x57720e){if(_0x5fe7d8[_0x81ba('0x48')]['id']){delete _0x5fe7d8[_0x81ba('0x48')]['id'];}return db[_0x81ba('0x2e')][_0x81ba('0x46')]({'where':{'id':_0x5fe7d8[_0x81ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d4af8,null))['then'](function(_0x48636d){if(_0x48636d){_0x5fe7d8['body'][_0x81ba('0x5a')]=_0x48636d['id'];return db[_0x81ba('0x4d')]['create'](_0x5fe7d8[_0x81ba('0x48')]);}})[_0x81ba('0x26')](respondWithResult(_0x3d4af8,null))['catch'](handleError(_0x3d4af8,null));};exports[_0x81ba('0x5b')]=function(_0x581035,_0x20148c,_0x161033){var _0x4847be={};var _0x3479c2={};var _0x406108;var _0x94195a;return db['ChatGroup']['findOne']({'where':{'id':_0x581035[_0x81ba('0x4a')]['id']}})[_0x81ba('0x26')](handleEntityNotFound(_0x20148c,null))['then'](function(_0x13a4b4){if(_0x13a4b4){_0x406108=_0x13a4b4;_0x3479c2[_0x81ba('0x32')]=_['keys'](db[_0x81ba('0x4d')][_0x81ba('0x2f')]);_0x3479c2[_0x81ba('0x34')]=_[_0x81ba('0x33')](_0x581035[_0x81ba('0x34')]);_0x3479c2['filters']=_[_0x81ba('0x35')](_0x3479c2[_0x81ba('0x32')],_0x3479c2[_0x81ba('0x34')]);_0x4847be[_0x81ba('0x36')]=_[_0x81ba('0x35')](_0x3479c2[_0x81ba('0x32')],qs['fields'](_0x581035[_0x81ba('0x34')][_0x81ba('0x37')]));_0x4847be[_0x81ba('0x36')]=_0x4847be[_0x81ba('0x36')]['length']?_0x4847be[_0x81ba('0x36')]:_0x3479c2['model'];_0x4847be['order']=qs[_0x81ba('0x3a')](_0x581035[_0x81ba('0x34')]['sort']);_0x4847be[_0x81ba('0x3b')]=qs[_0x81ba('0x3d')](_[_0x81ba('0x3c')](_0x581035['query'],_0x3479c2[_0x81ba('0x3d')]));if(_0x581035[_0x81ba('0x34')][_0x81ba('0x3e')]){_0x4847be[_0x81ba('0x3b')]=_[_0x81ba('0x3f')](_0x4847be[_0x81ba('0x3b')],{'$or':_['map'](_0x4847be['attributes'],function(_0x35854d){var _0x523866={};_0x523866[_0x35854d]={'$like':'%'+_0x581035[_0x81ba('0x34')][_0x81ba('0x3e')]+'%'};return _0x523866;})});}if(_0x581035['query']['$gte']){var _0x29bdd7=_0x581035[_0x81ba('0x34')][_0x81ba('0x5c')][_0x81ba('0x5d')](',');var _0x5933cf={};_0x5933cf[_0x29bdd7[0x0]]={'$gte':moment(_0x29bdd7[0x1])['format'](_0x81ba('0x5e'))};_0x4847be[_0x81ba('0x3b')]=_['merge'](_0x4847be['where'],_0x5933cf);}_0x4847be=_[_0x81ba('0x3f')]({},_0x4847be,_0x581035[_0x81ba('0x40')]);return _0x406108['getMessages'](_0x4847be);}})[_0x81ba('0x26')](function(_0x3b5812){if(_0x3b5812){_0x94195a=_0x3b5812[_0x81ba('0x56')];if(!_0x581035['query'][_0x81ba('0x38')](_0x81ba('0x39'))){_0x4847be[_0x81ba('0x22')]=qs[_0x81ba('0x22')](_0x581035[_0x81ba('0x34')]['limit']);_0x4847be[_0x81ba('0x21')]=qs[_0x81ba('0x21')](_0x581035[_0x81ba('0x34')][_0x81ba('0x21')]);}return _0x406108[_0x81ba('0x5b')](_0x4847be);}})['then'](function(_0x26496f){if(_0x26496f){return _0x26496f?{'count':_0x94195a,'rows':_0x26496f}:null;}})[_0x81ba('0x26')](respondWithResult(_0x20148c,null))[_0x81ba('0x49')](handleError(_0x20148c,null));};
\ No newline at end of file
+var _0x6551=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','update','then','error','name','send','index','map','ChatGroup','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','keys','find','create','body','destroy','describe','getUnread','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','pick','nolimit','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x37fb9e,_0x3ce746){var _0x38a526=function(_0x327a02){while(--_0x327a02){_0x37fb9e['push'](_0x37fb9e['shift']());}};_0x38a526(++_0x3ce746);}(_0x6551,0x1e1));var _0x1655=function(_0x12a961,_0x566902){_0x12a961=_0x12a961-0x0;var _0x596299=_0x6551[_0x12a961];return _0x596299;};'use strict';var emlformat=require(_0x1655('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1655('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1655('0x2'));var Mustache=require(_0x1655('0x3'));var util=require(_0x1655('0x4'));var path=require(_0x1655('0x5'));var sox=require(_0x1655('0x6'));var csv=require('to-csv');var ejs=require(_0x1655('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1655('0x8'));var squel=require(_0x1655('0x9'));var crypto=require(_0x1655('0xa'));var jsforce=require(_0x1655('0xb'));var deskjs=require(_0x1655('0xc'));var toCsv=require(_0x1655('0xd'));var querystring=require(_0x1655('0xe'));var Papa=require(_0x1655('0xf'));var Redis=require(_0x1655('0x10'));var authService=require(_0x1655('0x11'));var qs=require(_0x1655('0x12'));var as=require(_0x1655('0x13'));var hardwareService=require(_0x1655('0x14'));var logger=require(_0x1655('0x15'))(_0x1655('0x16'));var utils=require(_0x1655('0x17'));var config=require(_0x1655('0x18'));var licenseUtil=require(_0x1655('0x19'));var db=require(_0x1655('0x1a'))['db'];config[_0x1655('0x1b')]=_[_0x1655('0x1c')](config[_0x1655('0x1b')],{'host':_0x1655('0x1d'),'port':0x18eb});var socket=require(_0x1655('0x1e'))(new Redis(config[_0x1655('0x1b')]));require(_0x1655('0x1f'))[_0x1655('0x20')](socket);function respondWithStatusCode(_0x121ca9,_0x33b8bf){_0x33b8bf=_0x33b8bf||0xcc;return function(_0x322be8){if(_0x322be8){return _0x121ca9[_0x1655('0x21')](_0x33b8bf);}return _0x121ca9[_0x1655('0x22')](_0x33b8bf)[_0x1655('0x23')]();};}function respondWithResult(_0x1c4299,_0x29c4e6){_0x29c4e6=_0x29c4e6||0xc8;return function(_0x33b4eb){if(_0x33b4eb){return _0x1c4299[_0x1655('0x22')](_0x29c4e6)[_0x1655('0x24')](_0x33b4eb);}};}function respondWithFilteredResult(_0x14bec6,_0x1f8e41){return function(_0x33bfca){if(_0x33bfca){var _0x307dec=typeof _0x1f8e41[_0x1655('0x25')]===_0x1655('0x26')&&typeof _0x1f8e41[_0x1655('0x27')]===_0x1655('0x26');var _0x51db32=_0x33bfca['count'];var _0x56be3b=_0x307dec?0x0:_0x1f8e41[_0x1655('0x25')];var _0x23856b=_0x307dec?_0x33bfca['count']:_0x1f8e41['offset']+_0x1f8e41[_0x1655('0x27')];var _0x3d9ffc;if(_0x23856b>=_0x51db32){_0x23856b=_0x51db32;_0x3d9ffc=0xc8;}else{_0x3d9ffc=0xce;}_0x14bec6[_0x1655('0x22')](_0x3d9ffc);return _0x14bec6[_0x1655('0x28')]('Content-Range',_0x56be3b+'-'+_0x23856b+'/'+_0x51db32)['json'](_0x33bfca);}return null;};}function patchUpdates(_0x59bb09){return function(_0x140fb2){try{jsonpatch[_0x1655('0x29')](_0x140fb2,_0x59bb09,!![]);}catch(_0x17474e){return BPromise['reject'](_0x17474e);}return _0x140fb2[_0x1655('0x2a')]();};}function saveUpdates(_0x577e93,_0x1439a6){return function(_0x4abf54){if(_0x4abf54){return _0x4abf54[_0x1655('0x2b')](_0x577e93)[_0x1655('0x2c')](function(_0x5cb753){return _0x5cb753;});}return null;};}function removeEntity(_0x4280a7,_0x2bc51e){return function(_0x408e60){if(_0x408e60){return _0x408e60['destroy']()[_0x1655('0x2c')](function(){_0x4280a7[_0x1655('0x22')](0xcc)[_0x1655('0x23')]();});}};}function handleEntityNotFound(_0xe11a36,_0x43fe3f){return function(_0x201109){if(!_0x201109){_0xe11a36[_0x1655('0x21')](0x194);}return _0x201109;};}function handleError(_0x2cdcda,_0x1093bf){_0x1093bf=_0x1093bf||0x1f4;return function(_0xce9980){logger[_0x1655('0x2d')](_0xce9980['stack']);if(_0xce9980[_0x1655('0x2e')]){delete _0xce9980['name'];}_0x2cdcda['status'](_0x1093bf)[_0x1655('0x2f')](_0xce9980);};}exports[_0x1655('0x30')]=function(_0x3dd4dc,_0x5293d1){var _0x42364f={},_0x4edfbf={},_0x200abe={'count':0x0,'rows':[]};var _0x35f7f1=_[_0x1655('0x31')](db[_0x1655('0x32')]['rawAttributes'],function(_0x2bb85f){return{'name':_0x2bb85f['fieldName'],'type':_0x2bb85f['type'][_0x1655('0x33')]};});_0x4edfbf[_0x1655('0x34')]=_[_0x1655('0x31')](_0x35f7f1,_0x1655('0x2e'));_0x4edfbf[_0x1655('0x35')]=_['keys'](_0x3dd4dc[_0x1655('0x35')]);_0x4edfbf['filters']=_[_0x1655('0x36')](_0x4edfbf['model'],_0x4edfbf[_0x1655('0x35')]);_0x42364f[_0x1655('0x37')]=_['intersection'](_0x4edfbf[_0x1655('0x34')],qs[_0x1655('0x38')](_0x3dd4dc['query'][_0x1655('0x38')]));_0x42364f['attributes']=_0x42364f[_0x1655('0x37')][_0x1655('0x39')]?_0x42364f['attributes']:_0x4edfbf['model'];if(!_0x3dd4dc[_0x1655('0x35')][_0x1655('0x3a')]('nolimit')){_0x42364f[_0x1655('0x27')]=qs[_0x1655('0x27')](_0x3dd4dc[_0x1655('0x35')][_0x1655('0x27')]);_0x42364f[_0x1655('0x25')]=qs['offset'](_0x3dd4dc[_0x1655('0x35')][_0x1655('0x25')]);}_0x42364f[_0x1655('0x3b')]=qs[_0x1655('0x3c')](_0x3dd4dc[_0x1655('0x35')]['sort']);_0x42364f[_0x1655('0x3d')]=qs[_0x1655('0x3e')](_['pick'](_0x3dd4dc['query'],_0x4edfbf[_0x1655('0x3e')]),_0x35f7f1);if(_0x3dd4dc[_0x1655('0x35')]['filter']){_0x42364f[_0x1655('0x3d')]=_[_0x1655('0x3f')](_0x42364f[_0x1655('0x3d')],{'$or':_['map'](_0x35f7f1,function(_0x183e5c){if(_0x183e5c['type']!==_0x1655('0x40')){var _0x82a045={};_0x82a045[_0x183e5c[_0x1655('0x2e')]]={'$like':'%'+_0x3dd4dc[_0x1655('0x35')][_0x1655('0x41')]+'%'};return _0x82a045;}})});}_0x42364f=_[_0x1655('0x3f')]({},_0x42364f,_0x3dd4dc[_0x1655('0x42')]);var _0x3270dd={'where':_0x42364f[_0x1655('0x3d')]};return db[_0x1655('0x32')][_0x1655('0x43')](_0x3270dd)[_0x1655('0x2c')](function(_0x3f1de6){_0x200abe[_0x1655('0x43')]=_0x3f1de6;if(_0x3dd4dc[_0x1655('0x35')][_0x1655('0x44')]){_0x42364f[_0x1655('0x45')]=[{'all':!![]}];}return db[_0x1655('0x32')][_0x1655('0x46')](_0x42364f);})[_0x1655('0x2c')](function(_0x3a4b0e){_0x200abe['rows']=_0x3a4b0e;return _0x200abe;})['then'](respondWithFilteredResult(_0x5293d1,_0x42364f))[_0x1655('0x47')](handleError(_0x5293d1,null));};exports[_0x1655('0x48')]=function(_0x3a0e70,_0x387c3a){var _0xe3285e={'raw':!![],'where':{'id':_0x3a0e70[_0x1655('0x49')]['id']}},_0x4ce777={};_0x4ce777['model']=_['keys'](db[_0x1655('0x32')][_0x1655('0x4a')]);_0x4ce777[_0x1655('0x35')]=_[_0x1655('0x4b')](_0x3a0e70[_0x1655('0x35')]);_0x4ce777[_0x1655('0x3e')]=_[_0x1655('0x36')](_0x4ce777[_0x1655('0x34')],_0x4ce777[_0x1655('0x35')]);_0xe3285e[_0x1655('0x37')]=_[_0x1655('0x36')](_0x4ce777[_0x1655('0x34')],qs[_0x1655('0x38')](_0x3a0e70[_0x1655('0x35')][_0x1655('0x38')]));_0xe3285e[_0x1655('0x37')]=_0xe3285e['attributes']['length']?_0xe3285e[_0x1655('0x37')]:_0x4ce777[_0x1655('0x34')];if(_0x3a0e70[_0x1655('0x35')][_0x1655('0x44')]){_0xe3285e[_0x1655('0x45')]=[{'all':!![]}];}_0xe3285e=_[_0x1655('0x3f')]({},_0xe3285e,_0x3a0e70[_0x1655('0x42')]);return db[_0x1655('0x32')][_0x1655('0x4c')](_0xe3285e)[_0x1655('0x2c')](handleEntityNotFound(_0x387c3a,null))[_0x1655('0x2c')](respondWithResult(_0x387c3a,null))[_0x1655('0x47')](handleError(_0x387c3a,null));};exports[_0x1655('0x4d')]=function(_0x41c18c,_0x4dcdcb){return db[_0x1655('0x32')][_0x1655('0x4d')](_0x41c18c[_0x1655('0x4e')],{})['then'](respondWithResult(_0x4dcdcb,0xc9))[_0x1655('0x47')](handleError(_0x4dcdcb,null));};exports[_0x1655('0x2b')]=function(_0x35daec,_0x54bf73){if(_0x35daec[_0x1655('0x4e')]['id']){delete _0x35daec['body']['id'];}return db[_0x1655('0x32')][_0x1655('0x4c')]({'where':{'id':_0x35daec['params']['id']}})[_0x1655('0x2c')](handleEntityNotFound(_0x54bf73,null))[_0x1655('0x2c')](saveUpdates(_0x35daec[_0x1655('0x4e')],null))['then'](respondWithResult(_0x54bf73,null))[_0x1655('0x47')](handleError(_0x54bf73,null));};exports[_0x1655('0x4f')]=function(_0x272792,_0x131b66){return db[_0x1655('0x32')]['find']({'where':{'id':_0x272792['params']['id']}})[_0x1655('0x2c')](handleEntityNotFound(_0x131b66,null))['then'](removeEntity(_0x131b66,null))[_0x1655('0x47')](handleError(_0x131b66,null));};exports['describe']=function(_0x1485f6,_0x1b0e31){return db[_0x1655('0x32')][_0x1655('0x50')]()[_0x1655('0x2c')](respondWithResult(_0x1b0e31,null))[_0x1655('0x47')](handleError(_0x1b0e31,null));};exports[_0x1655('0x51')]=function(_0x331606,_0x3f28ee,_0x3635ea){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x331606[_0x1655('0x49')]['id'],'ToId':_0x331606[_0x1655('0x52')]['id'],'read':![]}})[_0x1655('0x2c')](function(_0x11178c){return{'id':_[_0x1655('0x53')](_0x331606[_0x1655('0x49')]['id']),'count':_0x11178c};})[_0x1655('0x2c')](respondWithResult(_0x3f28ee,null))[_0x1655('0x47')](handleError(_0x3f28ee,null));};exports['addMembers']=function(_0xe5b627,_0x5f1c10,_0x3ed3d6){return db[_0x1655('0x32')][_0x1655('0x4c')]({'where':{'id':_0xe5b627[_0x1655('0x49')]['id']}})[_0x1655('0x2c')](handleEntityNotFound(_0x5f1c10,null))[_0x1655('0x2c')](function(_0x4425e2){if(_0x4425e2){return _0x4425e2[_0x1655('0x54')](_0xe5b627[_0x1655('0x4e')]['ids'],_[_0x1655('0x55')](_0xe5b627[_0x1655('0x4e')],[_0x1655('0x56'),'id'])||{});}})[_0x1655('0x2c')](respondWithResult(_0x5f1c10,null))[_0x1655('0x47')](handleError(_0x5f1c10,null));};exports[_0x1655('0x57')]=function(_0xdf2242,_0x17b4df,_0x62b55c){var _0x278f37={};var _0x10c9aa={};var _0x199eef;var _0x600ace;return db[_0x1655('0x32')][_0x1655('0x58')]({'where':{'id':_0xdf2242[_0x1655('0x49')]['id']}})['then'](handleEntityNotFound(_0x17b4df,null))[_0x1655('0x2c')](function(_0x521912){if(_0x521912){_0x199eef=_0x521912;_0x10c9aa[_0x1655('0x34')]=_[_0x1655('0x4b')](db[_0x1655('0x59')][_0x1655('0x4a')]);_0x10c9aa['query']=_[_0x1655('0x4b')](_0xdf2242['query']);_0x10c9aa[_0x1655('0x3e')]=_[_0x1655('0x36')](_0x10c9aa[_0x1655('0x34')],_0x10c9aa[_0x1655('0x35')]);_0x278f37['attributes']=_[_0x1655('0x36')](_0x10c9aa['model'],qs[_0x1655('0x38')](_0xdf2242[_0x1655('0x35')][_0x1655('0x38')]));_0x278f37[_0x1655('0x37')]=_0x278f37[_0x1655('0x37')][_0x1655('0x39')]?_0x278f37[_0x1655('0x37')]:_0x10c9aa['model'];_0x278f37[_0x1655('0x3b')]=qs[_0x1655('0x3c')](_0xdf2242['query']['sort']);_0x278f37[_0x1655('0x3d')]=qs[_0x1655('0x3e')](_[_0x1655('0x5a')](_0xdf2242[_0x1655('0x35')],_0x10c9aa[_0x1655('0x3e')]));if(_0xdf2242[_0x1655('0x35')][_0x1655('0x41')]){_0x278f37['where']=_[_0x1655('0x3f')](_0x278f37[_0x1655('0x3d')],{'$or':_[_0x1655('0x31')](_0x278f37[_0x1655('0x37')],function(_0xe692d9){var _0x325a8e={};_0x325a8e[_0xe692d9]={'$like':'%'+_0xdf2242[_0x1655('0x35')][_0x1655('0x41')]+'%'};return _0x325a8e;})});}_0x278f37=_['merge']({},_0x278f37,_0xdf2242[_0x1655('0x42')]);return _0x199eef[_0x1655('0x57')](_0x278f37);}})[_0x1655('0x2c')](function(_0xc6978){if(_0xc6978){_0x600ace=_0xc6978[_0x1655('0x39')];if(!_0xdf2242['query']['hasOwnProperty'](_0x1655('0x5b'))){_0x278f37[_0x1655('0x27')]=qs['limit'](_0xdf2242[_0x1655('0x35')]['limit']);_0x278f37['offset']=qs['offset'](_0xdf2242[_0x1655('0x35')]['offset']);}return _0x199eef[_0x1655('0x57')](_0x278f37);}})['then'](function(_0x19df1f){if(_0x19df1f){return _0x19df1f?{'count':_0x600ace,'rows':_0x19df1f}:null;}})[_0x1655('0x2c')](respondWithResult(_0x17b4df,null))[_0x1655('0x47')](handleError(_0x17b4df,null));};exports[_0x1655('0x5c')]=function(_0x181eab,_0x777fad,_0x2ca49a){return db[_0x1655('0x32')][_0x1655('0x4c')]({'where':{'id':_0x181eab[_0x1655('0x49')]['id']}})['then'](handleEntityNotFound(_0x777fad,null))[_0x1655('0x2c')](function(_0x530ddb){if(_0x530ddb){return _0x530ddb[_0x1655('0x5c')](_0x181eab['query'][_0x1655('0x56')]);}})['then'](respondWithStatusCode(_0x777fad,null))[_0x1655('0x47')](handleError(_0x777fad,null));};exports['addMessage']=function(_0x2d6ad9,_0x5449e3,_0x3f960c){if(_0x2d6ad9[_0x1655('0x4e')]['id']){delete _0x2d6ad9[_0x1655('0x4e')]['id'];}return db[_0x1655('0x32')]['find']({'where':{'id':_0x2d6ad9[_0x1655('0x49')]['id']}})[_0x1655('0x2c')](handleEntityNotFound(_0x5449e3,null))[_0x1655('0x2c')](function(_0x1341d5){if(_0x1341d5){_0x2d6ad9[_0x1655('0x4e')][_0x1655('0x5d')]=_0x1341d5['id'];return db[_0x1655('0x5e')]['create'](_0x2d6ad9[_0x1655('0x4e')]);}})['then'](respondWithResult(_0x5449e3,null))[_0x1655('0x47')](handleError(_0x5449e3,null));};exports[_0x1655('0x5f')]=function(_0x5c4af6,_0x55b373,_0xf54a3d){var _0x220007={};var _0x35b0a9={};var _0x366288;var _0x2ff06a;return db[_0x1655('0x32')][_0x1655('0x58')]({'where':{'id':_0x5c4af6['params']['id']}})[_0x1655('0x2c')](handleEntityNotFound(_0x55b373,null))[_0x1655('0x2c')](function(_0x51422e){if(_0x51422e){_0x366288=_0x51422e;_0x35b0a9[_0x1655('0x34')]=_[_0x1655('0x4b')](db[_0x1655('0x5e')]['rawAttributes']);_0x35b0a9[_0x1655('0x35')]=_[_0x1655('0x4b')](_0x5c4af6[_0x1655('0x35')]);_0x35b0a9[_0x1655('0x3e')]=_[_0x1655('0x36')](_0x35b0a9[_0x1655('0x34')],_0x35b0a9[_0x1655('0x35')]);_0x220007[_0x1655('0x37')]=_[_0x1655('0x36')](_0x35b0a9[_0x1655('0x34')],qs['fields'](_0x5c4af6[_0x1655('0x35')][_0x1655('0x38')]));_0x220007['attributes']=_0x220007[_0x1655('0x37')][_0x1655('0x39')]?_0x220007[_0x1655('0x37')]:_0x35b0a9['model'];_0x220007[_0x1655('0x3b')]=qs['sort'](_0x5c4af6[_0x1655('0x35')][_0x1655('0x3c')]);_0x220007['where']=qs[_0x1655('0x3e')](_['pick'](_0x5c4af6['query'],_0x35b0a9[_0x1655('0x3e')]));if(_0x5c4af6[_0x1655('0x35')]['filter']){_0x220007['where']=_[_0x1655('0x3f')](_0x220007[_0x1655('0x3d')],{'$or':_[_0x1655('0x31')](_0x220007[_0x1655('0x37')],function(_0xa577f3){var _0x1ce8b3={};_0x1ce8b3[_0xa577f3]={'$like':'%'+_0x5c4af6['query']['filter']+'%'};return _0x1ce8b3;})});}if(_0x5c4af6[_0x1655('0x35')][_0x1655('0x60')]){var _0x2d8dd8=_0x5c4af6[_0x1655('0x35')]['$gte'][_0x1655('0x61')](',');var _0x1d5e6e={};_0x1d5e6e[_0x2d8dd8[0x0]]={'$gte':moment(_0x2d8dd8[0x1])[_0x1655('0x62')](_0x1655('0x63'))};_0x220007[_0x1655('0x3d')]=_['merge'](_0x220007[_0x1655('0x3d')],_0x1d5e6e);}_0x220007=_[_0x1655('0x3f')]({},_0x220007,_0x5c4af6[_0x1655('0x42')]);return _0x366288[_0x1655('0x5f')](_0x220007);}})[_0x1655('0x2c')](function(_0x583f65){if(_0x583f65){_0x2ff06a=_0x583f65[_0x1655('0x39')];if(!_0x5c4af6[_0x1655('0x35')][_0x1655('0x3a')](_0x1655('0x5b'))){_0x220007[_0x1655('0x27')]=qs[_0x1655('0x27')](_0x5c4af6[_0x1655('0x35')][_0x1655('0x27')]);_0x220007[_0x1655('0x25')]=qs['offset'](_0x5c4af6[_0x1655('0x35')][_0x1655('0x25')]);}return _0x366288[_0x1655('0x5f')](_0x220007);}})[_0x1655('0x2c')](function(_0x45aca6){if(_0x45aca6){return _0x45aca6?{'count':_0x2ff06a,'rows':_0x45aca6}:null;}})[_0x1655('0x2c')](respondWithResult(_0x55b373,null))[_0x1655('0x47')](handleError(_0x55b373,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 2cc9919..cc8e231 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 _0x2a19=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x55cc58,_0x5ce0af){var _0x26062e=function(_0x59e29d){while(--_0x59e29d){_0x55cc58['push'](_0x55cc58['shift']());}};_0x26062e(++_0x5ce0af);}(_0x2a19,0x199));var _0x92a1=function(_0x396c80,_0x13909e){_0x396c80=_0x396c80-0x0;var _0x4d3944=_0x2a19[_0x396c80];return _0x4d3944;};'use strict';var EventEmitter=require(_0x92a1('0x0'));var ChatGroup=require(_0x92a1('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x92a1('0x2'),'afterUpdate':_0x92a1('0x3'),'afterDestroy':_0x92a1('0x4')};function emitEvent(_0x356e40){return function(_0x315f01,_0x38ba73,_0x53eda1){ChatGroupEvents[_0x92a1('0x5')](_0x356e40+':'+_0x315f01['id'],_0x315f01);ChatGroupEvents[_0x92a1('0x5')](_0x356e40,_0x315f01);_0x53eda1(null);};}for(var e in events){if(events[_0x92a1('0x6')](e)){var event=events[e];ChatGroup[_0x92a1('0x7')](e,emitEvent(event));}}module[_0x92a1('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x6239=['events','../../mysqldb','ChatGroup','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3263aa,_0xa9ae7b){var _0x2184a9=function(_0x4baca1){while(--_0x4baca1){_0x3263aa['push'](_0x3263aa['shift']());}};_0x2184a9(++_0xa9ae7b);}(_0x6239,0x144));var _0x9623=function(_0x230115,_0x522113){_0x230115=_0x230115-0x0;var _0x48de38=_0x6239[_0x230115];return _0x48de38;};'use strict';var EventEmitter=require(_0x9623('0x0'));var ChatGroup=require(_0x9623('0x1'))['db'][_0x9623('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9623('0x3'),'afterUpdate':_0x9623('0x4'),'afterDestroy':_0x9623('0x5')};function emitEvent(_0x1a6015){return function(_0x1688cf,_0x24d85b,_0xd052a2){ChatGroupEvents[_0x9623('0x6')](_0x1a6015+':'+_0x1688cf['id'],_0x1688cf);ChatGroupEvents[_0x9623('0x6')](_0x1a6015,_0x1688cf);_0xd052a2(null);};}for(var e in events){if(events[_0x9623('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x9623('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 6c13267..c59a8dd 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 _0x2a8c=['rimraf','./chatGroup.attributes','exports','define','ChatGroup','util','api','moment','request-promise','path'];(function(_0xe1865b,_0x2129af){var _0x4a313f=function(_0x42ba87){while(--_0x42ba87){_0xe1865b['push'](_0xe1865b['shift']());}};_0x4a313f(++_0x2129af);}(_0x2a8c,0xb9));var _0xc2a8=function(_0x3cbce1,_0x50e44d){_0x3cbce1=_0x3cbce1-0x0;var _0xeec3c=_0x2a8c[_0x3cbce1];return _0xeec3c;};'use strict';var _=require('lodash');var util=require(_0xc2a8('0x0'));var logger=require('../../config/logger')(_0xc2a8('0x1'));var moment=require(_0xc2a8('0x2'));var BPromise=require('bluebird');var rp=require(_0xc2a8('0x3'));var fs=require('fs');var path=require(_0xc2a8('0x4'));var rimraf=require(_0xc2a8('0x5'));var config=require('../../config/environment');var attributes=require(_0xc2a8('0x6'));module[_0xc2a8('0x7')]=function(_0x2ab7b8,_0x4c168a){return _0x2ab7b8[_0xc2a8('0x8')](_0xc2a8('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3bca=['moment','request-promise','path','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0xd9ae5,_0x54cc57){var _0x5ece93=function(_0x115bea){while(--_0x115bea){_0xd9ae5['push'](_0xd9ae5['shift']());}};_0x5ece93(++_0x54cc57);}(_0x3bca,0x75));var _0xa3bc=function(_0x3a3b99,_0x13326f){_0x3a3b99=_0x3a3b99-0x0;var _0x27a8df=_0x3bca[_0x3a3b99];return _0x27a8df;};'use strict';var _=require(_0xa3bc('0x0'));var util=require(_0xa3bc('0x1'));var logger=require(_0xa3bc('0x2'))('api');var moment=require(_0xa3bc('0x3'));var BPromise=require('bluebird');var rp=require(_0xa3bc('0x4'));var fs=require('fs');var path=require(_0xa3bc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa3bc('0x6'));module[_0xa3bc('0x7')]=function(_0x5f469d,_0x10e21d){return _0x5f469d['define'](_0xa3bc('0x8'),attributes,{'tableName':_0xa3bc('0x9'),'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 80173b5..1bdf90e 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 _0xd7ed=['error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x480939,_0x21ad9b){var _0x174871=function(_0x34fbf9){while(--_0x34fbf9){_0x480939['push'](_0x480939['shift']());}};_0x174871(++_0x21ad9b);}(_0xd7ed,0x1a8));var _0xdd7e=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd7ed[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0xdd7e('0x0'));var moment=require(_0xdd7e('0x1'));var BPromise=require(_0xdd7e('0x2'));var rs=require(_0xdd7e('0x3'));var fs=require('fs');var Redis=require(_0xdd7e('0x4'));var db=require(_0xdd7e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd7e('0x6'))(_0xdd7e('0x7'));var config=require(_0xdd7e('0x8'));var jayson=require(_0xdd7e('0x9'));var client=jayson[_0xdd7e('0xa')][_0xdd7e('0xb')]({'port':0x232a});config['redis']=_[_0xdd7e('0xc')](config['redis'],{'host':_0xdd7e('0xd'),'port':0x18eb});var socket=require(_0xdd7e('0xe'))(new Redis(config[_0xdd7e('0xf')]));require(_0xdd7e('0x10'))[_0xdd7e('0x11')](socket);function respondWithRpcPromise(_0x553204,_0x5eeb31,_0x3c704d){return new BPromise(function(_0x2820b8,_0x9c5dc5){return client['request'](_0x553204,_0x3c704d)[_0xdd7e('0x12')](function(_0x23b6d6){logger[_0xdd7e('0x13')](_0xdd7e('0x14'),_0x5eeb31,_0xdd7e('0x15'));logger[_0xdd7e('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5eeb31,_0xdd7e('0x15'),JSON[_0xdd7e('0x17')](_0x23b6d6));if(_0x23b6d6[_0xdd7e('0x18')]){if(_0x23b6d6[_0xdd7e('0x18')][_0xdd7e('0x19')]===0x1f4){logger[_0xdd7e('0x18')](_0xdd7e('0x14'),_0x5eeb31,_0x23b6d6[_0xdd7e('0x18')][_0xdd7e('0x1a')]);return _0x9c5dc5(_0x23b6d6['error'][_0xdd7e('0x1a')]);}logger['error'](_0xdd7e('0x14'),_0x5eeb31,_0x23b6d6['error'][_0xdd7e('0x1a')]);return _0x2820b8(_0x23b6d6[_0xdd7e('0x18')]['message']);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x5eeb31,_0xdd7e('0x15'));_0x2820b8(_0x23b6d6['result'][_0xdd7e('0x1a')]);}})[_0xdd7e('0x1b')](function(_0x149d81){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5eeb31,_0x149d81);_0x9c5dc5(_0x149d81);});});}
\ No newline at end of file
+var _0x06cb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','debug','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x4f6069,_0x262b32){var _0x56d182=function(_0x19bc7e){while(--_0x19bc7e){_0x4f6069['push'](_0x4f6069['shift']());}};_0x56d182(++_0x262b32);}(_0x06cb,0x1c6));var _0xb06c=function(_0x26c935,_0x57a9a6){_0x26c935=_0x26c935-0x0;var _0x2d3ada=_0x06cb[_0x26c935];return _0x2d3ada;};'use strict';var _=require(_0xb06c('0x0'));var util=require(_0xb06c('0x1'));var moment=require(_0xb06c('0x2'));var BPromise=require(_0xb06c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb06c('0x4'))['db'];var utils=require(_0xb06c('0x5'));var logger=require(_0xb06c('0x6'))(_0xb06c('0x7'));var config=require(_0xb06c('0x8'));var jayson=require(_0xb06c('0x9'));var client=jayson['client'][_0xb06c('0xa')]({'port':0x232a});config[_0xb06c('0xb')]=_[_0xb06c('0xc')](config[_0xb06c('0xb')],{'host':_0xb06c('0xd'),'port':0x18eb});var socket=require(_0xb06c('0xe'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xb06c('0xf')](socket);function respondWithRpcPromise(_0x1ccaf3,_0x358273,_0x4e5779){return new BPromise(function(_0x48b995,_0xbb656b){return client[_0xb06c('0x10')](_0x1ccaf3,_0x4e5779)[_0xb06c('0x11')](function(_0xf8893d){logger['info']('ChatGroup,\x20%s,\x20%s',_0x358273,'request\x20sent');logger[_0xb06c('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x358273,_0xb06c('0x13'),JSON[_0xb06c('0x14')](_0xf8893d));if(_0xf8893d[_0xb06c('0x15')]){if(_0xf8893d['error'][_0xb06c('0x16')]===0x1f4){logger['error'](_0xb06c('0x17'),_0x358273,_0xf8893d[_0xb06c('0x15')][_0xb06c('0x18')]);return _0xbb656b(_0xf8893d['error'][_0xb06c('0x18')]);}logger[_0xb06c('0x15')]('ChatGroup,\x20%s,\x20%s',_0x358273,_0xf8893d[_0xb06c('0x15')]['message']);return _0x48b995(_0xf8893d[_0xb06c('0x15')][_0xb06c('0x18')]);}else{logger['info'](_0xb06c('0x17'),_0x358273,_0xb06c('0x13'));_0x48b995(_0xf8893d[_0xb06c('0x19')]['message']);}})[_0xb06c('0x1a')](function(_0x33fdc2){logger['error'](_0xb06c('0x17'),_0x358273,_0x33fdc2);_0xbb656b(_0x33fdc2);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index a8f1b7f..0eed7a4 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 _0x4ee9=['save','remove','emit','removeListener','register','length','./chatGroup.events'];(function(_0x1926de,_0x5b356e){var _0x40e398=function(_0x22c05c){while(--_0x22c05c){_0x1926de['push'](_0x1926de['shift']());}};_0x40e398(++_0x5b356e);}(_0x4ee9,0x7d));var _0x94ee=function(_0x1c6856,_0x8786ba){_0x1c6856=_0x1c6856-0x0;var _0x310ca5=_0x4ee9[_0x1c6856];return _0x310ca5;};'use strict';var ChatGroupEvents=require(_0x94ee('0x0'));var events=[_0x94ee('0x1'),_0x94ee('0x2'),'update'];function createListener(_0x5d2094,_0xe6f521){return function(_0x5aac1f){_0xe6f521[_0x94ee('0x3')](_0x5d2094,_0x5aac1f);};}function removeListener(_0x19d5ad,_0x2d0d39){return function(){ChatGroupEvents[_0x94ee('0x4')](_0x19d5ad,_0x2d0d39);};}exports[_0x94ee('0x5')]=function(_0x4ac1f6){for(var _0x301156=0x0,_0x2af747=events[_0x94ee('0x6')];_0x301156<_0x2af747;_0x301156++){var _0x240067=events[_0x301156];var _0xd664a2=createListener('chatGroup:'+_0x240067,_0x4ac1f6);ChatGroupEvents['on'](_0x240067,_0xd664a2);}};
\ No newline at end of file
+var _0x1fcf=['register','chatGroup:','./chatGroup.events','save','update','removeListener'];(function(_0x286706,_0x25669b){var _0x38d9dc=function(_0x53ab76){while(--_0x53ab76){_0x286706['push'](_0x286706['shift']());}};_0x38d9dc(++_0x25669b);}(_0x1fcf,0x92));var _0xf1fc=function(_0x5436c0,_0x45beac){_0x5436c0=_0x5436c0-0x0;var _0x51a455=_0x1fcf[_0x5436c0];return _0x51a455;};'use strict';var ChatGroupEvents=require(_0xf1fc('0x0'));var events=[_0xf1fc('0x1'),'remove',_0xf1fc('0x2')];function createListener(_0x3fee50,_0x40c7cd){return function(_0x1ca9f0){_0x40c7cd['emit'](_0x3fee50,_0x1ca9f0);};}function removeListener(_0x54c724,_0x1cbc09){return function(){ChatGroupEvents[_0xf1fc('0x3')](_0x54c724,_0x1cbc09);};}exports[_0xf1fc('0x4')]=function(_0x50153c){for(var _0x16ad11=0x0,_0x181215=events['length'];_0x16ad11<_0x181215;_0x16ad11++){var _0x2d281b=events[_0x16ad11];var _0x5a6db2=createListener(_0xf1fc('0x5')+_0x2d281b,_0x50153c);ChatGroupEvents['on'](_0x2d281b,_0x5a6db2);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 55d7a00..074d140 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 _0xccb8=['get','index','/describe','isAuthenticated','describe','/:id','show','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','addMessage','put','update','delete','removeMembers','exports','multer','express','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xccb8,0x1c5));var _0x8ccb=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xccb8[_0x409353];return _0x4f4b59;};'use strict';var multer=require(_0x8ccb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8ccb('0x1'));var router=express['Router']();var fs_extra=require(_0x8ccb('0x2'));var auth=require(_0x8ccb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8ccb('0x4'));var controller=require(_0x8ccb('0x5'));router[_0x8ccb('0x6')]('/',auth['isAuthenticated'](),controller[_0x8ccb('0x7')]);router['get'](_0x8ccb('0x8'),auth[_0x8ccb('0x9')](),controller[_0x8ccb('0xa')]);router[_0x8ccb('0x6')](_0x8ccb('0xb'),auth[_0x8ccb('0x9')](),controller[_0x8ccb('0xc')]);router[_0x8ccb('0x6')]('/:id/unread',auth[_0x8ccb('0x9')](),controller[_0x8ccb('0xd')]);router[_0x8ccb('0x6')](_0x8ccb('0xe'),auth[_0x8ccb('0x9')](),controller[_0x8ccb('0xf')]);router[_0x8ccb('0x6')]('/:id/messages',auth[_0x8ccb('0x9')](),controller[_0x8ccb('0x10')]);router[_0x8ccb('0x11')]('/',auth[_0x8ccb('0x9')](),controller[_0x8ccb('0x12')]);router[_0x8ccb('0x11')](_0x8ccb('0xe'),auth['isAuthenticated'](),controller[_0x8ccb('0x13')]);router['post'](_0x8ccb('0x14'),auth[_0x8ccb('0x9')](),controller[_0x8ccb('0x15')]);router[_0x8ccb('0x16')](_0x8ccb('0xb'),auth['isAuthenticated'](),controller[_0x8ccb('0x17')]);router[_0x8ccb('0x18')]('/:id',auth[_0x8ccb('0x9')](),controller['destroy']);router['delete']('/:id/members',auth[_0x8ccb('0x9')](),controller[_0x8ccb('0x19')]);module[_0x8ccb('0x1a')]=router;
\ No newline at end of file
+var _0xb3d7=['isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMessage','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get'];(function(_0x4de452,_0x53a80f){var _0x2a80ee=function(_0x10080e){while(--_0x10080e){_0x4de452['push'](_0x4de452['shift']());}};_0x2a80ee(++_0x53a80f);}(_0xb3d7,0xc1));var _0x7b3d=function(_0x5daaae,_0x44f0e1){_0x5daaae=_0x5daaae-0x0;var _0x35b780=_0xb3d7[_0x5daaae];return _0x35b780;};'use strict';var multer=require(_0x7b3d('0x0'));var util=require('util');var path=require(_0x7b3d('0x1'));var timeout=require(_0x7b3d('0x2'));var express=require(_0x7b3d('0x3'));var router=express[_0x7b3d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7b3d('0x5'));var interaction=require(_0x7b3d('0x6'));var config=require(_0x7b3d('0x7'));var controller=require(_0x7b3d('0x8'));router[_0x7b3d('0x9')]('/',auth[_0x7b3d('0xa')](),controller[_0x7b3d('0xb')]);router[_0x7b3d('0x9')](_0x7b3d('0xc'),auth[_0x7b3d('0xa')](),controller[_0x7b3d('0xd')]);router[_0x7b3d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7b3d('0xe')]);router[_0x7b3d('0x9')](_0x7b3d('0xf'),auth['isAuthenticated'](),controller[_0x7b3d('0x10')]);router[_0x7b3d('0x9')](_0x7b3d('0x11'),auth[_0x7b3d('0xa')](),controller[_0x7b3d('0x12')]);router[_0x7b3d('0x9')](_0x7b3d('0x13'),auth['isAuthenticated'](),controller[_0x7b3d('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7b3d('0x15')]);router['post']('/:id/members',auth[_0x7b3d('0xa')](),controller['addMembers']);router[_0x7b3d('0x16')](_0x7b3d('0x13'),auth[_0x7b3d('0xa')](),controller[_0x7b3d('0x17')]);router[_0x7b3d('0x18')](_0x7b3d('0x19'),auth[_0x7b3d('0xa')](),controller[_0x7b3d('0x1a')]);router['delete'](_0x7b3d('0x19'),auth[_0x7b3d('0xa')](),controller['destroy']);router[_0x7b3d('0x1b')](_0x7b3d('0x11'),auth[_0x7b3d('0xa')](),controller['removeMembers']);module[_0x7b3d('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 9739f43..e3735a9 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 _0x8eba=['thumb','TEXT','STRING','DATE','long','out','sequelize','exports','star'];(function(_0x37ef3d,_0x364ab0){var _0x41f726=function(_0x39a586){while(--_0x39a586){_0x37ef3d['push'](_0x37ef3d['shift']());}};_0x41f726(++_0x364ab0);}(_0x8eba,0xc3));var _0xa8eb=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0x8eba[_0x2dc96f];return _0xd012da;};'use strict';var Sequelize=require(_0xa8eb('0x0'));module[_0xa8eb('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0xa8eb('0x2'),_0xa8eb('0x3')),'defaultValue':_0xa8eb('0x2')},'ratingMessage':{'type':Sequelize[_0xa8eb('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa8eb('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa8eb('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa8eb('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa8eb('0x5')]},'browserName':{'type':Sequelize[_0xa8eb('0x5')]},'browserVersion':{'type':Sequelize[_0xa8eb('0x5')]},'osName':{'type':Sequelize[_0xa8eb('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xa8eb('0x5')]},'deviceVendor':{'type':Sequelize[_0xa8eb('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xa8eb('0x4')]},'customerIp':{'type':Sequelize[_0xa8eb('0x5')]},'formData':{'type':Sequelize[_0xa8eb('0x4')](_0xa8eb('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xa8eb('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa8eb('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xa8eb('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xa8eb('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xfff0=['STRING','long','DATE','ENUM','out','exports','BOOLEAN','INTEGER','star','thumb','TEXT'];(function(_0xd390d9,_0x5c122d){var _0x132919=function(_0x17765c){while(--_0x17765c){_0xd390d9['push'](_0xd390d9['shift']());}};_0x132919(++_0x5c122d);}(_0xfff0,0x139));var _0x0fff=function(_0x454bc0,_0x580a46){_0x454bc0=_0x454bc0-0x0;var _0x415eeb=_0xfff0[_0x454bc0];return _0x415eeb;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'closed':{'type':Sequelize[_0x0fff('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0fff('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x0fff('0x3'),_0x0fff('0x4')),'defaultValue':_0x0fff('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x0fff('0x5')]},'mailTranscript':{'type':Sequelize[_0x0fff('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0fff('0x6')]},'secondDisposition':{'type':Sequelize[_0x0fff('0x6')]},'thirdDisposition':{'type':Sequelize[_0x0fff('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x0fff('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x0fff('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x0fff('0x6')]},'deviceVendor':{'type':Sequelize[_0x0fff('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x0fff('0x5')]},'customerIp':{'type':Sequelize[_0x0fff('0x6')]},'formData':{'type':Sequelize[_0x0fff('0x5')](_0x0fff('0x7'))},'read1stAt':{'type':Sequelize[_0x0fff('0x8')]},'lastMsgAt':{'type':Sequelize[_0x0fff('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x0fff('0x9')]('in',_0x0fff('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0fff('0x6')]},'customerPort':{'type':Sequelize[_0x0fff('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x0fff('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 948e303..5f8654e 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 _0xa04c=['follow','metadata','ValidationError','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','attachmentDownload','Unauthorized','Attachment','join','server/files/attachments/','offline-chat/','download','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ChatWebsiteId','ContactId','UserId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','omit','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','split','YYYY-MM-DD\x20HH:mm:ss','include','getMyMessages','pick','includeAgent','push','rows','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','lastName','value','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','stack','name','render','body','contact','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','user','show','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull'];(function(_0x42bc30,_0x41f496){var _0x57bad3=function(_0x32b20a){while(--_0x32b20a){_0x42bc30['push'](_0x42bc30['shift']());}};_0x57bad3(++_0x41f496);}(_0xa04c,0x79));var _0xca04=function(_0x31ee50,_0x4f738e){_0x31ee50=_0x31ee50-0x0;var _0x1f9150=_0xa04c[_0x31ee50];return _0x1f9150;};'use strict';var rimraf=require(_0xca04('0x0'));var zipdir=require(_0xca04('0x1'));var rp=require(_0xca04('0x2'));var moment=require(_0xca04('0x3'));var BPromise=require(_0xca04('0x4'));var Mustache=require(_0xca04('0x5'));var util=require(_0xca04('0x6'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xca04('0x7'));var interaction=require(_0xca04('0x8'));var qs=require(_0xca04('0x9'));var pdf=require(_0xca04('0xa'));var logger=require(_0xca04('0xb'))('api');var config=require('../../config/environment');var db=require(_0xca04('0xc'))['db'];config['redis']=_[_0xca04('0xd')](config['redis'],{'host':_0xca04('0xe'),'port':0x18eb});var socket=require(_0xca04('0xf'))(new Redis(config[_0xca04('0x10')]));require(_0xca04('0x11'))[_0xca04('0x12')](socket);var jayson=require(_0xca04('0x13'));var client=jayson[_0xca04('0x14')][_0xca04('0x15')]({'port':0x232b});var client9004=jayson['client'][_0xca04('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x46c8b9,_0x4c2286,_0x33a28d,_0x23a396){return new BPromise(function(_0x3665a5,_0x3e366b){var _0x262746=_0x23a396||client;return _0x262746[_0xca04('0x16')](_0x46c8b9,_0x33a28d)[_0xca04('0x17')](function(_0x408c60){logger[_0xca04('0x18')](_0xca04('0x19'),_0x4c2286,'request\x20sent');logger[_0xca04('0x1a')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4c2286,'request\x20sent',JSON[_0xca04('0x1b')](_0x408c60));if(_0x408c60[_0xca04('0x1c')]){if(_0x408c60[_0xca04('0x1c')][_0xca04('0x1d')]===0x1f4){logger[_0xca04('0x1c')](_0xca04('0x19'),_0x4c2286,_0x408c60[_0xca04('0x1c')][_0xca04('0x1e')]);return _0x3e366b(_0x408c60[_0xca04('0x1c')][_0xca04('0x1e')]);}logger[_0xca04('0x1c')](_0xca04('0x19'),_0x4c2286,_0x408c60[_0xca04('0x1c')]['message']);return _0x3665a5(_0x408c60['error'][_0xca04('0x1e')]);}else{logger[_0xca04('0x18')](_0xca04('0x19'),_0x4c2286,'request\x20sent');_0x3665a5(_0x408c60[_0xca04('0x1f')][_0xca04('0x1e')]);}})[_0xca04('0x20')](function(_0x327ccb){logger[_0xca04('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x4c2286,_0x327ccb);_0x3e366b(_0x327ccb);});});}function respondWithStatusCode(_0x5a6f09,_0x3c9d33){_0x3c9d33=_0x3c9d33||0xcc;return function(_0x212682){if(_0x212682){return _0x5a6f09[_0xca04('0x21')](_0x3c9d33);}return _0x5a6f09[_0xca04('0x22')](_0x3c9d33)['end']();};}function respondWithResult(_0x802641,_0x22b4ed){_0x22b4ed=_0x22b4ed||0xc8;return function(_0x497afd){if(_0x497afd){return _0x802641[_0xca04('0x22')](_0x22b4ed)[_0xca04('0x23')](_0x497afd);}};}function respondWithFilteredResult(_0x362180,_0x18f9a4){return function(_0xea09db){if(_0xea09db){var _0x37594b=typeof _0x18f9a4[_0xca04('0x24')]===_0xca04('0x25')&&typeof _0x18f9a4[_0xca04('0x26')]===_0xca04('0x25');var _0x5d2ae3=_0xea09db[_0xca04('0x27')];var _0x6219fc=_0x37594b?0x0:_0x18f9a4[_0xca04('0x24')];var _0x10ffe3=_0x37594b?_0xea09db[_0xca04('0x27')]:_0x18f9a4[_0xca04('0x24')]+_0x18f9a4[_0xca04('0x26')];var _0x4c7619;if(_0x10ffe3>=_0x5d2ae3){_0x10ffe3=_0x5d2ae3;_0x4c7619=0xc8;}else{_0x4c7619=0xce;}_0x362180[_0xca04('0x22')](_0x4c7619);return _0x362180[_0xca04('0x28')](_0xca04('0x29'),_0x6219fc+'-'+_0x10ffe3+'/'+_0x5d2ae3)[_0xca04('0x23')](_0xea09db);}return null;};}function saveUpdates(_0x51adaf){return function(_0x29872c){if(_0x29872c){return _0x29872c[_0xca04('0x2a')](_0x51adaf)[_0xca04('0x17')](function(_0x45ee71){return _0x45ee71;});}return null;};}function removeEntity(_0x331670){return function(_0x524b2a){if(_0x524b2a){return _0x524b2a[_0xca04('0x2b')]()[_0xca04('0x17')](function(){_0x331670[_0xca04('0x22')](0xcc)[_0xca04('0x2c')]();});}};}function handleEntityNotFound(_0x4fd050){return function(_0x370309){if(!_0x370309){_0x4fd050[_0xca04('0x21')](0x194);}return _0x370309;};}function handleError(_0x1982e3,_0x33015d){_0x33015d=_0x33015d||0x1f4;return function(_0x14833c){logger[_0xca04('0x1c')](_0x14833c[_0xca04('0x2d')]);if(_0x14833c[_0xca04('0x2e')]){delete _0x14833c[_0xca04('0x2e')];}_0x1982e3['status'](_0x33015d)['send'](_0x14833c);};}function getMustacheRender(_0x38f76a,_0x188d55){return Mustache[_0xca04('0x2f')](_0x38f76a,_['merge'](_0x188d55[_0xca04('0x30')],{'contact':_0x188d55[_0xca04('0x31')],'message':_0x188d55[_0xca04('0x1e')],'agent':_0x188d55[_0xca04('0x32')],'interaction':_0x188d55[_0xca04('0x33')],'account':_0x188d55['account']}))||'';}exports[_0xca04('0x34')]=function(_0x341b9d,_0x40fb7a){var _0x28fb04={};var _0x13c0c9=_[_0xca04('0x35')](db[_0xca04('0x36')][_0xca04('0x37')],function(_0x2ba639){return{'name':_0x2ba639[_0xca04('0x38')],'type':_0x2ba639[_0xca04('0x39')][_0xca04('0x3a')]};});_0x28fb04=qs[_0xca04('0x3b')](_0x13c0c9,_0x341b9d);return interaction[_0xca04('0x3c')]('chat',_0x341b9d['query'],_0x341b9d[_0xca04('0x3d')],_0x28fb04,_0x13c0c9)[_0xca04('0x17')](respondWithFilteredResult(_0x40fb7a,_0x28fb04))[_0xca04('0x20')](handleError(_0x40fb7a,null));};exports[_0xca04('0x3e')]=function(_0x29354d,_0x150539){var _0x8487c3={'raw':![],'where':{'id':_0x29354d['params']['id']}},_0x5693ca={};_0x5693ca[_0xca04('0x3f')]=_[_0xca04('0x40')](db[_0xca04('0x36')][_0xca04('0x37')]);_0x5693ca[_0xca04('0x41')]=_['keys'](_0x29354d[_0xca04('0x41')]);_0x5693ca[_0xca04('0x42')]=_[_0xca04('0x43')](_0x5693ca[_0xca04('0x3f')],_0x5693ca[_0xca04('0x41')]);_0x8487c3[_0xca04('0x44')]=_['intersection'](_0x5693ca['model'],qs[_0xca04('0x45')](_0x29354d[_0xca04('0x41')][_0xca04('0x45')]));_0x8487c3[_0xca04('0x44')]=_0x8487c3['attributes'][_0xca04('0x46')]?_0x8487c3[_0xca04('0x44')]:_0x5693ca[_0xca04('0x3f')];if(_0x29354d[_0xca04('0x41')][_0xca04('0x47')]){_0x8487c3['include']=[{'all':!![]}];}_0x8487c3=_[_0xca04('0x48')]({},_0x8487c3,_0x29354d[_0xca04('0x49')]);return db['ChatInteraction'][_0xca04('0x4a')](_0x8487c3)[_0xca04('0x17')](handleEntityNotFound(_0x150539,null))[_0xca04('0x17')](respondWithResult(_0x150539,null))[_0xca04('0x20')](handleError(_0x150539,null));};exports[_0xca04('0x4b')]=function(_0x49a6ad,_0x805e53){return db[_0xca04('0x36')][_0xca04('0x4b')](_0x49a6ad[_0xca04('0x30')],{})[_0xca04('0x17')](respondWithResult(_0x805e53,0xc9))['catch'](handleError(_0x805e53,null));};exports[_0xca04('0x2a')]=function(_0x4780c4,_0x339b4a){if(_0x4780c4[_0xca04('0x30')]['id']){delete _0x4780c4[_0xca04('0x30')]['id'];}return db['ChatInteraction'][_0xca04('0x4a')]({'where':{'id':_0x4780c4[_0xca04('0x4c')]['id']}})[_0xca04('0x17')](handleEntityNotFound(_0x339b4a,null))[_0xca04('0x17')](saveUpdates(_0x4780c4[_0xca04('0x30')],null))[_0xca04('0x17')](respondWithResult(_0x339b4a,null))[_0xca04('0x20')](handleError(_0x339b4a,null));};exports['destroy']=function(_0x16bc57,_0x5e861b){return db[_0xca04('0x36')]['find']({'where':{'id':_0x16bc57[_0xca04('0x4c')]['id']}})[_0xca04('0x17')](handleEntityNotFound(_0x5e861b,null))['then'](removeEntity(_0x5e861b,null))[_0xca04('0x20')](handleError(_0x5e861b,null));};exports['describe']=function(_0x176dfe,_0x3b97a0){return db[_0xca04('0x36')][_0xca04('0x4d')]()[_0xca04('0x17')](respondWithResult(_0x3b97a0,null))[_0xca04('0x20')](handleError(_0x3b97a0,null));};exports[_0xca04('0x4e')]=function(_0x2421d2,_0x3c64a4){var _0x617c3a=_0x2421d2[_0xca04('0x4c')]['id'];var _0x5c3949;var _0x2301b0;var _0x14c6df;return db['ChatInteraction'][_0xca04('0x4f')]({'where':{'id':_0x617c3a}})[_0xca04('0x17')](function(_0x18f13){_0x5c3949=_0x18f13;return db[_0xca04('0x50')]['findOne']({'where':{'id':_0x18f13['ChatWebsiteId']},'attributes':['id',_0xca04('0x51'),_0xca04('0x52'),_0xca04('0x53'),_0xca04('0x54'),_0xca04('0x55')],'raw':!![]});})[_0xca04('0x17')](function(_0x135033){if(_0x135033&&_0x135033[_0xca04('0x51')]&&_0x135033[_0xca04('0x52')]){_0x2301b0=_0x135033;var _0x54f7fe={'interaction':{'id':_0x617c3a},'agent':{'id':_0x2421d2[_0xca04('0x3d')]['id'],'name':_0x2421d2[_0xca04('0x3d')][_0xca04('0x2e')],'fullname':_0x2421d2[_0xca04('0x3d')][_0xca04('0x56')],'email':_0x2421d2[_0xca04('0x3d')][_0xca04('0x57')]},'contact':_0x2421d2['body']['contact'],'account':_0x2421d2[_0xca04('0x30')]['account']};var _0x14c2b6={'rejectUnauthorized':![],'method':_0xca04('0x58'),'url':_0xca04('0x59'),'headers':{'X-APIKEY':_0x135033['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2421d2[_0xca04('0x3d')][_0xca04('0x57')]],'buttons':null,'topic':_0x2301b0['vidaooTopic'],'note':_[_0xca04('0x5a')](_0x2301b0[_0xca04('0x54')])?null:getMustacheRender(_0x2301b0[_0xca04('0x54')],_0x54f7fe),'metadata':null},'redirect':_0xca04('0x5b'),'json':!![]};try{if(!_[_0xca04('0x5a')](_0x2301b0['vidaooMetadata'])){var _0x10928d=getMustacheRender(_0x2301b0[_0xca04('0x55')],_0x54f7fe);var _0x2fc228=JSON['parse'](_0x10928d);_0x14c2b6[_0xca04('0x30')][_0xca04('0x5c')]=_0x2fc228;}}catch(_0x207f24){throw new db['Sequelize'][(_0xca04('0x5d'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x14c2b6);}else{throw new db[(_0xca04('0x5e'))]['ValidationError'](_0xca04('0x5f'));}})[_0xca04('0x17')](function(_0x47d982){_0x14c6df=_0x47d982;if(_0x14c6df['id']){var _0x40df33={'body':_0x14c6df[_0xca04('0x60')],'ChatWebsiteId':_0x2301b0['id'],'ChatInteractionId':_0x5c3949['id'],'direction':'out','UserId':_0x2421d2[_0xca04('0x3d')]['id']};return db[_0xca04('0x61')]['create'](_0x40df33,{});}else{throw new db[(_0xca04('0x5e'))][(_0xca04('0x5d'))](_0xca04('0x62'));}})[_0xca04('0x17')](function(){return _0x5c3949[_0xca04('0x63')]({'vidaooSessionId':_0x14c6df['id']});})['then'](respondWithResult(_0x3c64a4,null))[_0xca04('0x20')](handleError(_0x3c64a4,null));};exports[_0xca04('0x64')]=function(_0x3fba88,_0x1a14a6){if(_0x3fba88[_0xca04('0x30')]['id']){delete _0x3fba88['body']['id'];}return db[_0xca04('0x36')][_0xca04('0x4a')]({'where':{'id':_0x3fba88[_0xca04('0x4c')]['id']},'include':[{'model':db[_0xca04('0x65')],'as':_0xca04('0x66')}]})['then'](handleEntityNotFound(_0x1a14a6,null))['then'](saveUpdates(_0x3fba88[_0xca04('0x30')],null))['then'](respondWithResult(_0x1a14a6,null))[_0xca04('0x20')](handleError(_0x1a14a6,null));};exports[_0xca04('0x67')]=function(_0x37b87a,_0x28115c){if(_0x37b87a['body']['id']){delete _0x37b87a[_0xca04('0x30')]['id'];}return db[_0xca04('0x36')]['find']({'where':{'id':_0x37b87a[_0xca04('0x4c')]['id']}})['then'](function(_0x320bfb){if(!_0x320bfb){logger['error'](_0xca04('0x68'),_0xca04('0x67'),0x194,_0xca04('0x69'));_0x28115c['sendStatus'](0x194);}else{if(_0x320bfb['UserId']){throw new db[(_0xca04('0x5e'))][(_0xca04('0x5d'))]('Interaction\x20already\x20assigned');}}return _0x320bfb;})[_0xca04('0x17')](function(_0x929c17){if(_0x929c17){return _0x929c17[_0xca04('0x2a')]({'closed':_0x37b87a[_0xca04('0x30')][_0xca04('0x6a')],'disposition':_0x37b87a['body'][_0xca04('0x6b')]})[_0xca04('0x17')](function(_0x1c59a1){return _0x1c59a1;});}})[_0xca04('0x17')](function(){return respondWithRpcPromise(_0xca04('0x6c'),_0xca04('0x67'),_0x37b87a['body'],client9004);})['then'](respondWithResult(_0x28115c,null))['catch'](handleError(_0x28115c,null));};exports[_0xca04('0x6d')]=function(_0x4507f6,_0x5ca750){_0x4507f6[_0xca04('0x30')][_0xca04('0x2e')]=_0x4507f6['file'][_0xca04('0x6e')];_0x4507f6[_0xca04('0x30')][_0xca04('0x6f')]=_0x4507f6[_0xca04('0x70')][_0xca04('0x71')];_0x4507f6[_0xca04('0x30')][_0xca04('0x39')]=_0x4507f6[_0xca04('0x70')]['mimetype'];return db['Attachment'][_0xca04('0x4b')](_0x4507f6[_0xca04('0x30')])['then'](respondWithResult(_0x5ca750,0xc9))['catch'](handleError(_0x5ca750,null));};exports[_0xca04('0x72')]=function(_0x564cce,_0x25fef1){return db[_0xca04('0x36')][_0xca04('0x4f')]({'where':{'id':_0x564cce[_0xca04('0x4c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x25fef1,null))[_0xca04('0x17')](function(_0xcb08){if(_0xcb08){if(_0xcb08[_0xca04('0x6a')]){return _0x25fef1['status'](0x193)['json']({'status':0x193,'message':_0xca04('0x73')});}return db[_0xca04('0x74')][_0xca04('0x4f')]({'where':{'id':_0x564cce[_0xca04('0x41')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x25fef1,null));}})['then'](function(_0x3e4783){if(_0x3e4783){var _0x50382f=_0x3e4783['ChatOfflineMessageId']!==null;var _0x236b22=path[_0xca04('0x75')](config['root'],_0xca04('0x76'));if(_0x50382f){_0x236b22=path[_0xca04('0x75')](_0x236b22,_0xca04('0x77'));}var _0x23487c=path[_0xca04('0x75')](_0x236b22,_0x3e4783['basename']);return _0x25fef1[_0xca04('0x78')](_0x23487c);}})[_0xca04('0x20')](handleError(_0x25fef1,null));};exports['close']=function(_0x49db75,_0x2ca5cd){var _0x1d41d1=null;var _0x29fb58=null;var _0x18bb37=null;if(_0x49db75[_0xca04('0x30')]['id']){delete _0x49db75[_0xca04('0x30')]['id'];}if(_0x49db75[_0xca04('0x30')][_0xca04('0x79')]){_0x18bb37=path[_0xca04('0x75')](config[_0xca04('0x7a')],_0xca04('0x7b'),util[_0xca04('0x7c')](_0xca04('0x7d'),Date[_0xca04('0x7e')]()));_0x49db75['body']['pathTranscript']=_0x18bb37;}return db[_0xca04('0x36')]['find']({'where':{'id':_0x49db75[_0xca04('0x4c')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xca04('0x7f'),'include':[{'model':db[_0xca04('0x80')],'as':'User'}]}]})[_0xca04('0x17')](handleEntityNotFound(_0x2ca5cd,null))[_0xca04('0x17')](saveUpdates(_0x49db75[_0xca04('0x30')],null))[_0xca04('0x17')](function(_0x4dec30){if(_0x4dec30){_0x1d41d1=_0x4dec30;return db['ChatWebsite'][_0xca04('0x4a')]({'where':{'id':_0x1d41d1[_0xca04('0x81')]}});}})[_0xca04('0x17')](function(_0x256c53){if(_0x256c53){_0x29fb58=_0x256c53;return db[_0xca04('0x65')][_0xca04('0x4a')]({'where':{'id':_0x1d41d1[_0xca04('0x82')]}});}})[_0xca04('0x17')](function(_0x376afc){if(_0x376afc){if(_0x18bb37){var _0x477c2a=null;for(var _0x1c6a03=0x1;_0x1c6a03<_0x1d41d1[_0xca04('0x7f')][_0xca04('0x46')];++_0x1c6a03){_0x477c2a=_0x1d41d1[_0xca04('0x7f')][_0x1c6a03];var _0x1c7571=_0x477c2a[_0xca04('0x83')]?util[_0xca04('0x7c')](_0xca04('0x84'),_0x29fb58[_0xca04('0x85')],_0x477c2a[_0xca04('0x83')]):_0xca04('0x86');var _0x4843d6=_0x49db75[_0xca04('0x30')][_0xca04('0x87')]||util[_0xca04('0x7c')](_0xca04('0x84'),_0xca04('0x88'),_0x477c2a[_0xca04('0x82')]);switch(_0x29fb58[_0xca04('0x89')]){case _0xca04('0x8a'):_0x1c7571=_0x477c2a[_0xca04('0x83')]?util[_0xca04('0x7c')](_0xca04('0x84'),_0x29fb58[_0xca04('0x85')],_0x477c2a[_0xca04('0x83')]):_0xca04('0x86');break;case _0xca04('0x8b'):_0x1c7571=_0x477c2a['UserId']?_0x477c2a['User'][_0xca04('0x8c')]||_0x477c2a[_0xca04('0x80')][_0xca04('0x56')]:'System';break;case _0xca04('0x8d'):_0x1c7571=_0x477c2a[_0xca04('0x83')]?_0x477c2a['User'][_0xca04('0x56')]:'System';break;default:_0x1c7571=_0x477c2a['UserId']?util[_0xca04('0x7c')](_0xca04('0x84'),_0x29fb58[_0xca04('0x85')],_0x477c2a[_0xca04('0x83')]):_0xca04('0x86');}var _0x48802a=util['format'](_0xca04('0x8e'),moment(_0x477c2a[_0xca04('0x8f')])[_0xca04('0x7c')](_0xca04('0x90')),_0x477c2a[_0xca04('0x91')]==='in'?_0x4843d6:_0x1c7571,_0x477c2a['body']);if(!_0x477c2a[_0xca04('0x92')]){fs[_0xca04('0x93')](_0x18bb37,_0x48802a);}}return db['MailAccount'][_0xca04('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0xca04('0x94')],'as':_0xca04('0x95'),'raw':!![],'include':[{'model':db[_0xca04('0x96')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xca04('0x17')](function(_0x2aadc0){if(!_0x2aadc0||!_0x2aadc0[_0xca04('0x95')]||!_0x49db75['body'])return _0x1d41d1;var _0x27df05=_0x2aadc0[_0xca04('0x97')]();return respondWithRpcPromise('SendMail',_0xca04('0x98'),{'account':_0x27df05,'message':{'from':util[_0xca04('0x7c')](_0xca04('0x99'),_0x2aadc0[_0xca04('0x2e')],_0x2aadc0[_0xca04('0x57')]||_0x2aadc0[_0xca04('0x95')][_0xca04('0x3d')]),'to':_0x49db75[_0xca04('0x30')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0xca04('0x7c')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x49db75[_0xca04('0x30')][_0xca04('0x79')]),'attachments':[{'path':_0x18bb37}]}})['then'](function(){return _0x1d41d1;})['catch'](function(_0x4615cd){logger['error'](_0x4615cd);});})[_0xca04('0x17')](respondWithStatusCode(_0x2ca5cd,0xc8))[_0xca04('0x20')](handleError(_0x2ca5cd,null));};exports[_0xca04('0x9a')]=function(_0x40ed44,_0x403319){return db[_0xca04('0x61')][_0xca04('0x4a')]({'where':{'id':_0x40ed44['params']['id']}})[_0xca04('0x17')](handleEntityNotFound(_0x403319,null))[_0xca04('0x17')](function(_0x1ad693){if(_0x1ad693){return _0x1ad693[_0xca04('0x9a')](_0x40ed44['body']['ids'],_[_0xca04('0x9b')](_0x40ed44[_0xca04('0x30')],[_0xca04('0x9c'),'id'])||{});}})[_0xca04('0x17')](respondWithResult(_0x403319,null))['catch'](handleError(_0x403319,null));};exports[_0xca04('0x9d')]=function(_0x14213d,_0x35e00d){var _0x13eec5={'raw':![],'where':{}};var _0x4baa20={};var _0x2787d0={'count':0x0,'rows':[]};return db[_0xca04('0x36')][_0xca04('0x4f')]({'where':{'id':_0x14213d['params']['id']}})['then'](handleEntityNotFound(_0x35e00d,null))[_0xca04('0x17')](function(_0x485b52){if(_0x485b52){_0x4baa20[_0xca04('0x3f')]=_['keys'](db[_0xca04('0x61')][_0xca04('0x37')]);_0x4baa20[_0xca04('0x41')]=_['keys'](_0x14213d[_0xca04('0x41')]);_0x4baa20[_0xca04('0x42')]=_[_0xca04('0x43')](_0x4baa20[_0xca04('0x3f')],_0x4baa20['query']);_0x13eec5[_0xca04('0x44')]=_[_0xca04('0x43')](_0x4baa20[_0xca04('0x3f')],qs[_0xca04('0x45')](_0x14213d[_0xca04('0x41')][_0xca04('0x45')]));_0x13eec5[_0xca04('0x44')]=_0x13eec5[_0xca04('0x44')]['length']?_0x13eec5['attributes']:_0x4baa20[_0xca04('0x3f')];if(!_0x14213d[_0xca04('0x41')][_0xca04('0x9e')](_0xca04('0x9f'))){_0x13eec5[_0xca04('0x26')]=qs['limit'](_0x14213d[_0xca04('0x41')][_0xca04('0x26')]);_0x13eec5[_0xca04('0x24')]=qs[_0xca04('0x24')](_0x14213d[_0xca04('0x41')][_0xca04('0x24')]);}_0x13eec5[_0xca04('0xa0')]=qs['sort'](_0x14213d[_0xca04('0x41')][_0xca04('0xa1')]);_0x13eec5['where']=qs[_0xca04('0x42')](_['pick'](_0x14213d[_0xca04('0x41')],_0x4baa20[_0xca04('0x42')]));_0x13eec5[_0xca04('0xa2')][_0xca04('0xa3')]=_0x485b52['id'];if(_0x14213d[_0xca04('0x41')][_0xca04('0xa4')]){_0x13eec5[_0xca04('0xa2')]=_[_0xca04('0x48')](_0x13eec5[_0xca04('0xa2')],{'$or':_[_0xca04('0x35')](_0x13eec5[_0xca04('0x44')],function(_0x99b24a){var _0x6fe971={};_0x6fe971[_0x99b24a]={'$like':'%'+_0x14213d[_0xca04('0x41')][_0xca04('0xa4')]+'%'};return _0x6fe971;})});}if(_0x14213d[_0xca04('0x41')]['$gte']){var _0x3915f3=_0x14213d['query']['$gte'][_0xca04('0xa5')](',');var _0xb6381c={};_0xb6381c[_0x3915f3[0x0]]={'$gte':moment(_0x3915f3[0x1])[_0xca04('0x7c')](_0xca04('0xa6'))};_0x13eec5[_0xca04('0xa2')]=_[_0xca04('0x48')](_0x13eec5[_0xca04('0xa2')],_0xb6381c);}_0x13eec5=_[_0xca04('0x48')]({},_0x13eec5,_0x14213d['options']);return db['ChatMessage'][_0xca04('0x27')]({'where':_0x13eec5[_0xca04('0xa2')]})['then'](function(_0x17651f){_0x2787d0[_0xca04('0x27')]=_0x17651f;if(_0x14213d[_0xca04('0x41')][_0xca04('0x47')]){_0x13eec5[_0xca04('0xa7')]=[{'all':!![]}];}return db[_0xca04('0x61')][_0xca04('0x3c')](_0x13eec5);})['then'](function(_0x12ad02){_0x2787d0['rows']=_0x12ad02;return _0x2787d0;});}})[_0xca04('0x17')](respondWithFilteredResult(_0x35e00d,_0x13eec5))['catch'](handleError(_0x35e00d,null));};exports[_0xca04('0xa8')]=function(_0x3d5a28,_0xe19f0f){var _0x25b467={'where':{}},_0x54e83e={},_0xba74a={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xca04('0x4f')]({'where':{'id':_0x3d5a28['params']['id']}})[_0xca04('0x17')](handleEntityNotFound(_0xe19f0f,null))[_0xca04('0x17')](function(_0x4f8889){if(_0x4f8889){_0x54e83e[_0xca04('0x3f')]=_[_0xca04('0x40')](db[_0xca04('0x61')][_0xca04('0x37')]);_0x54e83e[_0xca04('0x41')]=_[_0xca04('0x40')](_0x3d5a28[_0xca04('0x41')]);_0x54e83e[_0xca04('0x42')]=_[_0xca04('0x43')](_0x54e83e[_0xca04('0x3f')],_0x54e83e['query']);_0x25b467[_0xca04('0x44')]=_[_0xca04('0x43')](_0x54e83e[_0xca04('0x3f')],qs[_0xca04('0x45')](_0x3d5a28[_0xca04('0x41')][_0xca04('0x45')]));_0x25b467['attributes']=_0x25b467[_0xca04('0x44')][_0xca04('0x46')]?_0x25b467[_0xca04('0x44')]:_0x54e83e[_0xca04('0x3f')];if(!_0x3d5a28[_0xca04('0x41')]['hasOwnProperty']('nolimit')){_0x25b467[_0xca04('0x26')]=qs['limit'](_0x3d5a28[_0xca04('0x41')][_0xca04('0x26')]);_0x25b467[_0xca04('0x24')]=qs['offset'](_0x3d5a28['query'][_0xca04('0x24')]);}_0x25b467[_0xca04('0xa0')]=qs[_0xca04('0xa1')](_0x3d5a28['query'][_0xca04('0xa1')]);_0x25b467[_0xca04('0xa2')]=qs['filters'](_[_0xca04('0xa9')](_0x3d5a28[_0xca04('0x41')],_0x54e83e[_0xca04('0x42')]));_0x25b467[_0xca04('0xa2')][_0xca04('0xa3')]=_0x4f8889['id'];if(_0x3d5a28[_0xca04('0x41')][_0xca04('0xa4')]){_0x25b467['where']=_['merge'](_0x25b467[_0xca04('0xa2')],{'$or':_[_0xca04('0x35')](_0x25b467['attributes'],function(_0x4c98b2){var _0x36aa76={};_0x36aa76[_0x4c98b2]={'$like':'%'+_0x3d5a28[_0xca04('0x41')][_0xca04('0xa4')]+'%'};return _0x36aa76;})});}_0x25b467[_0xca04('0xa2')][_0xca04('0x92')]=![];if(_0x3d5a28[_0xca04('0x41')]['id']){_0x25b467[_0xca04('0xa2')]['id']={'$gt':_0x3d5a28[_0xca04('0x41')]['id']};}_0x25b467=_[_0xca04('0x48')]({},_0x25b467,_0x3d5a28['options']);return db[_0xca04('0x61')]['count']({'where':_0x25b467[_0xca04('0xa2')]})[_0xca04('0x17')](function(_0x64f729){_0xba74a['count']=_0x64f729;_0x25b467[_0xca04('0xa7')]=[];if(_0x3d5a28[_0xca04('0x41')][_0xca04('0xaa')]){_0x25b467[_0xca04('0xa7')][_0xca04('0xab')]({'model':db[_0xca04('0x80')],'as':_0xca04('0x80'),'attributes':['id','fullname',_0xca04('0x8c')]});}if(_0x3d5a28[_0xca04('0x41')]['includeAll']){_0x25b467[_0xca04('0xa7')]=[{'all':!![]}];}return db[_0xca04('0x61')][_0xca04('0x3c')](_0x25b467);})['then'](function(_0xb1bf3f){_0xba74a[_0xca04('0xac')]=_0xb1bf3f;return _0xba74a;});}})[_0xca04('0x17')](respondWithFilteredResult(_0xe19f0f,_0x25b467))[_0xca04('0x20')](handleError(_0xe19f0f,null));};exports['addTags']=function(_0x45394c,_0x36de37){return db['ChatInteraction'][_0xca04('0x4a')]({'where':{'id':_0x45394c[_0xca04('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36de37,null))[_0xca04('0x17')](function(_0x559ec8){if(_0x559ec8){return _0x559ec8[_0xca04('0xad')](_0x45394c[_0xca04('0x30')]['ids'],_[_0xca04('0x9b')](_0x45394c[_0xca04('0x30')],['ids','id'])||{})['spread'](function(){return db[_0xca04('0xae')]['findAll']({'attributes':['id','name',_0xca04('0xaf')],'where':{'id':_0x45394c[_0xca04('0x30')][_0xca04('0x9c')]}});})[_0xca04('0x17')](function(_0x3117db){socket[_0xca04('0xb0')](_0xca04('0xb1'),{'id':Number(_0x45394c[_0xca04('0x4c')]['id']),'tags':_0x3117db||[]});return{'id':Number(_0x45394c['params']['id']),'tags':_0x3117db||[]};});}})[_0xca04('0x17')](respondWithResult(_0x36de37,null))['catch'](handleError(_0x36de37,null));};exports[_0xca04('0xb2')]=function(_0x385cf3,_0x598a63){return db[_0xca04('0x36')][_0xca04('0x4a')]({'where':{'id':_0x385cf3['params']['id']}})[_0xca04('0x17')](handleEntityNotFound(_0x598a63,null))['then'](function(_0x17ba01){if(_0x17ba01){return _0x17ba01[_0xca04('0xb2')](_0x385cf3[_0xca04('0x41')]['ids']);}})[_0xca04('0x17')](respondWithStatusCode(_0x598a63,null))[_0xca04('0x20')](handleError(_0x598a63,null));};exports[_0xca04('0x78')]=function(_0x1b7982,_0x19f905){var _0x539979=moment()[_0xca04('0xb3')]()[_0xca04('0xb4')]();var _0x27b31e=path[_0xca04('0x75')](config[_0xca04('0x7a')],_0xca04('0xb5'),_0xca04('0xb6'),_0xca04('0xb7'));var _0x480cb1=path[_0xca04('0x75')](config[_0xca04('0x7a')],_0xca04('0xb5'),_0xca04('0xb6'),_0xca04('0xb8'));var _0x2862b9=path[_0xca04('0x75')](_0x27b31e,_0x539979);var _0x1ba854=util[_0xca04('0x7c')](_0xca04('0xb9'),_0x1b7982[_0xca04('0x4c')]['id'],_0x539979);var _0x11845e=path[_0xca04('0x75')](_0x27b31e,_0x1ba854);var _0x147c64=[];_0x147c64[_0xca04('0xab')]({'model':db[_0xca04('0x80')],'as':_0xca04('0x80'),'attributes':['id',_0xca04('0x56')],'raw':!![]});_0x147c64[_0xca04('0xab')]({'model':db[_0xca04('0x65')],'as':_0xca04('0x66'),'attributes':['id',_0xca04('0xba'),'lastName'],'raw':!![]});if(_0x1b7982[_0xca04('0x41')]['attachments']){_0x147c64[_0xca04('0xab')]({'model':db['Attachment'],'as':_0xca04('0x74'),'raw':!![]});}var _0x52092b=[{'model':db[_0xca04('0x61')],'as':_0xca04('0x7f'),'attributes':['id',_0xca04('0x30'),'createdAt',_0xca04('0x91'),'secret',_0xca04('0xbb')],'include':_0x147c64}];_0x52092b['push']({'model':db['ChatWebsite'],'as':_0xca04('0xbc'),'attributes':['id',_0xca04('0x2e')]});_0x52092b[_0xca04('0xab')]({'model':db[_0xca04('0x80')],'as':_0xca04('0xbd'),'attributes':['id','fullname']});return db[_0xca04('0x36')][_0xca04('0x4a')]({'where':{'id':_0x1b7982[_0xca04('0x4c')]['id']},'include':_0x52092b})[_0xca04('0x17')](handleEntityNotFound(_0x19f905,null))['then'](function(_0x2cf192){if(_0x2cf192){var _0x4a9e1b=_0x2cf192[_0xca04('0xbe')]({'plain':!![]});fs[_0xca04('0xbf')](_0x2862b9);var _0x6ee652={'channel':_0xca04('0xc0'),'account':_0x4a9e1b['Account'][_0xca04('0x2e')],'agent':_0x4a9e1b[_0xca04('0xbd')]?_0x4a9e1b[_0xca04('0xbd')][_0xca04('0x56')]:_0xca04('0xc1'),'createdAt':moment(_0x4a9e1b[_0xca04('0x8f')])['format'](_0xca04('0xa6'))[_0xca04('0xb4')](),'closedAt':_0x4a9e1b['closed']?moment(_0x4a9e1b[_0xca04('0xc2')])['format'](_0xca04('0xa6'))[_0xca04('0xb4')]():'','disposition':_0x4a9e1b[_0xca04('0x6b')],'chatInfo':{'browser':_0x4a9e1b[_0xca04('0xc3')],'os':_0x4a9e1b[_0xca04('0xc4')],'referer':_0x4a9e1b['referer'],'customerIp':_0x4a9e1b[_0xca04('0xc5')],'customerPort':_0x4a9e1b[_0xca04('0xc6')]?_0x4a9e1b[_0xca04('0xc6')]:'N.A.'},'messages':_(_0x4a9e1b['Messages'])['tail']()[_0xca04('0xa4')]({'secret':![]})['map'](function(_0x56f1af){if(_0x56f1af[_0xca04('0x74')]){var _0x1263d0=path['join'](_0x480cb1,_0x56f1af[_0xca04('0x74')][_0xca04('0x6f')]);if(fs[_0xca04('0xc7')](_0x1263d0)){fs[_0xca04('0xc8')](_0x1263d0)[_0xca04('0xc9')](fs[_0xca04('0xca')](path['join'](_0x2862b9,_0x56f1af['Attachment']['basename'])));}}return{'date':moment(_0x56f1af[_0xca04('0x8f')])[_0xca04('0x7c')](_0xca04('0xa6'))[_0xca04('0xb4')](),'sender':_0x56f1af[_0xca04('0x91')]===_0xca04('0xcb')?_0x56f1af['User']?_0x56f1af[_0xca04('0x80')]['fullname']:_0xca04('0x86'):_0x56f1af[_0xca04('0x66')][_0xca04('0xba')]+(_0x56f1af['Contact'][_0xca04('0xcc')]?'\x20'+_0x56f1af['Contact'][_0xca04('0xcc')]:''),'body':_0x56f1af[_0xca04('0x74')]?_0x56f1af[_0xca04('0x74')][_0xca04('0x6f')]:_0x56f1af[_0xca04('0x30')],'direction':_0x56f1af['direction']===_0xca04('0xcb')?'A':'C','secret':_0x56f1af[_0xca04('0x92')],'read':_0x56f1af[_0xca04('0xbb')],'attachment':_0x56f1af[_0xca04('0x74')]};})[_0xca04('0xcd')]()};return ejs['renderFile'](path['join'](config[_0xca04('0x7a')],'server',_0xca04('0xce'),_0xca04('0xcf')),{'interaction':_0x6ee652})[_0xca04('0x17')](function(_0x125432){var _0x4bcf4d=path[_0xca04('0x75')](_0x2862b9,_0xca04('0xd0')+_0x4a9e1b['id']+'-'+_0x539979+_0xca04('0xd1'));var _0x3e4aab={'path':_0x4bcf4d,'channel':_0xca04('0xc0'),'interactionId':_0x4a9e1b['id']};return pdf['createPdfFromHTML'](_0x125432,_0x3e4aab);})[_0xca04('0x17')](function(){return new Promise(function(_0x267965,_0x598de8){zipdir(_0x2862b9,{'saveTo':_0x11845e},function(_0x3eda49,_0xeb6b83){if(_0x3eda49)return _0x598de8(_0x3eda49);return _0x267965(_0xeb6b83);});})[_0xca04('0x17')](function(){return new BPromise(function(_0x47921d,_0x38ffaa){rimraf(_0x2862b9,function(_0x354fd2){if(_0x354fd2)_0x38ffaa(_0x354fd2);return _0x47921d();});});})[_0xca04('0x17')](function(){return _0x19f905[_0xca04('0x78')](_0x11845e,_0x1ba854,function(_0x1c9641){if(_0x1c9641){logger['error'](_0xca04('0xd2'),_0x1c9641);}else{fs[_0xca04('0xd3')](_0x11845e);}});});});}else{return _0x19f905[_0xca04('0x21')](0xc8);}})[_0xca04('0x20')](handleError(_0x19f905,null));};
\ No newline at end of file
+var _0xa1e9=['map','ChatInteraction','type','key','findAll','query','user','show','rawAttributes','keys','filters','model','attributes','fields','length','includeAll','options','find','create','update','params','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','join','root','offline-chat/','basename','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','CmContact','Messages','%s%d','System','customer','ContactId','agentIdentifier','website_alias','agentAlias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','getMessages','intersection','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','merge','$gte','split','include','rows','getMyMessages','pick','includeAgent','push','addTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','attachments','firstName','read','Account','Owner','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','direction','lastName','value','renderFile','transcript-','err','unlinkSync','rimraf','request-promise','mustache','util','path','ejs','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','then','destroy','stack','name','send','body','contact','agent','interaction','account'];(function(_0x53eeac,_0x4f9fb8){var _0xba17bc=function(_0x4ea620){while(--_0x4ea620){_0x53eeac['push'](_0x53eeac['shift']());}};_0xba17bc(++_0x4f9fb8);}(_0xa1e9,0x161));var _0x9a1e=function(_0x5d7b04,_0x13dec9){_0x5d7b04=_0x5d7b04-0x0;var _0x24d8db=_0xa1e9[_0x5d7b04];return _0x24d8db;};'use strict';var rimraf=require(_0x9a1e('0x0'));var zipdir=require('zip-dir');var rp=require(_0x9a1e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9a1e('0x2'));var util=require(_0x9a1e('0x3'));var path=require(_0x9a1e('0x4'));var ejs=require(_0x9a1e('0x5'));var fs=require('fs');var _=require(_0x9a1e('0x6'));var Redis=require('ioredis');var interaction=require(_0x9a1e('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0x9a1e('0x8'));var logger=require(_0x9a1e('0x9'))(_0x9a1e('0xa'));var config=require('../../config/environment');var db=require(_0x9a1e('0xb'))['db'];config[_0x9a1e('0xc')]=_['defaults'](config['redis'],{'host':_0x9a1e('0xd'),'port':0x18eb});var socket=require(_0x9a1e('0xe'))(new Redis(config[_0x9a1e('0xc')]));require('./chatInteraction.socket')[_0x9a1e('0xf')](socket);var jayson=require(_0x9a1e('0x10'));var client=jayson[_0x9a1e('0x11')][_0x9a1e('0x12')]({'port':0x232b});var client9004=jayson[_0x9a1e('0x11')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5b7339,_0x25198c,_0x22e9cb,_0x579c00){return new BPromise(function(_0x5346c6,_0x4ba7fa){var _0x4a7c0f=_0x579c00||client;return _0x4a7c0f[_0x9a1e('0x13')](_0x5b7339,_0x22e9cb)['then'](function(_0x3956f9){logger[_0x9a1e('0x14')](_0x9a1e('0x15'),_0x25198c,_0x9a1e('0x16'));logger['debug'](_0x9a1e('0x17'),_0x25198c,_0x9a1e('0x16'),JSON[_0x9a1e('0x18')](_0x3956f9));if(_0x3956f9[_0x9a1e('0x19')]){if(_0x3956f9['error'][_0x9a1e('0x1a')]===0x1f4){logger['error'](_0x9a1e('0x15'),_0x25198c,_0x3956f9['error'][_0x9a1e('0x1b')]);return _0x4ba7fa(_0x3956f9[_0x9a1e('0x19')][_0x9a1e('0x1b')]);}logger[_0x9a1e('0x19')](_0x9a1e('0x15'),_0x25198c,_0x3956f9['error']['message']);return _0x5346c6(_0x3956f9[_0x9a1e('0x19')][_0x9a1e('0x1b')]);}else{logger[_0x9a1e('0x14')](_0x9a1e('0x15'),_0x25198c,'request\x20sent');_0x5346c6(_0x3956f9[_0x9a1e('0x1c')][_0x9a1e('0x1b')]);}})[_0x9a1e('0x1d')](function(_0x4f2af8){logger[_0x9a1e('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x25198c,_0x4f2af8);_0x4ba7fa(_0x4f2af8);});});}function respondWithStatusCode(_0x3ff7be,_0x18e132){_0x18e132=_0x18e132||0xcc;return function(_0x29a9a9){if(_0x29a9a9){return _0x3ff7be[_0x9a1e('0x1e')](_0x18e132);}return _0x3ff7be[_0x9a1e('0x1f')](_0x18e132)[_0x9a1e('0x20')]();};}function respondWithResult(_0x48cec5,_0x435e60){_0x435e60=_0x435e60||0xc8;return function(_0x1f1544){if(_0x1f1544){return _0x48cec5[_0x9a1e('0x1f')](_0x435e60)['json'](_0x1f1544);}};}function respondWithFilteredResult(_0x9eb837,_0x5e3c8b){return function(_0x4fe985){if(_0x4fe985){var _0x1b24c6=typeof _0x5e3c8b['offset']===_0x9a1e('0x21')&&typeof _0x5e3c8b[_0x9a1e('0x22')]===_0x9a1e('0x21');var _0x2333aa=_0x4fe985[_0x9a1e('0x23')];var _0x55cacf=_0x1b24c6?0x0:_0x5e3c8b['offset'];var _0x56ae89=_0x1b24c6?_0x4fe985[_0x9a1e('0x23')]:_0x5e3c8b[_0x9a1e('0x24')]+_0x5e3c8b[_0x9a1e('0x22')];var _0x1c099c;if(_0x56ae89>=_0x2333aa){_0x56ae89=_0x2333aa;_0x1c099c=0xc8;}else{_0x1c099c=0xce;}_0x9eb837[_0x9a1e('0x1f')](_0x1c099c);return _0x9eb837['set'](_0x9a1e('0x25'),_0x55cacf+'-'+_0x56ae89+'/'+_0x2333aa)[_0x9a1e('0x26')](_0x4fe985);}return null;};}function saveUpdates(_0x4c4664){return function(_0x5266c6){if(_0x5266c6){return _0x5266c6['update'](_0x4c4664)[_0x9a1e('0x27')](function(_0x17704b){return _0x17704b;});}return null;};}function removeEntity(_0x448e14){return function(_0x4d08ab){if(_0x4d08ab){return _0x4d08ab[_0x9a1e('0x28')]()[_0x9a1e('0x27')](function(){_0x448e14['status'](0xcc)[_0x9a1e('0x20')]();});}};}function handleEntityNotFound(_0x51bd7c){return function(_0x579573){if(!_0x579573){_0x51bd7c[_0x9a1e('0x1e')](0x194);}return _0x579573;};}function handleError(_0x189454,_0x474414){_0x474414=_0x474414||0x1f4;return function(_0x3e51f8){logger[_0x9a1e('0x19')](_0x3e51f8[_0x9a1e('0x29')]);if(_0x3e51f8[_0x9a1e('0x2a')]){delete _0x3e51f8[_0x9a1e('0x2a')];}_0x189454[_0x9a1e('0x1f')](_0x474414)[_0x9a1e('0x2b')](_0x3e51f8);};}function getMustacheRender(_0x5226e0,_0x58e51a){return Mustache['render'](_0x5226e0,_['merge'](_0x58e51a[_0x9a1e('0x2c')],{'contact':_0x58e51a[_0x9a1e('0x2d')],'message':_0x58e51a[_0x9a1e('0x1b')],'agent':_0x58e51a[_0x9a1e('0x2e')],'interaction':_0x58e51a[_0x9a1e('0x2f')],'account':_0x58e51a[_0x9a1e('0x30')]}))||'';}exports['index']=function(_0x3bea3a,_0x1b8be3){var _0x2fb8a7={};var _0x35b91d=_[_0x9a1e('0x31')](db[_0x9a1e('0x32')]['rawAttributes'],function(_0x1e93ae){return{'name':_0x1e93ae['fieldName'],'type':_0x1e93ae[_0x9a1e('0x33')][_0x9a1e('0x34')]};});_0x2fb8a7=qs['getOptions'](_0x35b91d,_0x3bea3a);return interaction[_0x9a1e('0x35')]('chat',_0x3bea3a[_0x9a1e('0x36')],_0x3bea3a[_0x9a1e('0x37')],_0x2fb8a7,_0x35b91d)[_0x9a1e('0x27')](respondWithFilteredResult(_0x1b8be3,_0x2fb8a7))['catch'](handleError(_0x1b8be3,null));};exports[_0x9a1e('0x38')]=function(_0x5db8b4,_0x56c015){var _0x5bceac={'raw':![],'where':{'id':_0x5db8b4['params']['id']}},_0x18a585={};_0x18a585['model']=_['keys'](db[_0x9a1e('0x32')][_0x9a1e('0x39')]);_0x18a585[_0x9a1e('0x36')]=_[_0x9a1e('0x3a')](_0x5db8b4[_0x9a1e('0x36')]);_0x18a585[_0x9a1e('0x3b')]=_['intersection'](_0x18a585[_0x9a1e('0x3c')],_0x18a585[_0x9a1e('0x36')]);_0x5bceac[_0x9a1e('0x3d')]=_['intersection'](_0x18a585['model'],qs[_0x9a1e('0x3e')](_0x5db8b4[_0x9a1e('0x36')]['fields']));_0x5bceac[_0x9a1e('0x3d')]=_0x5bceac[_0x9a1e('0x3d')][_0x9a1e('0x3f')]?_0x5bceac[_0x9a1e('0x3d')]:_0x18a585['model'];if(_0x5db8b4['query'][_0x9a1e('0x40')]){_0x5bceac['include']=[{'all':!![]}];}_0x5bceac=_['merge']({},_0x5bceac,_0x5db8b4[_0x9a1e('0x41')]);return db['ChatInteraction'][_0x9a1e('0x42')](_0x5bceac)[_0x9a1e('0x27')](handleEntityNotFound(_0x56c015,null))['then'](respondWithResult(_0x56c015,null))[_0x9a1e('0x1d')](handleError(_0x56c015,null));};exports[_0x9a1e('0x43')]=function(_0x2c472d,_0x36e6e9){return db[_0x9a1e('0x32')]['create'](_0x2c472d[_0x9a1e('0x2c')],{})[_0x9a1e('0x27')](respondWithResult(_0x36e6e9,0xc9))['catch'](handleError(_0x36e6e9,null));};exports[_0x9a1e('0x44')]=function(_0x3c82d6,_0x54ad9a){if(_0x3c82d6['body']['id']){delete _0x3c82d6['body']['id'];}return db[_0x9a1e('0x32')][_0x9a1e('0x42')]({'where':{'id':_0x3c82d6[_0x9a1e('0x45')]['id']}})[_0x9a1e('0x27')](handleEntityNotFound(_0x54ad9a,null))[_0x9a1e('0x27')](saveUpdates(_0x3c82d6[_0x9a1e('0x2c')],null))[_0x9a1e('0x27')](respondWithResult(_0x54ad9a,null))[_0x9a1e('0x1d')](handleError(_0x54ad9a,null));};exports[_0x9a1e('0x28')]=function(_0x3ca0aa,_0x42cb43){return db[_0x9a1e('0x32')][_0x9a1e('0x42')]({'where':{'id':_0x3ca0aa['params']['id']}})[_0x9a1e('0x27')](handleEntityNotFound(_0x42cb43,null))[_0x9a1e('0x27')](removeEntity(_0x42cb43,null))['catch'](handleError(_0x42cb43,null));};exports[_0x9a1e('0x46')]=function(_0x592e38,_0x5e53b8){return db[_0x9a1e('0x32')][_0x9a1e('0x46')]()['then'](respondWithResult(_0x5e53b8,null))['catch'](handleError(_0x5e53b8,null));};exports[_0x9a1e('0x47')]=function(_0x1f8fcf,_0x264c49){var _0x16dc95=_0x1f8fcf[_0x9a1e('0x45')]['id'];var _0x45b717;var _0x57272b;var _0x311c57;return db[_0x9a1e('0x32')][_0x9a1e('0x48')]({'where':{'id':_0x16dc95}})[_0x9a1e('0x27')](function(_0x2910f7){_0x45b717=_0x2910f7;return db[_0x9a1e('0x49')]['findOne']({'where':{'id':_0x2910f7[_0x9a1e('0x4a')]},'attributes':['id',_0x9a1e('0x4b'),'vidaooEscalation','vidaooTopic',_0x9a1e('0x4c'),_0x9a1e('0x4d')],'raw':!![]});})['then'](function(_0x1a560c){if(_0x1a560c&&_0x1a560c[_0x9a1e('0x4b')]&&_0x1a560c[_0x9a1e('0x4e')]){_0x57272b=_0x1a560c;var _0x190b9d={'interaction':{'id':_0x16dc95},'agent':{'id':_0x1f8fcf[_0x9a1e('0x37')]['id'],'name':_0x1f8fcf[_0x9a1e('0x37')][_0x9a1e('0x2a')],'fullname':_0x1f8fcf[_0x9a1e('0x37')][_0x9a1e('0x4f')],'email':_0x1f8fcf[_0x9a1e('0x37')][_0x9a1e('0x50')]},'contact':_0x1f8fcf[_0x9a1e('0x2c')][_0x9a1e('0x2d')],'account':_0x1f8fcf['body']['account']};var _0x427038={'rejectUnauthorized':![],'method':_0x9a1e('0x51'),'url':_0x9a1e('0x52'),'headers':{'X-APIKEY':_0x1a560c['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1f8fcf[_0x9a1e('0x37')][_0x9a1e('0x50')]],'buttons':null,'topic':_0x57272b[_0x9a1e('0x53')],'note':_[_0x9a1e('0x54')](_0x57272b['vidaooNote'])?null:getMustacheRender(_0x57272b[_0x9a1e('0x4c')],_0x190b9d),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x57272b[_0x9a1e('0x4d')])){var _0x4752a7=getMustacheRender(_0x57272b[_0x9a1e('0x4d')],_0x190b9d);var _0x48b674=JSON[_0x9a1e('0x55')](_0x4752a7);_0x427038['body'][_0x9a1e('0x56')]=_0x48b674;}}catch(_0x50c9f4){throw new db[(_0x9a1e('0x57'))][(_0x9a1e('0x58'))](_0x9a1e('0x59'));}return rp(_0x427038);}else{throw new db['Sequelize'][(_0x9a1e('0x58'))](_0x9a1e('0x5a'));}})[_0x9a1e('0x27')](function(_0x5bf716){_0x311c57=_0x5bf716;if(_0x311c57['id']){var _0x40cc86={'body':_0x311c57[_0x9a1e('0x5b')],'ChatWebsiteId':_0x57272b['id'],'ChatInteractionId':_0x45b717['id'],'direction':_0x9a1e('0x5c'),'UserId':_0x1f8fcf[_0x9a1e('0x37')]['id']};return db[_0x9a1e('0x5d')][_0x9a1e('0x43')](_0x40cc86,{});}else{throw new db['Sequelize'][(_0x9a1e('0x58'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x9a1e('0x27')](function(){return _0x45b717[_0x9a1e('0x5e')]({'vidaooSessionId':_0x311c57['id']});})[_0x9a1e('0x27')](respondWithResult(_0x264c49,null))['catch'](handleError(_0x264c49,null));};exports[_0x9a1e('0x5f')]=function(_0x585022,_0x216abf){if(_0x585022[_0x9a1e('0x2c')]['id']){delete _0x585022[_0x9a1e('0x2c')]['id'];}return db['ChatInteraction'][_0x9a1e('0x42')]({'where':{'id':_0x585022[_0x9a1e('0x45')]['id']},'include':[{'model':db['CmContact'],'as':_0x9a1e('0x60')}]})[_0x9a1e('0x27')](handleEntityNotFound(_0x216abf,null))[_0x9a1e('0x27')](saveUpdates(_0x585022[_0x9a1e('0x2c')],null))['then'](respondWithResult(_0x216abf,null))[_0x9a1e('0x1d')](handleError(_0x216abf,null));};exports[_0x9a1e('0x61')]=function(_0x33c269,_0x262e91){if(_0x33c269[_0x9a1e('0x2c')]['id']){delete _0x33c269[_0x9a1e('0x2c')]['id'];}return db[_0x9a1e('0x32')][_0x9a1e('0x42')]({'where':{'id':_0x33c269[_0x9a1e('0x45')]['id']}})['then'](function(_0x2df7e5){if(!_0x2df7e5){logger[_0x9a1e('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x9a1e('0x61'),0x194,_0x9a1e('0x62'));_0x262e91['sendStatus'](0x194);}else{if(_0x2df7e5[_0x9a1e('0x63')]){throw new db[(_0x9a1e('0x57'))][(_0x9a1e('0x58'))]('Interaction\x20already\x20assigned');}}return _0x2df7e5;})['then'](function(_0x13579f){if(_0x13579f){return _0x13579f[_0x9a1e('0x44')]({'closed':_0x33c269['body'][_0x9a1e('0x64')],'disposition':_0x33c269[_0x9a1e('0x2c')][_0x9a1e('0x65')]})[_0x9a1e('0x27')](function(_0x54448b){return _0x54448b;});}})[_0x9a1e('0x27')](function(){return respondWithRpcPromise(_0x9a1e('0x66'),'abandon',_0x33c269[_0x9a1e('0x2c')],client9004);})['then'](respondWithResult(_0x262e91,null))[_0x9a1e('0x1d')](handleError(_0x262e91,null));};exports[_0x9a1e('0x67')]=function(_0x3409d6,_0x432613){_0x3409d6[_0x9a1e('0x2c')][_0x9a1e('0x2a')]=_0x3409d6[_0x9a1e('0x68')][_0x9a1e('0x69')];_0x3409d6[_0x9a1e('0x2c')]['basename']=_0x3409d6['file'][_0x9a1e('0x6a')];_0x3409d6[_0x9a1e('0x2c')][_0x9a1e('0x33')]=_0x3409d6['file'][_0x9a1e('0x6b')];return db[_0x9a1e('0x6c')][_0x9a1e('0x43')](_0x3409d6[_0x9a1e('0x2c')])[_0x9a1e('0x27')](respondWithResult(_0x432613,0xc9))[_0x9a1e('0x1d')](handleError(_0x432613,null));};exports[_0x9a1e('0x6d')]=function(_0x6d93a1,_0x572a86){return db['ChatInteraction']['findOne']({'where':{'id':_0x6d93a1['params']['id']},'raw':!![]})[_0x9a1e('0x27')](handleEntityNotFound(_0x572a86,null))[_0x9a1e('0x27')](function(_0x5c23cc){if(_0x5c23cc){if(_0x5c23cc[_0x9a1e('0x64')]){return _0x572a86[_0x9a1e('0x1f')](0x193)[_0x9a1e('0x26')]({'status':0x193,'message':'Unauthorized'});}return db[_0x9a1e('0x6c')]['findOne']({'where':{'id':_0x6d93a1[_0x9a1e('0x36')]['attachId']},'raw':!![]})[_0x9a1e('0x27')](handleEntityNotFound(_0x572a86,null));}})[_0x9a1e('0x27')](function(_0x56c777){if(_0x56c777){var _0x3b3a41=_0x56c777[_0x9a1e('0x6e')]!==null;var _0x2773cf=path[_0x9a1e('0x6f')](config[_0x9a1e('0x70')],'server/files/attachments/');if(_0x3b3a41){_0x2773cf=path['join'](_0x2773cf,_0x9a1e('0x71'));}var _0x5b1cc6=path['join'](_0x2773cf,_0x56c777[_0x9a1e('0x72')]);return _0x572a86['download'](_0x5b1cc6);}})[_0x9a1e('0x1d')](handleError(_0x572a86,null));};exports[_0x9a1e('0x73')]=function(_0x556431,_0x294505){var _0x3a0ee5=null;var _0x41134a=null;var _0x130e6f=null;if(_0x556431['body']['id']){delete _0x556431[_0x9a1e('0x2c')]['id'];}if(_0x556431[_0x9a1e('0x2c')][_0x9a1e('0x74')]){_0x130e6f=path[_0x9a1e('0x6f')](config[_0x9a1e('0x70')],_0x9a1e('0x75'),util[_0x9a1e('0x76')](_0x9a1e('0x77'),Date[_0x9a1e('0x78')]()));_0x556431['body'][_0x9a1e('0x79')]=_0x130e6f;}return db['ChatInteraction'][_0x9a1e('0x42')]({'where':{'id':_0x556431[_0x9a1e('0x45')]['id']},'include':[{'model':db[_0x9a1e('0x5d')],'as':'Messages','include':[{'model':db[_0x9a1e('0x7a')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x294505,null))[_0x9a1e('0x27')](saveUpdates(_0x556431[_0x9a1e('0x2c')],null))[_0x9a1e('0x27')](function(_0x4e069d){if(_0x4e069d){_0x3a0ee5=_0x4e069d;return db[_0x9a1e('0x49')][_0x9a1e('0x42')]({'where':{'id':_0x3a0ee5[_0x9a1e('0x4a')]}});}})[_0x9a1e('0x27')](function(_0x3f64c0){if(_0x3f64c0){_0x41134a=_0x3f64c0;return db[_0x9a1e('0x7b')][_0x9a1e('0x42')]({'where':{'id':_0x3a0ee5['ContactId']}});}})[_0x9a1e('0x27')](function(_0x1334da){if(_0x1334da){if(_0x130e6f){var _0x117be4=null;for(var _0x20788e=0x1;_0x20788e<_0x3a0ee5[_0x9a1e('0x7c')][_0x9a1e('0x3f')];++_0x20788e){_0x117be4=_0x3a0ee5[_0x9a1e('0x7c')][_0x20788e];var _0xdd5b59=_0x117be4['UserId']?util[_0x9a1e('0x76')](_0x9a1e('0x7d'),_0x41134a['agentAlias'],_0x117be4[_0x9a1e('0x63')]):_0x9a1e('0x7e');var _0x4bd341=_0x556431[_0x9a1e('0x2c')][_0x9a1e('0x7f')]||util['format'](_0x9a1e('0x7d'),'Visitor',_0x117be4[_0x9a1e('0x80')]);switch(_0x41134a[_0x9a1e('0x81')]){case _0x9a1e('0x82'):_0xdd5b59=_0x117be4[_0x9a1e('0x63')]?util[_0x9a1e('0x76')](_0x9a1e('0x7d'),_0x41134a[_0x9a1e('0x83')],_0x117be4[_0x9a1e('0x63')]):'System';break;case'agent_alias':_0xdd5b59=_0x117be4[_0x9a1e('0x63')]?_0x117be4[_0x9a1e('0x7a')][_0x9a1e('0x84')]||_0x117be4[_0x9a1e('0x7a')]['fullname']:_0x9a1e('0x7e');break;case'agent_fullname':_0xdd5b59=_0x117be4[_0x9a1e('0x63')]?_0x117be4[_0x9a1e('0x7a')][_0x9a1e('0x4f')]:_0x9a1e('0x7e');break;default:_0xdd5b59=_0x117be4['UserId']?util['format'](_0x9a1e('0x7d'),_0x41134a[_0x9a1e('0x83')],_0x117be4['UserId']):_0x9a1e('0x7e');}var _0x42ff58=util[_0x9a1e('0x76')](_0x9a1e('0x85'),moment(_0x117be4[_0x9a1e('0x86')])['format'](_0x9a1e('0x87')),_0x117be4['direction']==='in'?_0x4bd341:_0xdd5b59,_0x117be4[_0x9a1e('0x2c')]);if(!_0x117be4[_0x9a1e('0x88')]){fs[_0x9a1e('0x89')](_0x130e6f,_0x42ff58);}}return db[_0x9a1e('0x8a')][_0x9a1e('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0x9a1e('0x8b')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x13cb74){if(!_0x13cb74||!_0x13cb74[_0x9a1e('0x8c')]||!_0x556431[_0x9a1e('0x2c')])return _0x3a0ee5;var _0x6ab296=_0x13cb74['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x6ab296,'message':{'from':util[_0x9a1e('0x76')](_0x9a1e('0x8d'),_0x13cb74[_0x9a1e('0x2a')],_0x13cb74[_0x9a1e('0x50')]||_0x13cb74[_0x9a1e('0x8c')]['user']),'to':_0x556431['body'][_0x9a1e('0x74')],'subject':_0x9a1e('0x8e'),'text':util[_0x9a1e('0x76')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x556431[_0x9a1e('0x2c')][_0x9a1e('0x74')]),'attachments':[{'path':_0x130e6f}]}})[_0x9a1e('0x27')](function(){return _0x3a0ee5;})['catch'](function(_0x3a8556){logger[_0x9a1e('0x19')](_0x3a8556);});})[_0x9a1e('0x27')](respondWithStatusCode(_0x294505,0xc8))[_0x9a1e('0x1d')](handleError(_0x294505,null));};exports[_0x9a1e('0x8f')]=function(_0x28a43a,_0x5e570b){return db[_0x9a1e('0x5d')][_0x9a1e('0x42')]({'where':{'id':_0x28a43a[_0x9a1e('0x45')]['id']}})[_0x9a1e('0x27')](handleEntityNotFound(_0x5e570b,null))[_0x9a1e('0x27')](function(_0x4d5bc0){if(_0x4d5bc0){return _0x4d5bc0['addMessage'](_0x28a43a['body'][_0x9a1e('0x90')],_['omit'](_0x28a43a['body'],[_0x9a1e('0x90'),'id'])||{});}})[_0x9a1e('0x27')](respondWithResult(_0x5e570b,null))[_0x9a1e('0x1d')](handleError(_0x5e570b,null));};exports[_0x9a1e('0x91')]=function(_0x2d367a,_0xd4b717){var _0x21e6ec={'raw':![],'where':{}};var _0x4a8fd8={};var _0x2f1253={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x9a1e('0x48')]({'where':{'id':_0x2d367a[_0x9a1e('0x45')]['id']}})[_0x9a1e('0x27')](handleEntityNotFound(_0xd4b717,null))[_0x9a1e('0x27')](function(_0x5e76e0){if(_0x5e76e0){_0x4a8fd8[_0x9a1e('0x3c')]=_['keys'](db[_0x9a1e('0x5d')][_0x9a1e('0x39')]);_0x4a8fd8['query']=_[_0x9a1e('0x3a')](_0x2d367a[_0x9a1e('0x36')]);_0x4a8fd8[_0x9a1e('0x3b')]=_[_0x9a1e('0x92')](_0x4a8fd8[_0x9a1e('0x3c')],_0x4a8fd8[_0x9a1e('0x36')]);_0x21e6ec[_0x9a1e('0x3d')]=_[_0x9a1e('0x92')](_0x4a8fd8[_0x9a1e('0x3c')],qs[_0x9a1e('0x3e')](_0x2d367a['query'][_0x9a1e('0x3e')]));_0x21e6ec[_0x9a1e('0x3d')]=_0x21e6ec[_0x9a1e('0x3d')][_0x9a1e('0x3f')]?_0x21e6ec[_0x9a1e('0x3d')]:_0x4a8fd8[_0x9a1e('0x3c')];if(!_0x2d367a['query'][_0x9a1e('0x93')](_0x9a1e('0x94'))){_0x21e6ec['limit']=qs['limit'](_0x2d367a[_0x9a1e('0x36')][_0x9a1e('0x22')]);_0x21e6ec[_0x9a1e('0x24')]=qs[_0x9a1e('0x24')](_0x2d367a[_0x9a1e('0x36')][_0x9a1e('0x24')]);}_0x21e6ec[_0x9a1e('0x95')]=qs['sort'](_0x2d367a['query'][_0x9a1e('0x96')]);_0x21e6ec[_0x9a1e('0x97')]=qs[_0x9a1e('0x3b')](_['pick'](_0x2d367a[_0x9a1e('0x36')],_0x4a8fd8[_0x9a1e('0x3b')]));_0x21e6ec[_0x9a1e('0x97')][_0x9a1e('0x98')]=_0x5e76e0['id'];if(_0x2d367a[_0x9a1e('0x36')][_0x9a1e('0x99')]){_0x21e6ec[_0x9a1e('0x97')]=_[_0x9a1e('0x9a')](_0x21e6ec[_0x9a1e('0x97')],{'$or':_['map'](_0x21e6ec[_0x9a1e('0x3d')],function(_0x542ff8){var _0xb516e7={};_0xb516e7[_0x542ff8]={'$like':'%'+_0x2d367a[_0x9a1e('0x36')][_0x9a1e('0x99')]+'%'};return _0xb516e7;})});}if(_0x2d367a[_0x9a1e('0x36')][_0x9a1e('0x9b')]){var _0x257f76=_0x2d367a[_0x9a1e('0x36')][_0x9a1e('0x9b')][_0x9a1e('0x9c')](',');var _0x30e207={};_0x30e207[_0x257f76[0x0]]={'$gte':moment(_0x257f76[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x21e6ec[_0x9a1e('0x97')]=_[_0x9a1e('0x9a')](_0x21e6ec[_0x9a1e('0x97')],_0x30e207);}_0x21e6ec=_[_0x9a1e('0x9a')]({},_0x21e6ec,_0x2d367a['options']);return db[_0x9a1e('0x5d')][_0x9a1e('0x23')]({'where':_0x21e6ec[_0x9a1e('0x97')]})[_0x9a1e('0x27')](function(_0x3f0618){_0x2f1253[_0x9a1e('0x23')]=_0x3f0618;if(_0x2d367a['query'][_0x9a1e('0x40')]){_0x21e6ec[_0x9a1e('0x9d')]=[{'all':!![]}];}return db[_0x9a1e('0x5d')]['findAll'](_0x21e6ec);})[_0x9a1e('0x27')](function(_0x28e34d){_0x2f1253[_0x9a1e('0x9e')]=_0x28e34d;return _0x2f1253;});}})[_0x9a1e('0x27')](respondWithFilteredResult(_0xd4b717,_0x21e6ec))[_0x9a1e('0x1d')](handleError(_0xd4b717,null));};exports[_0x9a1e('0x9f')]=function(_0x3bb298,_0x1bd767){var _0x2918b5={'where':{}},_0x243493={},_0x17bfd9={'count':0x0,'rows':[]};return db[_0x9a1e('0x32')]['findOne']({'where':{'id':_0x3bb298[_0x9a1e('0x45')]['id']}})[_0x9a1e('0x27')](handleEntityNotFound(_0x1bd767,null))[_0x9a1e('0x27')](function(_0x18f857){if(_0x18f857){_0x243493[_0x9a1e('0x3c')]=_['keys'](db[_0x9a1e('0x5d')][_0x9a1e('0x39')]);_0x243493[_0x9a1e('0x36')]=_['keys'](_0x3bb298[_0x9a1e('0x36')]);_0x243493['filters']=_['intersection'](_0x243493[_0x9a1e('0x3c')],_0x243493[_0x9a1e('0x36')]);_0x2918b5[_0x9a1e('0x3d')]=_['intersection'](_0x243493[_0x9a1e('0x3c')],qs[_0x9a1e('0x3e')](_0x3bb298[_0x9a1e('0x36')][_0x9a1e('0x3e')]));_0x2918b5[_0x9a1e('0x3d')]=_0x2918b5[_0x9a1e('0x3d')][_0x9a1e('0x3f')]?_0x2918b5[_0x9a1e('0x3d')]:_0x243493[_0x9a1e('0x3c')];if(!_0x3bb298['query'][_0x9a1e('0x93')](_0x9a1e('0x94'))){_0x2918b5['limit']=qs[_0x9a1e('0x22')](_0x3bb298['query'][_0x9a1e('0x22')]);_0x2918b5[_0x9a1e('0x24')]=qs[_0x9a1e('0x24')](_0x3bb298[_0x9a1e('0x36')]['offset']);}_0x2918b5[_0x9a1e('0x95')]=qs[_0x9a1e('0x96')](_0x3bb298[_0x9a1e('0x36')][_0x9a1e('0x96')]);_0x2918b5['where']=qs[_0x9a1e('0x3b')](_[_0x9a1e('0xa0')](_0x3bb298[_0x9a1e('0x36')],_0x243493[_0x9a1e('0x3b')]));_0x2918b5['where'][_0x9a1e('0x98')]=_0x18f857['id'];if(_0x3bb298[_0x9a1e('0x36')][_0x9a1e('0x99')]){_0x2918b5[_0x9a1e('0x97')]=_['merge'](_0x2918b5[_0x9a1e('0x97')],{'$or':_['map'](_0x2918b5['attributes'],function(_0x5857ee){var _0x727fb5={};_0x727fb5[_0x5857ee]={'$like':'%'+_0x3bb298[_0x9a1e('0x36')]['filter']+'%'};return _0x727fb5;})});}_0x2918b5[_0x9a1e('0x97')]['secret']=![];if(_0x3bb298[_0x9a1e('0x36')]['id']){_0x2918b5[_0x9a1e('0x97')]['id']={'$gt':_0x3bb298[_0x9a1e('0x36')]['id']};}_0x2918b5=_[_0x9a1e('0x9a')]({},_0x2918b5,_0x3bb298[_0x9a1e('0x41')]);return db[_0x9a1e('0x5d')][_0x9a1e('0x23')]({'where':_0x2918b5[_0x9a1e('0x97')]})['then'](function(_0x2d5268){_0x17bfd9[_0x9a1e('0x23')]=_0x2d5268;_0x2918b5[_0x9a1e('0x9d')]=[];if(_0x3bb298['query'][_0x9a1e('0xa1')]){_0x2918b5[_0x9a1e('0x9d')][_0x9a1e('0xa2')]({'model':db['User'],'as':_0x9a1e('0x7a'),'attributes':['id','fullname',_0x9a1e('0x84')]});}if(_0x3bb298[_0x9a1e('0x36')][_0x9a1e('0x40')]){_0x2918b5[_0x9a1e('0x9d')]=[{'all':!![]}];}return db[_0x9a1e('0x5d')]['findAll'](_0x2918b5);})[_0x9a1e('0x27')](function(_0x3c890a){_0x17bfd9[_0x9a1e('0x9e')]=_0x3c890a;return _0x17bfd9;});}})[_0x9a1e('0x27')](respondWithFilteredResult(_0x1bd767,_0x2918b5))[_0x9a1e('0x1d')](handleError(_0x1bd767,null));};exports[_0x9a1e('0xa3')]=function(_0x512b4f,_0x4dc634){return db['ChatInteraction']['find']({'where':{'id':_0x512b4f[_0x9a1e('0x45')]['id']}})[_0x9a1e('0x27')](handleEntityNotFound(_0x4dc634,null))[_0x9a1e('0x27')](function(_0x3291cc){if(_0x3291cc){return _0x3291cc['setTags'](_0x512b4f[_0x9a1e('0x2c')]['ids'],_['omit'](_0x512b4f[_0x9a1e('0x2c')],['ids','id'])||{})[_0x9a1e('0xa4')](function(){return db[_0x9a1e('0xa5')]['findAll']({'attributes':['id','name',_0x9a1e('0xa6')],'where':{'id':_0x512b4f[_0x9a1e('0x2c')][_0x9a1e('0x90')]}});})[_0x9a1e('0x27')](function(_0x440c47){socket[_0x9a1e('0xa7')](_0x9a1e('0xa8'),{'id':Number(_0x512b4f[_0x9a1e('0x45')]['id']),'tags':_0x440c47||[]});return{'id':Number(_0x512b4f[_0x9a1e('0x45')]['id']),'tags':_0x440c47||[]};});}})[_0x9a1e('0x27')](respondWithResult(_0x4dc634,null))[_0x9a1e('0x1d')](handleError(_0x4dc634,null));};exports[_0x9a1e('0xa9')]=function(_0x24be31,_0x258e06){return db[_0x9a1e('0x32')][_0x9a1e('0x42')]({'where':{'id':_0x24be31['params']['id']}})[_0x9a1e('0x27')](handleEntityNotFound(_0x258e06,null))['then'](function(_0x470968){if(_0x470968){return _0x470968[_0x9a1e('0xa9')](_0x24be31[_0x9a1e('0x36')]['ids']);}})[_0x9a1e('0x27')](respondWithStatusCode(_0x258e06,null))[_0x9a1e('0x1d')](handleError(_0x258e06,null));};exports[_0x9a1e('0xaa')]=function(_0x2afad7,_0x5036b2){var _0x12268f=moment()[_0x9a1e('0xab')]()[_0x9a1e('0xac')]();var _0x60e9c2=path[_0x9a1e('0x6f')](config[_0x9a1e('0x70')],_0x9a1e('0xad'),_0x9a1e('0xae'),_0x9a1e('0xaf'));var _0x140635=path[_0x9a1e('0x6f')](config[_0x9a1e('0x70')],_0x9a1e('0xad'),'files',_0x9a1e('0xb0'));var _0x5dccbe=path[_0x9a1e('0x6f')](_0x60e9c2,_0x12268f);var _0x4ad083=util[_0x9a1e('0x76')]('transcript-%d-%s.zip',_0x2afad7[_0x9a1e('0x45')]['id'],_0x12268f);var _0x1b8771=path['join'](_0x60e9c2,_0x4ad083);var _0x152d65=[];_0x152d65['push']({'model':db['User'],'as':_0x9a1e('0x7a'),'attributes':['id',_0x9a1e('0x4f')],'raw':!![]});_0x152d65[_0x9a1e('0xa2')]({'model':db[_0x9a1e('0x7b')],'as':'Contact','attributes':['id',_0x9a1e('0xb1'),'lastName'],'raw':!![]});if(_0x2afad7['query']['attachments']){_0x152d65[_0x9a1e('0xa2')]({'model':db[_0x9a1e('0x6c')],'as':'Attachment','raw':!![]});}var _0x448847=[{'model':db['ChatMessage'],'as':_0x9a1e('0x7c'),'attributes':['id',_0x9a1e('0x2c'),_0x9a1e('0x86'),'direction',_0x9a1e('0x88'),_0x9a1e('0xb2')],'include':_0x152d65}];_0x448847[_0x9a1e('0xa2')]({'model':db[_0x9a1e('0x49')],'as':_0x9a1e('0xb3'),'attributes':['id',_0x9a1e('0x2a')]});_0x448847[_0x9a1e('0xa2')]({'model':db[_0x9a1e('0x7a')],'as':_0x9a1e('0xb4'),'attributes':['id',_0x9a1e('0x4f')]});return db[_0x9a1e('0x32')][_0x9a1e('0x42')]({'where':{'id':_0x2afad7[_0x9a1e('0x45')]['id']},'include':_0x448847})[_0x9a1e('0x27')](handleEntityNotFound(_0x5036b2,null))[_0x9a1e('0x27')](function(_0x57e8a8){if(_0x57e8a8){var _0x3d85c7=_0x57e8a8['get']({'plain':!![]});fs[_0x9a1e('0xb5')](_0x5dccbe);var _0x44bbe9={'channel':_0x9a1e('0xb6'),'account':_0x3d85c7[_0x9a1e('0xb3')][_0x9a1e('0x2a')],'agent':_0x3d85c7[_0x9a1e('0xb4')]?_0x3d85c7[_0x9a1e('0xb4')][_0x9a1e('0x4f')]:_0x9a1e('0xb7'),'createdAt':moment(_0x3d85c7[_0x9a1e('0x86')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x9a1e('0xac')](),'closedAt':_0x3d85c7[_0x9a1e('0x64')]?moment(_0x3d85c7['closedAt'])[_0x9a1e('0x76')](_0x9a1e('0xb8'))[_0x9a1e('0xac')]():'','disposition':_0x3d85c7[_0x9a1e('0x65')],'chatInfo':{'browser':_0x3d85c7[_0x9a1e('0xb9')],'os':_0x3d85c7[_0x9a1e('0xba')],'referer':_0x3d85c7[_0x9a1e('0xbb')],'customerIp':_0x3d85c7['customerIp'],'customerPort':_0x3d85c7[_0x9a1e('0xbc')]?_0x3d85c7['customerPort']:_0x9a1e('0xb7')},'messages':_(_0x3d85c7['Messages'])[_0x9a1e('0xbd')]()[_0x9a1e('0x99')]({'secret':![]})[_0x9a1e('0x31')](function(_0x2b62ad){if(_0x2b62ad[_0x9a1e('0x6c')]){var _0x1ab696=path[_0x9a1e('0x6f')](_0x140635,_0x2b62ad['Attachment'][_0x9a1e('0x72')]);if(fs[_0x9a1e('0xbe')](_0x1ab696)){fs[_0x9a1e('0xbf')](_0x1ab696)[_0x9a1e('0xc0')](fs[_0x9a1e('0xc1')](path[_0x9a1e('0x6f')](_0x5dccbe,_0x2b62ad[_0x9a1e('0x6c')]['basename'])));}}return{'date':moment(_0x2b62ad[_0x9a1e('0x86')])['format'](_0x9a1e('0xb8'))[_0x9a1e('0xac')](),'sender':_0x2b62ad[_0x9a1e('0xc2')]===_0x9a1e('0x5c')?_0x2b62ad[_0x9a1e('0x7a')]?_0x2b62ad[_0x9a1e('0x7a')][_0x9a1e('0x4f')]:_0x9a1e('0x7e'):_0x2b62ad['Contact'][_0x9a1e('0xb1')]+(_0x2b62ad[_0x9a1e('0x60')]['lastName']?'\x20'+_0x2b62ad[_0x9a1e('0x60')][_0x9a1e('0xc3')]:''),'body':_0x2b62ad[_0x9a1e('0x6c')]?_0x2b62ad[_0x9a1e('0x6c')]['basename']:_0x2b62ad[_0x9a1e('0x2c')],'direction':_0x2b62ad[_0x9a1e('0xc2')]==='out'?'A':'C','secret':_0x2b62ad[_0x9a1e('0x88')],'read':_0x2b62ad['read'],'attachment':_0x2b62ad[_0x9a1e('0x6c')]};})[_0x9a1e('0xc4')]()};return ejs[_0x9a1e('0xc5')](path[_0x9a1e('0x6f')](config[_0x9a1e('0x70')],_0x9a1e('0xad'),'views','downloadInteraction.ejs'),{'interaction':_0x44bbe9})[_0x9a1e('0x27')](function(_0x456e04){var _0x250322=path['join'](_0x5dccbe,_0x9a1e('0xc6')+_0x3d85c7['id']+'-'+_0x12268f+'.pdf');var _0x21d1e2={'path':_0x250322,'channel':_0x9a1e('0xb6'),'interactionId':_0x3d85c7['id']};return pdf['createPdfFromHTML'](_0x456e04,_0x21d1e2);})[_0x9a1e('0x27')](function(){return new Promise(function(_0x183584,_0x11f3fe){zipdir(_0x5dccbe,{'saveTo':_0x1b8771},function(_0x923ce5,_0x2f0205){if(_0x923ce5)return _0x11f3fe(_0x923ce5);return _0x183584(_0x2f0205);});})[_0x9a1e('0x27')](function(){return new BPromise(function(_0x4a1aeb,_0x4b8b3a){rimraf(_0x5dccbe,function(_0x5789c0){if(_0x5789c0)_0x4b8b3a(_0x5789c0);return _0x4a1aeb();});});})[_0x9a1e('0x27')](function(){return _0x5036b2[_0x9a1e('0xaa')](_0x1b8771,_0x4ad083,function(_0x221752){if(_0x221752){logger[_0x9a1e('0x19')](_0x9a1e('0xc7'),_0x221752);}else{fs[_0x9a1e('0xc8')](_0x1b8771);}});});});}else{return _0x5036b2[_0x9a1e('0x1e')](0xc8);}})[_0x9a1e('0x1d')](handleError(_0x5036b2,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 3948b01..29d4f70 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 _0xbcd4=['remove','getUsers','then','Users','map','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0xf1a005,_0x361fee){var _0x5313f6=function(_0x3753f8){while(--_0x3753f8){_0xf1a005['push'](_0xf1a005['shift']());}};_0x5313f6(++_0x361fee);}(_0xbcd4,0x92));var _0x4bcd=function(_0x434392,_0x548f1d){_0x434392=_0x434392-0x0;var _0x113261=_0xbcd4[_0x434392];return _0x113261;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x4bcd('0x0'))['db'][_0x4bcd('0x1')];var ChatMessage=require(_0x4bcd('0x0'))['db'][_0x4bcd('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4bcd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4bcd('0x4')};function emitEvent(_0x5a17dd){return function(_0x5a32a7,_0x53a11c,_0x44c146){_0x5a32a7[_0x4bcd('0x5')]({'attributes':['id'],'raw':!![]})[_0x4bcd('0x6')](function(_0x444a63){_0x5a32a7['setDataValue'](_0x4bcd('0x7'),_0x444a63[_0x4bcd('0x8')](function(_0x49fcd5){return{'id':_0x49fcd5['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5a32a7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4bcd('0x6')](function(_0x4c5d43){_0x5a32a7[_0x4bcd('0x9')](_0x4bcd('0xa'),_0x4c5d43['length']);ChatInteractionEvents[_0x4bcd('0xb')](_0x5a17dd+':'+_0x5a32a7['id'],_0x5a32a7);ChatInteractionEvents['emit'](_0x5a17dd,_0x5a32a7);_0x44c146(null);})[_0x4bcd('0xc')](_0x44c146(null));};}for(var e in events){if(events[_0x4bcd('0xd')](e)){var event=events[e];ChatInteraction[_0x4bcd('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x5d6f=['unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','map','findAll'];(function(_0x4f0dd8,_0x5f3912){var _0x121c01=function(_0x4e59f9){while(--_0x4e59f9){_0x4f0dd8['push'](_0x4f0dd8['shift']());}};_0x121c01(++_0x5f3912);}(_0x5d6f,0x1e1));var _0xf5d6=function(_0x606fe8,_0x10b084){_0x606fe8=_0x606fe8-0x0;var _0x28b517=_0x5d6f[_0x606fe8];return _0x28b517;};'use strict';var EventEmitter=require(_0xf5d6('0x0'));var ChatInteraction=require(_0xf5d6('0x1'))['db'][_0xf5d6('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xf5d6('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf5d6('0x4')](0x0);var events={'afterCreate':_0xf5d6('0x5'),'afterUpdate':_0xf5d6('0x6'),'afterDestroy':_0xf5d6('0x7')};function emitEvent(_0x4f4043){return function(_0x224a69,_0x529c61,_0x451a7a){_0x224a69['getUsers']({'attributes':['id'],'raw':!![]})[_0xf5d6('0x8')](function(_0x1b8a99){_0x224a69[_0xf5d6('0x9')]('Users',_0x1b8a99[_0xf5d6('0xa')](function(_0x1da504){return{'id':_0x1da504['id']};}));return ChatMessage[_0xf5d6('0xb')]({'where':{'ChatInteractionId':_0x224a69['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf5d6('0x8')](function(_0x11b91e){_0x224a69[_0xf5d6('0x9')](_0xf5d6('0xc'),_0x11b91e[_0xf5d6('0xd')]);ChatInteractionEvents[_0xf5d6('0xe')](_0x4f4043+':'+_0x224a69['id'],_0x224a69);ChatInteractionEvents[_0xf5d6('0xe')](_0x4f4043,_0x224a69);_0x451a7a(null);})[_0xf5d6('0xf')](_0x451a7a(null));};}for(var e in events){if(events[_0xf5d6('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index cbcb350..6e1cbc9 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 _0x9040=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x329e00,_0x2bd443){var _0x413fb2=function(_0x2567b2){while(--_0x2567b2){_0x329e00['push'](_0x329e00['shift']());}};_0x413fb2(++_0x2bd443);}(_0x9040,0x176));var _0x0904=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x9040[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0904('0x0'));var util=require(_0x0904('0x1'));var logger=require(_0x0904('0x2'))(_0x0904('0x3'));var moment=require(_0x0904('0x4'));var BPromise=require(_0x0904('0x5'));var rp=require(_0x0904('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0904('0x7'));var config=require(_0x0904('0x8'));var attributes=require(_0x0904('0x9'));module[_0x0904('0xa')]=function(_0x25ee73,_0x778c3e){return _0x25ee73[_0x0904('0xb')](_0x0904('0xc'),attributes,{'tableName':_0x0904('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e5fcc,_0x16ecfc,_0x5af42f){if(_0x3e5fcc['changed'](_0x0904('0xe'))){_0x3e5fcc[_0x0904('0xf')]=moment()['format'](_0x0904('0x10'));}_0x5af42f(null,_0x3e5fcc);}},'charset':_0x0904('0x11'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9c6d=['request-promise','path','../../config/environment','exports','define','ChatInteraction','changed','closed','closedAt','format','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a34e0,_0x29ff2f){var _0xb5ce1d=function(_0x225c39){while(--_0x225c39){_0x4a34e0['push'](_0x4a34e0['shift']());}};_0xb5ce1d(++_0x29ff2f);}(_0x9c6d,0x1d6));var _0xd9c6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9c6d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd9c6('0x0'));var util=require(_0xd9c6('0x1'));var logger=require(_0xd9c6('0x2'))(_0xd9c6('0x3'));var moment=require(_0xd9c6('0x4'));var BPromise=require(_0xd9c6('0x5'));var rp=require(_0xd9c6('0x6'));var fs=require('fs');var path=require(_0xd9c6('0x7'));var rimraf=require('rimraf');var config=require(_0xd9c6('0x8'));var attributes=require('./chatInteraction.attributes');module[_0xd9c6('0x9')]=function(_0x353206,_0x18def6){return _0x353206[_0xd9c6('0xa')](_0xd9c6('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d95c6,_0x566046,_0x25ac30){if(_0x5d95c6[_0xd9c6('0xc')](_0xd9c6('0xd'))){_0x5d95c6[_0xd9c6('0xe')]=moment()[_0xd9c6('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x25ac30(null,_0x5d95c6);}},'charset':_0xd9c6('0x10'),'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 809c629..0611b68 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 _0xff75=['ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','stringify','find','addTags'];(function(_0x141d5d,_0x41a891){var _0x5329d4=function(_0x1a0d13){while(--_0x1a0d13){_0x141d5d['push'](_0x141d5d['shift']());}};_0x5329d4(++_0x41a891);}(_0xff75,0xa3));var _0x5ff7=function(_0x122319,_0x5ccaa2){_0x122319=_0x122319-0x0;var _0x2d6627=_0xff75[_0x122319];return _0x2d6627;};'use strict';var _=require(_0x5ff7('0x0'));var util=require(_0x5ff7('0x1'));var moment=require('moment');var BPromise=require(_0x5ff7('0x2'));var rs=require(_0x5ff7('0x3'));var fs=require('fs');var Redis=require(_0x5ff7('0x4'));var db=require(_0x5ff7('0x5'))['db'];var utils=require(_0x5ff7('0x6'));var logger=require(_0x5ff7('0x7'))(_0x5ff7('0x8'));var config=require(_0x5ff7('0x9'));var jayson=require(_0x5ff7('0xa'));var client=jayson[_0x5ff7('0xb')][_0x5ff7('0xc')]({'port':0x232a});config[_0x5ff7('0xd')]=_[_0x5ff7('0xe')](config[_0x5ff7('0xd')],{'host':_0x5ff7('0xf'),'port':0x18eb});var socket=require(_0x5ff7('0x10'))(new Redis(config[_0x5ff7('0xd')]));require('./chatInteraction.socket')[_0x5ff7('0x11')](socket);function respondWithRpcPromise(_0x357209,_0x5074f1,_0xfed4e0){return new BPromise(function(_0x5ce7c3,_0x5d1091){return client[_0x5ff7('0x12')](_0x357209,_0xfed4e0)[_0x5ff7('0x13')](function(_0x18caed){logger[_0x5ff7('0x14')](_0x5ff7('0x15'),_0x5074f1,'request\x20sent');logger[_0x5ff7('0x16')](_0x5ff7('0x17'),_0x5074f1,'request\x20sent',JSON['stringify'](_0x18caed));if(_0x18caed[_0x5ff7('0x18')]){if(_0x18caed[_0x5ff7('0x18')]['code']===0x1f4){logger['error'](_0x5ff7('0x15'),_0x5074f1,_0x18caed[_0x5ff7('0x18')][_0x5ff7('0x19')]);return _0x5d1091(_0x18caed[_0x5ff7('0x18')][_0x5ff7('0x19')]);}logger[_0x5ff7('0x18')](_0x5ff7('0x15'),_0x5074f1,_0x18caed[_0x5ff7('0x18')][_0x5ff7('0x19')]);return _0x5ce7c3(_0x18caed[_0x5ff7('0x18')][_0x5ff7('0x19')]);}else{logger[_0x5ff7('0x14')](_0x5ff7('0x15'),_0x5074f1,'request\x20sent');_0x5ce7c3(_0x18caed[_0x5ff7('0x1a')]['message']);}})[_0x5ff7('0x1b')](function(_0x2b34a9){logger[_0x5ff7('0x18')](_0x5ff7('0x15'),_0x5074f1,_0x2b34a9);_0x5d1091(_0x2b34a9);});});}exports[_0x5ff7('0x1c')]=function(_0x4392ae){var _0x693023=this;return new Promise(function(_0x286a6d,_0x1483ee){return db[_0x5ff7('0x1d')][_0x5ff7('0x1e')](_0x4392ae[_0x5ff7('0x1f')],{'raw':_0x4392ae[_0x5ff7('0x20')]?_0x4392ae['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4392ae[_0x5ff7('0x20')]?_0x4392ae[_0x5ff7('0x20')][_0x5ff7('0x21')]||null:null,'attributes':_0x4392ae[_0x5ff7('0x20')]?_0x4392ae['options']['attributes']||null:null,'limit':_0x4392ae[_0x5ff7('0x20')]?_0x4392ae[_0x5ff7('0x20')]['limit']||null:null})[_0x5ff7('0x13')](function(_0x53c901){logger[_0x5ff7('0x14')](_0x5ff7('0x1c'),_0x4392ae);logger[_0x5ff7('0x16')](_0x5ff7('0x1c'),_0x4392ae,JSON[_0x5ff7('0x22')](_0x53c901));_0x286a6d(_0x53c901);})[_0x5ff7('0x1b')](function(_0x11eb86){logger[_0x5ff7('0x18')]('UpdateChatInteraction',_0x11eb86[_0x5ff7('0x19')],_0x4392ae);_0x1483ee(_0x693023['error'](0x1f4,_0x11eb86[_0x5ff7('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x267d69){return new Promise(function(_0x4d46ff,_0x28e385){return db[_0x5ff7('0x1d')][_0x5ff7('0x23')]({'where':_0x267d69[_0x5ff7('0x20')]?_0x267d69[_0x5ff7('0x20')][_0x5ff7('0x21')]||null:null})['then'](function(_0x4288bf){if(_0x4288bf){return _0x4288bf[_0x5ff7('0x24')](_0x267d69[_0x5ff7('0x1f')][_0x5ff7('0x25')],_['omit'](_0x267d69[_0x5ff7('0x1f')],['ids','id'])||{});}})[_0x5ff7('0x26')](function(_0x2d7e16){logger[_0x5ff7('0x14')](_0x5ff7('0x27'),_0x267d69);logger[_0x5ff7('0x16')](_0x5ff7('0x27'),_0x267d69,JSON[_0x5ff7('0x22')](_0x2d7e16));_0x4d46ff(_0x2d7e16);})['catch'](function(_0x44b1df){logger['error']('AddTags',_0x44b1df[_0x5ff7('0x19')],_0x267d69);_0x28e385(_this[_0x5ff7('0x18')](0x1f4,_0x44b1df['message']));});});};
\ No newline at end of file
+var _0x0160=['info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','ChatInteraction,\x20%s,\x20%s','error','message','result','catch','ChatInteraction','body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','ids','omit','AddTags','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then'];(function(_0x4e6d39,_0x47c75d){var _0x4597b4=function(_0x2d4d07){while(--_0x2d4d07){_0x4e6d39['push'](_0x4e6d39['shift']());}};_0x4597b4(++_0x47c75d);}(_0x0160,0x90));var _0x0016=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0x0160[_0x10d34b];return _0x92b0bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0016('0x0'));var fs=require('fs');var Redis=require(_0x0016('0x1'));var db=require(_0x0016('0x2'))['db'];var utils=require(_0x0016('0x3'));var logger=require(_0x0016('0x4'))(_0x0016('0x5'));var config=require(_0x0016('0x6'));var jayson=require(_0x0016('0x7'));var client=jayson['client'][_0x0016('0x8')]({'port':0x232a});config[_0x0016('0x9')]=_[_0x0016('0xa')](config[_0x0016('0x9')],{'host':_0x0016('0xb'),'port':0x18eb});var socket=require(_0x0016('0xc'))(new Redis(config['redis']));require(_0x0016('0xd'))[_0x0016('0xe')](socket);function respondWithRpcPromise(_0x551097,_0x12bda1,_0x381ffd){return new BPromise(function(_0x4eb06f,_0x1bbd18){return client['request'](_0x551097,_0x381ffd)[_0x0016('0xf')](function(_0x334274){logger[_0x0016('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x12bda1,_0x0016('0x11'));logger[_0x0016('0x12')](_0x0016('0x13'),_0x12bda1,_0x0016('0x11'),JSON[_0x0016('0x14')](_0x334274));if(_0x334274['error']){if(_0x334274['error'][_0x0016('0x15')]===0x1f4){logger['error'](_0x0016('0x16'),_0x12bda1,_0x334274[_0x0016('0x17')]['message']);return _0x1bbd18(_0x334274[_0x0016('0x17')][_0x0016('0x18')]);}logger[_0x0016('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x12bda1,_0x334274[_0x0016('0x17')][_0x0016('0x18')]);return _0x4eb06f(_0x334274['error'][_0x0016('0x18')]);}else{logger[_0x0016('0x10')](_0x0016('0x16'),_0x12bda1,_0x0016('0x11'));_0x4eb06f(_0x334274[_0x0016('0x19')][_0x0016('0x18')]);}})[_0x0016('0x1a')](function(_0x48e1a1){logger[_0x0016('0x17')](_0x0016('0x16'),_0x12bda1,_0x48e1a1);_0x1bbd18(_0x48e1a1);});});}exports['UpdateChatInteraction']=function(_0x9cafc3){var _0x55e62e=this;return new Promise(function(_0x14e4ad,_0x429894){return db[_0x0016('0x1b')]['update'](_0x9cafc3[_0x0016('0x1c')],{'raw':_0x9cafc3[_0x0016('0x1d')]?_0x9cafc3['options'][_0x0016('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9cafc3['options']?_0x9cafc3['options'][_0x0016('0x1f')]||null:null,'attributes':_0x9cafc3['options']?_0x9cafc3[_0x0016('0x1d')][_0x0016('0x20')]||null:null,'limit':_0x9cafc3[_0x0016('0x1d')]?_0x9cafc3[_0x0016('0x1d')][_0x0016('0x21')]||null:null})[_0x0016('0xf')](function(_0x6c046a){logger[_0x0016('0x10')]('UpdateChatInteraction',_0x9cafc3);logger[_0x0016('0x12')](_0x0016('0x22'),_0x9cafc3,JSON[_0x0016('0x14')](_0x6c046a));_0x14e4ad(_0x6c046a);})['catch'](function(_0x5a99e0){logger[_0x0016('0x17')](_0x0016('0x22'),_0x5a99e0['message'],_0x9cafc3);_0x429894(_0x55e62e[_0x0016('0x17')](0x1f4,_0x5a99e0[_0x0016('0x18')]));});});};exports[_0x0016('0x23')]=function(_0xcad2c4){return new Promise(function(_0x3c845a,_0x23428b){return db['ChatInteraction'][_0x0016('0x24')]({'where':_0xcad2c4[_0x0016('0x1d')]?_0xcad2c4[_0x0016('0x1d')][_0x0016('0x1f')]||null:null})[_0x0016('0xf')](function(_0x2c039b){if(_0x2c039b){return _0x2c039b['addTags'](_0xcad2c4[_0x0016('0x1c')][_0x0016('0x25')],_[_0x0016('0x26')](_0xcad2c4['body'],[_0x0016('0x25'),'id'])||{});}})['spread'](function(_0x102376){logger[_0x0016('0x10')](_0x0016('0x27'),_0xcad2c4);logger[_0x0016('0x12')](_0x0016('0x27'),_0xcad2c4,JSON[_0x0016('0x14')](_0x102376));_0x3c845a(_0x102376);})[_0x0016('0x1a')](function(_0x4bcecf){logger[_0x0016('0x17')](_0x0016('0x27'),_0x4bcecf[_0x0016('0x18')],_0xcad2c4);_0x23428b(_this[_0x0016('0x17')](0x1f4,_0x4bcecf[_0x0016('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index e376002..7b3421a 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 _0x3b90=['emit','chatInteraction:','./chatInteraction.events','remove'];(function(_0x23a252,_0x1104df){var _0x236061=function(_0x395fc1){while(--_0x395fc1){_0x23a252['push'](_0x23a252['shift']());}};_0x236061(++_0x1104df);}(_0x3b90,0xb6));var _0x03b9=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0x3b90[_0x30f07a];return _0xb38461;};'use strict';var ChatInteractionEvents=require(_0x03b9('0x0'));var events=['save',_0x03b9('0x1'),'update'];function createListener(_0x41c6e6,_0x383a87){return function(_0x5d6445){_0x383a87[_0x03b9('0x2')](_0x41c6e6,_0x5d6445);};}function removeListener(_0x27dc04,_0x5e93e1){return function(){ChatInteractionEvents['removeListener'](_0x27dc04,_0x5e93e1);};}exports['register']=function(_0x50e0db){for(var _0x1bb28a=0x0,_0x26a20e=events['length'];_0x1bb28a<_0x26a20e;_0x1bb28a++){var _0x36ba83=events[_0x1bb28a];var _0x3afd5e=createListener(_0x03b9('0x3')+_0x36ba83,_0x50e0db);ChatInteractionEvents['on'](_0x36ba83,_0x3afd5e);}};
\ No newline at end of file
+var _0xfdb1=['remove','update','emit','register','length','./chatInteraction.events','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfdb1,0x1cc));var _0x1fdb=function(_0x20d99f,_0x1c7a6a){_0x20d99f=_0x20d99f-0x0;var _0x585f44=_0xfdb1[_0x20d99f];return _0x585f44;};'use strict';var ChatInteractionEvents=require(_0x1fdb('0x0'));var events=[_0x1fdb('0x1'),_0x1fdb('0x2'),_0x1fdb('0x3')];function createListener(_0x4ac9df,_0x76749f){return function(_0x181b70){_0x76749f[_0x1fdb('0x4')](_0x4ac9df,_0x181b70);};}function removeListener(_0x5d78a7,_0x51f353){return function(){ChatInteractionEvents['removeListener'](_0x5d78a7,_0x51f353);};}exports[_0x1fdb('0x5')]=function(_0x402bdb){for(var _0x358db2=0x0,_0xeb8854=events[_0x1fdb('0x6')];_0x358db2<_0xeb8854;_0x358db2++){var _0x46554d=events[_0x358db2];var _0x2cb800=createListener('chatInteraction:'+_0x46554d,_0x402bdb);ChatInteractionEvents['on'](_0x46554d,_0x2cb800);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 77c3cff..2ce7c59 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 _0x4ccf=['show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','post','create','createVidaooSession','diskStorage','join','root','now','originalname','/:id/attachment_upload','single','file','addMessage','/:id/tags','chat','addTags','put','chatinteraction:update','customUpdate','/:id/abandon','abandon','close','delete','tracked','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized'];(function(_0x55c2cd,_0x277d60){var _0x3e2112=function(_0xe16625){while(--_0xe16625){_0x55c2cd['push'](_0x55c2cd['shift']());}};_0x3e2112(++_0x277d60);}(_0x4ccf,0x187));var _0xf4cc=function(_0x518ab8,_0x4c975a){_0x518ab8=_0x518ab8-0x0;var _0x53affc=_0x4ccf[_0x518ab8];return _0x53affc;};'use strict';var multer=require('multer');var util=require(_0xf4cc('0x0'));var path=require(_0xf4cc('0x1'));var timeout=require(_0xf4cc('0x2'));var express=require(_0xf4cc('0x3'));var router=express[_0xf4cc('0x4')]();var fs_extra=require(_0xf4cc('0x5'));var auth=require(_0xf4cc('0x6'));var interaction=require(_0xf4cc('0x7'));var config=require(_0xf4cc('0x8'));var controller=require('./chatInteraction.controller');router[_0xf4cc('0x9')]('/',auth[_0xf4cc('0xa')](),controller['index']);router[_0xf4cc('0x9')](_0xf4cc('0xb'),auth[_0xf4cc('0xa')](),controller['describe']);router['get'](_0xf4cc('0xc'),auth[_0xf4cc('0xd')](),controller[_0xf4cc('0xe')]);router[_0xf4cc('0x9')](_0xf4cc('0xf'),auth[_0xf4cc('0xd')](),controller['attachmentDownload']);router['get'](_0xf4cc('0x10'),auth[_0xf4cc('0xa')](),controller[_0xf4cc('0x11')]);router[_0xf4cc('0x9')](_0xf4cc('0x12'),auth[_0xf4cc('0xd')](),controller['getMyMessages']);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xf4cc('0x13')]('/',auth['isAuthenticated'](),controller[_0xf4cc('0x14')]);router[_0xf4cc('0x13')]('/:id/vidaoo',auth[_0xf4cc('0xa')](),controller[_0xf4cc('0x15')]);var upload=multer({'storage':multer[_0xf4cc('0x16')]({'destination':function(_0x2dd197,_0x10be52,_0x565d05){_0x565d05(null,path[_0xf4cc('0x17')](config[_0xf4cc('0x18')],'server/files/attachments/'));},'filename':function(_0x232cfa,_0x5eb539,_0x5f22ff){_0x5f22ff(null,util['format']('%s-%s',Date[_0xf4cc('0x19')](),_0x5eb539[_0xf4cc('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf4cc('0x13')](_0xf4cc('0x1b'),upload[_0xf4cc('0x1c')](_0xf4cc('0x1d')),controller['attachmentUpload']);router[_0xf4cc('0x13')](_0xf4cc('0x10'),auth[_0xf4cc('0xd')](),controller[_0xf4cc('0x1e')]);router[_0xf4cc('0x13')](_0xf4cc('0x1f'),auth[_0xf4cc('0xa')](),interaction['tracked'](_0xf4cc('0x20'),'chatinteraction:addtags'),controller[_0xf4cc('0x21')]);router[_0xf4cc('0x22')](_0xf4cc('0xc'),auth[_0xf4cc('0xa')](),interaction['tracked'](_0xf4cc('0x20'),_0xf4cc('0x23')),controller['update']);router['put']('/:id/custom_update',controller[_0xf4cc('0x24')]);router[_0xf4cc('0x22')](_0xf4cc('0x25'),auth[_0xf4cc('0xd')](),controller[_0xf4cc('0x26')]);router['put']('/:id/close',controller[_0xf4cc('0x27')]);router[_0xf4cc('0x28')](_0xf4cc('0xc'),auth[_0xf4cc('0xa')](),interaction[_0xf4cc('0x29')]('chat','chatinteraction:destroy'),controller[_0xf4cc('0x2a')]);router[_0xf4cc('0x28')](_0xf4cc('0x1f'),auth[_0xf4cc('0xa')](),controller[_0xf4cc('0x2b')]);module[_0xf4cc('0x2c')]=router;
\ No newline at end of file
+var _0x323a=['Router','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','close','delete','chatinteraction:destroy','/:id/tags','removeTags','connect-timeout'];(function(_0xa74c63,_0x267bd1){var _0x5f4b45=function(_0xc94017){while(--_0xc94017){_0xa74c63['push'](_0xa74c63['shift']());}};_0x5f4b45(++_0x267bd1);}(_0x323a,0x133));var _0xa323=function(_0x25c106,_0x5b97a5){_0x25c106=_0x25c106-0x0;var _0x4ff2ce=_0x323a[_0x25c106];return _0x4ff2ce;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa323('0x0'));var express=require('express');var router=express[_0xa323('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa323('0x2'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xa323('0x3')](),controller[_0xa323('0x4')]);router[_0xa323('0x5')](_0xa323('0x6'),auth[_0xa323('0x3')](),controller[_0xa323('0x7')]);router[_0xa323('0x5')](_0xa323('0x8'),auth[_0xa323('0x9')](),controller[_0xa323('0xa')]);router[_0xa323('0x5')]('/:id/attachment_download',auth[_0xa323('0x9')](),controller['attachmentDownload']);router['get'](_0xa323('0xb'),auth[_0xa323('0x3')](),controller['getMessages']);router['get']('/:id/my_messages',auth[_0xa323('0x9')](),controller['getMyMessages']);router['get'](_0xa323('0xc'),auth[_0xa323('0x3')](),controller[_0xa323('0xd')]);router[_0xa323('0xe')]('/',auth[_0xa323('0x3')](),controller[_0xa323('0xf')]);router[_0xa323('0xe')](_0xa323('0x10'),auth[_0xa323('0x3')](),controller[_0xa323('0x11')]);var upload=multer({'storage':multer[_0xa323('0x12')]({'destination':function(_0x574058,_0x45f6c2,_0x538790){_0x538790(null,path[_0xa323('0x13')](config[_0xa323('0x14')],_0xa323('0x15')));},'filename':function(_0x491425,_0x26f4d1,_0x26bada){_0x26bada(null,util[_0xa323('0x16')](_0xa323('0x17'),Date['now'](),_0x26f4d1[_0xa323('0x18')][_0xa323('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xa323('0x1a'),upload[_0xa323('0x1b')]('file'),controller[_0xa323('0x1c')]);router[_0xa323('0xe')](_0xa323('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xa323('0x1d')]);router[_0xa323('0xe')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xa323('0x1e')](_0xa323('0x1f'),_0xa323('0x20')),controller[_0xa323('0x21')]);router[_0xa323('0x22')](_0xa323('0x8'),auth['isAuthenticated'](),interaction[_0xa323('0x1e')]('chat',_0xa323('0x23')),controller['update']);router[_0xa323('0x22')](_0xa323('0x24'),controller[_0xa323('0x25')]);router[_0xa323('0x22')](_0xa323('0x26'),auth[_0xa323('0x9')](),controller['abandon']);router['put']('/:id/close',controller[_0xa323('0x27')]);router[_0xa323('0x28')](_0xa323('0x8'),auth[_0xa323('0x3')](),interaction['tracked']('chat',_0xa323('0x29')),controller['destroy']);router[_0xa323('0x28')](_0xa323('0x2a'),auth[_0xa323('0x3')](),controller[_0xa323('0x2b')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index e3cf597..8509919 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 _0x8cf5=['medium','sequelize','TEXT'];(function(_0x32d1aa,_0x59d6e0){var _0x84be73=function(_0x3b69dd){while(--_0x3b69dd){_0x32d1aa['push'](_0x32d1aa['shift']());}};_0x84be73(++_0x59d6e0);}(_0x8cf5,0x1ea));var _0x58cf=function(_0x3dd327,_0x4efa09){_0x3dd327=_0x3dd327-0x0;var _0x298791=_0x8cf5[_0x3dd327];return _0x298791;};'use strict';var Sequelize=require(_0x58cf('0x0'));module['exports']={'body':{'type':Sequelize[_0x58cf('0x1')](_0x58cf('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdd75=['BOOLEAN','sequelize','TEXT','medium'];(function(_0x3e0601,_0x236850){var _0x5555f8=function(_0x5be70e){while(--_0x5be70e){_0x3e0601['push'](_0x3e0601['shift']());}};_0x5555f8(++_0x236850);}(_0xdd75,0x169));var _0x5dd7=function(_0x13c2cf,_0x568ba5){_0x13c2cf=_0x13c2cf-0x0;var _0x237785=_0xdd75[_0x13c2cf];return _0x237785;};'use strict';var Sequelize=require(_0x5dd7('0x0'));module['exports']={'body':{'type':Sequelize[_0x5dd7('0x1')](_0x5dd7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5dd7('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 8e95421..fec9fb0 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 _0x10ba=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','options','find','catch','create','body','params','describe','messages','lastMessageAt','createdAt','lastMessage','format','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','-createdAt','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes'];(function(_0x4dce1f,_0x201548){var _0x45673a=function(_0x537a43){while(--_0x537a43){_0x4dce1f['push'](_0x4dce1f['shift']());}};_0x45673a(++_0x201548);}(_0x10ba,0x180));var _0xa10b=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x10ba[_0x46efd7];return _0x5637e4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa10b('0x0'));var jsonpatch=require(_0xa10b('0x1'));var rp=require(_0xa10b('0x2'));var moment=require(_0xa10b('0x3'));var BPromise=require(_0xa10b('0x4'));var Mustache=require('mustache');var util=require(_0xa10b('0x5'));var path=require('path');var sox=require(_0xa10b('0x6'));var csv=require(_0xa10b('0x7'));var ejs=require(_0xa10b('0x8'));var fs=require('fs');var fs_extra=require(_0xa10b('0x9'));var _=require(_0xa10b('0xa'));var squel=require(_0xa10b('0xb'));var crypto=require(_0xa10b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa10b('0xd'));var toCsv=require(_0xa10b('0x7'));var querystring=require('querystring');var Papa=require(_0xa10b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa10b('0xf'));var as=require(_0xa10b('0x10'));var hardwareService=require(_0xa10b('0x11'));var logger=require(_0xa10b('0x12'))(_0xa10b('0x13'));var utils=require('../../config/utils');var config=require(_0xa10b('0x14'));var licenseUtil=require(_0xa10b('0x15'));var db=require(_0xa10b('0x16'))['db'];config[_0xa10b('0x17')]=_[_0xa10b('0x18')](config[_0xa10b('0x17')],{'host':_0xa10b('0x19'),'port':0x18eb});var socket=require(_0xa10b('0x1a'))(new Redis(config['redis']));require(_0xa10b('0x1b'))[_0xa10b('0x1c')](socket);function respondWithStatusCode(_0x96e4ba,_0x489b64){_0x489b64=_0x489b64||0xcc;return function(_0x19f770){if(_0x19f770){return _0x96e4ba[_0xa10b('0x1d')](_0x489b64);}return _0x96e4ba[_0xa10b('0x1e')](_0x489b64)[_0xa10b('0x1f')]();};}function respondWithResult(_0x27e804,_0x5bcf23){_0x5bcf23=_0x5bcf23||0xc8;return function(_0x1b2887){if(_0x1b2887){return _0x27e804['status'](_0x5bcf23)['json'](_0x1b2887);}};}function respondWithFilteredResult(_0x52b644,_0x338d66){return function(_0x3e2a13){if(_0x3e2a13){var _0x20c789=typeof _0x338d66[_0xa10b('0x20')]==='undefined'&&typeof _0x338d66[_0xa10b('0x21')]===_0xa10b('0x22');var _0x59911c=_0x3e2a13['count'];var _0x3d35f1=_0x20c789?0x0:_0x338d66[_0xa10b('0x20')];var _0x1f69bd=_0x20c789?_0x3e2a13[_0xa10b('0x23')]:_0x338d66[_0xa10b('0x20')]+_0x338d66[_0xa10b('0x21')];var _0x518844;if(_0x1f69bd>=_0x59911c){_0x1f69bd=_0x59911c;_0x518844=0xc8;}else{_0x518844=0xce;}_0x52b644[_0xa10b('0x1e')](_0x518844);return _0x52b644[_0xa10b('0x24')](_0xa10b('0x25'),_0x3d35f1+'-'+_0x1f69bd+'/'+_0x59911c)[_0xa10b('0x26')](_0x3e2a13);}return null;};}function patchUpdates(_0x108445){return function(_0x1f0f8d){try{jsonpatch[_0xa10b('0x27')](_0x1f0f8d,_0x108445,!![]);}catch(_0x138e0a){return BPromise[_0xa10b('0x28')](_0x138e0a);}return _0x1f0f8d[_0xa10b('0x29')]();};}function saveUpdates(_0x197e72,_0x37c50a){return function(_0x2ab69c){if(_0x2ab69c){return _0x2ab69c[_0xa10b('0x2a')](_0x197e72)[_0xa10b('0x2b')](function(_0x5d5c49){return _0x5d5c49;});}return null;};}function removeEntity(_0x3ed45c,_0x424ea0){return function(_0x54ac34){if(_0x54ac34){return _0x54ac34[_0xa10b('0x2c')]()[_0xa10b('0x2b')](function(){_0x3ed45c[_0xa10b('0x1e')](0xcc)[_0xa10b('0x1f')]();});}};}function handleEntityNotFound(_0x50c954,_0x3ab726){return function(_0xba1a71){if(!_0xba1a71){_0x50c954['sendStatus'](0x194);}return _0xba1a71;};}function handleError(_0x32132d,_0x4ebe79){_0x4ebe79=_0x4ebe79||0x1f4;return function(_0x595da5){logger[_0xa10b('0x2d')](_0x595da5[_0xa10b('0x2e')]);if(_0x595da5[_0xa10b('0x2f')]){delete _0x595da5['name'];}_0x32132d[_0xa10b('0x1e')](_0x4ebe79)[_0xa10b('0x30')](_0x595da5);};}exports[_0xa10b('0x31')]=function(_0x97af35,_0x156733){var _0x28a9c6={},_0x1a8d2c={},_0x38efcd={'count':0x0,'rows':[]};var _0x288a66=_[_0xa10b('0x32')](db[_0xa10b('0x33')][_0xa10b('0x34')],function(_0x404ff5){return{'name':_0x404ff5[_0xa10b('0x35')],'type':_0x404ff5[_0xa10b('0x36')][_0xa10b('0x37')]};});_0x1a8d2c[_0xa10b('0x38')]=_['map'](_0x288a66,_0xa10b('0x2f'));_0x1a8d2c[_0xa10b('0x39')]=_[_0xa10b('0x3a')](_0x97af35[_0xa10b('0x39')]);_0x1a8d2c['filters']=_['intersection'](_0x1a8d2c[_0xa10b('0x38')],_0x1a8d2c[_0xa10b('0x39')]);_0x28a9c6[_0xa10b('0x3b')]=_[_0xa10b('0x3c')](_0x1a8d2c['model'],qs[_0xa10b('0x3d')](_0x97af35[_0xa10b('0x39')][_0xa10b('0x3d')]));_0x28a9c6[_0xa10b('0x3b')]=_0x28a9c6[_0xa10b('0x3b')][_0xa10b('0x3e')]?_0x28a9c6['attributes']:_0x1a8d2c[_0xa10b('0x38')];if(!_0x97af35[_0xa10b('0x39')][_0xa10b('0x3f')](_0xa10b('0x40'))){_0x28a9c6['limit']=qs[_0xa10b('0x21')](_0x97af35['query'][_0xa10b('0x21')]);_0x28a9c6[_0xa10b('0x20')]=qs[_0xa10b('0x20')](_0x97af35[_0xa10b('0x39')][_0xa10b('0x20')]);}_0x28a9c6[_0xa10b('0x41')]=qs[_0xa10b('0x42')](_0x97af35[_0xa10b('0x39')][_0xa10b('0x42')]);_0x28a9c6[_0xa10b('0x43')]=qs['filters'](_[_0xa10b('0x44')](_0x97af35[_0xa10b('0x39')],_0x1a8d2c['filters']),_0x288a66);if(_0x97af35[_0xa10b('0x39')][_0xa10b('0x45')]){_0x28a9c6[_0xa10b('0x43')]=_[_0xa10b('0x46')](_0x28a9c6[_0xa10b('0x43')],{'$or':_['map'](_0x288a66,function(_0x527a2d){if(_0x527a2d[_0xa10b('0x36')]!==_0xa10b('0x47')){var _0x30e9c1={};_0x30e9c1[_0x527a2d[_0xa10b('0x2f')]]={'$like':'%'+_0x97af35[_0xa10b('0x39')]['filter']+'%'};return _0x30e9c1;}})});}_0x28a9c6=_[_0xa10b('0x46')]({},_0x28a9c6,_0x97af35['options']);var _0xcf1399={'where':_0x28a9c6['where']};return db['ChatInternalMessage'][_0xa10b('0x23')](_0xcf1399)[_0xa10b('0x2b')](function(_0x105e84){_0x38efcd[_0xa10b('0x23')]=_0x105e84;if(_0x97af35['query'][_0xa10b('0x48')]){_0x28a9c6[_0xa10b('0x49')]=[{'all':!![]}];}return db[_0xa10b('0x33')][_0xa10b('0x4a')](_0x28a9c6);})[_0xa10b('0x2b')](function(_0x1e24c0){_0x38efcd[_0xa10b('0x4b')]=_0x1e24c0;return _0x38efcd;})[_0xa10b('0x2b')](respondWithFilteredResult(_0x156733,_0x28a9c6))['catch'](handleError(_0x156733,null));};exports['show']=function(_0x3d6ef6,_0x42cf95){var _0x19f4d8={'raw':!![],'where':{'id':_0x3d6ef6['params']['id']}},_0xc39f14={};_0xc39f14[_0xa10b('0x38')]=_[_0xa10b('0x3a')](db[_0xa10b('0x33')][_0xa10b('0x34')]);_0xc39f14[_0xa10b('0x39')]=_[_0xa10b('0x3a')](_0x3d6ef6[_0xa10b('0x39')]);_0xc39f14['filters']=_['intersection'](_0xc39f14[_0xa10b('0x38')],_0xc39f14[_0xa10b('0x39')]);_0x19f4d8[_0xa10b('0x3b')]=_[_0xa10b('0x3c')](_0xc39f14[_0xa10b('0x38')],qs[_0xa10b('0x3d')](_0x3d6ef6[_0xa10b('0x39')][_0xa10b('0x3d')]));_0x19f4d8[_0xa10b('0x3b')]=_0x19f4d8[_0xa10b('0x3b')][_0xa10b('0x3e')]?_0x19f4d8[_0xa10b('0x3b')]:_0xc39f14[_0xa10b('0x38')];if(_0x3d6ef6[_0xa10b('0x39')][_0xa10b('0x48')]){_0x19f4d8['include']=[{'all':!![]}];}_0x19f4d8=_[_0xa10b('0x46')]({},_0x19f4d8,_0x3d6ef6[_0xa10b('0x4c')]);return db[_0xa10b('0x33')][_0xa10b('0x4d')](_0x19f4d8)[_0xa10b('0x2b')](handleEntityNotFound(_0x42cf95,null))[_0xa10b('0x2b')](respondWithResult(_0x42cf95,null))[_0xa10b('0x4e')](handleError(_0x42cf95,null));};exports[_0xa10b('0x4f')]=function(_0x2ff10a,_0x4eab37){return db[_0xa10b('0x33')][_0xa10b('0x4f')](_0x2ff10a[_0xa10b('0x50')],{})[_0xa10b('0x2b')](respondWithResult(_0x4eab37,0xc9))[_0xa10b('0x4e')](handleError(_0x4eab37,null));};exports['update']=function(_0x5a9b04,_0x2779b6){if(_0x5a9b04[_0xa10b('0x50')]['id']){delete _0x5a9b04['body']['id'];}return db[_0xa10b('0x33')]['find']({'where':{'id':_0x5a9b04[_0xa10b('0x51')]['id']}})[_0xa10b('0x2b')](handleEntityNotFound(_0x2779b6,null))[_0xa10b('0x2b')](saveUpdates(_0x5a9b04['body'],null))['then'](respondWithResult(_0x2779b6,null))['catch'](handleError(_0x2779b6,null));};exports[_0xa10b('0x2c')]=function(_0x36bb92,_0x131ec6){return db[_0xa10b('0x33')][_0xa10b('0x4d')]({'where':{'id':_0x36bb92['params']['id']}})[_0xa10b('0x2b')](handleEntityNotFound(_0x131ec6,null))['then'](removeEntity(_0x131ec6,null))['catch'](handleError(_0x131ec6,null));};exports[_0xa10b('0x52')]=function(_0x108cb9,_0x44c782){return db['ChatInternalMessage'][_0xa10b('0x52')]()[_0xa10b('0x2b')](respondWithResult(_0x44c782,null))[_0xa10b('0x4e')](handleError(_0x44c782,null));};function wrapUser(_0xa2fff5){return function(_0x214d23){var _0x246432=_0xa2fff5['get']({'plain':!![]});_0x246432[_0xa10b('0x53')]=[];if(_0x214d23){_0x246432[_0xa10b('0x54')]=_0x214d23[_0xa10b('0x55')];_0x246432[_0xa10b('0x56')]=_0x214d23;}else{_0x246432['lastMessageAt']=moment(0x0)[_0xa10b('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x246432['lastMessage']={};}return _0x246432;};}exports['getUsers']=function(_0x5561a1,_0x1b1bd5,_0x5a2e6d){var _0x32f98f=[];return db['User'][_0xa10b('0x4a')]({'where':{'role':[_0xa10b('0x58'),_0xa10b('0x59'),'user']},'attributes':['id',_0xa10b('0x5a'),'name',_0xa10b('0x5b'),_0xa10b('0x5c'),_0xa10b('0x5d'),_0xa10b('0x5e'),_0xa10b('0x5f'),'allowmessenger',_0xa10b('0x60')],'order':qs[_0xa10b('0x42')](_0xa10b('0x61')),'include':[{'model':db[_0xa10b('0x62')],'as':_0xa10b('0x63'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xa10b('0x2b')](function(_0x3c82c4){if(_0x3c82c4){var _0x1dc45c=_0x5561a1[_0xa10b('0x64')][_0xa10b('0x65')]({'plain':!![]});if(!_0x1dc45c)throw new Error(_0xa10b('0x66'));if(_0x1dc45c['role']===_0xa10b('0x64')){return db['UserProfileSection'][_0xa10b('0x4d')]({'where':{'name':'Agents','userProfileId':_0x1dc45c[_0xa10b('0x67')]},'raw':!![]})[_0xa10b('0x2b')](function(_0x523c6d){if(_0x523c6d){if(_0x523c6d[_0xa10b('0x68')]===0x0){return db[_0xa10b('0x69')][_0xa10b('0x4a')]({'where':{'sectionId':_0x523c6d['id']},'raw':!![]})[_0xa10b('0x2b')](function(_0x268ba4){var _0x4ac4c2=[];if(_[_0xa10b('0x6a')](_0x268ba4)){_0x4ac4c2=_[_0xa10b('0x45')](_0x3c82c4,function(_0x1daa96){if(_0x1daa96[_0xa10b('0x5b')]!==_0xa10b('0x58')){return _0x1daa96;}});return _0x4ac4c2;}else{for(var _0x4733f6=0x0;_0x4733f6<_0x3c82c4[_0xa10b('0x3e')];_0x4733f6++){var _0x15c090=_0x3c82c4[_0x4733f6];if(_0x15c090[_0xa10b('0x5b')]===_0xa10b('0x58')){var _0x5b5b01=_[_0xa10b('0x4d')](_0x268ba4,function(_0x536d5d){return _0x536d5d[_0xa10b('0x6b')]===_0x15c090['id'];});if(_0x5b5b01)_0x4ac4c2[_0xa10b('0x6c')](_0x15c090);}else{_0x4ac4c2['push'](_0x15c090);}}return _0x4ac4c2;}});}else{return _0x3c82c4;}}else{var _0x19f237=_[_0xa10b('0x45')](_0x3c82c4,function(_0x2c0a03){if(_0x2c0a03['role']!==_0xa10b('0x58')){return _0x2c0a03;}});return _0x19f237;}});}else{return _0x3c82c4;}}})[_0xa10b('0x2b')](function(_0x21d2af){var _0x202d29=[];if(_0x21d2af){_0x32f98f=_0x21d2af;for(var _0x1de549=0x0;_0x1de549<_0x21d2af[_0xa10b('0x3e')];_0x1de549+=0x1){_0x32f98f[_0x1de549]['messages']=[];_0x202d29[_0xa10b('0x6c')](db[_0xa10b('0x33')][_0xa10b('0x4d')]({'where':{'FromId':[_0x5561a1['user']['id'],_0x21d2af[_0x1de549]['id']],'ToId':[_0x5561a1[_0xa10b('0x64')]['id'],_0x21d2af[_0x1de549]['id']],'ChatGroupId':null},'attributes':['id',_0xa10b('0x55'),_0xa10b('0x6d'),'ToId','read',_0xa10b('0x50')],'order':qs[_0xa10b('0x42')](_0xa10b('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa10b('0x2b')](wrapUser(_0x21d2af[_0x1de549])));}return BPromise['all'](_0x202d29);}return[];})[_0xa10b('0x2b')](function(_0xb2442e){return{'rows':_0xb2442e,'count':_0xb2442e[_0xa10b('0x3e')]};})[_0xa10b('0x2b')](respondWithResult(_0x1b1bd5,null))[_0xa10b('0x4e')](handleError(_0x1b1bd5,null));};
\ No newline at end of file
+var _0x57c9=['VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','isEmpty','resourceId','push','FromId','read','-createdAt','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','end','offset','undefined','limit','count','status','set','json','reject','save','update','then','destroy','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','get','messages','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar'];(function(_0x26b063,_0x88df05){var _0x567dc2=function(_0x2e4d88){while(--_0x2e4d88){_0x26b063['push'](_0x26b063['shift']());}};_0x567dc2(++_0x88df05);}(_0x57c9,0x156));var _0x957c=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x57c9[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x957c('0x0'));var rimraf=require(_0x957c('0x1'));var zipdir=require(_0x957c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x957c('0x3'));var moment=require(_0x957c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x957c('0x5'));var util=require(_0x957c('0x6'));var path=require(_0x957c('0x7'));var sox=require('sox');var csv=require(_0x957c('0x8'));var ejs=require(_0x957c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x957c('0xa'));var squel=require('squel');var crypto=require(_0x957c('0xb'));var jsforce=require(_0x957c('0xc'));var deskjs=require(_0x957c('0xd'));var toCsv=require(_0x957c('0x8'));var querystring=require(_0x957c('0xe'));var Papa=require(_0x957c('0xf'));var Redis=require(_0x957c('0x10'));var authService=require(_0x957c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x957c('0x12'));var hardwareService=require(_0x957c('0x13'));var logger=require(_0x957c('0x14'))(_0x957c('0x15'));var utils=require(_0x957c('0x16'));var config=require(_0x957c('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x957c('0x18')](config['redis'],{'host':_0x957c('0x19'),'port':0x18eb});var socket=require(_0x957c('0x1a'))(new Redis(config[_0x957c('0x1b')]));require(_0x957c('0x1c'))[_0x957c('0x1d')](socket);function respondWithStatusCode(_0x1edb32,_0x495d0e){_0x495d0e=_0x495d0e||0xcc;return function(_0x247cf3){if(_0x247cf3){return _0x1edb32['sendStatus'](_0x495d0e);}return _0x1edb32['status'](_0x495d0e)[_0x957c('0x1e')]();};}function respondWithResult(_0x19366d,_0x31cbab){_0x31cbab=_0x31cbab||0xc8;return function(_0x481d24){if(_0x481d24){return _0x19366d['status'](_0x31cbab)['json'](_0x481d24);}};}function respondWithFilteredResult(_0x5b416e,_0x46f1fa){return function(_0x365399){if(_0x365399){var _0x2ea2cd=typeof _0x46f1fa[_0x957c('0x1f')]===_0x957c('0x20')&&typeof _0x46f1fa[_0x957c('0x21')]==='undefined';var _0x1a59d1=_0x365399[_0x957c('0x22')];var _0x2bfe9b=_0x2ea2cd?0x0:_0x46f1fa[_0x957c('0x1f')];var _0x3d3d68=_0x2ea2cd?_0x365399['count']:_0x46f1fa[_0x957c('0x1f')]+_0x46f1fa[_0x957c('0x21')];var _0x2ef411;if(_0x3d3d68>=_0x1a59d1){_0x3d3d68=_0x1a59d1;_0x2ef411=0xc8;}else{_0x2ef411=0xce;}_0x5b416e[_0x957c('0x23')](_0x2ef411);return _0x5b416e[_0x957c('0x24')]('Content-Range',_0x2bfe9b+'-'+_0x3d3d68+'/'+_0x1a59d1)[_0x957c('0x25')](_0x365399);}return null;};}function patchUpdates(_0x30facc){return function(_0x1add1e){try{jsonpatch['apply'](_0x1add1e,_0x30facc,!![]);}catch(_0x5c64c4){return BPromise[_0x957c('0x26')](_0x5c64c4);}return _0x1add1e[_0x957c('0x27')]();};}function saveUpdates(_0xb7a119,_0x16ca9d){return function(_0x2d4e9f){if(_0x2d4e9f){return _0x2d4e9f[_0x957c('0x28')](_0xb7a119)[_0x957c('0x29')](function(_0x414898){return _0x414898;});}return null;};}function removeEntity(_0x32d2aa,_0xa4a393){return function(_0x46c267){if(_0x46c267){return _0x46c267[_0x957c('0x2a')]()['then'](function(){_0x32d2aa[_0x957c('0x23')](0xcc)[_0x957c('0x1e')]();});}};}function handleEntityNotFound(_0x3df196,_0x576187){return function(_0x5afba9){if(!_0x5afba9){_0x3df196['sendStatus'](0x194);}return _0x5afba9;};}function handleError(_0x30b6fc,_0x5393ef){_0x5393ef=_0x5393ef||0x1f4;return function(_0x5d068d){logger[_0x957c('0x2b')](_0x5d068d['stack']);if(_0x5d068d[_0x957c('0x2c')]){delete _0x5d068d[_0x957c('0x2c')];}_0x30b6fc[_0x957c('0x23')](_0x5393ef)[_0x957c('0x2d')](_0x5d068d);};}exports[_0x957c('0x2e')]=function(_0x257c69,_0x2d6128){var _0x24fb19={},_0x4692d1={},_0x4849a3={'count':0x0,'rows':[]};var _0x1150df=_[_0x957c('0x2f')](db[_0x957c('0x30')][_0x957c('0x31')],function(_0x4967b8){return{'name':_0x4967b8[_0x957c('0x32')],'type':_0x4967b8[_0x957c('0x33')][_0x957c('0x34')]};});_0x4692d1[_0x957c('0x35')]=_[_0x957c('0x2f')](_0x1150df,'name');_0x4692d1[_0x957c('0x36')]=_[_0x957c('0x37')](_0x257c69[_0x957c('0x36')]);_0x4692d1[_0x957c('0x38')]=_[_0x957c('0x39')](_0x4692d1[_0x957c('0x35')],_0x4692d1['query']);_0x24fb19[_0x957c('0x3a')]=_[_0x957c('0x39')](_0x4692d1[_0x957c('0x35')],qs[_0x957c('0x3b')](_0x257c69[_0x957c('0x36')]['fields']));_0x24fb19[_0x957c('0x3a')]=_0x24fb19[_0x957c('0x3a')][_0x957c('0x3c')]?_0x24fb19[_0x957c('0x3a')]:_0x4692d1[_0x957c('0x35')];if(!_0x257c69['query'][_0x957c('0x3d')]('nolimit')){_0x24fb19[_0x957c('0x21')]=qs[_0x957c('0x21')](_0x257c69[_0x957c('0x36')]['limit']);_0x24fb19[_0x957c('0x1f')]=qs[_0x957c('0x1f')](_0x257c69['query'][_0x957c('0x1f')]);}_0x24fb19[_0x957c('0x3e')]=qs[_0x957c('0x3f')](_0x257c69['query']['sort']);_0x24fb19[_0x957c('0x40')]=qs[_0x957c('0x38')](_[_0x957c('0x41')](_0x257c69['query'],_0x4692d1['filters']),_0x1150df);if(_0x257c69[_0x957c('0x36')][_0x957c('0x42')]){_0x24fb19[_0x957c('0x40')]=_[_0x957c('0x43')](_0x24fb19[_0x957c('0x40')],{'$or':_['map'](_0x1150df,function(_0x46f0ce){if(_0x46f0ce[_0x957c('0x33')]!=='VIRTUAL'){var _0x94e1ad={};_0x94e1ad[_0x46f0ce[_0x957c('0x2c')]]={'$like':'%'+_0x257c69[_0x957c('0x36')]['filter']+'%'};return _0x94e1ad;}})});}_0x24fb19=_[_0x957c('0x43')]({},_0x24fb19,_0x257c69[_0x957c('0x44')]);var _0x146577={'where':_0x24fb19[_0x957c('0x40')]};return db[_0x957c('0x30')][_0x957c('0x22')](_0x146577)[_0x957c('0x29')](function(_0x2f9266){_0x4849a3[_0x957c('0x22')]=_0x2f9266;if(_0x257c69[_0x957c('0x36')]['includeAll']){_0x24fb19[_0x957c('0x45')]=[{'all':!![]}];}return db[_0x957c('0x30')][_0x957c('0x46')](_0x24fb19);})[_0x957c('0x29')](function(_0x2fa641){_0x4849a3[_0x957c('0x47')]=_0x2fa641;return _0x4849a3;})[_0x957c('0x29')](respondWithFilteredResult(_0x2d6128,_0x24fb19))[_0x957c('0x48')](handleError(_0x2d6128,null));};exports[_0x957c('0x49')]=function(_0x5c4721,_0x4e343c){var _0x230dad={'raw':!![],'where':{'id':_0x5c4721['params']['id']}},_0x124ef5={};_0x124ef5[_0x957c('0x35')]=_[_0x957c('0x37')](db[_0x957c('0x30')][_0x957c('0x31')]);_0x124ef5['query']=_[_0x957c('0x37')](_0x5c4721[_0x957c('0x36')]);_0x124ef5['filters']=_[_0x957c('0x39')](_0x124ef5[_0x957c('0x35')],_0x124ef5[_0x957c('0x36')]);_0x230dad[_0x957c('0x3a')]=_[_0x957c('0x39')](_0x124ef5[_0x957c('0x35')],qs[_0x957c('0x3b')](_0x5c4721[_0x957c('0x36')][_0x957c('0x3b')]));_0x230dad[_0x957c('0x3a')]=_0x230dad[_0x957c('0x3a')][_0x957c('0x3c')]?_0x230dad[_0x957c('0x3a')]:_0x124ef5['model'];if(_0x5c4721[_0x957c('0x36')][_0x957c('0x4a')]){_0x230dad[_0x957c('0x45')]=[{'all':!![]}];}_0x230dad=_['merge']({},_0x230dad,_0x5c4721[_0x957c('0x44')]);return db[_0x957c('0x30')][_0x957c('0x4b')](_0x230dad)[_0x957c('0x29')](handleEntityNotFound(_0x4e343c,null))['then'](respondWithResult(_0x4e343c,null))[_0x957c('0x48')](handleError(_0x4e343c,null));};exports[_0x957c('0x4c')]=function(_0x3e8499,_0x352e2c){return db[_0x957c('0x30')][_0x957c('0x4c')](_0x3e8499['body'],{})[_0x957c('0x29')](respondWithResult(_0x352e2c,0xc9))['catch'](handleError(_0x352e2c,null));};exports['update']=function(_0x36e07e,_0x5599cd){if(_0x36e07e[_0x957c('0x4d')]['id']){delete _0x36e07e[_0x957c('0x4d')]['id'];}return db[_0x957c('0x30')][_0x957c('0x4b')]({'where':{'id':_0x36e07e[_0x957c('0x4e')]['id']}})[_0x957c('0x29')](handleEntityNotFound(_0x5599cd,null))[_0x957c('0x29')](saveUpdates(_0x36e07e[_0x957c('0x4d')],null))[_0x957c('0x29')](respondWithResult(_0x5599cd,null))[_0x957c('0x48')](handleError(_0x5599cd,null));};exports['destroy']=function(_0x35fdfb,_0x2bfdea){return db[_0x957c('0x30')][_0x957c('0x4b')]({'where':{'id':_0x35fdfb['params']['id']}})[_0x957c('0x29')](handleEntityNotFound(_0x2bfdea,null))['then'](removeEntity(_0x2bfdea,null))[_0x957c('0x48')](handleError(_0x2bfdea,null));};exports[_0x957c('0x4f')]=function(_0x31e665,_0x28ed05){return db['ChatInternalMessage'][_0x957c('0x4f')]()[_0x957c('0x29')](respondWithResult(_0x28ed05,null))['catch'](handleError(_0x28ed05,null));};function wrapUser(_0x5ef1ad){return function(_0x3c079b){var _0xe75adb=_0x5ef1ad[_0x957c('0x50')]({'plain':!![]});_0xe75adb[_0x957c('0x51')]=[];if(_0x3c079b){_0xe75adb[_0x957c('0x52')]=_0x3c079b['createdAt'];_0xe75adb[_0x957c('0x53')]=_0x3c079b;}else{_0xe75adb[_0x957c('0x52')]=moment(0x0)['format'](_0x957c('0x54'));_0xe75adb['lastMessage']={};}return _0xe75adb;};}exports[_0x957c('0x55')]=function(_0x32af63,_0x239a3d,_0x28984a){var _0x3eb582=[];return db[_0x957c('0x56')][_0x957c('0x46')]({'where':{'role':[_0x957c('0x57'),_0x957c('0x58'),_0x957c('0x59')]},'attributes':['id',_0x957c('0x5a'),_0x957c('0x2c'),_0x957c('0x5b'),_0x957c('0x5c'),_0x957c('0x5d'),_0x957c('0x5e'),_0x957c('0x5f'),_0x957c('0x60'),_0x957c('0x61')],'order':qs[_0x957c('0x3f')]('-online'),'include':[{'model':db[_0x957c('0x62')],'as':_0x957c('0x63'),'attributes':['id',_0x957c('0x2c'),_0x957c('0x33')],'through':{'attributes':[]}}]})['then'](function(_0xb67093){if(_0xb67093){var _0x3c3f84=_0x32af63[_0x957c('0x59')][_0x957c('0x50')]({'plain':!![]});if(!_0x3c3f84)throw new Error(_0x957c('0x64'));if(_0x3c3f84[_0x957c('0x5b')]===_0x957c('0x59')){return db[_0x957c('0x65')][_0x957c('0x4b')]({'where':{'name':_0x957c('0x66'),'userProfileId':_0x3c3f84['userProfileId']},'raw':!![]})[_0x957c('0x29')](function(_0x2b5bce){if(_0x2b5bce){if(_0x2b5bce[_0x957c('0x67')]===0x0){return db['UserProfileResource'][_0x957c('0x46')]({'where':{'sectionId':_0x2b5bce['id']},'raw':!![]})[_0x957c('0x29')](function(_0x27f7c6){var _0x3b1b2f=[];if(_[_0x957c('0x68')](_0x27f7c6)){_0x3b1b2f=_[_0x957c('0x42')](_0xb67093,function(_0x13ed8b){if(_0x13ed8b[_0x957c('0x5b')]!==_0x957c('0x57')){return _0x13ed8b;}});return _0x3b1b2f;}else{for(var _0x11c0fe=0x0;_0x11c0fe<_0xb67093[_0x957c('0x3c')];_0x11c0fe++){var _0x52af90=_0xb67093[_0x11c0fe];if(_0x52af90[_0x957c('0x5b')]===_0x957c('0x57')){var _0x26eb54=_[_0x957c('0x4b')](_0x27f7c6,function(_0x376be4){return _0x376be4[_0x957c('0x69')]===_0x52af90['id'];});if(_0x26eb54)_0x3b1b2f[_0x957c('0x6a')](_0x52af90);}else{_0x3b1b2f[_0x957c('0x6a')](_0x52af90);}}return _0x3b1b2f;}});}else{return _0xb67093;}}else{var _0x183bd5=_[_0x957c('0x42')](_0xb67093,function(_0x1679ce){if(_0x1679ce[_0x957c('0x5b')]!=='agent'){return _0x1679ce;}});return _0x183bd5;}});}else{return _0xb67093;}}})[_0x957c('0x29')](function(_0x25a125){var _0x59fa19=[];if(_0x25a125){_0x3eb582=_0x25a125;for(var _0x116d51=0x0;_0x116d51<_0x25a125[_0x957c('0x3c')];_0x116d51+=0x1){_0x3eb582[_0x116d51][_0x957c('0x51')]=[];_0x59fa19['push'](db[_0x957c('0x30')][_0x957c('0x4b')]({'where':{'FromId':[_0x32af63[_0x957c('0x59')]['id'],_0x25a125[_0x116d51]['id']],'ToId':[_0x32af63[_0x957c('0x59')]['id'],_0x25a125[_0x116d51]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x957c('0x6b'),'ToId',_0x957c('0x6c'),_0x957c('0x4d')],'order':qs[_0x957c('0x3f')](_0x957c('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x25a125[_0x116d51])));}return BPromise['all'](_0x59fa19);}return[];})['then'](function(_0x1fef15){return{'rows':_0x1fef15,'count':_0x1fef15[_0x957c('0x3c')]};})[_0x957c('0x29')](respondWithResult(_0x239a3d,null))[_0x957c('0x48')](handleError(_0x239a3d,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 5abe7aa..8c6e0fc 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 _0x339d=['setMaxListeners','emit','hook','../../mysqldb','ChatInternalMessage'];(function(_0x26224c,_0x1a354c){var _0x4c2bc5=function(_0x179343){while(--_0x179343){_0x26224c['push'](_0x26224c['shift']());}};_0x4c2bc5(++_0x1a354c);}(_0x339d,0xb2));var _0xd339=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x339d[_0x36c6eb];return _0x30675b;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xd339('0x0'))['db'][_0xd339('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd339('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x12f26e){return function(_0x459c0e,_0x1ff8e0,_0x57169f){ChatInternalMessageEvents['emit'](_0x12f26e+':'+_0x459c0e['id'],_0x459c0e);ChatInternalMessageEvents[_0xd339('0x3')](_0x12f26e,_0x459c0e);_0x57169f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xd339('0x4')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x48cb=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','exports','events'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x48cb,0x16f));var _0xb48c=function(_0x7855ae,_0x28e4e3){_0x7855ae=_0x7855ae-0x0;var _0x17c7d9=_0x48cb[_0x7855ae];return _0x17c7d9;};'use strict';var EventEmitter=require(_0xb48c('0x0'));var ChatInternalMessage=require(_0xb48c('0x1'))['db'][_0xb48c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb48c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb48c('0x4'),'afterDestroy':_0xb48c('0x5')};function emitEvent(_0x1beb71){return function(_0x447481,_0x852166,_0x1ce256){ChatInternalMessageEvents[_0xb48c('0x6')](_0x1beb71+':'+_0x447481['id'],_0x447481);ChatInternalMessageEvents[_0xb48c('0x6')](_0x1beb71,_0x447481);_0x1ce256(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb48c('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index cf5ac15..39c28d6 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 _0x463f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x463f,0x1cf));var _0xf463=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x463f[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xf463('0x0'));var util=require(_0xf463('0x1'));var logger=require(_0xf463('0x2'))(_0xf463('0x3'));var moment=require(_0xf463('0x4'));var BPromise=require(_0xf463('0x5'));var rp=require(_0xf463('0x6'));var fs=require('fs');var path=require(_0xf463('0x7'));var rimraf=require(_0xf463('0x8'));var config=require(_0xf463('0x9'));var attributes=require(_0xf463('0xa'));module[_0xf463('0xb')]=function(_0x290390,_0x5f38b4){return _0x290390[_0xf463('0xc')](_0xf463('0xd'),attributes,{'tableName':_0xf463('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf463('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x911b=['chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x212635,_0x473753){var _0x4f1f22=function(_0x4318b1){while(--_0x4318b1){_0x212635['push'](_0x212635['shift']());}};_0x4f1f22(++_0x473753);}(_0x911b,0x128));var _0xb911=function(_0x21381e,_0x2a491e){_0x21381e=_0x21381e-0x0;var _0x10bfe7=_0x911b[_0x21381e];return _0x10bfe7;};'use strict';var _=require(_0xb911('0x0'));var util=require(_0xb911('0x1'));var logger=require(_0xb911('0x2'))(_0xb911('0x3'));var moment=require('moment');var BPromise=require(_0xb911('0x4'));var rp=require(_0xb911('0x5'));var fs=require('fs');var path=require(_0xb911('0x6'));var rimraf=require(_0xb911('0x7'));var config=require(_0xb911('0x8'));var attributes=require(_0xb911('0x9'));module[_0xb911('0xa')]=function(_0xcecacd,_0x1127ef){return _0xcecacd[_0xb911('0xb')]('ChatInternalMessage',attributes,{'tableName':_0xb911('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb911('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 1ea183c..4696f54 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 _0x64fd=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x319cd8,_0x1fc6e4){var _0x5b2306=function(_0x2f4147){while(--_0x2f4147){_0x319cd8['push'](_0x319cd8['shift']());}};_0x5b2306(++_0x1fc6e4);}(_0x64fd,0x9f));var _0xd64f=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x64fd[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xd64f('0x0'));var util=require('util');var moment=require(_0xd64f('0x1'));var BPromise=require(_0xd64f('0x2'));var rs=require(_0xd64f('0x3'));var fs=require('fs');var Redis=require(_0xd64f('0x4'));var db=require(_0xd64f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd64f('0x6'))(_0xd64f('0x7'));var config=require(_0xd64f('0x8'));var jayson=require(_0xd64f('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xd64f('0xa')]=_[_0xd64f('0xb')](config[_0xd64f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd64f('0xc'))(new Redis(config[_0xd64f('0xa')]));require(_0xd64f('0xd'))[_0xd64f('0xe')](socket);function respondWithRpcPromise(_0x47bc3a,_0x392d5a,_0x5ce03f){return new BPromise(function(_0x345205,_0xf92fd7){return client['request'](_0x47bc3a,_0x5ce03f)[_0xd64f('0xf')](function(_0x482e97){logger[_0xd64f('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x392d5a,_0xd64f('0x11'));logger[_0xd64f('0x12')](_0xd64f('0x13'),_0x392d5a,'request\x20sent',JSON[_0xd64f('0x14')](_0x482e97));if(_0x482e97[_0xd64f('0x15')]){if(_0x482e97[_0xd64f('0x15')]['code']===0x1f4){logger[_0xd64f('0x15')](_0xd64f('0x16'),_0x392d5a,_0x482e97['error'][_0xd64f('0x17')]);return _0xf92fd7(_0x482e97['error']['message']);}logger[_0xd64f('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x392d5a,_0x482e97[_0xd64f('0x15')]['message']);return _0x345205(_0x482e97[_0xd64f('0x15')][_0xd64f('0x17')]);}else{logger[_0xd64f('0x10')](_0xd64f('0x16'),_0x392d5a,_0xd64f('0x11'));_0x345205(_0x482e97[_0xd64f('0x18')][_0xd64f('0x17')]);}})[_0xd64f('0x19')](function(_0xa1a309){logger[_0xd64f('0x15')](_0xd64f('0x16'),_0x392d5a,_0xa1a309);_0xf92fd7(_0xa1a309);});});}
\ No newline at end of file
+var _0x45ae=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5c89e2,_0x416a81){var _0x2b9eea=function(_0x26cc1a){while(--_0x26cc1a){_0x5c89e2['push'](_0x5c89e2['shift']());}};_0x2b9eea(++_0x416a81);}(_0x45ae,0xc6));var _0xe45a=function(_0x2377e3,_0x2c0352){_0x2377e3=_0x2377e3-0x0;var _0x2a6d1b=_0x45ae[_0x2377e3];return _0x2a6d1b;};'use strict';var _=require(_0xe45a('0x0'));var util=require(_0xe45a('0x1'));var moment=require(_0xe45a('0x2'));var BPromise=require(_0xe45a('0x3'));var rs=require(_0xe45a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe45a('0x5'))['db'];var utils=require(_0xe45a('0x6'));var logger=require(_0xe45a('0x7'))(_0xe45a('0x8'));var config=require(_0xe45a('0x9'));var jayson=require(_0xe45a('0xa'));var client=jayson[_0xe45a('0xb')]['http']({'port':0x232a});config[_0xe45a('0xc')]=_[_0xe45a('0xd')](config['redis'],{'host':_0xe45a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe45a('0xc')]));require(_0xe45a('0xf'))[_0xe45a('0x10')](socket);function respondWithRpcPromise(_0x20c418,_0x4f5695,_0x328b2b){return new BPromise(function(_0x188b07,_0x1b8913){return client[_0xe45a('0x11')](_0x20c418,_0x328b2b)[_0xe45a('0x12')](function(_0x19d359){logger[_0xe45a('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x4f5695,'request\x20sent');logger[_0xe45a('0x14')](_0xe45a('0x15'),_0x4f5695,_0xe45a('0x16'),JSON['stringify'](_0x19d359));if(_0x19d359[_0xe45a('0x17')]){if(_0x19d359[_0xe45a('0x17')][_0xe45a('0x18')]===0x1f4){logger['error'](_0xe45a('0x19'),_0x4f5695,_0x19d359[_0xe45a('0x17')]['message']);return _0x1b8913(_0x19d359[_0xe45a('0x17')][_0xe45a('0x1a')]);}logger[_0xe45a('0x17')](_0xe45a('0x19'),_0x4f5695,_0x19d359[_0xe45a('0x17')][_0xe45a('0x1a')]);return _0x188b07(_0x19d359[_0xe45a('0x17')]['message']);}else{logger[_0xe45a('0x13')](_0xe45a('0x19'),_0x4f5695,'request\x20sent');_0x188b07(_0x19d359[_0xe45a('0x1b')][_0xe45a('0x1a')]);}})[_0xe45a('0x1c')](function(_0x211009){logger[_0xe45a('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x4f5695,_0x211009);_0x1b8913(_0x211009);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index a743157..a840428 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 _0x5709=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','register','length'];(function(_0x3c43f6,_0x225d9c){var _0x1ed23d=function(_0x815c7b){while(--_0x815c7b){_0x3c43f6['push'](_0x3c43f6['shift']());}};_0x1ed23d(++_0x225d9c);}(_0x5709,0x1b1));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x9570('0x0'));var events=[_0x9570('0x1'),_0x9570('0x2'),_0x9570('0x3')];function createListener(_0x12b90d,_0x507339){return function(_0x4c6c4d){_0x507339[_0x9570('0x4')](_0x12b90d,_0x4c6c4d);};}function removeListener(_0x437fc1,_0x13cd88){return function(){ChatInternalMessageEvents['removeListener'](_0x437fc1,_0x13cd88);};}exports[_0x9570('0x5')]=function(_0x544f9e){for(var _0x34ba75=0x0,_0x2d025c=events[_0x9570('0x6')];_0x34ba75<_0x2d025c;_0x34ba75++){var _0x2fffb0=events[_0x34ba75];var _0x57c732=createListener(_0x9570('0x7')+_0x2fffb0,_0x544f9e);ChatInternalMessageEvents['on'](_0x2fffb0,_0x57c732);}};
\ No newline at end of file
+var _0x16a7=['save','remove','update','removeListener','register','length','chatInternalMessage:'];(function(_0x2f627d,_0x370a12){var _0x29c392=function(_0x3fe491){while(--_0x3fe491){_0x2f627d['push'](_0x2f627d['shift']());}};_0x29c392(++_0x370a12);}(_0x16a7,0xe7));var _0x716a=function(_0x359afb,_0x2670fe){_0x359afb=_0x359afb-0x0;var _0x2b68f3=_0x16a7[_0x359afb];return _0x2b68f3;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x716a('0x0'),_0x716a('0x1'),_0x716a('0x2')];function createListener(_0xb1aa3a,_0x189c94){return function(_0x3a3836){_0x189c94['emit'](_0xb1aa3a,_0x3a3836);};}function removeListener(_0x3f0299,_0x1fe7e9){return function(){ChatInternalMessageEvents[_0x716a('0x3')](_0x3f0299,_0x1fe7e9);};}exports[_0x716a('0x4')]=function(_0x252ca7){for(var _0x1d510b=0x0,_0x159a70=events[_0x716a('0x5')];_0x1d510b<_0x159a70;_0x1d510b++){var _0x95fc84=events[_0x1d510b];var _0x1ee27e=createListener(_0x716a('0x6')+_0x95fc84,_0x252ca7);ChatInternalMessageEvents['on'](_0x95fc84,_0x1ee27e);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 7965e43..e83e7b5 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 _0xda49=['index','/describe','isAuthenticated','describe','/users','getUsers','show','post','create','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x1a42b9,_0x3b7b48){var _0x2929f9=function(_0x2829d3){while(--_0x2829d3){_0x1a42b9['push'](_0x1a42b9['shift']());}};_0x2929f9(++_0x3b7b48);}(_0xda49,0x8b));var _0x9da4=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xda49[_0x342baa];return _0x1208f3;};'use strict';var multer=require(_0x9da4('0x0'));var util=require(_0x9da4('0x1'));var path=require(_0x9da4('0x2'));var timeout=require('connect-timeout');var express=require(_0x9da4('0x3'));var router=express[_0x9da4('0x4')]();var fs_extra=require(_0x9da4('0x5'));var auth=require(_0x9da4('0x6'));var interaction=require(_0x9da4('0x7'));var config=require(_0x9da4('0x8'));var controller=require(_0x9da4('0x9'));router[_0x9da4('0xa')]('/',auth['isAuthenticated'](),controller[_0x9da4('0xb')]);router[_0x9da4('0xa')](_0x9da4('0xc'),auth[_0x9da4('0xd')](),controller[_0x9da4('0xe')]);router[_0x9da4('0xa')](_0x9da4('0xf'),auth[_0x9da4('0xd')](),controller[_0x9da4('0x10')]);router[_0x9da4('0xa')]('/:id',auth[_0x9da4('0xd')](),controller[_0x9da4('0x11')]);router[_0x9da4('0x12')]('/',auth['isAuthenticated'](),controller[_0x9da4('0x13')]);router[_0x9da4('0x14')](_0x9da4('0x15'),controller[_0x9da4('0x16')]);router[_0x9da4('0x17')](_0x9da4('0x15'),auth[_0x9da4('0xd')](),controller['destroy']);module[_0x9da4('0x18')]=router;
\ No newline at end of file
+var _0x6880=['/describe','describe','/users','getUsers','/:id','show','post','create','put','update','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x2958c9,_0x3948fa){var _0x7ec3dc=function(_0x229dbd){while(--_0x229dbd){_0x2958c9['push'](_0x2958c9['shift']());}};_0x7ec3dc(++_0x3948fa);}(_0x6880,0x164));var _0x0688=function(_0x48ba11,_0x5c196f){_0x48ba11=_0x48ba11-0x0;var _0x9fbf41=_0x6880[_0x48ba11];return _0x9fbf41;};'use strict';var multer=require(_0x0688('0x0'));var util=require(_0x0688('0x1'));var path=require(_0x0688('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0688('0x3')]();var fs_extra=require(_0x0688('0x4'));var auth=require(_0x0688('0x5'));var interaction=require(_0x0688('0x6'));var config=require(_0x0688('0x7'));var controller=require(_0x0688('0x8'));router[_0x0688('0x9')]('/',auth[_0x0688('0xa')](),controller[_0x0688('0xb')]);router[_0x0688('0x9')](_0x0688('0xc'),auth[_0x0688('0xa')](),controller[_0x0688('0xd')]);router['get'](_0x0688('0xe'),auth[_0x0688('0xa')](),controller[_0x0688('0xf')]);router[_0x0688('0x9')](_0x0688('0x10'),auth[_0x0688('0xa')](),controller[_0x0688('0x11')]);router[_0x0688('0x12')]('/',auth[_0x0688('0xa')](),controller[_0x0688('0x13')]);router[_0x0688('0x14')]('/:id',controller[_0x0688('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0688('0x16')]);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 3cbd658..6509718 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 _0x7462=['out','STRING','TEXT','sequelize','exports','BOOLEAN'];(function(_0x2e2e62,_0x22b872){var _0x52afed=function(_0x636129){while(--_0x636129){_0x2e2e62['push'](_0x2e2e62['shift']());}};_0x52afed(++_0x22b872);}(_0x7462,0x165));var _0x2746=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7462[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x2746('0x0'));module[_0x2746('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2746('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2746('0x3')),'defaultValue':_0x2746('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x2746('0x4')]},'providerResponse':{'type':Sequelize[_0x2746('0x5')]}};
\ No newline at end of file
+var _0x659c=['medium','BOOLEAN','ENUM','out','STRING','TEXT','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x659c,0x1aa));var _0xc659=function(_0x58910b,_0x540685){_0x58910b=_0x58910b-0x0;var _0xfe1259=_0x659c[_0x58910b];return _0xfe1259;};'use strict';var Sequelize=require(_0xc659('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xc659('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc659('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc659('0x3')]('in',_0xc659('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc659('0x5')]},'providerResponse':{'type':Sequelize[_0xc659('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 5558b77..51bff8b 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 _0xb825=['fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','ChatMessage','includeAll','findAll','rows','show','params','rawAttributes','include','options','find','create','body','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','http','client','request','then','info','request\x20sent','debug','stringify','code','error','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map'];(function(_0xd307d9,_0x50e8e0){var _0x209bf8=function(_0x335069){while(--_0x335069){_0xd307d9['push'](_0xd307d9['shift']());}};_0x209bf8(++_0x50e8e0);}(_0xb825,0x1d0));var _0x5b82=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb825[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x5b82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b82('0x1'));var jsonpatch=require(_0x5b82('0x2'));var rp=require(_0x5b82('0x3'));var moment=require(_0x5b82('0x4'));var BPromise=require(_0x5b82('0x5'));var Mustache=require('mustache');var util=require(_0x5b82('0x6'));var path=require(_0x5b82('0x7'));var sox=require(_0x5b82('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b82('0x9'));var _=require(_0x5b82('0xa'));var squel=require(_0x5b82('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5b82('0xc'));var toCsv=require(_0x5b82('0xd'));var querystring=require(_0x5b82('0xe'));var Papa=require(_0x5b82('0xf'));var Redis=require(_0x5b82('0x10'));var authService=require(_0x5b82('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b82('0x12'));var logger=require(_0x5b82('0x13'))('api');var utils=require(_0x5b82('0x14'));var config=require(_0x5b82('0x15'));var licenseUtil=require(_0x5b82('0x16'));var db=require(_0x5b82('0x17'))['db'];config[_0x5b82('0x18')]=_[_0x5b82('0x19')](config[_0x5b82('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b82('0x1a'))(new Redis(config[_0x5b82('0x18')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5b82('0x1b')]({'port':0x232c});var client9002=jayson[_0x5b82('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4747ae,_0x4a1549,_0x5e2611,_0x5e22ac){return new BPromise(function(_0x164568,_0x206f6c){var _0x5c35b7=_0x5e22ac||client;return _0x5c35b7[_0x5b82('0x1d')](_0x4747ae,_0x5e2611)[_0x5b82('0x1e')](function(_0x18579c){logger[_0x5b82('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x4a1549,_0x5b82('0x20'));logger[_0x5b82('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4a1549,_0x5b82('0x20'),JSON[_0x5b82('0x22')](_0x18579c));if(_0x18579c['error']){if(_0x18579c['error'][_0x5b82('0x23')]===0x1f4){logger[_0x5b82('0x24')]('ChatMessage,\x20%s,\x20%s',_0x4a1549,_0x18579c[_0x5b82('0x24')][_0x5b82('0x25')]);return _0x206f6c(_0x18579c[_0x5b82('0x24')][_0x5b82('0x25')]);}logger[_0x5b82('0x24')](_0x5b82('0x26'),_0x4a1549,_0x18579c[_0x5b82('0x24')][_0x5b82('0x25')]);return _0x164568(_0x18579c[_0x5b82('0x24')][_0x5b82('0x25')]);}else{logger[_0x5b82('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x4a1549,_0x5b82('0x20'));_0x164568(_0x18579c[_0x5b82('0x27')][_0x5b82('0x25')]);}})[_0x5b82('0x28')](function(_0xfa6693){logger['error'](_0x5b82('0x26'),_0x4a1549,_0xfa6693);_0x206f6c(_0xfa6693);});});}function respondWithStatusCode(_0x36f307,_0x5390c4){_0x5390c4=_0x5390c4||0xcc;return function(_0x5de486){if(_0x5de486){return _0x36f307[_0x5b82('0x29')](_0x5390c4);}return _0x36f307[_0x5b82('0x2a')](_0x5390c4)['end']();};}function respondWithResult(_0x61e96b,_0x5ac695){_0x5ac695=_0x5ac695||0xc8;return function(_0x23c155){if(_0x23c155){return _0x61e96b[_0x5b82('0x2a')](_0x5ac695)[_0x5b82('0x2b')](_0x23c155);}};}function respondWithFilteredResult(_0x34895a,_0x24e0b2){return function(_0x4d4c80){if(_0x4d4c80){var _0x31a599=typeof _0x24e0b2[_0x5b82('0x2c')]==='undefined'&&typeof _0x24e0b2[_0x5b82('0x2d')]===_0x5b82('0x2e');var _0x55cd11=_0x4d4c80[_0x5b82('0x2f')];var _0x376ecf=_0x31a599?0x0:_0x24e0b2[_0x5b82('0x2c')];var _0x2c57b1=_0x31a599?_0x4d4c80[_0x5b82('0x2f')]:_0x24e0b2[_0x5b82('0x2c')]+_0x24e0b2[_0x5b82('0x2d')];var _0x552cad;if(_0x2c57b1>=_0x55cd11){_0x2c57b1=_0x55cd11;_0x552cad=0xc8;}else{_0x552cad=0xce;}_0x34895a[_0x5b82('0x2a')](_0x552cad);return _0x34895a[_0x5b82('0x30')](_0x5b82('0x31'),_0x376ecf+'-'+_0x2c57b1+'/'+_0x55cd11)[_0x5b82('0x2b')](_0x4d4c80);}return null;};}function patchUpdates(_0x495f1a){return function(_0x25e1b9){try{jsonpatch[_0x5b82('0x32')](_0x25e1b9,_0x495f1a,!![]);}catch(_0x17edc8){return BPromise[_0x5b82('0x33')](_0x17edc8);}return _0x25e1b9[_0x5b82('0x34')]();};}function saveUpdates(_0x24749a,_0x2af2ae){return function(_0x23c35d){if(_0x23c35d){return _0x23c35d[_0x5b82('0x35')](_0x24749a)[_0x5b82('0x1e')](function(_0x499309){return _0x499309;});}return null;};}function removeEntity(_0x27cf15,_0x28cf54){return function(_0x59f820){if(_0x59f820){return _0x59f820[_0x5b82('0x36')]()[_0x5b82('0x1e')](function(){_0x27cf15[_0x5b82('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e19ba,_0x3b1e6f){return function(_0x354528){if(!_0x354528){_0x3e19ba['sendStatus'](0x194);}return _0x354528;};}function handleError(_0x34ad32,_0x5e6db9){_0x5e6db9=_0x5e6db9||0x1f4;return function(_0x4c707f){logger[_0x5b82('0x24')](_0x4c707f[_0x5b82('0x37')]);if(_0x4c707f[_0x5b82('0x38')]){delete _0x4c707f[_0x5b82('0x38')];}_0x34ad32['status'](_0x5e6db9)[_0x5b82('0x39')](_0x4c707f);};}exports[_0x5b82('0x3a')]=function(_0x1a1efe,_0x535e57){var _0x4b72cf={},_0x4eb8ed={},_0x2adb42={'count':0x0,'rows':[]};var _0x202a37=_[_0x5b82('0x3b')](db['ChatMessage']['rawAttributes'],function(_0x326353){return{'name':_0x326353[_0x5b82('0x3c')],'type':_0x326353[_0x5b82('0x3d')][_0x5b82('0x3e')]};});_0x4eb8ed['model']=_[_0x5b82('0x3b')](_0x202a37,_0x5b82('0x38'));_0x4eb8ed[_0x5b82('0x3f')]=_[_0x5b82('0x40')](_0x1a1efe['query']);_0x4eb8ed[_0x5b82('0x41')]=_['intersection'](_0x4eb8ed[_0x5b82('0x42')],_0x4eb8ed[_0x5b82('0x3f')]);_0x4b72cf['attributes']=_[_0x5b82('0x43')](_0x4eb8ed['model'],qs['fields'](_0x1a1efe[_0x5b82('0x3f')][_0x5b82('0x44')]));_0x4b72cf[_0x5b82('0x45')]=_0x4b72cf[_0x5b82('0x45')][_0x5b82('0x46')]?_0x4b72cf[_0x5b82('0x45')]:_0x4eb8ed['model'];if(!_0x1a1efe[_0x5b82('0x3f')][_0x5b82('0x47')](_0x5b82('0x48'))){_0x4b72cf[_0x5b82('0x2d')]=qs[_0x5b82('0x2d')](_0x1a1efe[_0x5b82('0x3f')][_0x5b82('0x2d')]);_0x4b72cf['offset']=qs[_0x5b82('0x2c')](_0x1a1efe['query'][_0x5b82('0x2c')]);}_0x4b72cf['order']=qs['sort'](_0x1a1efe[_0x5b82('0x3f')][_0x5b82('0x49')]);_0x4b72cf[_0x5b82('0x4a')]=qs[_0x5b82('0x41')](_[_0x5b82('0x4b')](_0x1a1efe[_0x5b82('0x3f')],_0x4eb8ed[_0x5b82('0x41')]),_0x202a37);if(_0x1a1efe[_0x5b82('0x3f')][_0x5b82('0x4c')]){_0x4b72cf[_0x5b82('0x4a')]=_['merge'](_0x4b72cf['where'],{'$or':_[_0x5b82('0x3b')](_0x202a37,function(_0x32c1be){if(_0x32c1be[_0x5b82('0x3d')]!==_0x5b82('0x4d')){var _0x55b87b={};_0x55b87b[_0x32c1be[_0x5b82('0x38')]]={'$like':'%'+_0x1a1efe['query'][_0x5b82('0x4c')]+'%'};return _0x55b87b;}})});}_0x4b72cf=_[_0x5b82('0x4e')]({},_0x4b72cf,_0x1a1efe['options']);var _0x559783={'where':_0x4b72cf[_0x5b82('0x4a')]};return db[_0x5b82('0x4f')][_0x5b82('0x2f')](_0x559783)['then'](function(_0x59aeb4){_0x2adb42[_0x5b82('0x2f')]=_0x59aeb4;if(_0x1a1efe['query'][_0x5b82('0x50')]){_0x4b72cf['include']=[{'all':!![]}];}return db['ChatMessage'][_0x5b82('0x51')](_0x4b72cf);})[_0x5b82('0x1e')](function(_0x55d20c){_0x2adb42[_0x5b82('0x52')]=_0x55d20c;return _0x2adb42;})[_0x5b82('0x1e')](respondWithFilteredResult(_0x535e57,_0x4b72cf))[_0x5b82('0x28')](handleError(_0x535e57,null));};exports[_0x5b82('0x53')]=function(_0x436c4e,_0xeee4c6){var _0x50596d={'raw':!![],'where':{'id':_0x436c4e[_0x5b82('0x54')]['id']}},_0x38e79f={};_0x38e79f[_0x5b82('0x42')]=_['keys'](db['ChatMessage'][_0x5b82('0x55')]);_0x38e79f['query']=_[_0x5b82('0x40')](_0x436c4e[_0x5b82('0x3f')]);_0x38e79f[_0x5b82('0x41')]=_[_0x5b82('0x43')](_0x38e79f[_0x5b82('0x42')],_0x38e79f[_0x5b82('0x3f')]);_0x50596d[_0x5b82('0x45')]=_[_0x5b82('0x43')](_0x38e79f[_0x5b82('0x42')],qs[_0x5b82('0x44')](_0x436c4e['query']['fields']));_0x50596d[_0x5b82('0x45')]=_0x50596d[_0x5b82('0x45')][_0x5b82('0x46')]?_0x50596d[_0x5b82('0x45')]:_0x38e79f[_0x5b82('0x42')];if(_0x436c4e[_0x5b82('0x3f')]['includeAll']){_0x50596d[_0x5b82('0x56')]=[{'all':!![]}];}_0x50596d=_[_0x5b82('0x4e')]({},_0x50596d,_0x436c4e[_0x5b82('0x57')]);return db[_0x5b82('0x4f')][_0x5b82('0x58')](_0x50596d)[_0x5b82('0x1e')](handleEntityNotFound(_0xeee4c6,null))[_0x5b82('0x1e')](respondWithResult(_0xeee4c6,null))['catch'](handleError(_0xeee4c6,null));};exports[_0x5b82('0x59')]=function(_0x5a817c,_0x24551b){return db[_0x5b82('0x4f')][_0x5b82('0x59')](_0x5a817c['body'],{})[_0x5b82('0x1e')](respondWithResult(_0x24551b,0xc9))[_0x5b82('0x28')](handleError(_0x24551b,null));};exports[_0x5b82('0x35')]=function(_0x32ca67,_0x300678){if(_0x32ca67['body']['id']){delete _0x32ca67[_0x5b82('0x5a')]['id'];}return db[_0x5b82('0x4f')][_0x5b82('0x58')]({'where':{'id':_0x32ca67['params']['id']}})[_0x5b82('0x1e')](handleEntityNotFound(_0x300678,null))[_0x5b82('0x1e')](saveUpdates(_0x32ca67[_0x5b82('0x5a')],null))[_0x5b82('0x1e')](respondWithResult(_0x300678,null))['catch'](handleError(_0x300678,null));};exports[_0x5b82('0x36')]=function(_0x11a197,_0x4c8c38){return db[_0x5b82('0x4f')]['find']({'where':{'id':_0x11a197[_0x5b82('0x54')]['id']}})[_0x5b82('0x1e')](handleEntityNotFound(_0x4c8c38,null))[_0x5b82('0x1e')](removeEntity(_0x4c8c38,null))[_0x5b82('0x28')](handleError(_0x4c8c38,null));};exports['describe']=function(_0x479c71,_0x4092d0){return db['ChatMessage']['describe']()[_0x5b82('0x1e')](respondWithResult(_0x4092d0,null))['catch'](handleError(_0x4092d0,null));};var interaction_log=require(_0x5b82('0x13'))('chat-interactions');exports[_0x5b82('0x5b')]=function(_0x570556,_0x43f561,_0x2f2913){var _0x527593={'agent':{},'channel':_0x5b82('0x5c')};if(_0x570556[_0x5b82('0x5a')]['id']){delete _0x570556['body']['id'];}_0x570556[_0x5b82('0x5a')][_0x5b82('0x5d')]=!![];_0x570556[_0x5b82('0x5a')][_0x5b82('0x5e')]=moment()[_0x5b82('0x5f')](_0x5b82('0x60'));_0x570556[_0x5b82('0x5a')]['UserId']=_0x570556[_0x5b82('0x5a')][_0x5b82('0x61')]||_0x570556[_0x5b82('0x62')]['id'];_0x527593[_0x5b82('0x63')]['id']=_0x570556[_0x5b82('0x5a')][_0x5b82('0x61')];return db[_0x5b82('0x4f')]['find']({'where':{'id':_0x570556[_0x5b82('0x54')]['id'],'UserId':null}})[_0x5b82('0x1e')](handleEntityNotFound(_0x43f561,null))[_0x5b82('0x1e')](saveUpdates(_0x570556[_0x5b82('0x5a')],null))[_0x5b82('0x1e')](function(_0x17fb9a){if(_0x17fb9a){_0x527593[_0x5b82('0x25')]=_0x17fb9a[_0x5b82('0x64')]({'plain':!![]});return db[_0x5b82('0x65')][_0x5b82('0x58')]({'where':{'id':_0x17fb9a[_0x5b82('0x66')]}});}return null;})[_0x5b82('0x1e')](handleEntityNotFound(_0x43f561,null))[_0x5b82('0x1e')](function(_0x48b280){if(_0x48b280){return _0x48b280[_0x5b82('0x35')]({'UserId':_0x570556[_0x5b82('0x5a')][_0x5b82('0x61')],'read1stAt':_['isNil'](_0x48b280[_0x5b82('0x67')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5b82('0x1e')](function(_0x244828){if(_0x244828){_0x527593[_0x5b82('0x68')]=_0x244828[_0x5b82('0x64')]({'plain':!![]});interaction_log[_0x5b82('0x1f')](_0x5b82('0x69'),_0x570556['user']['id'],_0x570556['user']['name'],_0x570556[_0x5b82('0x62')][_0x5b82('0x6a')],_0x527593[_0x5b82('0x68')]['id'],_0x570556[_0x5b82('0x5a')]?JSON[_0x5b82('0x22')](_0x570556['body']):'null');return respondWithRpcPromise(_0x5b82('0x6b'),'acceptMessage',_0x527593);}return null;})['then'](function(_0x5709c5){var _0x1ac00a=_0x5b82('0x6c')+_0x5709c5['message'][_0x5b82('0x6d')];return db[_0x5b82('0x6e')][_0x5b82('0x3f')](_0x1ac00a,{'type':db[_0x5b82('0x6f')][_0x5b82('0x70')][_0x5b82('0x71')],'raw':!![]})[_0x5b82('0x1e')](function(_0x4774ec){return _0x4774ec;});})[_0x5b82('0x1e')](function(_0x1e16f8){if(_0x1e16f8){_0x527593['message']['contact']=_0x1e16f8[0x0];if(!_0x570556[_0x5b82('0x5a')][_0x5b82('0x61')])return;return db['User'][_0x5b82('0x58')]({'where':{'id':_0x570556['body'][_0x5b82('0x61')],'role':_0x5b82('0x63')},'attributes':['id',_0x5b82('0x38'),_0x5b82('0x72'),_0x5b82('0x73'),_0x5b82('0x74')],'raw':!![]});}return null;})[_0x5b82('0x1e')](function(_0x2dec84){if(!_0x2dec84)return null;_0x527593[_0x5b82('0x25')][_0x5b82('0x63')]=_0x2dec84;return _0x527593;})[_0x5b82('0x1e')](function(_0x5f142b){if(_0x5f142b){if(_0x570556[_0x5b82('0x5a')]['manual']){_0x527593[_0x5b82('0x25')][_0x5b82('0x75')]=util['format'](_0x5b82('0x76'),_0x570556[_0x5b82('0x62')][_0x5b82('0x38')]);_0x527593[_0x5b82('0x25')][_0x5b82('0x77')]=_0x527593['channel'];_0x527593[_0x5b82('0x25')][_0x5b82('0x78')]=_0x527593[_0x5b82('0x77')];_0x527593['message'][_0x5b82('0x79')]='accept';return respondWithRpcPromise(_0x5b82('0x7a'),_0x5b82('0x7a'),{'event':_0x5b82('0x7b'),'message':_[_0x5b82('0x4e')](_0x527593[_0x5b82('0x25')],JSON[_0x5b82('0x7c')](_0x527593[_0x5b82('0x68')][_0x5b82('0x7d')]))},client9002)['then'](function(){return _0x527593;});}return _0x527593;}return null;})['then'](respondWithResult(_0x43f561,null))['catch'](handleError(_0x43f561,null));};var interaction_log=require(_0x5b82('0x13'))(_0x5b82('0x7e'));exports[_0x5b82('0x33')]=function(_0xa64fd,_0x474f49,_0x363c3b){var _0x5b0bd1={'agent':{},'channel':_0x5b82('0x5c')};if(_0xa64fd[_0x5b82('0x5a')]['id']){delete _0xa64fd['body']['id'];}_0xa64fd[_0x5b82('0x5a')]['UserId']=_0xa64fd['body'][_0x5b82('0x61')]||_0xa64fd['user']['id'];_0x5b0bd1[_0x5b82('0x63')]['id']=_0xa64fd[_0x5b82('0x5a')][_0x5b82('0x61')];return db[_0x5b82('0x4f')]['find']({'where':{'id':_0xa64fd['params']['id'],'UserId':null}})[_0x5b82('0x1e')](handleEntityNotFound(_0x474f49,null))['then'](function(_0x10e8b0){if(_0x10e8b0){_0x5b0bd1['message']=_0x10e8b0[_0x5b82('0x64')]({'plain':!![]});return db[_0x5b82('0x65')]['find']({'where':{'id':_0x10e8b0[_0x5b82('0x66')]}});}return null;})[_0x5b82('0x1e')](handleEntityNotFound(_0x474f49,null))[_0x5b82('0x1e')](function(_0x33c465){if(_0x33c465){_0x5b0bd1['interaction']=_0x33c465[_0x5b82('0x64')]({'plain':!![]});interaction_log['info'](_0x5b82('0x7f'),_0xa64fd[_0x5b82('0x62')]['id'],_0xa64fd[_0x5b82('0x62')]['name'],_0xa64fd['user'][_0x5b82('0x6a')],_0x5b0bd1[_0x5b82('0x68')]['id'],_0xa64fd[_0x5b82('0x5a')]?JSON[_0x5b82('0x22')](_0xa64fd['body']):_0x5b82('0x80'));return respondWithRpcPromise('RejectMessage',_0x5b82('0x81'),_0x5b0bd1);}return null;})[_0x5b82('0x1e')](function(_0x4d81aa){var _0x27be2a=_0x5b82('0x6c')+_0x4d81aa['message'][_0x5b82('0x6d')];return db[_0x5b82('0x6e')][_0x5b82('0x3f')](_0x27be2a,{'type':db[_0x5b82('0x6f')][_0x5b82('0x70')][_0x5b82('0x71')],'raw':!![]})[_0x5b82('0x1e')](function(_0x4f931f){return _0x4f931f;});})['then'](function(_0x1d0ef6){if(_0x1d0ef6){_0x5b0bd1[_0x5b82('0x25')]['contact']=_0x1d0ef6[0x0];if(!_0xa64fd[_0x5b82('0x5a')]['UserId'])return;return db[_0x5b82('0x82')][_0x5b82('0x58')]({'where':{'id':_0xa64fd[_0x5b82('0x5a')][_0x5b82('0x61')],'role':_0x5b82('0x63')},'attributes':['id','name',_0x5b82('0x72'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x46ce6c){if(!_0x46ce6c)return null;_0x5b0bd1['message']['agent']=_0x46ce6c;return _0x5b0bd1;})['then'](function(_0x465323){if(_0x465323){_0x465323[_0x5b82('0x25')][_0x5b82('0x75')]=util[_0x5b82('0x5f')]('SIP/%s',_0xa64fd['user'][_0x5b82('0x38')]);_0x465323[_0x5b82('0x25')][_0x5b82('0x77')]=_0x5b0bd1[_0x5b82('0x77')];_0x465323['message']['motionChannel']=_0x5b0bd1['channel'];_0x465323[_0x5b82('0x25')][_0x5b82('0x79')]=_0x5b82('0x33');respondWithRpcPromise(_0x5b82('0x7a'),_0x5b82('0x7a'),{'event':'rejectmessage','message':_['merge'](_0x5b0bd1[_0x5b82('0x25')],JSON[_0x5b82('0x7c')](_0x5b0bd1[_0x5b82('0x68')][_0x5b82('0x7d')]))},client9002);return _0x5b0bd1;}return null;})[_0x5b82('0x1e')](respondWithResult(_0x474f49,null))['catch'](handleError(_0x474f49,null));};
\ No newline at end of file
+var _0x6419=['undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','length','include','find','create','body','params','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','UserId','ChatInteractionId','isNil','read1stAt','format','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','fullname','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','QueryTypes','internal','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','catch','sendStatus','status','json','offset','limit'];(function(_0x216345,_0xfd9b72){var _0x313486=function(_0x2a60f5){while(--_0x2a60f5){_0x216345['push'](_0x216345['shift']());}};_0x313486(++_0xfd9b72);}(_0x6419,0xe2));var _0x9641=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6419[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9641('0x0'));var zipdir=require(_0x9641('0x1'));var jsonpatch=require(_0x9641('0x2'));var rp=require(_0x9641('0x3'));var moment=require('moment');var BPromise=require(_0x9641('0x4'));var Mustache=require(_0x9641('0x5'));var util=require(_0x9641('0x6'));var path=require('path');var sox=require(_0x9641('0x7'));var csv=require(_0x9641('0x8'));var ejs=require(_0x9641('0x9'));var fs=require('fs');var fs_extra=require(_0x9641('0xa'));var _=require('lodash');var squel=require(_0x9641('0xb'));var crypto=require('crypto');var jsforce=require(_0x9641('0xc'));var deskjs=require(_0x9641('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9641('0xe'));var Redis=require(_0x9641('0xf'));var authService=require(_0x9641('0x10'));var qs=require(_0x9641('0x11'));var as=require(_0x9641('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9641('0x13'));var utils=require('../../config/utils');var config=require(_0x9641('0x14'));var licenseUtil=require(_0x9641('0x15'));var db=require(_0x9641('0x16'))['db'];config[_0x9641('0x17')]=_[_0x9641('0x18')](config[_0x9641('0x17')],{'host':_0x9641('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9641('0x17')]));require(_0x9641('0x1a'))[_0x9641('0x1b')](socket);var jayson=require(_0x9641('0x1c'));var client=jayson[_0x9641('0x1d')][_0x9641('0x1e')]({'port':0x232c});var client9002=jayson[_0x9641('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49f684,_0x4e5f74,_0x26425e,_0xf67f45){return new BPromise(function(_0x3457ae,_0x4e8564){var _0x2bcdec=_0xf67f45||client;return _0x2bcdec[_0x9641('0x1f')](_0x49f684,_0x26425e)['then'](function(_0x5c962e){logger[_0x9641('0x20')](_0x9641('0x21'),_0x4e5f74,'request\x20sent');logger[_0x9641('0x22')](_0x9641('0x23'),_0x4e5f74,'request\x20sent',JSON['stringify'](_0x5c962e));if(_0x5c962e['error']){if(_0x5c962e['error'][_0x9641('0x24')]===0x1f4){logger[_0x9641('0x25')](_0x9641('0x21'),_0x4e5f74,_0x5c962e[_0x9641('0x25')]['message']);return _0x4e8564(_0x5c962e['error'][_0x9641('0x26')]);}logger['error'](_0x9641('0x21'),_0x4e5f74,_0x5c962e[_0x9641('0x25')][_0x9641('0x26')]);return _0x3457ae(_0x5c962e[_0x9641('0x25')][_0x9641('0x26')]);}else{logger[_0x9641('0x20')](_0x9641('0x21'),_0x4e5f74,_0x9641('0x27'));_0x3457ae(_0x5c962e['result'][_0x9641('0x26')]);}})[_0x9641('0x28')](function(_0x58594f){logger[_0x9641('0x25')](_0x9641('0x21'),_0x4e5f74,_0x58594f);_0x4e8564(_0x58594f);});});}function respondWithStatusCode(_0x46096a,_0x36e45b){_0x36e45b=_0x36e45b||0xcc;return function(_0x5ca1cb){if(_0x5ca1cb){return _0x46096a[_0x9641('0x29')](_0x36e45b);}return _0x46096a[_0x9641('0x2a')](_0x36e45b)['end']();};}function respondWithResult(_0x3de43a,_0x4c2c12){_0x4c2c12=_0x4c2c12||0xc8;return function(_0xe289ad){if(_0xe289ad){return _0x3de43a['status'](_0x4c2c12)[_0x9641('0x2b')](_0xe289ad);}};}function respondWithFilteredResult(_0x4009f2,_0x53b1de){return function(_0x978698){if(_0x978698){var _0x92768e=typeof _0x53b1de[_0x9641('0x2c')]==='undefined'&&typeof _0x53b1de[_0x9641('0x2d')]===_0x9641('0x2e');var _0x87dd5a=_0x978698[_0x9641('0x2f')];var _0x489c1c=_0x92768e?0x0:_0x53b1de[_0x9641('0x2c')];var _0x30008d=_0x92768e?_0x978698[_0x9641('0x2f')]:_0x53b1de[_0x9641('0x2c')]+_0x53b1de['limit'];var _0x3697e9;if(_0x30008d>=_0x87dd5a){_0x30008d=_0x87dd5a;_0x3697e9=0xc8;}else{_0x3697e9=0xce;}_0x4009f2[_0x9641('0x2a')](_0x3697e9);return _0x4009f2[_0x9641('0x30')](_0x9641('0x31'),_0x489c1c+'-'+_0x30008d+'/'+_0x87dd5a)[_0x9641('0x2b')](_0x978698);}return null;};}function patchUpdates(_0x38455d){return function(_0x50e532){try{jsonpatch[_0x9641('0x32')](_0x50e532,_0x38455d,!![]);}catch(_0x10cd1f){return BPromise[_0x9641('0x33')](_0x10cd1f);}return _0x50e532[_0x9641('0x34')]();};}function saveUpdates(_0x3cd896,_0x15b608){return function(_0x882b1d){if(_0x882b1d){return _0x882b1d[_0x9641('0x35')](_0x3cd896)[_0x9641('0x36')](function(_0x3b347c){return _0x3b347c;});}return null;};}function removeEntity(_0x2f5126,_0x549503){return function(_0x44baf8){if(_0x44baf8){return _0x44baf8[_0x9641('0x37')]()[_0x9641('0x36')](function(){_0x2f5126[_0x9641('0x2a')](0xcc)[_0x9641('0x38')]();});}};}function handleEntityNotFound(_0x3cf467,_0x1bd45b){return function(_0x47cb01){if(!_0x47cb01){_0x3cf467[_0x9641('0x29')](0x194);}return _0x47cb01;};}function handleError(_0x1467a0,_0x218aa5){_0x218aa5=_0x218aa5||0x1f4;return function(_0x3f659a){logger[_0x9641('0x25')](_0x3f659a[_0x9641('0x39')]);if(_0x3f659a[_0x9641('0x3a')]){delete _0x3f659a[_0x9641('0x3a')];}_0x1467a0[_0x9641('0x2a')](_0x218aa5)[_0x9641('0x3b')](_0x3f659a);};}exports[_0x9641('0x3c')]=function(_0x469311,_0x48052b){var _0x286add={},_0x539593={},_0x3f42b1={'count':0x0,'rows':[]};var _0x4ff8ee=_[_0x9641('0x3d')](db[_0x9641('0x3e')][_0x9641('0x3f')],function(_0x17061c){return{'name':_0x17061c[_0x9641('0x40')],'type':_0x17061c['type'][_0x9641('0x41')]};});_0x539593[_0x9641('0x42')]=_[_0x9641('0x3d')](_0x4ff8ee,_0x9641('0x3a'));_0x539593[_0x9641('0x43')]=_[_0x9641('0x44')](_0x469311[_0x9641('0x43')]);_0x539593[_0x9641('0x45')]=_[_0x9641('0x46')](_0x539593[_0x9641('0x42')],_0x539593[_0x9641('0x43')]);_0x286add[_0x9641('0x47')]=_[_0x9641('0x46')](_0x539593['model'],qs[_0x9641('0x48')](_0x469311[_0x9641('0x43')][_0x9641('0x48')]));_0x286add[_0x9641('0x47')]=_0x286add[_0x9641('0x47')]['length']?_0x286add['attributes']:_0x539593[_0x9641('0x42')];if(!_0x469311[_0x9641('0x43')][_0x9641('0x49')](_0x9641('0x4a'))){_0x286add[_0x9641('0x2d')]=qs[_0x9641('0x2d')](_0x469311[_0x9641('0x43')][_0x9641('0x2d')]);_0x286add[_0x9641('0x2c')]=qs[_0x9641('0x2c')](_0x469311[_0x9641('0x43')]['offset']);}_0x286add[_0x9641('0x4b')]=qs[_0x9641('0x4c')](_0x469311[_0x9641('0x43')]['sort']);_0x286add[_0x9641('0x4d')]=qs[_0x9641('0x45')](_[_0x9641('0x4e')](_0x469311[_0x9641('0x43')],_0x539593[_0x9641('0x45')]),_0x4ff8ee);if(_0x469311[_0x9641('0x43')][_0x9641('0x4f')]){_0x286add['where']=_[_0x9641('0x50')](_0x286add[_0x9641('0x4d')],{'$or':_['map'](_0x4ff8ee,function(_0x4e2d54){if(_0x4e2d54[_0x9641('0x51')]!=='VIRTUAL'){var _0x1d7953={};_0x1d7953[_0x4e2d54[_0x9641('0x3a')]]={'$like':'%'+_0x469311['query']['filter']+'%'};return _0x1d7953;}})});}_0x286add=_[_0x9641('0x50')]({},_0x286add,_0x469311[_0x9641('0x52')]);var _0x1f5131={'where':_0x286add[_0x9641('0x4d')]};return db[_0x9641('0x3e')][_0x9641('0x2f')](_0x1f5131)['then'](function(_0x2cbd0b){_0x3f42b1['count']=_0x2cbd0b;if(_0x469311['query'][_0x9641('0x53')]){_0x286add['include']=[{'all':!![]}];}return db[_0x9641('0x3e')][_0x9641('0x54')](_0x286add);})['then'](function(_0x57e3ce){_0x3f42b1[_0x9641('0x55')]=_0x57e3ce;return _0x3f42b1;})[_0x9641('0x36')](respondWithFilteredResult(_0x48052b,_0x286add))[_0x9641('0x28')](handleError(_0x48052b,null));};exports['show']=function(_0x2b53ac,_0xddb736){var _0x564408={'raw':!![],'where':{'id':_0x2b53ac['params']['id']}},_0x3eb3c8={};_0x3eb3c8[_0x9641('0x42')]=_[_0x9641('0x44')](db[_0x9641('0x3e')][_0x9641('0x3f')]);_0x3eb3c8[_0x9641('0x43')]=_[_0x9641('0x44')](_0x2b53ac[_0x9641('0x43')]);_0x3eb3c8['filters']=_[_0x9641('0x46')](_0x3eb3c8[_0x9641('0x42')],_0x3eb3c8[_0x9641('0x43')]);_0x564408[_0x9641('0x47')]=_[_0x9641('0x46')](_0x3eb3c8[_0x9641('0x42')],qs['fields'](_0x2b53ac['query']['fields']));_0x564408[_0x9641('0x47')]=_0x564408['attributes'][_0x9641('0x56')]?_0x564408[_0x9641('0x47')]:_0x3eb3c8[_0x9641('0x42')];if(_0x2b53ac['query'][_0x9641('0x53')]){_0x564408[_0x9641('0x57')]=[{'all':!![]}];}_0x564408=_[_0x9641('0x50')]({},_0x564408,_0x2b53ac[_0x9641('0x52')]);return db[_0x9641('0x3e')][_0x9641('0x58')](_0x564408)[_0x9641('0x36')](handleEntityNotFound(_0xddb736,null))['then'](respondWithResult(_0xddb736,null))[_0x9641('0x28')](handleError(_0xddb736,null));};exports[_0x9641('0x59')]=function(_0x44cce0,_0x1285c8){return db[_0x9641('0x3e')]['create'](_0x44cce0[_0x9641('0x5a')],{})['then'](respondWithResult(_0x1285c8,0xc9))[_0x9641('0x28')](handleError(_0x1285c8,null));};exports[_0x9641('0x35')]=function(_0x13e915,_0x585353){if(_0x13e915['body']['id']){delete _0x13e915[_0x9641('0x5a')]['id'];}return db['ChatMessage'][_0x9641('0x58')]({'where':{'id':_0x13e915[_0x9641('0x5b')]['id']}})[_0x9641('0x36')](handleEntityNotFound(_0x585353,null))[_0x9641('0x36')](saveUpdates(_0x13e915[_0x9641('0x5a')],null))[_0x9641('0x36')](respondWithResult(_0x585353,null))[_0x9641('0x28')](handleError(_0x585353,null));};exports[_0x9641('0x37')]=function(_0x24f404,_0x53e8a1){return db['ChatMessage'][_0x9641('0x58')]({'where':{'id':_0x24f404['params']['id']}})[_0x9641('0x36')](handleEntityNotFound(_0x53e8a1,null))['then'](removeEntity(_0x53e8a1,null))[_0x9641('0x28')](handleError(_0x53e8a1,null));};exports[_0x9641('0x5c')]=function(_0x206fb1,_0x34a40a){return db[_0x9641('0x3e')][_0x9641('0x5c')]()[_0x9641('0x36')](respondWithResult(_0x34a40a,null))[_0x9641('0x28')](handleError(_0x34a40a,null));};var interaction_log=require(_0x9641('0x5d'))(_0x9641('0x5e'));exports[_0x9641('0x5f')]=function(_0x299726,_0x15065b,_0x276cb4){var _0x3b02e2={'agent':{},'channel':_0x9641('0x60')};if(_0x299726[_0x9641('0x5a')]['id']){delete _0x299726['body']['id'];}_0x299726[_0x9641('0x5a')][_0x9641('0x61')]=!![];_0x299726[_0x9641('0x5a')][_0x9641('0x62')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x299726[_0x9641('0x5a')][_0x9641('0x63')]=_0x299726[_0x9641('0x5a')][_0x9641('0x63')]||_0x299726['user']['id'];_0x3b02e2['agent']['id']=_0x299726[_0x9641('0x5a')][_0x9641('0x63')];return db[_0x9641('0x3e')][_0x9641('0x58')]({'where':{'id':_0x299726['params']['id'],'UserId':null}})[_0x9641('0x36')](handleEntityNotFound(_0x15065b,null))[_0x9641('0x36')](saveUpdates(_0x299726[_0x9641('0x5a')],null))[_0x9641('0x36')](function(_0x5b7014){if(_0x5b7014){_0x3b02e2[_0x9641('0x26')]=_0x5b7014['get']({'plain':!![]});return db['ChatInteraction'][_0x9641('0x58')]({'where':{'id':_0x5b7014[_0x9641('0x64')]}});}return null;})[_0x9641('0x36')](handleEntityNotFound(_0x15065b,null))[_0x9641('0x36')](function(_0x5d61a7){if(_0x5d61a7){return _0x5d61a7[_0x9641('0x35')]({'UserId':_0x299726['body'][_0x9641('0x63')],'read1stAt':_[_0x9641('0x65')](_0x5d61a7[_0x9641('0x66')])?moment()[_0x9641('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9641('0x36')](function(_0x42bea1){if(_0x42bea1){_0x3b02e2[_0x9641('0x68')]=_0x42bea1[_0x9641('0x69')]({'plain':!![]});interaction_log[_0x9641('0x20')](_0x9641('0x6a'),_0x299726[_0x9641('0x6b')]['id'],_0x299726['user'][_0x9641('0x3a')],_0x299726[_0x9641('0x6b')]['role'],_0x3b02e2[_0x9641('0x68')]['id'],_0x299726[_0x9641('0x5a')]?JSON[_0x9641('0x6c')](_0x299726[_0x9641('0x5a')]):_0x9641('0x6d'));return respondWithRpcPromise(_0x9641('0x6e'),_0x9641('0x6f'),_0x3b02e2);}return null;})[_0x9641('0x36')](function(_0x3541ea){var _0x5979ab=_0x9641('0x70')+_0x3541ea[_0x9641('0x26')][_0x9641('0x71')];return db[_0x9641('0x72')]['query'](_0x5979ab,{'type':db[_0x9641('0x73')]['QueryTypes'][_0x9641('0x74')],'raw':!![]})[_0x9641('0x36')](function(_0x1db984){return _0x1db984;});})[_0x9641('0x36')](function(_0x3fa8bf){if(_0x3fa8bf){_0x3b02e2[_0x9641('0x26')][_0x9641('0x75')]=_0x3fa8bf[0x0];if(!_0x299726[_0x9641('0x5a')]['UserId'])return;return db[_0x9641('0x76')][_0x9641('0x58')]({'where':{'id':_0x299726[_0x9641('0x5a')][_0x9641('0x63')],'role':_0x9641('0x77')},'attributes':['id','name',_0x9641('0x78'),'email','internal'],'raw':!![]});}return null;})[_0x9641('0x36')](function(_0x57d670){if(!_0x57d670)return null;_0x3b02e2[_0x9641('0x26')][_0x9641('0x77')]=_0x57d670;return _0x3b02e2;})['then'](function(_0x4451a4){if(_0x4451a4){if(_0x299726[_0x9641('0x5a')]['manual']){_0x3b02e2[_0x9641('0x26')][_0x9641('0x79')]=util[_0x9641('0x67')]('SIP/%s',_0x299726[_0x9641('0x6b')][_0x9641('0x3a')]);_0x3b02e2[_0x9641('0x26')][_0x9641('0x7a')]=_0x3b02e2[_0x9641('0x7a')];_0x3b02e2[_0x9641('0x26')][_0x9641('0x7b')]=_0x3b02e2[_0x9641('0x7a')];_0x3b02e2['message'][_0x9641('0x7c')]=_0x9641('0x5f');return respondWithRpcPromise('EventManager',_0x9641('0x7d'),{'event':_0x9641('0x7e'),'message':_[_0x9641('0x50')](_0x3b02e2[_0x9641('0x26')],JSON[_0x9641('0x7f')](_0x3b02e2[_0x9641('0x68')][_0x9641('0x80')]))},client9002)[_0x9641('0x36')](function(){return _0x3b02e2;});}return _0x3b02e2;}return null;})[_0x9641('0x36')](respondWithResult(_0x15065b,null))[_0x9641('0x28')](handleError(_0x15065b,null));};var interaction_log=require(_0x9641('0x5d'))(_0x9641('0x5e'));exports[_0x9641('0x33')]=function(_0x4eef47,_0x81d884,_0x4e29af){var _0x4499c7={'agent':{},'channel':'chat'};if(_0x4eef47[_0x9641('0x5a')]['id']){delete _0x4eef47[_0x9641('0x5a')]['id'];}_0x4eef47[_0x9641('0x5a')][_0x9641('0x63')]=_0x4eef47[_0x9641('0x5a')][_0x9641('0x63')]||_0x4eef47[_0x9641('0x6b')]['id'];_0x4499c7['agent']['id']=_0x4eef47['body'][_0x9641('0x63')];return db[_0x9641('0x3e')][_0x9641('0x58')]({'where':{'id':_0x4eef47[_0x9641('0x5b')]['id'],'UserId':null}})[_0x9641('0x36')](handleEntityNotFound(_0x81d884,null))[_0x9641('0x36')](function(_0x10f014){if(_0x10f014){_0x4499c7['message']=_0x10f014['get']({'plain':!![]});return db['ChatInteraction'][_0x9641('0x58')]({'where':{'id':_0x10f014[_0x9641('0x64')]}});}return null;})[_0x9641('0x36')](handleEntityNotFound(_0x81d884,null))['then'](function(_0x35884f){if(_0x35884f){_0x4499c7['interaction']=_0x35884f[_0x9641('0x69')]({'plain':!![]});interaction_log[_0x9641('0x20')](_0x9641('0x81'),_0x4eef47['user']['id'],_0x4eef47[_0x9641('0x6b')][_0x9641('0x3a')],_0x4eef47[_0x9641('0x6b')][_0x9641('0x82')],_0x4499c7[_0x9641('0x68')]['id'],_0x4eef47[_0x9641('0x5a')]?JSON[_0x9641('0x6c')](_0x4eef47[_0x9641('0x5a')]):'null');return respondWithRpcPromise(_0x9641('0x83'),_0x9641('0x84'),_0x4499c7);}return null;})[_0x9641('0x36')](function(_0x11e700){var _0x3ba20f=_0x9641('0x70')+_0x11e700[_0x9641('0x26')][_0x9641('0x71')];return db['sequelize']['query'](_0x3ba20f,{'type':db[_0x9641('0x73')][_0x9641('0x85')][_0x9641('0x74')],'raw':!![]})['then'](function(_0x52a290){return _0x52a290;});})[_0x9641('0x36')](function(_0x30271b){if(_0x30271b){_0x4499c7['message'][_0x9641('0x75')]=_0x30271b[0x0];if(!_0x4eef47[_0x9641('0x5a')][_0x9641('0x63')])return;return db['User']['find']({'where':{'id':_0x4eef47[_0x9641('0x5a')][_0x9641('0x63')],'role':_0x9641('0x77')},'attributes':['id',_0x9641('0x3a'),_0x9641('0x78'),'email',_0x9641('0x86')],'raw':!![]});}return null;})['then'](function(_0x24829f){if(!_0x24829f)return null;_0x4499c7[_0x9641('0x26')]['agent']=_0x24829f;return _0x4499c7;})[_0x9641('0x36')](function(_0x561a63){if(_0x561a63){_0x561a63['message'][_0x9641('0x79')]=util[_0x9641('0x67')]('SIP/%s',_0x4eef47[_0x9641('0x6b')]['name']);_0x561a63['message'][_0x9641('0x7a')]=_0x4499c7['channel'];_0x561a63[_0x9641('0x26')][_0x9641('0x7b')]=_0x4499c7[_0x9641('0x7a')];_0x561a63['message']['event']=_0x9641('0x33');respondWithRpcPromise(_0x9641('0x7d'),_0x9641('0x7d'),{'event':_0x9641('0x87'),'message':_[_0x9641('0x50')](_0x4499c7[_0x9641('0x26')],JSON['parse'](_0x4499c7[_0x9641('0x68')][_0x9641('0x80')]))},client9002);return _0x4499c7;}return null;})[_0x9641('0x36')](respondWithResult(_0x81d884,null))[_0x9641('0x28')](handleError(_0x81d884,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index cd4550b..b7da3dd 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 _0x5888=['events','../../mysqldb','ChatMessage','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x203d64,_0x1ec79c){var _0x462ab3=function(_0x55ee6e){while(--_0x55ee6e){_0x203d64['push'](_0x203d64['shift']());}};_0x462ab3(++_0x1ec79c);}(_0x5888,0x68));var _0x8588=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x5888[_0x7791d5];return _0x5ce288;};'use strict';var EventEmitter=require(_0x8588('0x0'));var ChatMessage=require(_0x8588('0x1'))['db'][_0x8588('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8588('0x3')](0x0);var events={'afterCreate':_0x8588('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1809c1){return function(_0x598759,_0x2b2469,_0x3f08a6){ChatMessageEvents[_0x8588('0x5')](_0x1809c1+':'+_0x598759['id'],_0x598759);ChatMessageEvents[_0x8588('0x5')](_0x1809c1,_0x598759);_0x3f08a6(null);};}for(var e in events){if(events[_0x8588('0x6')](e)){var event=events[e];ChatMessage[_0x8588('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x117f=['ChatMessage','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1241ba,_0x529e24){var _0x2f01df=function(_0x52463d){while(--_0x52463d){_0x1241ba['push'](_0x1241ba['shift']());}};_0x2f01df(++_0x529e24);}(_0x117f,0x1e4));var _0xf117=function(_0x135c72,_0x2fe069){_0x135c72=_0x135c72-0x0;var _0x52191b=_0x117f[_0x135c72];return _0x52191b;};'use strict';var EventEmitter=require(_0xf117('0x0'));var ChatMessage=require(_0xf117('0x1'))['db'][_0xf117('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf117('0x3'),'afterUpdate':_0xf117('0x4'),'afterDestroy':_0xf117('0x5')};function emitEvent(_0x3fe2f6){return function(_0x5767f9,_0x3d943e,_0x391031){ChatMessageEvents['emit'](_0x3fe2f6+':'+_0x5767f9['id'],_0x5767f9);ChatMessageEvents[_0xf117('0x6')](_0x3fe2f6,_0x5767f9);_0x391031(null);};}for(var e in events){if(events[_0xf117('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xf117('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 889bfd7..77df0a9 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 _0xc900=['findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path','../../config/environment','define','ChatMessage','chat_messages','body','FULLTEXT','direction','toLowerCase','out','secret','UserId','ChatInteraction'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0xc900,0xc7));var _0x0c90=function(_0x24ec3a,_0x8d67b9){_0x24ec3a=_0x24ec3a-0x0;var _0x20d59d=_0xc900[_0x24ec3a];return _0x20d59d;};'use strict';var _=require(_0x0c90('0x0'));var util=require(_0x0c90('0x1'));var logger=require('../../config/logger')(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c90('0x4'));var rimraf=require('rimraf');var config=require(_0x0c90('0x5'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x4ae244,_0x35152b){return _0x4ae244[_0x0c90('0x6')](_0x0c90('0x7'),attributes,{'tableName':_0x0c90('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x0c90('0x9')],'type':_0x0c90('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x175817,_0x406d55,_0xe817ad){var _0x33191e=_0x4ae244['models'];var _0x3f2274=_0x175817['get']({'plain':!![]});if(_0x3f2274[_0x0c90('0xb')][_0x0c90('0xc')]()==='in'||_0x3f2274[_0x0c90('0xb')][_0x0c90('0xc')]()===_0x0c90('0xd')&&!_0x3f2274[_0x0c90('0xe')]&&!_['isNil'](_0x3f2274[_0x0c90('0xf')])){_0x33191e[_0x0c90('0x10')][_0x0c90('0x11')]({'where':{'id':_0x3f2274['ChatInteractionId']}})[_0x0c90('0x12')](function(_0x24d87d){if(_0x24d87d){_0x24d87d[_0x0c90('0x13')]({'lastMsgAt':_0x3f2274['createdAt'],'lastMsgDirection':_0x3f2274[_0x0c90('0xb')][_0x0c90('0xc')]()});}})[_0x0c90('0x14')](function(_0x42aeb4){console[_0x0c90('0x15')](_0x42aeb4);});}_0xe817ad();}},'charset':_0x0c90('0x16'),'collate':_0x0c90('0x17')});};
\ No newline at end of file
+var _0xa2e7=['path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x167574,_0x288293){var _0x10e73f=function(_0x8ed259){while(--_0x8ed259){_0x167574['push'](_0x167574['shift']());}};_0x10e73f(++_0x288293);}(_0xa2e7,0x185));var _0x7a2e=function(_0x5d7dc8,_0x14a0fc){_0x5d7dc8=_0x5d7dc8-0x0;var _0x4b99bb=_0xa2e7[_0x5d7dc8];return _0x4b99bb;};'use strict';var _=require(_0x7a2e('0x0'));var util=require(_0x7a2e('0x1'));var logger=require(_0x7a2e('0x2'))(_0x7a2e('0x3'));var moment=require(_0x7a2e('0x4'));var BPromise=require(_0x7a2e('0x5'));var rp=require(_0x7a2e('0x6'));var fs=require('fs');var path=require(_0x7a2e('0x7'));var rimraf=require('rimraf');var config=require(_0x7a2e('0x8'));var attributes=require(_0x7a2e('0x9'));module[_0x7a2e('0xa')]=function(_0x4b942d,_0x253ae2){return _0x4b942d[_0x7a2e('0xb')](_0x7a2e('0xc'),attributes,{'tableName':_0x7a2e('0xd'),'paranoid':![],'indexes':[{'name':_0x7a2e('0xe'),'fields':[_0x7a2e('0xf')],'type':_0x7a2e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x10ef14,_0x45f210,_0x2643bb){var _0x2c9454=_0x4b942d[_0x7a2e('0x11')];var _0x283eae=_0x10ef14[_0x7a2e('0x12')]({'plain':!![]});if(_0x283eae['direction']['toLowerCase']()==='in'||_0x283eae[_0x7a2e('0x13')][_0x7a2e('0x14')]()===_0x7a2e('0x15')&&!_0x283eae[_0x7a2e('0x16')]&&!_[_0x7a2e('0x17')](_0x283eae[_0x7a2e('0x18')])){_0x2c9454['ChatInteraction'][_0x7a2e('0x19')]({'where':{'id':_0x283eae['ChatInteractionId']}})[_0x7a2e('0x1a')](function(_0xf28220){if(_0xf28220){_0xf28220[_0x7a2e('0x1b')]({'lastMsgAt':_0x283eae[_0x7a2e('0x1c')],'lastMsgDirection':_0x283eae[_0x7a2e('0x13')][_0x7a2e('0x14')]()});}})[_0x7a2e('0x1d')](function(_0x5f53ea){console[_0x7a2e('0x1e')](_0x5f53ea);});}_0x2643bb();}},'charset':_0x7a2e('0x1f'),'collate':_0x7a2e('0x20')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 5d2eb76..300e179 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 _0xa2f1=['create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatMessage.socket','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage'];(function(_0xfb3ff5,_0x502da4){var _0xe14503=function(_0x5222f6){while(--_0x5222f6){_0xfb3ff5['push'](_0xfb3ff5['shift']());}};_0xe14503(++_0x502da4);}(_0xa2f1,0x19c));var _0x1a2f=function(_0x2d70cb,_0x4da421){_0x2d70cb=_0x2d70cb-0x0;var _0x20d745=_0xa2f1[_0x2d70cb];return _0x20d745;};'use strict';var _=require(_0x1a2f('0x0'));var util=require(_0x1a2f('0x1'));var moment=require(_0x1a2f('0x2'));var BPromise=require(_0x1a2f('0x3'));var rs=require(_0x1a2f('0x4'));var fs=require('fs');var Redis=require(_0x1a2f('0x5'));var db=require(_0x1a2f('0x6'))['db'];var utils=require(_0x1a2f('0x7'));var logger=require('../../config/logger')(_0x1a2f('0x8'));var config=require(_0x1a2f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1a2f('0xa')][_0x1a2f('0xb')]({'port':0x232a});config[_0x1a2f('0xc')]=_[_0x1a2f('0xd')](config[_0x1a2f('0xc')],{'host':_0x1a2f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1a2f('0xf'))['register'](socket);function respondWithRpcPromise(_0x1b402f,_0x3b6cc0,_0xa03831){return new BPromise(function(_0x3378ff,_0x4f3bbc){return client['request'](_0x1b402f,_0xa03831)[_0x1a2f('0x10')](function(_0x4a33b7){logger[_0x1a2f('0x11')](_0x1a2f('0x12'),_0x3b6cc0,_0x1a2f('0x13'));logger[_0x1a2f('0x14')](_0x1a2f('0x15'),_0x3b6cc0,_0x1a2f('0x13'),JSON[_0x1a2f('0x16')](_0x4a33b7));if(_0x4a33b7[_0x1a2f('0x17')]){if(_0x4a33b7[_0x1a2f('0x17')][_0x1a2f('0x18')]===0x1f4){logger[_0x1a2f('0x17')]('ChatMessage,\x20%s,\x20%s',_0x3b6cc0,_0x4a33b7[_0x1a2f('0x17')][_0x1a2f('0x19')]);return _0x4f3bbc(_0x4a33b7[_0x1a2f('0x17')][_0x1a2f('0x19')]);}logger[_0x1a2f('0x17')](_0x1a2f('0x12'),_0x3b6cc0,_0x4a33b7[_0x1a2f('0x17')][_0x1a2f('0x19')]);return _0x3378ff(_0x4a33b7[_0x1a2f('0x17')][_0x1a2f('0x19')]);}else{logger[_0x1a2f('0x11')]('ChatMessage,\x20%s,\x20%s',_0x3b6cc0,'request\x20sent');_0x3378ff(_0x4a33b7[_0x1a2f('0x1a')][_0x1a2f('0x19')]);}})[_0x1a2f('0x1b')](function(_0x221ae7){logger[_0x1a2f('0x17')](_0x1a2f('0x12'),_0x3b6cc0,_0x221ae7);_0x4f3bbc(_0x221ae7);});});}exports[_0x1a2f('0x1c')]=function(_0x26b19a){var _0x3afd7e=this;return new Promise(function(_0x4ade1a,_0x5206aa){return db[_0x1a2f('0x1d')][_0x1a2f('0x1e')](_0x26b19a[_0x1a2f('0x1f')],{'raw':_0x26b19a[_0x1a2f('0x20')]?_0x26b19a[_0x1a2f('0x20')][_0x1a2f('0x21')]===undefined?!![]:![]:!![]})[_0x1a2f('0x10')](function(_0x526b67){logger['info'](_0x1a2f('0x1c'),_0x26b19a);logger['debug']('CreateChatMessage',_0x26b19a,JSON[_0x1a2f('0x16')](_0x526b67));_0x4ade1a(_0x526b67);})['catch'](function(_0x5c2a8f){logger['error'](_0x1a2f('0x1c'),_0x5c2a8f['message'],_0x26b19a);_0x5206aa(_0x3afd7e['error'](0x1f4,_0x5c2a8f['message']));});});};
\ No newline at end of file
+var _0x31a2=['error','code','message','catch','CreateChatMessage','ChatMessage','body','options','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x42868d,_0x165917){var _0xd29bb1=function(_0x252969){while(--_0x252969){_0x42868d['push'](_0x42868d['shift']());}};_0xd29bb1(++_0x165917);}(_0x31a2,0x116));var _0x231a=function(_0x4b1875,_0x1fae56){_0x4b1875=_0x4b1875-0x0;var _0x2c688b=_0x31a2[_0x4b1875];return _0x2c688b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x231a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x231a('0x1'));var db=require(_0x231a('0x2'))['db'];var utils=require(_0x231a('0x3'));var logger=require(_0x231a('0x4'))(_0x231a('0x5'));var config=require(_0x231a('0x6'));var jayson=require(_0x231a('0x7'));var client=jayson['client'][_0x231a('0x8')]({'port':0x232a});config['redis']=_[_0x231a('0x9')](config[_0x231a('0xa')],{'host':_0x231a('0xb'),'port':0x18eb});var socket=require(_0x231a('0xc'))(new Redis(config[_0x231a('0xa')]));require(_0x231a('0xd'))[_0x231a('0xe')](socket);function respondWithRpcPromise(_0x2e754f,_0x16270b,_0x7f339){return new BPromise(function(_0xfb72e3,_0x4915ec){return client[_0x231a('0xf')](_0x2e754f,_0x7f339)[_0x231a('0x10')](function(_0x1e2bb7){logger[_0x231a('0x11')](_0x231a('0x12'),_0x16270b,_0x231a('0x13'));logger[_0x231a('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x16270b,_0x231a('0x13'),JSON[_0x231a('0x15')](_0x1e2bb7));if(_0x1e2bb7['error']){if(_0x1e2bb7[_0x231a('0x16')][_0x231a('0x17')]===0x1f4){logger[_0x231a('0x16')]('ChatMessage,\x20%s,\x20%s',_0x16270b,_0x1e2bb7['error']['message']);return _0x4915ec(_0x1e2bb7[_0x231a('0x16')][_0x231a('0x18')]);}logger[_0x231a('0x16')](_0x231a('0x12'),_0x16270b,_0x1e2bb7[_0x231a('0x16')][_0x231a('0x18')]);return _0xfb72e3(_0x1e2bb7[_0x231a('0x16')]['message']);}else{logger[_0x231a('0x11')]('ChatMessage,\x20%s,\x20%s',_0x16270b,_0x231a('0x13'));_0xfb72e3(_0x1e2bb7['result'][_0x231a('0x18')]);}})[_0x231a('0x19')](function(_0xe7eade){logger[_0x231a('0x16')](_0x231a('0x12'),_0x16270b,_0xe7eade);_0x4915ec(_0xe7eade);});});}exports[_0x231a('0x1a')]=function(_0x99c3c0){var _0x55529a=this;return new Promise(function(_0x2a4dcb,_0x84cde9){return db[_0x231a('0x1b')]['create'](_0x99c3c0[_0x231a('0x1c')],{'raw':_0x99c3c0['options']?_0x99c3c0[_0x231a('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x231a('0x10')](function(_0x485359){logger[_0x231a('0x11')](_0x231a('0x1a'),_0x99c3c0);logger[_0x231a('0x14')](_0x231a('0x1a'),_0x99c3c0,JSON[_0x231a('0x15')](_0x485359));_0x2a4dcb(_0x485359);})['catch'](function(_0x5bba16){logger[_0x231a('0x16')](_0x231a('0x1a'),_0x5bba16[_0x231a('0x18')],_0x99c3c0);_0x84cde9(_0x55529a[_0x231a('0x16')](0x1f4,_0x5bba16[_0x231a('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 74618cb..7839992 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 _0xd6d2=['save','update','removeListener','length','chatMessage:','./chatMessage.events'];(function(_0x357d69,_0xf80d4d){var _0x3182e9=function(_0x180ba3){while(--_0x180ba3){_0x357d69['push'](_0x357d69['shift']());}};_0x3182e9(++_0xf80d4d);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x480d8d,_0x3ee87a){_0x480d8d=_0x480d8d-0x0;var _0x3c0c7d=_0xd6d2[_0x480d8d];return _0x3c0c7d;};'use strict';var ChatMessageEvents=require(_0x2d6d('0x0'));var events=[_0x2d6d('0x1'),'remove',_0x2d6d('0x2')];function createListener(_0x224caa,_0x5b4a5b){return function(_0x2c2dd9){_0x5b4a5b['emit'](_0x224caa,_0x2c2dd9);};}function removeListener(_0x1c5e54,_0x3ee519){return function(){ChatMessageEvents[_0x2d6d('0x3')](_0x1c5e54,_0x3ee519);};}exports['register']=function(_0xfcdb1d){for(var _0x132361=0x0,_0xf59b20=events[_0x2d6d('0x4')];_0x132361<_0xf59b20;_0x132361++){var _0x4002b7=events[_0x132361];var _0x42d802=createListener(_0x2d6d('0x5')+_0x4002b7,_0xfcdb1d);ChatMessageEvents['on'](_0x4002b7,_0x42d802);}};
\ No newline at end of file
+var _0x78d3=['removeListener','register','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x16f869,_0x309f33){var _0x24906a=function(_0x49c2b3){while(--_0x49c2b3){_0x16f869['push'](_0x16f869['shift']());}};_0x24906a(++_0x309f33);}(_0x78d3,0x73));var _0x378d=function(_0x428e71,_0x192e72){_0x428e71=_0x428e71-0x0;var _0xa8fa25=_0x78d3[_0x428e71];return _0xa8fa25;};'use strict';var ChatMessageEvents=require(_0x378d('0x0'));var events=[_0x378d('0x1'),_0x378d('0x2'),_0x378d('0x3')];function createListener(_0x40323e,_0x1d87b8){return function(_0x367f93){_0x1d87b8[_0x378d('0x4')](_0x40323e,_0x367f93);};}function removeListener(_0x52f934,_0x32a62f){return function(){ChatMessageEvents[_0x378d('0x5')](_0x52f934,_0x32a62f);};}exports[_0x378d('0x6')]=function(_0xc18c0b){for(var _0x59117c=0x0,_0x47a99f=events['length'];_0x59117c<_0x47a99f;_0x59117c++){var _0x1c880e=events[_0x59117c];var _0x4b3ef5=createListener(_0x378d('0x7')+_0x1c880e,_0xc18c0b);ChatMessageEvents['on'](_0x1c880e,_0x4b3ef5);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 7b3f401..676d400 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 _0xb497=['create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','tracked','chat'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb497,0x7a));var _0x7b49=function(_0x44a34a,_0x2533b6){_0x44a34a=_0x44a34a-0x0;var _0x3e64d0=_0xb497[_0x44a34a];return _0x3e64d0;};'use strict';var multer=require(_0x7b49('0x0'));var util=require(_0x7b49('0x1'));var path=require('path');var timeout=require(_0x7b49('0x2'));var express=require(_0x7b49('0x3'));var router=express[_0x7b49('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7b49('0x5'));var interaction=require(_0x7b49('0x6'));var config=require(_0x7b49('0x7'));var controller=require(_0x7b49('0x8'));router['get']('/',auth[_0x7b49('0x9')](),controller[_0x7b49('0xa')]);router['get'](_0x7b49('0xb'),auth[_0x7b49('0x9')](),controller[_0x7b49('0xc')]);router[_0x7b49('0xd')](_0x7b49('0xe'),auth[_0x7b49('0x9')](),controller[_0x7b49('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x7b49('0x10')](_0x7b49('0x11'),'chatmessage:create'),controller[_0x7b49('0x12')]);router[_0x7b49('0x13')]('/:id',controller[_0x7b49('0x14')]);router[_0x7b49('0x13')](_0x7b49('0x15'),auth['isAuthenticated'](),controller[_0x7b49('0x16')]);router[_0x7b49('0x13')](_0x7b49('0x17'),auth[_0x7b49('0x9')](),controller[_0x7b49('0x18')]);router[_0x7b49('0x19')](_0x7b49('0xe'),auth[_0x7b49('0x9')](),controller[_0x7b49('0x1a')]);module[_0x7b49('0x1b')]=router;
\ No newline at end of file
+var _0xe6ee=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','index','isAuthenticated','describe','get','show','post','tracked','chatmessage:create','create','put','/:id','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe6ee,0x99));var _0xee6e=function(_0x36a346,_0x230a63){_0x36a346=_0x36a346-0x0;var _0x6109cf=_0xe6ee[_0x36a346];return _0x6109cf;};'use strict';var multer=require(_0xee6e('0x0'));var util=require(_0xee6e('0x1'));var path=require(_0xee6e('0x2'));var timeout=require(_0xee6e('0x3'));var express=require(_0xee6e('0x4'));var router=express['Router']();var fs_extra=require(_0xee6e('0x5'));var auth=require(_0xee6e('0x6'));var interaction=require(_0xee6e('0x7'));var config=require('../../config/environment');var controller=require(_0xee6e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xee6e('0x9')]);router['get']('/describe',auth[_0xee6e('0xa')](),controller[_0xee6e('0xb')]);router[_0xee6e('0xc')]('/:id',auth[_0xee6e('0xa')](),controller[_0xee6e('0xd')]);router[_0xee6e('0xe')]('/',auth[_0xee6e('0xa')](),interaction[_0xee6e('0xf')]('chat',_0xee6e('0x10')),controller[_0xee6e('0x11')]);router[_0xee6e('0x12')](_0xee6e('0x13'),controller[_0xee6e('0x14')]);router[_0xee6e('0x12')](_0xee6e('0x15'),auth[_0xee6e('0xa')](),controller['accept']);router[_0xee6e('0x12')](_0xee6e('0x16'),auth[_0xee6e('0xa')](),controller[_0xee6e('0x17')]);router['delete']('/:id',auth[_0xee6e('0xa')](),controller[_0xee6e('0x18')]);module[_0xee6e('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 9734b96..deca1a8 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 _0x5f66=['medium','TEXT','exports'];(function(_0x4dfb4f,_0x105a7e){var _0x2b7295=function(_0x4ea999){while(--_0x4ea999){_0x4dfb4f['push'](_0x4dfb4f['shift']());}};_0x2b7295(++_0x105a7e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x44cdf9,_0x2fd3c3){var _0x3a2633=function(_0x338d5c){while(--_0x338d5c){_0x44cdf9['push'](_0x44cdf9['shift']());}};_0x3a2633(++_0x2fd3c3);}(_0xdb28,0x106));var _0x8db2=function(_0x3953f8,_0x40657d){_0x3953f8=_0x3953f8-0x0;var _0x3858e6=_0xdb28[_0x3953f8];return _0x3858e6;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('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 aebba2c..bd80773 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x585d2d,_0x1fa398){var _0x20be1c=function(_0xfe5362){while(--_0xfe5362){_0x585d2d['push'](_0x585d2d['shift']());}};_0x20be1c(++_0x1fa398);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x7a54,0x106));var _0x47a5=function(_0x24d917,_0x1cb597){_0x24d917=_0x24d917-0x0;var _0x20e3f4=_0x7a54[_0x24d917];return _0x20e3f4;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 49d3087..a6831a0 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d18=['hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x10f85b,_0x2581c2){var _0x3799ab=function(_0x2bd2df){while(--_0x2bd2df){_0x10f85b['push'](_0x10f85b['shift']());}};_0x3799ab(++_0x2581c2);}(_0x4d18,0x19c));var _0x84d1=function(_0x3e1f1e,_0x50785b){_0x3e1f1e=_0x3e1f1e-0x0;var _0x3bdc31=_0x4d18[_0x3e1f1e];return _0x3bdc31;};'use strict';var EventEmitter=require(_0x84d1('0x0'));var ChatOfflineMessage=require(_0x84d1('0x1'))['db'][_0x84d1('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x84d1('0x3')](0x0);var events={'afterCreate':_0x84d1('0x4'),'afterUpdate':_0x84d1('0x5'),'afterDestroy':_0x84d1('0x6')};function emitEvent(_0x43f2d4){return function(_0x4d544e,_0x17235f,_0xe254a8){ChatOfflineMessageEvents[_0x84d1('0x7')](_0x43f2d4+':'+_0x4d544e['id'],_0x4d544e);ChatOfflineMessageEvents['emit'](_0x43f2d4,_0x4d544e);_0xe254a8(null);};}for(var e in events){if(events[_0x84d1('0x8')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x84d1('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x7c1a=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x1d25df,_0x5ce190){var _0x3138f9=function(_0x227e34){while(--_0x227e34){_0x1d25df['push'](_0x1d25df['shift']());}};_0x3138f9(++_0x5ce190);}(_0x7c1a,0x159));var _0xa7c1=function(_0x238b61,_0xb94d00){_0x238b61=_0x238b61-0x0;var _0x519752=_0x7c1a[_0x238b61];return _0x519752;};'use strict';var EventEmitter=require(_0xa7c1('0x0'));var ChatOfflineMessage=require(_0xa7c1('0x1'))['db'][_0xa7c1('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xa7c1('0x3')](0x0);var events={'afterCreate':_0xa7c1('0x4'),'afterUpdate':_0xa7c1('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd434f){return function(_0x132b08,_0x506858,_0x135ae7){ChatOfflineMessageEvents['emit'](_0xd434f+':'+_0x132b08['id'],_0x132b08);ChatOfflineMessageEvents[_0xa7c1('0x6')](_0xd434f,_0x132b08);_0x135ae7(null);};}for(var e in events){if(events[_0xa7c1('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xa7c1('0x8')](e,emitEvent(event));}}module[_0xa7c1('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 16d511e..dabd444 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 _0xfb0f=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x1daaa4,_0x2a13f8){var _0x4d6a11=function(_0x52ea7f){while(--_0x52ea7f){_0x1daaa4['push'](_0x1daaa4['shift']());}};_0x4d6a11(++_0x2a13f8);}(_0xfb0f,0x1cd));var _0xffb0=function(_0x30b077,_0x5a9aa7){_0x30b077=_0x30b077-0x0;var _0x599659=_0xfb0f[_0x30b077];return _0x599659;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xffb0('0x0')]=function(_0x401d9d){return _0x401d9d[_0xffb0('0x1')](_0xffb0('0x2'),attributes,{'tableName':_0xffb0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xffb0('0x4'),'collate':_0xffb0('0x5')});};
\ No newline at end of file
+var _0xba7b=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4'];(function(_0x922971,_0xf97ffa){var _0x22bdd7=function(_0x4a44f7){while(--_0x4a44f7){_0x922971['push'](_0x922971['shift']());}};_0x22bdd7(++_0xf97ffa);}(_0xba7b,0x103));var _0xbba7=function(_0x24864a,_0x16c627){_0x24864a=_0x24864a-0x0;var _0x3f61be=_0xba7b[_0x24864a];return _0x3f61be;};'use strict';var attributes=require(_0xbba7('0x0'));module[_0xbba7('0x1')]=function(_0x1d298c){return _0x1d298c[_0xbba7('0x2')](_0xbba7('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbba7('0x4'),'collate':_0xbba7('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 27a86a8..8a47c62 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 _0xafc6=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','bluebird'];(function(_0x3f0441,_0x2d94e1){var _0x3bfea9=function(_0x20ec60){while(--_0x20ec60){_0x3f0441['push'](_0x3f0441['shift']());}};_0x3bfea9(++_0x2d94e1);}(_0xafc6,0xf9));var _0x6afc=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xafc6[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x6afc('0x0'));var util=require(_0x6afc('0x1'));var moment=require(_0x6afc('0x2'));var BPromise=require(_0x6afc('0x3'));var rs=require(_0x6afc('0x4'));var fs=require('fs');var Redis=require(_0x6afc('0x5'));var db=require(_0x6afc('0x6'))['db'];var utils=require(_0x6afc('0x7'));var logger=require('../../config/logger')(_0x6afc('0x8'));var config=require(_0x6afc('0x9'));var jayson=require(_0x6afc('0xa'));var client=jayson[_0x6afc('0xb')][_0x6afc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ef905,_0x30d951,_0x3219b1){return new BPromise(function(_0x11694c,_0x14393d){return client[_0x6afc('0xd')](_0x5ef905,_0x3219b1)['then'](function(_0x39c1d0){logger[_0x6afc('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x30d951,'request\x20sent');logger['debug'](_0x6afc('0xf'),_0x30d951,'request\x20sent',JSON[_0x6afc('0x10')](_0x39c1d0));if(_0x39c1d0[_0x6afc('0x11')]){if(_0x39c1d0[_0x6afc('0x11')][_0x6afc('0x12')]===0x1f4){logger[_0x6afc('0x11')](_0x6afc('0x13'),_0x30d951,_0x39c1d0[_0x6afc('0x11')][_0x6afc('0x14')]);return _0x14393d(_0x39c1d0[_0x6afc('0x11')][_0x6afc('0x14')]);}logger[_0x6afc('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x30d951,_0x39c1d0[_0x6afc('0x11')][_0x6afc('0x14')]);return _0x11694c(_0x39c1d0[_0x6afc('0x11')][_0x6afc('0x14')]);}else{logger[_0x6afc('0xe')](_0x6afc('0x13'),_0x30d951,_0x6afc('0x15'));_0x11694c(_0x39c1d0['result'][_0x6afc('0x14')]);}})[_0x6afc('0x16')](function(_0x4d74f2){logger['error'](_0x6afc('0x13'),_0x30d951,_0x4d74f2);_0x14393d(_0x4d74f2);});});}
\ No newline at end of file
+var _0xdc8c=['stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0x2335bb,_0x4145eb){var _0x217c2b=function(_0x29578){while(--_0x29578){_0x2335bb['push'](_0x2335bb['shift']());}};_0x217c2b(++_0x4145eb);}(_0xdc8c,0xd9));var _0xcdc8=function(_0x18870a,_0x295a40){_0x18870a=_0x18870a-0x0;var _0x4ca1c1=_0xdc8c[_0x18870a];return _0x4ca1c1;};'use strict';var _=require(_0xcdc8('0x0'));var util=require(_0xcdc8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcdc8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdc8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdc8('0x4'))(_0xcdc8('0x5'));var config=require(_0xcdc8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcdc8('0x7')][_0xcdc8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2feede,_0x2e7bd0,_0x1f6292){return new BPromise(function(_0x1830d2,_0x4394dc){return client[_0xcdc8('0x9')](_0x2feede,_0x1f6292)[_0xcdc8('0xa')](function(_0x15748e){logger[_0xcdc8('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2e7bd0,_0xcdc8('0xc'));logger[_0xcdc8('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x2e7bd0,_0xcdc8('0xc'),JSON[_0xcdc8('0xe')](_0x15748e));if(_0x15748e[_0xcdc8('0xf')]){if(_0x15748e[_0xcdc8('0xf')][_0xcdc8('0x10')]===0x1f4){logger[_0xcdc8('0xf')](_0xcdc8('0x11'),_0x2e7bd0,_0x15748e[_0xcdc8('0xf')][_0xcdc8('0x12')]);return _0x4394dc(_0x15748e[_0xcdc8('0xf')][_0xcdc8('0x12')]);}logger[_0xcdc8('0xf')](_0xcdc8('0x11'),_0x2e7bd0,_0x15748e[_0xcdc8('0xf')]['message']);return _0x1830d2(_0x15748e[_0xcdc8('0xf')][_0xcdc8('0x12')]);}else{logger[_0xcdc8('0xb')](_0xcdc8('0x11'),_0x2e7bd0,_0xcdc8('0xc'));_0x1830d2(_0x15748e[_0xcdc8('0x13')][_0xcdc8('0x12')]);}})[_0xcdc8('0x14')](function(_0x7f0157){logger[_0xcdc8('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2e7bd0,_0x7f0157);_0x4394dc(_0x7f0157);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index de994cb..c141127 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 _0x20b0=['show','post','create','put','destroy','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x4cf71e,_0x11057f){var _0x51128e=function(_0x2b8eca){while(--_0x2b8eca){_0x4cf71e['push'](_0x4cf71e['shift']());}};_0x51128e(++_0x11057f);}(_0x20b0,0x159));var _0x020b=function(_0x359a26,_0x1f4885){_0x359a26=_0x359a26-0x0;var _0x1bbbf1=_0x20b0[_0x359a26];return _0x1bbbf1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x020b('0x0'));var timeout=require(_0x020b('0x1'));var express=require(_0x020b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x020b('0x3'));var interaction=require(_0x020b('0x4'));var config=require('../../config/environment');var controller=require(_0x020b('0x5'));router[_0x020b('0x6')]('/',auth['isAuthenticated'](),controller[_0x020b('0x7')]);router[_0x020b('0x6')](_0x020b('0x8'),auth['isAuthenticated'](),controller[_0x020b('0x9')]);router[_0x020b('0x6')](_0x020b('0xa'),auth[_0x020b('0xb')](),controller[_0x020b('0xc')]);router[_0x020b('0xd')]('/',auth[_0x020b('0xb')](),controller[_0x020b('0xe')]);router[_0x020b('0xf')](_0x020b('0xa'),auth[_0x020b('0xb')](),controller['update']);router['delete'](_0x020b('0xa'),auth['isAuthenticated'](),controller[_0x020b('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x7a32=['post','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','show'];(function(_0x5d0607,_0x50c068){var _0x4f955b=function(_0x4e9b95){while(--_0x4e9b95){_0x5d0607['push'](_0x5d0607['shift']());}};_0x4f955b(++_0x50c068);}(_0x7a32,0xf5));var _0x27a3=function(_0x217889,_0x451611){_0x217889=_0x217889-0x0;var _0x34550e=_0x7a32[_0x217889];return _0x34550e;};'use strict';var multer=require(_0x27a3('0x0'));var util=require(_0x27a3('0x1'));var path=require(_0x27a3('0x2'));var timeout=require(_0x27a3('0x3'));var express=require('express');var router=express[_0x27a3('0x4')]();var fs_extra=require(_0x27a3('0x5'));var auth=require(_0x27a3('0x6'));var interaction=require(_0x27a3('0x7'));var config=require(_0x27a3('0x8'));var controller=require(_0x27a3('0x9'));router[_0x27a3('0xa')]('/',auth[_0x27a3('0xb')](),controller[_0x27a3('0xc')]);router['get']('/describe',auth[_0x27a3('0xb')](),controller[_0x27a3('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x27a3('0xe')]);router[_0x27a3('0xf')]('/',auth['isAuthenticated'](),controller[_0x27a3('0x10')]);router['put']('/:id',auth[_0x27a3('0xb')](),controller[_0x27a3('0x11')]);router[_0x27a3('0x12')]('/:id',auth[_0x27a3('0xb')](),controller['destroy']);module[_0x27a3('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index b01218d..666befa 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 _0xf964=['INTEGER','STRING','ENUM','timeout'];(function(_0x2f8c99,_0x1970d0){var _0x47eb13=function(_0x56a94f){while(--_0x56a94f){_0x2f8c99['push'](_0x2f8c99['shift']());}};_0x47eb13(++_0x1970d0);}(_0xf964,0x1c1));var _0x4f96=function(_0x5da6a5,_0x14a51b){_0x5da6a5=_0x5da6a5-0x0;var _0x40d092=_0xf964[_0x5da6a5];return _0x40d092;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4f96('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x4f96('0x1')]('mouseOver',_0x4f96('0x2')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x4f96('0x0')]},'timeout':{'type':Sequelize[_0x4f96('0x3')]}};
\ No newline at end of file
+var _0x5e96=['STRING','ENUM','timeout','mouseOver'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x5e96,0x1dd));var _0x65e9=function(_0x223bc9,_0x23332e){_0x223bc9=_0x223bc9-0x0;var _0xcd700b=_0x5e96[_0x223bc9];return _0xcd700b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x65e9('0x0')]('mouseOver',_0x65e9('0x1')),'defaultValue':_0x65e9('0x2')},'selector':{'type':Sequelize[_0x65e9('0x3')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 2d2c396..bf15468 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 _0x3de0=['desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','end','error','name','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3de0,0x143));var _0x03de=function(_0x1189f9,_0x393c8f){_0x1189f9=_0x1189f9-0x0;var _0x951fd3=_0x3de0[_0x1189f9];return _0x951fd3;};'use strict';var emlformat=require(_0x03de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03de('0x1'));var jsonpatch=require(_0x03de('0x2'));var rp=require('request-promise');var moment=require(_0x03de('0x3'));var BPromise=require(_0x03de('0x4'));var Mustache=require('mustache');var util=require(_0x03de('0x5'));var path=require(_0x03de('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x03de('0x7'));var fs=require('fs');var fs_extra=require(_0x03de('0x8'));var _=require(_0x03de('0x9'));var squel=require(_0x03de('0xa'));var crypto=require(_0x03de('0xb'));var jsforce=require(_0x03de('0xc'));var deskjs=require(_0x03de('0xd'));var toCsv=require(_0x03de('0xe'));var querystring=require('querystring');var Papa=require(_0x03de('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x03de('0x10'));var as=require(_0x03de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03de('0x12'))(_0x03de('0x13'));var utils=require('../../config/utils');var config=require(_0x03de('0x14'));var licenseUtil=require(_0x03de('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d6629,_0x10ab8b){_0x10ab8b=_0x10ab8b||0xcc;return function(_0x40dd5d){if(_0x40dd5d){return _0x3d6629[_0x03de('0x16')](_0x10ab8b);}return _0x3d6629[_0x03de('0x17')](_0x10ab8b)['end']();};}function respondWithResult(_0xf9553d,_0x1b467e){_0x1b467e=_0x1b467e||0xc8;return function(_0x14d19c){if(_0x14d19c){return _0xf9553d[_0x03de('0x17')](_0x1b467e)['json'](_0x14d19c);}};}function respondWithFilteredResult(_0x453564,_0xedbc6b){return function(_0x1aa88d){if(_0x1aa88d){var _0x45881e=typeof _0xedbc6b[_0x03de('0x18')]===_0x03de('0x19')&&typeof _0xedbc6b[_0x03de('0x1a')]===_0x03de('0x19');var _0x313a71=_0x1aa88d['count'];var _0x4835c0=_0x45881e?0x0:_0xedbc6b[_0x03de('0x18')];var _0x42962e=_0x45881e?_0x1aa88d[_0x03de('0x1b')]:_0xedbc6b['offset']+_0xedbc6b[_0x03de('0x1a')];var _0x5f6058;if(_0x42962e>=_0x313a71){_0x42962e=_0x313a71;_0x5f6058=0xc8;}else{_0x5f6058=0xce;}_0x453564[_0x03de('0x17')](_0x5f6058);return _0x453564[_0x03de('0x1c')](_0x03de('0x1d'),_0x4835c0+'-'+_0x42962e+'/'+_0x313a71)[_0x03de('0x1e')](_0x1aa88d);}return null;};}function patchUpdates(_0x3cb6ff){return function(_0x5cb66b){try{jsonpatch['apply'](_0x5cb66b,_0x3cb6ff,!![]);}catch(_0x528862){return BPromise[_0x03de('0x1f')](_0x528862);}return _0x5cb66b[_0x03de('0x20')]();};}function saveUpdates(_0x512d82,_0x12337f){return function(_0x4447d7){if(_0x4447d7){return _0x4447d7[_0x03de('0x21')](_0x512d82)['then'](function(_0x23e463){return _0x23e463;});}return null;};}function removeEntity(_0x396a57,_0x5f2317){return function(_0x13fb22){if(_0x13fb22){return _0x13fb22[_0x03de('0x22')]()[_0x03de('0x23')](function(){_0x396a57[_0x03de('0x17')](0xcc)[_0x03de('0x24')]();});}};}function handleEntityNotFound(_0x54b4fc,_0xf54687){return function(_0x13ab64){if(!_0x13ab64){_0x54b4fc[_0x03de('0x16')](0x194);}return _0x13ab64;};}function handleError(_0x1ed415,_0x5a9631){_0x5a9631=_0x5a9631||0x1f4;return function(_0x14e785){logger[_0x03de('0x25')](_0x14e785['stack']);if(_0x14e785['name']){delete _0x14e785[_0x03de('0x26')];}_0x1ed415[_0x03de('0x17')](_0x5a9631)['send'](_0x14e785);};}exports['show']=function(_0x261b19,_0x17463b){var _0x514232={'raw':!![],'where':{'id':_0x261b19[_0x03de('0x27')]['id']}},_0x405c25={};_0x405c25[_0x03de('0x28')]=_[_0x03de('0x29')](db['ChatProactiveAction']['rawAttributes']);_0x405c25[_0x03de('0x2a')]=_[_0x03de('0x29')](_0x261b19[_0x03de('0x2a')]);_0x405c25[_0x03de('0x2b')]=_[_0x03de('0x2c')](_0x405c25[_0x03de('0x28')],_0x405c25['query']);_0x514232[_0x03de('0x2d')]=_[_0x03de('0x2c')](_0x405c25[_0x03de('0x28')],qs[_0x03de('0x2e')](_0x261b19[_0x03de('0x2a')][_0x03de('0x2e')]));_0x514232['attributes']=_0x514232[_0x03de('0x2d')][_0x03de('0x2f')]?_0x514232['attributes']:_0x405c25[_0x03de('0x28')];if(_0x261b19[_0x03de('0x2a')][_0x03de('0x30')]){_0x514232[_0x03de('0x31')]=[{'all':!![]}];}_0x514232=_['merge']({},_0x514232,_0x261b19[_0x03de('0x32')]);return db[_0x03de('0x33')][_0x03de('0x34')](_0x514232)[_0x03de('0x23')](handleEntityNotFound(_0x17463b,null))['then'](respondWithResult(_0x17463b,null))[_0x03de('0x35')](handleError(_0x17463b,null));};exports[_0x03de('0x36')]=function(_0x1e7dc7,_0x4930a6){return db[_0x03de('0x33')][_0x03de('0x36')](_0x1e7dc7[_0x03de('0x37')],{})[_0x03de('0x23')](respondWithResult(_0x4930a6,0xc9))[_0x03de('0x35')](handleError(_0x4930a6,null));};exports[_0x03de('0x21')]=function(_0xdb21c3,_0x5bc7dd){if(_0xdb21c3[_0x03de('0x37')]['id']){delete _0xdb21c3[_0x03de('0x37')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0xdb21c3[_0x03de('0x27')]['id']}})[_0x03de('0x23')](handleEntityNotFound(_0x5bc7dd,null))[_0x03de('0x23')](saveUpdates(_0xdb21c3[_0x03de('0x37')],null))[_0x03de('0x23')](respondWithResult(_0x5bc7dd,null))[_0x03de('0x35')](handleError(_0x5bc7dd,null));};exports[_0x03de('0x22')]=function(_0x152a59,_0x294c92){return db[_0x03de('0x33')][_0x03de('0x34')]({'where':{'id':_0x152a59[_0x03de('0x27')]['id']}})[_0x03de('0x23')](handleEntityNotFound(_0x294c92,null))[_0x03de('0x23')](removeEntity(_0x294c92,null))[_0x03de('0x35')](handleError(_0x294c92,null));};
\ No newline at end of file
+var _0x4f5d=['then','destroy','sendStatus','stack','name','show','params','model','keys','ChatProactiveAction','filters','intersection','query','fields','attributes','length','includeAll','include','merge','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','status','end','json','offset','limit','count','Content-Range','apply','save','update'];(function(_0x418bb2,_0x1d8b9e){var _0x58bfd5=function(_0x4dc3c2){while(--_0x4dc3c2){_0x418bb2['push'](_0x418bb2['shift']());}};_0x58bfd5(++_0x1d8b9e);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4f5d[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0xd4f5('0x0'));var rimraf=require(_0xd4f5('0x1'));var zipdir=require(_0xd4f5('0x2'));var jsonpatch=require(_0xd4f5('0x3'));var rp=require(_0xd4f5('0x4'));var moment=require(_0xd4f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd4f5('0x6'));var util=require(_0xd4f5('0x7'));var path=require(_0xd4f5('0x8'));var sox=require(_0xd4f5('0x9'));var csv=require(_0xd4f5('0xa'));var ejs=require(_0xd4f5('0xb'));var fs=require('fs');var fs_extra=require(_0xd4f5('0xc'));var _=require(_0xd4f5('0xd'));var squel=require(_0xd4f5('0xe'));var crypto=require(_0xd4f5('0xf'));var jsforce=require(_0xd4f5('0x10'));var deskjs=require(_0xd4f5('0x11'));var toCsv=require(_0xd4f5('0xa'));var querystring=require('querystring');var Papa=require(_0xd4f5('0x12'));var Redis=require(_0xd4f5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd4f5('0x14'));var as=require(_0xd4f5('0x15'));var hardwareService=require(_0xd4f5('0x16'));var logger=require(_0xd4f5('0x17'))(_0xd4f5('0x18'));var utils=require(_0xd4f5('0x19'));var config=require(_0xd4f5('0x1a'));var licenseUtil=require(_0xd4f5('0x1b'));var db=require(_0xd4f5('0x1c'))['db'];function respondWithStatusCode(_0x5d5554,_0x445072){_0x445072=_0x445072||0xcc;return function(_0x21b2a2){if(_0x21b2a2){return _0x5d5554['sendStatus'](_0x445072);}return _0x5d5554[_0xd4f5('0x1d')](_0x445072)[_0xd4f5('0x1e')]();};}function respondWithResult(_0x28e1cf,_0x511fcf){_0x511fcf=_0x511fcf||0xc8;return function(_0x166d4d){if(_0x166d4d){return _0x28e1cf[_0xd4f5('0x1d')](_0x511fcf)[_0xd4f5('0x1f')](_0x166d4d);}};}function respondWithFilteredResult(_0x1a158f,_0x33f6dc){return function(_0x32f4b7){if(_0x32f4b7){var _0x23780a=typeof _0x33f6dc[_0xd4f5('0x20')]==='undefined'&&typeof _0x33f6dc[_0xd4f5('0x21')]==='undefined';var _0x45d043=_0x32f4b7['count'];var _0x220707=_0x23780a?0x0:_0x33f6dc[_0xd4f5('0x20')];var _0x271f53=_0x23780a?_0x32f4b7[_0xd4f5('0x22')]:_0x33f6dc[_0xd4f5('0x20')]+_0x33f6dc[_0xd4f5('0x21')];var _0x8c7e05;if(_0x271f53>=_0x45d043){_0x271f53=_0x45d043;_0x8c7e05=0xc8;}else{_0x8c7e05=0xce;}_0x1a158f[_0xd4f5('0x1d')](_0x8c7e05);return _0x1a158f['set'](_0xd4f5('0x23'),_0x220707+'-'+_0x271f53+'/'+_0x45d043)[_0xd4f5('0x1f')](_0x32f4b7);}return null;};}function patchUpdates(_0x57a16b){return function(_0x1aae04){try{jsonpatch[_0xd4f5('0x24')](_0x1aae04,_0x57a16b,!![]);}catch(_0x47f101){return BPromise['reject'](_0x47f101);}return _0x1aae04[_0xd4f5('0x25')]();};}function saveUpdates(_0x161443,_0x3cbe7b){return function(_0x3ae7af){if(_0x3ae7af){return _0x3ae7af[_0xd4f5('0x26')](_0x161443)[_0xd4f5('0x27')](function(_0x378af6){return _0x378af6;});}return null;};}function removeEntity(_0x527dd4,_0x578071){return function(_0x5ccc63){if(_0x5ccc63){return _0x5ccc63[_0xd4f5('0x28')]()[_0xd4f5('0x27')](function(){_0x527dd4[_0xd4f5('0x1d')](0xcc)[_0xd4f5('0x1e')]();});}};}function handleEntityNotFound(_0x5f3a5d,_0xb7ea1){return function(_0x49ad32){if(!_0x49ad32){_0x5f3a5d[_0xd4f5('0x29')](0x194);}return _0x49ad32;};}function handleError(_0x2fbee8,_0x5b519e){_0x5b519e=_0x5b519e||0x1f4;return function(_0x5ba979){logger['error'](_0x5ba979[_0xd4f5('0x2a')]);if(_0x5ba979[_0xd4f5('0x2b')]){delete _0x5ba979['name'];}_0x2fbee8[_0xd4f5('0x1d')](_0x5b519e)['send'](_0x5ba979);};}exports[_0xd4f5('0x2c')]=function(_0xb5dd60,_0x2134f2){var _0x2130e4={'raw':!![],'where':{'id':_0xb5dd60[_0xd4f5('0x2d')]['id']}},_0x32d067={};_0x32d067[_0xd4f5('0x2e')]=_[_0xd4f5('0x2f')](db[_0xd4f5('0x30')]['rawAttributes']);_0x32d067['query']=_['keys'](_0xb5dd60['query']);_0x32d067[_0xd4f5('0x31')]=_[_0xd4f5('0x32')](_0x32d067[_0xd4f5('0x2e')],_0x32d067[_0xd4f5('0x33')]);_0x2130e4['attributes']=_[_0xd4f5('0x32')](_0x32d067[_0xd4f5('0x2e')],qs[_0xd4f5('0x34')](_0xb5dd60[_0xd4f5('0x33')][_0xd4f5('0x34')]));_0x2130e4[_0xd4f5('0x35')]=_0x2130e4[_0xd4f5('0x35')][_0xd4f5('0x36')]?_0x2130e4[_0xd4f5('0x35')]:_0x32d067['model'];if(_0xb5dd60['query'][_0xd4f5('0x37')]){_0x2130e4[_0xd4f5('0x38')]=[{'all':!![]}];}_0x2130e4=_[_0xd4f5('0x39')]({},_0x2130e4,_0xb5dd60[_0xd4f5('0x3a')]);return db[_0xd4f5('0x30')]['find'](_0x2130e4)[_0xd4f5('0x27')](handleEntityNotFound(_0x2134f2,null))[_0xd4f5('0x27')](respondWithResult(_0x2134f2,null))[_0xd4f5('0x3b')](handleError(_0x2134f2,null));};exports['create']=function(_0x23b0af,_0x31b9e6){return db[_0xd4f5('0x30')][_0xd4f5('0x3c')](_0x23b0af[_0xd4f5('0x3d')],{})[_0xd4f5('0x27')](respondWithResult(_0x31b9e6,0xc9))['catch'](handleError(_0x31b9e6,null));};exports['update']=function(_0x5555b8,_0x29f348){if(_0x5555b8[_0xd4f5('0x3d')]['id']){delete _0x5555b8['body']['id'];}return db[_0xd4f5('0x30')][_0xd4f5('0x3e')]({'where':{'id':_0x5555b8['params']['id']}})[_0xd4f5('0x27')](handleEntityNotFound(_0x29f348,null))[_0xd4f5('0x27')](saveUpdates(_0x5555b8['body'],null))['then'](respondWithResult(_0x29f348,null))[_0xd4f5('0x3b')](handleError(_0x29f348,null));};exports['destroy']=function(_0x172294,_0x3070bb){return db[_0xd4f5('0x30')][_0xd4f5('0x3e')]({'where':{'id':_0x172294[_0xd4f5('0x2d')]['id']}})[_0xd4f5('0x27')](handleEntityNotFound(_0x3070bb,null))[_0xd4f5('0x27')](removeEntity(_0x3070bb,null))[_0xd4f5('0x3b')](handleError(_0x3070bb,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index ef0ec46..63621aa 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 _0x18ab=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3074d3,_0x4c5358){var _0x54a5f1=function(_0x2b55ff){while(--_0x2b55ff){_0x3074d3['push'](_0x3074d3['shift']());}};_0x54a5f1(++_0x4c5358);}(_0x18ab,0x1e9));var _0xb18a=function(_0x4160cf,_0x32e272){_0x4160cf=_0x4160cf-0x0;var _0x3003cc=_0x18ab[_0x4160cf];return _0x3003cc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb18a('0x0'))(_0xb18a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb18a('0x2'));var fs=require('fs');var path=require(_0xb18a('0x3'));var rimraf=require(_0xb18a('0x4'));var config=require(_0xb18a('0x5'));var attributes=require(_0xb18a('0x6'));module[_0xb18a('0x7')]=function(_0x36ae0d,_0x38a308){return _0x36ae0d[_0xb18a('0x8')](_0xb18a('0x9'),attributes,{'tableName':_0xb18a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x279b=['./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x209552,_0x15dcbb){var _0x4198ea=function(_0x2ea322){while(--_0x2ea322){_0x209552['push'](_0x209552['shift']());}};_0x4198ea(++_0x15dcbb);}(_0x279b,0x1e5));var _0xb279=function(_0x38bd6e,_0x9d3bd8){_0x38bd6e=_0x38bd6e-0x0;var _0x3378ef=_0x279b[_0x38bd6e];return _0x3378ef;};'use strict';var _=require('lodash');var util=require(_0xb279('0x0'));var logger=require(_0xb279('0x1'))(_0xb279('0x2'));var moment=require(_0xb279('0x3'));var BPromise=require(_0xb279('0x4'));var rp=require(_0xb279('0x5'));var fs=require('fs');var path=require(_0xb279('0x6'));var rimraf=require(_0xb279('0x7'));var config=require(_0xb279('0x8'));var attributes=require(_0xb279('0x9'));module['exports']=function(_0x3794da,_0x293f01){return _0x3794da[_0xb279('0xa')](_0xb279('0xb'),attributes,{'tableName':_0xb279('0xc'),'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 b4e09b1..ee1e806 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 _0xe1ed=['error','code','ChatProactiveAction,\x20%s,\x20%s','info','result','message','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x167f09,_0x3af933){var _0x57494b=function(_0x4fc78d){while(--_0x4fc78d){_0x167f09['push'](_0x167f09['shift']());}};_0x57494b(++_0x3af933);}(_0xe1ed,0xbf));var _0xde1e=function(_0x390dfd,_0x444dcf){_0x390dfd=_0x390dfd-0x0;var _0x66c15d=_0xe1ed[_0x390dfd];return _0x66c15d;};'use strict';var _=require(_0xde1e('0x0'));var util=require(_0xde1e('0x1'));var moment=require('moment');var BPromise=require(_0xde1e('0x2'));var rs=require(_0xde1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xde1e('0x4'));var logger=require('../../config/logger')(_0xde1e('0x5'));var config=require(_0xde1e('0x6'));var jayson=require(_0xde1e('0x7'));var client=jayson[_0xde1e('0x8')][_0xde1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37856e,_0x411cdb,_0x4e5d83){return new BPromise(function(_0x386ab1,_0x4a6eeb){return client[_0xde1e('0xa')](_0x37856e,_0x4e5d83)[_0xde1e('0xb')](function(_0x42d3ef){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x411cdb,_0xde1e('0xc'));logger[_0xde1e('0xd')](_0xde1e('0xe'),_0x411cdb,'request\x20sent',JSON[_0xde1e('0xf')](_0x42d3ef));if(_0x42d3ef[_0xde1e('0x10')]){if(_0x42d3ef['error'][_0xde1e('0x11')]===0x1f4){logger[_0xde1e('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x411cdb,_0x42d3ef[_0xde1e('0x10')]['message']);return _0x4a6eeb(_0x42d3ef[_0xde1e('0x10')]['message']);}logger[_0xde1e('0x10')](_0xde1e('0x12'),_0x411cdb,_0x42d3ef[_0xde1e('0x10')]['message']);return _0x386ab1(_0x42d3ef[_0xde1e('0x10')]['message']);}else{logger[_0xde1e('0x13')](_0xde1e('0x12'),_0x411cdb,_0xde1e('0xc'));_0x386ab1(_0x42d3ef[_0xde1e('0x14')][_0xde1e('0x15')]);}})[_0xde1e('0x16')](function(_0x44b283){logger[_0xde1e('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x411cdb,_0x44b283);_0x4a6eeb(_0x44b283);});});}
\ No newline at end of file
+var _0xbbbc=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x46f17a,_0x4d72c8){var _0x580d30=function(_0x5e7781){while(--_0x5e7781){_0x46f17a['push'](_0x46f17a['shift']());}};_0x580d30(++_0x4d72c8);}(_0xbbbc,0xbe));var _0xcbbb=function(_0x125ca8,_0x2b9dc7){_0x125ca8=_0x125ca8-0x0;var _0x8c6d50=_0xbbbc[_0x125ca8];return _0x8c6d50;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbbb('0x6'));var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')][_0xcbbb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a9c5c,_0x2db391,_0x387a7a){return new BPromise(function(_0x14f6f4,_0x445175){return client[_0xcbbb('0xd')](_0x1a9c5c,_0x387a7a)[_0xcbbb('0xe')](function(_0x45421){logger[_0xcbbb('0xf')](_0xcbbb('0x10'),_0x2db391,_0xcbbb('0x11'));logger[_0xcbbb('0x12')](_0xcbbb('0x13'),_0x2db391,_0xcbbb('0x11'),JSON[_0xcbbb('0x14')](_0x45421));if(_0x45421['error']){if(_0x45421[_0xcbbb('0x15')][_0xcbbb('0x16')]===0x1f4){logger[_0xcbbb('0x15')](_0xcbbb('0x10'),_0x2db391,_0x45421[_0xcbbb('0x15')][_0xcbbb('0x17')]);return _0x445175(_0x45421[_0xcbbb('0x15')]['message']);}logger[_0xcbbb('0x15')](_0xcbbb('0x10'),_0x2db391,_0x45421['error'][_0xcbbb('0x17')]);return _0x14f6f4(_0x45421[_0xcbbb('0x15')]['message']);}else{logger[_0xcbbb('0xf')](_0xcbbb('0x10'),_0x2db391,_0xcbbb('0x11'));_0x14f6f4(_0x45421[_0xcbbb('0x18')][_0xcbbb('0x17')]);}})[_0xcbbb('0x19')](function(_0x2230c3){logger[_0xcbbb('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x2db391,_0x2230c3);_0x445175(_0x2230c3);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 341ae05..18911c0 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 _0x9957=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x57928b,_0x29a111){var _0x49aad6=function(_0x34a268){while(--_0x34a268){_0x57928b['push'](_0x57928b['shift']());}};_0x49aad6(++_0x29a111);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0xc')]);router[_0x7995('0xd')]('/',auth['isAuthenticated'](),controller[_0x7995('0xe')]);router[_0x7995('0xf')]('/:id',auth[_0x7995('0xb')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0x12')]);module[_0x7995('0x13')]=router;
\ No newline at end of file
+var _0x425d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x425d,0x1e0));var _0xd425=function(_0x2051dd,_0x149c46){_0x2051dd=_0x2051dd-0x0;var _0x25770c=_0x425d[_0x2051dd];return _0x25770c;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0xc')]);router[_0xd425('0xd')]('/',auth['isAuthenticated'](),controller[_0xd425('0xe')]);router[_0xd425('0xf')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x10')]);router[_0xd425('0x11')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x12')]);module[_0xd425('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 3c02c77..e350868 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 _0xe0ce=['rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0xc35659,_0x218468){var _0x4d8a54=function(_0x2b8eab){while(--_0x2b8eab){_0xc35659['push'](_0xc35659['shift']());}};_0x4d8a54(++_0x218468);}(_0xe0ce,0x117));var _0xee0c=function(_0xf5eaa0,_0x5bfa29){_0xf5eaa0=_0xf5eaa0-0x0;var _0x47039e=_0xe0ce[_0xf5eaa0];return _0x47039e;};'use strict';var Sequelize=require('sequelize');module[_0xee0c('0x0')]={'name':{'type':Sequelize[_0xee0c('0x1')],'unique':_0xee0c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xee0c('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xee0c('0x3'),_0xee0c('0x4'),_0xee0c('0x5'))}};
\ No newline at end of file
+var _0x6c70=['INTEGER','roundrobin','sequelize','exports','STRING','name'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x6c70,0x1e2));var _0x06c7=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x6c70[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require(_0x06c7('0x0'));module[_0x06c7('0x1')]={'name':{'type':Sequelize[_0x06c7('0x2')],'unique':_0x06c7('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x06c7('0x2')]},'timeout':{'type':Sequelize[_0x06c7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x06c7('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 5d87cda..948bbe7 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 _0x62c1=['redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','index','map','ChatQueue','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','order','sort','where','filters','pick','merge','filter','options','include','findAll','rows','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','ids','online','voicePause','interface','Agents','sequelize','transaction','addTeams','each','findOrCreate','emit','userChatQueue:save','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','userChatQueue:remove','addAgents','omit','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults'];(function(_0x5d5906,_0xd14700){var _0x2b18b3=function(_0x4df84b){while(--_0x4df84b){_0x5d5906['push'](_0x5d5906['shift']());}};_0x2b18b3(++_0xd14700);}(_0x62c1,0x7a));var _0x162c=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x62c1[_0x258fb0];return _0x4d1afe;};'use strict';var emlformat=require(_0x162c('0x0'));var rimraf=require(_0x162c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x162c('0x2'));var rp=require(_0x162c('0x3'));var moment=require(_0x162c('0x4'));var BPromise=require(_0x162c('0x5'));var Mustache=require(_0x162c('0x6'));var util=require('util');var path=require(_0x162c('0x7'));var sox=require('sox');var csv=require(_0x162c('0x8'));var ejs=require(_0x162c('0x9'));var fs=require('fs');var fs_extra=require(_0x162c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x162c('0xb'));var jsforce=require(_0x162c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x162c('0x8'));var querystring=require(_0x162c('0xd'));var Papa=require(_0x162c('0xe'));var Redis=require(_0x162c('0xf'));var authService=require(_0x162c('0x10'));var qs=require(_0x162c('0x11'));var as=require(_0x162c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x162c('0x13'))(_0x162c('0x14'));var utils=require(_0x162c('0x15'));var config=require(_0x162c('0x16'));var licenseUtil=require(_0x162c('0x17'));var db=require(_0x162c('0x18'))['db'];config['redis']=_[_0x162c('0x19')](config[_0x162c('0x1a')],{'host':_0x162c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x162c('0x1c'))[_0x162c('0x1d')](socket);var jayson=require(_0x162c('0x1e'));var client=jayson[_0x162c('0x1f')][_0x162c('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x867361,_0x55342c,_0x393fd9,_0x1b6ab3){return new BPromise(function(_0x30d006,_0xbc51ec){var _0x26769b=_0x1b6ab3||client;return _0x26769b[_0x162c('0x21')](_0x867361,_0x393fd9)[_0x162c('0x22')](function(_0x337795){logger[_0x162c('0x23')]('ChatQueue,\x20%s,\x20%s',_0x55342c,_0x162c('0x24'));logger[_0x162c('0x25')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x55342c,_0x162c('0x24'),JSON[_0x162c('0x26')](_0x337795));if(_0x337795[_0x162c('0x27')]){if(_0x337795[_0x162c('0x27')][_0x162c('0x28')]===0x1f4){logger[_0x162c('0x27')](_0x162c('0x29'),_0x55342c,_0x337795[_0x162c('0x27')][_0x162c('0x2a')]);return _0xbc51ec(_0x337795[_0x162c('0x27')][_0x162c('0x2a')]);}logger[_0x162c('0x27')](_0x162c('0x29'),_0x55342c,_0x337795['error'][_0x162c('0x2a')]);return _0x30d006(_0x337795['error']['message']);}else{logger[_0x162c('0x23')](_0x162c('0x29'),_0x55342c,_0x162c('0x24'));_0x30d006(_0x337795[_0x162c('0x2b')][_0x162c('0x2a')]);}})[_0x162c('0x2c')](function(_0x5c71c1){logger[_0x162c('0x27')](_0x162c('0x29'),_0x55342c,_0x5c71c1);_0xbc51ec(_0x5c71c1);});});}function respondWithStatusCode(_0x46e899,_0x44111d){_0x44111d=_0x44111d||0xcc;return function(_0x4ec605){if(_0x4ec605){return _0x46e899[_0x162c('0x2d')](_0x44111d);}return _0x46e899[_0x162c('0x2e')](_0x44111d)[_0x162c('0x2f')]();};}function respondWithResult(_0x436acf,_0x55daa8){_0x55daa8=_0x55daa8||0xc8;return function(_0x3771a1){if(_0x3771a1){return _0x436acf['status'](_0x55daa8)[_0x162c('0x30')](_0x3771a1);}};}function respondWithFilteredResult(_0x20ec49,_0x103bb6){return function(_0x19c9a8){if(_0x19c9a8){var _0x41c6db=typeof _0x103bb6[_0x162c('0x31')]===_0x162c('0x32')&&typeof _0x103bb6[_0x162c('0x33')]===_0x162c('0x32');var _0x2bc6c7=_0x19c9a8[_0x162c('0x34')];var _0x2169b8=_0x41c6db?0x0:_0x103bb6[_0x162c('0x31')];var _0x28935d=_0x41c6db?_0x19c9a8[_0x162c('0x34')]:_0x103bb6['offset']+_0x103bb6[_0x162c('0x33')];var _0x18b932;if(_0x28935d>=_0x2bc6c7){_0x28935d=_0x2bc6c7;_0x18b932=0xc8;}else{_0x18b932=0xce;}_0x20ec49[_0x162c('0x2e')](_0x18b932);return _0x20ec49['set'](_0x162c('0x35'),_0x2169b8+'-'+_0x28935d+'/'+_0x2bc6c7)[_0x162c('0x30')](_0x19c9a8);}return null;};}function patchUpdates(_0x1da71e){return function(_0x4ec636){try{jsonpatch[_0x162c('0x36')](_0x4ec636,_0x1da71e,!![]);}catch(_0x5ad36d){return BPromise[_0x162c('0x37')](_0x5ad36d);}return _0x4ec636[_0x162c('0x38')]();};}function saveUpdates(_0x2fab44,_0x3a7b96){return function(_0x30c9e5){if(_0x30c9e5){return _0x30c9e5[_0x162c('0x39')](_0x2fab44)[_0x162c('0x22')](function(_0x3d47f6){return _0x3d47f6;});}return null;};}function removeEntity(_0x1e463d,_0x3918e3){return function(_0x18e4a0){if(_0x18e4a0){return _0x18e4a0[_0x162c('0x3a')]()[_0x162c('0x22')](function(){var _0x2e9572=_0x18e4a0[_0x162c('0x3b')]({'plain':!![]});var _0x5369b8='ChatQueues';return db[_0x162c('0x3c')][_0x162c('0x3a')]({'where':{'type':_0x5369b8,'resourceId':_0x2e9572['id']}})[_0x162c('0x22')](function(){return _0x18e4a0;});})['then'](function(){_0x1e463d[_0x162c('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e3cf5,_0x406f97){return function(_0x2aa80d){if(!_0x2aa80d){_0x1e3cf5[_0x162c('0x2d')](0x194);}return _0x2aa80d;};}function handleError(_0x73d7ed,_0x465516){_0x465516=_0x465516||0x1f4;return function(_0x3d3002){logger[_0x162c('0x27')](_0x3d3002[_0x162c('0x3d')]);if(_0x3d3002[_0x162c('0x3e')]){delete _0x3d3002['name'];}_0x73d7ed['status'](_0x465516)['send'](_0x3d3002);};}exports[_0x162c('0x3f')]=function(_0xf89440,_0x45a1c9){var _0x1136fd={},_0x5d2fe6={},_0x195387={'count':0x0,'rows':[]};var _0x2d4d6c=_[_0x162c('0x40')](db[_0x162c('0x41')][_0x162c('0x42')],function(_0x12052d){return{'name':_0x12052d[_0x162c('0x43')],'type':_0x12052d['type'][_0x162c('0x44')]};});_0x5d2fe6[_0x162c('0x45')]=_[_0x162c('0x40')](_0x2d4d6c,_0x162c('0x3e'));_0x5d2fe6['query']=_[_0x162c('0x46')](_0xf89440[_0x162c('0x47')]);_0x5d2fe6['filters']=_[_0x162c('0x48')](_0x5d2fe6[_0x162c('0x45')],_0x5d2fe6[_0x162c('0x47')]);_0x1136fd['attributes']=_[_0x162c('0x48')](_0x5d2fe6[_0x162c('0x45')],qs[_0x162c('0x49')](_0xf89440[_0x162c('0x47')]['fields']));_0x1136fd['attributes']=_0x1136fd[_0x162c('0x4a')]['length']?_0x1136fd[_0x162c('0x4a')]:_0x5d2fe6['model'];if(!_0xf89440['query']['hasOwnProperty']('nolimit')){_0x1136fd[_0x162c('0x33')]=qs['limit'](_0xf89440['query'][_0x162c('0x33')]);_0x1136fd[_0x162c('0x31')]=qs[_0x162c('0x31')](_0xf89440[_0x162c('0x47')]['offset']);}_0x1136fd[_0x162c('0x4b')]=qs[_0x162c('0x4c')](_0xf89440[_0x162c('0x47')][_0x162c('0x4c')]);_0x1136fd[_0x162c('0x4d')]=qs[_0x162c('0x4e')](_[_0x162c('0x4f')](_0xf89440[_0x162c('0x47')],_0x5d2fe6[_0x162c('0x4e')]),_0x2d4d6c);if(_0xf89440['query']['filter']){_0x1136fd[_0x162c('0x4d')]=_[_0x162c('0x50')](_0x1136fd['where'],{'$or':_[_0x162c('0x40')](_0x2d4d6c,function(_0x5612be){if(_0x5612be['type']!=='VIRTUAL'){var _0x4fd9b3={};_0x4fd9b3[_0x5612be['name']]={'$like':'%'+_0xf89440[_0x162c('0x47')][_0x162c('0x51')]+'%'};return _0x4fd9b3;}})});}_0x1136fd=_['merge']({},_0x1136fd,_0xf89440[_0x162c('0x52')]);var _0x5b87f8={'where':_0x1136fd['where']};return db[_0x162c('0x41')][_0x162c('0x34')](_0x5b87f8)[_0x162c('0x22')](function(_0x4ef559){_0x195387['count']=_0x4ef559;if(_0xf89440[_0x162c('0x47')]['includeAll']){_0x1136fd[_0x162c('0x53')]=[{'all':!![]}];}return db['ChatQueue'][_0x162c('0x54')](_0x1136fd);})['then'](function(_0x2f8a86){_0x195387[_0x162c('0x55')]=_0x2f8a86;return _0x195387;})[_0x162c('0x22')](respondWithFilteredResult(_0x45a1c9,_0x1136fd))[_0x162c('0x2c')](handleError(_0x45a1c9,null));};exports[_0x162c('0x56')]=function(_0x247205,_0x5eef15){var _0x156dd={'raw':!![],'where':{'id':_0x247205[_0x162c('0x57')]['id']}},_0x33794f={};_0x33794f[_0x162c('0x45')]=_[_0x162c('0x46')](db[_0x162c('0x41')]['rawAttributes']);_0x33794f[_0x162c('0x47')]=_[_0x162c('0x46')](_0x247205[_0x162c('0x47')]);_0x33794f['filters']=_['intersection'](_0x33794f[_0x162c('0x45')],_0x33794f[_0x162c('0x47')]);_0x156dd[_0x162c('0x4a')]=_[_0x162c('0x48')](_0x33794f[_0x162c('0x45')],qs[_0x162c('0x49')](_0x247205['query'][_0x162c('0x49')]));_0x156dd['attributes']=_0x156dd[_0x162c('0x4a')][_0x162c('0x58')]?_0x156dd['attributes']:_0x33794f[_0x162c('0x45')];if(_0x247205[_0x162c('0x47')]['includeAll']){_0x156dd[_0x162c('0x53')]=[{'all':!![]}];}_0x156dd=_['merge']({},_0x156dd,_0x247205[_0x162c('0x52')]);return db[_0x162c('0x41')][_0x162c('0x59')](_0x156dd)[_0x162c('0x22')](handleEntityNotFound(_0x5eef15,null))['then'](respondWithResult(_0x5eef15,null))[_0x162c('0x2c')](handleError(_0x5eef15,null));};exports[_0x162c('0x5a')]=function(_0xa4fae9,_0x1ff947){return db['ChatQueue'][_0x162c('0x5a')](_0xa4fae9[_0x162c('0x5b')],{})['then'](function(_0x5e826e){var _0xcdd222=_0xa4fae9[_0x162c('0x5c')]['get']({'plain':!![]});if(!_0xcdd222)throw new Error(_0x162c('0x5d'));if(_0xcdd222['role']===_0x162c('0x5c')){var _0xf7cf6=_0x5e826e['get']({'plain':!![]});var _0x2f75b7='ChatQueues';return db['UserProfileSection']['find']({'where':{'name':_0x2f75b7,'userProfileId':_0xcdd222['userProfileId']},'raw':!![]})['then'](function(_0xbec8e7){if(_0xbec8e7&&_0xbec8e7[_0x162c('0x5e')]===0x0){return db[_0x162c('0x3c')][_0x162c('0x5a')]({'name':_0xf7cf6[_0x162c('0x3e')],'resourceId':_0xf7cf6['id'],'type':_0xbec8e7[_0x162c('0x3e')],'sectionId':_0xbec8e7['id']},{})[_0x162c('0x22')](function(){return _0x5e826e;});}else{return _0x5e826e;}})[_0x162c('0x2c')](function(_0x249d8c){logger['error'](_0x162c('0x5f'),_0x249d8c);throw _0x249d8c;});}return _0x5e826e;})[_0x162c('0x22')](respondWithResult(_0x1ff947,0xc9))['catch'](handleError(_0x1ff947,null));};exports['update']=function(_0x4791e6,_0x2c89c3){if(_0x4791e6['body']['id']){delete _0x4791e6[_0x162c('0x5b')]['id'];}return db[_0x162c('0x41')]['find']({'where':{'id':_0x4791e6[_0x162c('0x57')]['id']}})[_0x162c('0x22')](handleEntityNotFound(_0x2c89c3,null))[_0x162c('0x22')](saveUpdates(_0x4791e6[_0x162c('0x5b')],null))['then'](respondWithResult(_0x2c89c3,null))['catch'](handleError(_0x2c89c3,null));};exports['destroy']=function(_0x49e9b0,_0x4c0279){return db['ChatQueue']['find']({'where':{'id':_0x49e9b0[_0x162c('0x57')]['id']}})['then'](handleEntityNotFound(_0x4c0279,null))['then'](removeEntity(_0x4c0279,null))['catch'](handleError(_0x4c0279,null));};exports[_0x162c('0x60')]=function(_0x400e64,_0x58e583){return db['ChatQueue'][_0x162c('0x60')]()[_0x162c('0x22')](respondWithResult(_0x58e583,null))[_0x162c('0x2c')](handleError(_0x58e583,null));};exports[_0x162c('0x61')]=function(_0x7625,_0x374335,_0x342fcc){var _0x23ae56={'raw':!![],'where':{}},_0x4f3fa2={},_0x4e27e8;return db[_0x162c('0x41')][_0x162c('0x62')]({'where':{'id':_0x7625[_0x162c('0x57')]['id']}})[_0x162c('0x22')](handleEntityNotFound(_0x374335,null))[_0x162c('0x22')](function(_0x56c560){if(_0x56c560){_0x4e27e8=_0x56c560[_0x162c('0x3b')]({'plain':!![]});_0x4f3fa2[_0x162c('0x45')]=_[_0x162c('0x46')](db[_0x162c('0x63')][_0x162c('0x42')]);_0x4f3fa2['query']=_[_0x162c('0x46')](_0x7625[_0x162c('0x47')]);_0x4f3fa2[_0x162c('0x4e')]=_[_0x162c('0x48')](_0x4f3fa2[_0x162c('0x45')],_0x4f3fa2[_0x162c('0x47')]);_0x23ae56[_0x162c('0x4a')]=_[_0x162c('0x48')](_0x4f3fa2['model'],qs['fields'](_0x7625['query'][_0x162c('0x49')]));_0x23ae56[_0x162c('0x4a')]=_0x23ae56[_0x162c('0x4a')]['length']?_0x23ae56['attributes']:_0x4f3fa2['model'];if(!_0x7625['query'][_0x162c('0x64')](_0x162c('0x65'))){_0x23ae56['limit']=qs['limit'](_0x7625['query'][_0x162c('0x33')]);_0x23ae56[_0x162c('0x31')]=qs[_0x162c('0x31')](_0x7625['query'][_0x162c('0x31')]);}_0x23ae56['order']=qs[_0x162c('0x4c')](_0x7625[_0x162c('0x47')][_0x162c('0x4c')]);_0x23ae56[_0x162c('0x4d')]=qs['filters'](_['pick'](_0x7625['query'],_0x4f3fa2[_0x162c('0x4e')]));_0x23ae56['where'][_0x162c('0x66')]=_0x56c560['id'];if(_0x7625['query'][_0x162c('0x51')]){_0x23ae56[_0x162c('0x4d')]=_[_0x162c('0x50')](_0x23ae56[_0x162c('0x4d')],{'$or':_[_0x162c('0x40')](_0x23ae56['attributes'],function(_0x26fbde){var _0x5097e6={};_0x5097e6[_0x26fbde]={'$like':'%'+_0x7625[_0x162c('0x47')][_0x162c('0x51')]+'%'};return _0x5097e6;})});}_0x23ae56=_[_0x162c('0x50')]({},_0x23ae56,_0x7625[_0x162c('0x52')]);return db[_0x162c('0x63')][_0x162c('0x54')](_0x23ae56);}})[_0x162c('0x22')](function(_0x5c46b8){if(_0x5c46b8){return db['User'][_0x162c('0x67')]({'where':{'id':_[_0x162c('0x40')](_0x5c46b8,_0x162c('0x68')),'role':_0x162c('0x69')},'attributes':['id','name',_0x162c('0x6a'),_0x162c('0x6b'),'createdAt']});}})['then'](function(_0x523580){if(_0x523580){return{'count':_0x523580[_0x162c('0x34')],'rows':_[_0x162c('0x40')](_0x523580['rows'],function(_0x21c511){return{'membername':_0x21c511['name'],'UserId':_0x21c511['id'],'queue_name':_0x4e27e8['name'],'ChatQueueId':_0x4e27e8['id'],'interface':util['format'](_0x162c('0x6c'),_0x162c('0x6d'),_0x21c511['name']),'penalty':0x0,'paused':_0x21c511[_0x162c('0x6a')],'createdAt':_0x21c511[_0x162c('0x6e')],'updatedAt':_0x21c511['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x162c('0x22')](respondWithFilteredResult(_0x374335,_0x23ae56))[_0x162c('0x2c')](handleError(_0x374335,null));};exports[_0x162c('0x6f')]=function(_0x9fb481,_0x1c4122,_0x285aa1){var _0x150862={};var _0x1c8d67={};var _0x19e652;var _0x223d77;return db[_0x162c('0x41')][_0x162c('0x62')]({'where':{'id':_0x9fb481[_0x162c('0x57')]['id']}})[_0x162c('0x22')](handleEntityNotFound(_0x1c4122,null))[_0x162c('0x22')](function(_0x4ef53c){if(_0x4ef53c){_0x19e652=_0x4ef53c;_0x1c8d67[_0x162c('0x45')]=_[_0x162c('0x46')](db[_0x162c('0x70')][_0x162c('0x42')]);_0x1c8d67['query']=_[_0x162c('0x46')](_0x9fb481['query']);_0x1c8d67[_0x162c('0x4e')]=_[_0x162c('0x48')](_0x1c8d67[_0x162c('0x45')],_0x1c8d67[_0x162c('0x47')]);_0x150862[_0x162c('0x4a')]=_['intersection'](_0x1c8d67['model'],qs['fields'](_0x9fb481['query'][_0x162c('0x49')]));_0x150862[_0x162c('0x4a')]=_0x150862[_0x162c('0x4a')]['length']?_0x150862['attributes']:_0x1c8d67['model'];_0x150862[_0x162c('0x4b')]=qs[_0x162c('0x4c')](_0x9fb481[_0x162c('0x47')][_0x162c('0x4c')]);_0x150862[_0x162c('0x4d')]=qs['filters'](_[_0x162c('0x4f')](_0x9fb481['query'],_0x1c8d67['filters']));if(_0x9fb481[_0x162c('0x47')][_0x162c('0x51')]){_0x150862[_0x162c('0x4d')]=_['merge'](_0x150862['where'],{'$or':_['map'](_0x150862[_0x162c('0x4a')],function(_0x3a0a66){var _0x1eaa44={};_0x1eaa44[_0x3a0a66]={'$like':'%'+_0x9fb481[_0x162c('0x47')][_0x162c('0x51')]+'%'};return _0x1eaa44;})});}_0x150862=_[_0x162c('0x50')]({},_0x150862,_0x9fb481[_0x162c('0x52')]);return _0x19e652[_0x162c('0x6f')](_0x150862);}})[_0x162c('0x22')](function(_0xbd6d25){if(_0xbd6d25){_0x223d77=_0xbd6d25['length'];if(!_0x9fb481[_0x162c('0x47')][_0x162c('0x64')](_0x162c('0x65'))){_0x150862[_0x162c('0x33')]=qs[_0x162c('0x33')](_0x9fb481[_0x162c('0x47')][_0x162c('0x33')]);_0x150862[_0x162c('0x31')]=qs[_0x162c('0x31')](_0x9fb481[_0x162c('0x47')][_0x162c('0x31')]);}return _0x19e652[_0x162c('0x6f')](_0x150862);}})[_0x162c('0x22')](function(_0x55badd){if(_0x55badd){return _0x55badd?{'count':_0x223d77,'rows':_0x55badd}:null;}})[_0x162c('0x22')](respondWithResult(_0x1c4122,null))[_0x162c('0x2c')](handleError(_0x1c4122,null));};exports['addTeams']=function(_0x3e5880,_0x212907,_0x4b8acf){var _0x2b48f1=_0x3e5880[_0x162c('0x5b')][_0x162c('0x71')];return db[_0x162c('0x70')][_0x162c('0x54')]({'where':{'id':_0x2b48f1},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x162c('0x3e'),_0x162c('0x72'),_0x162c('0x73'),_0x162c('0x74')],'raw':!![]}]})[_0x162c('0x22')](function(_0x11889b){if(_0x11889b){var _0x521735=_['flatMap'](_0x11889b,function(_0x34fb08){var _0x3ed6cc=_0x34fb08['get']({'plain':!![]});return _0x3ed6cc[_0x162c('0x75')];});return db[_0x162c('0x41')][_0x162c('0x59')]({'where':{'id':_0x3e5880[_0x162c('0x57')]['id']}})[_0x162c('0x22')](function(_0x2eee53){return db[_0x162c('0x76')][_0x162c('0x77')](function(_0x2e95af){return _0x2eee53[_0x162c('0x78')](_0x2b48f1,{'transaction':_0x2e95af})[_0x162c('0x22')](function(){return BPromise[_0x162c('0x79')](_0x521735,function(_0x17e359){return db[_0x162c('0x63')][_0x162c('0x7a')]({'where':{'UserId':_0x17e359['id'],'ChatQueueId':_0x3e5880[_0x162c('0x57')]['id']},'transaction':_0x2e95af});});})[_0x162c('0x22')](function(){_0x521735['forEach'](function(_0x3b279){socket[_0x162c('0x7b')](_0x162c('0x7c'),{'UserId':_0x3b279['id'],'ChatQueueId':_0x2eee53['id']});});});});});}})[_0x162c('0x22')](respondWithStatusCode(_0x212907,null))[_0x162c('0x2c')](handleError(_0x212907,null));};exports['removeTeams']=function(_0x526c5e,_0x5e16e7,_0xbe79c7){return db[_0x162c('0x70')][_0x162c('0x54')]({'where':{'id':_0x526c5e[_0x162c('0x47')][_0x162c('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x162c('0x22')](handleEntityNotFound(_0x5e16e7,null))[_0x162c('0x22')](function(_0x46a25){var _0x79cc03=_[_0x162c('0x40')](_0x46a25,'id');var _0x8d1642=[];var _0x594955=[];var _0x34db8b=squel[_0x162c('0x7d')]();_0x34db8b[_0x162c('0x7e')](_0x162c('0x7f'))['from']('team_has_chat_queues','tq')[_0x162c('0x80')](_0x162c('0x81'),'ut',_0x162c('0x82'))[_0x162c('0x4d')](_0x162c('0x83'),_0x526c5e[_0x162c('0x57')]['id']);for(var _0xdf8896=0x0;_0xdf8896<_0x46a25['length'];_0xdf8896+=0x1){let _0x393c5a=_0x46a25[_0xdf8896];for(var _0xca643=0x0;_0xca643<_0x393c5a[_0x162c('0x75')][_0x162c('0x58')];_0xca643+=0x1){let _0x4d44be=_0x393c5a[_0x162c('0x75')][_0xca643];var _0x1c9152=_0x34db8b[_0x162c('0x84')]();_0x1c9152[_0x162c('0x4d')](_0x162c('0x85'),_0x4d44be['id']);_0x594955['push'](db[_0x162c('0x76')][_0x162c('0x47')](_0x1c9152[_0x162c('0x86')](),{'type':db[_0x162c('0x76')]['QueryTypes']['SELECT']})[_0x162c('0x22')](function(_0x4be70a){if(_0x4be70a['length']===0x1){return _0x4d44be['id'];}else{var _0x48b7e2=_[_0x162c('0x87')](_[_0x162c('0x40')](_0x4be70a,_0x162c('0x88')),function(_0x2ab7f7){return _[_0x162c('0x89')](_0x79cc03,_0x2ab7f7);});if(_0x48b7e2){return _0x4d44be['id'];}}}));}}return BPromise[_0x162c('0x8a')](_0x594955)[_0x162c('0x22')](function(_0x431ee1){_0x8d1642=_(_0x8d1642)['union'](_0x431ee1)[_0x162c('0x8b')]()[_0x162c('0x8c')]();return db[_0x162c('0x41')][_0x162c('0x59')]({'where':{'id':_0x526c5e[_0x162c('0x57')]['id']}})[_0x162c('0x22')](function(_0x425d9f){return db['sequelize'][_0x162c('0x77')](function(_0x35aa9c){return _0x425d9f[_0x162c('0x8d')](_0x526c5e['query'][_0x162c('0x71')],{'transaction':_0x35aa9c})['then'](function(){if(!_[_0x162c('0x8e')](_0x8d1642)){return _0x425d9f['removeAgents'](_0x8d1642,{'transaction':_0x35aa9c});}})[_0x162c('0x22')](function(){_0x8d1642['forEach'](function(_0x294111){socket[_0x162c('0x7b')](_0x162c('0x8f'),{'UserId':_0x294111,'ChatQueueId':_0x425d9f['id']});});});});});});})[_0x162c('0x22')](respondWithStatusCode(_0x5e16e7,null))[_0x162c('0x2c')](handleError(_0x5e16e7,null));};exports[_0x162c('0x90')]=function(_0x48bb6a,_0x2b1db5,_0x2356af){return db[_0x162c('0x41')][_0x162c('0x59')]({'where':{'id':_0x48bb6a[_0x162c('0x57')]['id']}})['then'](handleEntityNotFound(_0x2b1db5,null))[_0x162c('0x22')](function(_0x16d526){if(_0x16d526){return _0x16d526['addAgents'](_0x48bb6a[_0x162c('0x5b')]['ids'],_[_0x162c('0x91')](_0x48bb6a[_0x162c('0x5b')],[_0x162c('0x71'),'id'])||{})['spread'](function(_0x276fb1){for(var _0x4505f6=0x0;_0x4505f6<_0x48bb6a[_0x162c('0x5b')][_0x162c('0x71')][_0x162c('0x58')];_0x4505f6+=0x1){socket[_0x162c('0x7b')](_0x162c('0x7c'),{'UserId':Number(_0x48bb6a['body'][_0x162c('0x71')][_0x4505f6]),'ChatQueueId':Number(_0x48bb6a['params']['id'])});}return _0x276fb1;});}})[_0x162c('0x22')](respondWithResult(_0x2b1db5,null))['catch'](handleError(_0x2b1db5,null));};exports[_0x162c('0x92')]=function(_0x4dd338,_0x491da2,_0x3592c5){return db[_0x162c('0x41')][_0x162c('0x59')]({'where':{'id':_0x4dd338['params']['id']}})['then'](handleEntityNotFound(_0x491da2,null))[_0x162c('0x22')](function(_0x22677b){if(_0x22677b){return _0x22677b['removeAgents'](_0x4dd338[_0x162c('0x47')]['ids'])['then'](function(){if(_['isArray'](_0x4dd338[_0x162c('0x47')][_0x162c('0x71')])){for(var _0x30b867=0x0;_0x30b867<_0x4dd338[_0x162c('0x47')][_0x162c('0x71')]['length'];_0x30b867+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x4dd338[_0x162c('0x47')][_0x162c('0x71')][_0x30b867]),'ChatQueueId':Number(_0x4dd338[_0x162c('0x57')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x4dd338['query'][_0x162c('0x71')]),'ChatQueueId':Number(_0x4dd338[_0x162c('0x57')]['id'])});}});}})[_0x162c('0x22')](respondWithStatusCode(_0x491da2,null))[_0x162c('0x2c')](handleError(_0x491da2,null));};exports[_0x162c('0x93')]=function(_0x4efaf8,_0xd8ddcd,_0x34258b){var _0x5be7f1={};var _0x41d2ca={};var _0x4ffd26;var _0x24abe6;return db[_0x162c('0x41')]['findOne']({'where':{'id':_0x4efaf8[_0x162c('0x57')]['id']}})[_0x162c('0x22')](handleEntityNotFound(_0xd8ddcd,null))[_0x162c('0x22')](function(_0x38572d){if(_0x38572d){_0x4ffd26=_0x38572d;_0x41d2ca['model']=_[_0x162c('0x46')](db['User']['rawAttributes']);_0x41d2ca[_0x162c('0x47')]=_['keys'](_0x4efaf8[_0x162c('0x47')]);_0x41d2ca[_0x162c('0x4e')]=_['intersection'](_0x41d2ca[_0x162c('0x45')],_0x41d2ca[_0x162c('0x47')]);_0x5be7f1[_0x162c('0x4a')]=_['intersection'](_0x41d2ca[_0x162c('0x45')],qs[_0x162c('0x49')](_0x4efaf8[_0x162c('0x47')]['fields']));_0x5be7f1[_0x162c('0x4a')]=_0x5be7f1['attributes'][_0x162c('0x58')]?_0x5be7f1[_0x162c('0x4a')]:_0x41d2ca['model'];_0x5be7f1[_0x162c('0x4b')]=qs[_0x162c('0x4c')](_0x4efaf8['query']['sort']);_0x5be7f1[_0x162c('0x4d')]=qs[_0x162c('0x4e')](_[_0x162c('0x4f')](_0x4efaf8[_0x162c('0x47')],_0x41d2ca['filters']));if(_0x4efaf8[_0x162c('0x47')][_0x162c('0x51')]){_0x5be7f1['where']=_[_0x162c('0x50')](_0x5be7f1[_0x162c('0x4d')],{'$or':_[_0x162c('0x40')](_0x5be7f1[_0x162c('0x4a')],function(_0x2550da){var _0x51da19={};_0x51da19[_0x2550da]={'$like':'%'+_0x4efaf8[_0x162c('0x47')][_0x162c('0x51')]+'%'};return _0x51da19;})});}_0x5be7f1=_[_0x162c('0x50')]({},_0x5be7f1,_0x4efaf8[_0x162c('0x52')]);return _0x4ffd26['getAgents'](_0x5be7f1);}})[_0x162c('0x22')](function(_0x568577){if(_0x568577){_0x24abe6=_0x568577[_0x162c('0x58')];if(!_0x4efaf8[_0x162c('0x47')]['hasOwnProperty'](_0x162c('0x65'))){_0x5be7f1[_0x162c('0x33')]=qs['limit'](_0x4efaf8[_0x162c('0x47')]['limit']);_0x5be7f1[_0x162c('0x31')]=qs['offset'](_0x4efaf8[_0x162c('0x47')]['offset']);}return _0x4ffd26[_0x162c('0x93')](_0x5be7f1);}})[_0x162c('0x22')](function(_0x584c4d){if(_0x584c4d){return _0x584c4d?{'count':_0x24abe6,'rows':_0x584c4d}:null;}})['then'](respondWithResult(_0xd8ddcd,null))['catch'](handleError(_0xd8ddcd,null));};
\ No newline at end of file
+var _0xe366=['Content-Range','reject','then','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','ChatQueue','findAll','show','params','fields','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','addAgents','omit','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x3b182d,_0x578149){var _0x5c647b=function(_0x1770a5){while(--_0x1770a5){_0x3b182d['push'](_0x3b182d['shift']());}};_0x5c647b(++_0x578149);}(_0xe366,0x68));var _0x6e36=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xe366[_0x387777];return _0x3f84c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e36('0x0'));var zipdir=require(_0x6e36('0x1'));var jsonpatch=require(_0x6e36('0x2'));var rp=require(_0x6e36('0x3'));var moment=require(_0x6e36('0x4'));var BPromise=require(_0x6e36('0x5'));var Mustache=require('mustache');var util=require(_0x6e36('0x6'));var path=require(_0x6e36('0x7'));var sox=require(_0x6e36('0x8'));var csv=require(_0x6e36('0x9'));var ejs=require(_0x6e36('0xa'));var fs=require('fs');var fs_extra=require(_0x6e36('0xb'));var _=require(_0x6e36('0xc'));var squel=require(_0x6e36('0xd'));var crypto=require(_0x6e36('0xe'));var jsforce=require(_0x6e36('0xf'));var deskjs=require(_0x6e36('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6e36('0x11'));var Redis=require('ioredis');var authService=require(_0x6e36('0x12'));var qs=require(_0x6e36('0x13'));var as=require(_0x6e36('0x14'));var hardwareService=require(_0x6e36('0x15'));var logger=require(_0x6e36('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6e36('0x17'));var db=require(_0x6e36('0x18'))['db'];config[_0x6e36('0x19')]=_[_0x6e36('0x1a')](config[_0x6e36('0x19')],{'host':_0x6e36('0x1b'),'port':0x18eb});var socket=require(_0x6e36('0x1c'))(new Redis(config[_0x6e36('0x19')]));require(_0x6e36('0x1d'))[_0x6e36('0x1e')](socket);var jayson=require(_0x6e36('0x1f'));var client=jayson['client'][_0x6e36('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x400134,_0x2a0ba7,_0x2c9662,_0x3369f8){return new BPromise(function(_0x149a49,_0x3a280b){var _0xa02789=_0x3369f8||client;return _0xa02789[_0x6e36('0x21')](_0x400134,_0x2c9662)['then'](function(_0x254d33){logger[_0x6e36('0x22')](_0x6e36('0x23'),_0x2a0ba7,_0x6e36('0x24'));logger[_0x6e36('0x25')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2a0ba7,_0x6e36('0x24'),JSON['stringify'](_0x254d33));if(_0x254d33[_0x6e36('0x26')]){if(_0x254d33[_0x6e36('0x26')]['code']===0x1f4){logger['error'](_0x6e36('0x23'),_0x2a0ba7,_0x254d33['error'][_0x6e36('0x27')]);return _0x3a280b(_0x254d33[_0x6e36('0x26')]['message']);}logger[_0x6e36('0x26')](_0x6e36('0x23'),_0x2a0ba7,_0x254d33[_0x6e36('0x26')]['message']);return _0x149a49(_0x254d33['error']['message']);}else{logger[_0x6e36('0x22')]('ChatQueue,\x20%s,\x20%s',_0x2a0ba7,_0x6e36('0x24'));_0x149a49(_0x254d33[_0x6e36('0x28')][_0x6e36('0x27')]);}})[_0x6e36('0x29')](function(_0x388f00){logger['error'](_0x6e36('0x23'),_0x2a0ba7,_0x388f00);_0x3a280b(_0x388f00);});});}function respondWithStatusCode(_0x4b4c83,_0x3c77ba){_0x3c77ba=_0x3c77ba||0xcc;return function(_0x5b7359){if(_0x5b7359){return _0x4b4c83[_0x6e36('0x2a')](_0x3c77ba);}return _0x4b4c83[_0x6e36('0x2b')](_0x3c77ba)[_0x6e36('0x2c')]();};}function respondWithResult(_0x3ad5d9,_0x5c1c74){_0x5c1c74=_0x5c1c74||0xc8;return function(_0xbe376b){if(_0xbe376b){return _0x3ad5d9[_0x6e36('0x2b')](_0x5c1c74)[_0x6e36('0x2d')](_0xbe376b);}};}function respondWithFilteredResult(_0x380f45,_0x5b1cc7){return function(_0x318a53){if(_0x318a53){var _0x292bb5=typeof _0x5b1cc7[_0x6e36('0x2e')]==='undefined'&&typeof _0x5b1cc7[_0x6e36('0x2f')]==='undefined';var _0x318745=_0x318a53[_0x6e36('0x30')];var _0x39b41c=_0x292bb5?0x0:_0x5b1cc7[_0x6e36('0x2e')];var _0x586809=_0x292bb5?_0x318a53[_0x6e36('0x30')]:_0x5b1cc7[_0x6e36('0x2e')]+_0x5b1cc7['limit'];var _0x36683a;if(_0x586809>=_0x318745){_0x586809=_0x318745;_0x36683a=0xc8;}else{_0x36683a=0xce;}_0x380f45[_0x6e36('0x2b')](_0x36683a);return _0x380f45[_0x6e36('0x31')](_0x6e36('0x32'),_0x39b41c+'-'+_0x586809+'/'+_0x318745)[_0x6e36('0x2d')](_0x318a53);}return null;};}function patchUpdates(_0x1004f9){return function(_0xfb4747){try{jsonpatch['apply'](_0xfb4747,_0x1004f9,!![]);}catch(_0xa23bf7){return BPromise[_0x6e36('0x33')](_0xa23bf7);}return _0xfb4747['save']();};}function saveUpdates(_0x817bbd,_0x1c888c){return function(_0xc70a8e){if(_0xc70a8e){return _0xc70a8e['update'](_0x817bbd)[_0x6e36('0x34')](function(_0x1a01c2){return _0x1a01c2;});}return null;};}function removeEntity(_0x294490,_0x43645f){return function(_0x1053f5){if(_0x1053f5){return _0x1053f5[_0x6e36('0x35')]()[_0x6e36('0x34')](function(){var _0x599a4a=_0x1053f5[_0x6e36('0x36')]({'plain':!![]});var _0x2b83c1=_0x6e36('0x37');return db[_0x6e36('0x38')][_0x6e36('0x35')]({'where':{'type':_0x2b83c1,'resourceId':_0x599a4a['id']}})[_0x6e36('0x34')](function(){return _0x1053f5;});})[_0x6e36('0x34')](function(){_0x294490[_0x6e36('0x2b')](0xcc)[_0x6e36('0x2c')]();});}};}function handleEntityNotFound(_0x410f20,_0x1b13a9){return function(_0x41a8f7){if(!_0x41a8f7){_0x410f20['sendStatus'](0x194);}return _0x41a8f7;};}function handleError(_0x47e389,_0x4462ba){_0x4462ba=_0x4462ba||0x1f4;return function(_0x15f66c){logger[_0x6e36('0x26')](_0x15f66c[_0x6e36('0x39')]);if(_0x15f66c[_0x6e36('0x3a')]){delete _0x15f66c[_0x6e36('0x3a')];}_0x47e389[_0x6e36('0x2b')](_0x4462ba)['send'](_0x15f66c);};}exports[_0x6e36('0x3b')]=function(_0x1313e9,_0x3790ef){var _0x37e19d={},_0x209cf1={},_0x410189={'count':0x0,'rows':[]};var _0x3139b9=_[_0x6e36('0x3c')](db['ChatQueue'][_0x6e36('0x3d')],function(_0x295eb5){return{'name':_0x295eb5[_0x6e36('0x3e')],'type':_0x295eb5[_0x6e36('0x3f')][_0x6e36('0x40')]};});_0x209cf1['model']=_['map'](_0x3139b9,'name');_0x209cf1[_0x6e36('0x41')]=_[_0x6e36('0x42')](_0x1313e9[_0x6e36('0x41')]);_0x209cf1[_0x6e36('0x43')]=_[_0x6e36('0x44')](_0x209cf1[_0x6e36('0x45')],_0x209cf1['query']);_0x37e19d[_0x6e36('0x46')]=_[_0x6e36('0x44')](_0x209cf1['model'],qs['fields'](_0x1313e9['query']['fields']));_0x37e19d[_0x6e36('0x46')]=_0x37e19d[_0x6e36('0x46')][_0x6e36('0x47')]?_0x37e19d[_0x6e36('0x46')]:_0x209cf1[_0x6e36('0x45')];if(!_0x1313e9['query']['hasOwnProperty'](_0x6e36('0x48'))){_0x37e19d['limit']=qs['limit'](_0x1313e9['query'][_0x6e36('0x2f')]);_0x37e19d[_0x6e36('0x2e')]=qs['offset'](_0x1313e9['query'][_0x6e36('0x2e')]);}_0x37e19d[_0x6e36('0x49')]=qs['sort'](_0x1313e9['query'][_0x6e36('0x4a')]);_0x37e19d[_0x6e36('0x4b')]=qs[_0x6e36('0x43')](_[_0x6e36('0x4c')](_0x1313e9[_0x6e36('0x41')],_0x209cf1['filters']),_0x3139b9);if(_0x1313e9[_0x6e36('0x41')][_0x6e36('0x4d')]){_0x37e19d[_0x6e36('0x4b')]=_['merge'](_0x37e19d[_0x6e36('0x4b')],{'$or':_[_0x6e36('0x3c')](_0x3139b9,function(_0xdf06f6){if(_0xdf06f6[_0x6e36('0x3f')]!==_0x6e36('0x4e')){var _0xa2b292={};_0xa2b292[_0xdf06f6['name']]={'$like':'%'+_0x1313e9['query'][_0x6e36('0x4d')]+'%'};return _0xa2b292;}})});}_0x37e19d=_[_0x6e36('0x4f')]({},_0x37e19d,_0x1313e9[_0x6e36('0x50')]);var _0x154589={'where':_0x37e19d['where']};return db['ChatQueue']['count'](_0x154589)[_0x6e36('0x34')](function(_0x3554cb){_0x410189[_0x6e36('0x30')]=_0x3554cb;if(_0x1313e9[_0x6e36('0x41')]['includeAll']){_0x37e19d['include']=[{'all':!![]}];}return db[_0x6e36('0x51')][_0x6e36('0x52')](_0x37e19d);})[_0x6e36('0x34')](function(_0x291686){_0x410189['rows']=_0x291686;return _0x410189;})['then'](respondWithFilteredResult(_0x3790ef,_0x37e19d))[_0x6e36('0x29')](handleError(_0x3790ef,null));};exports[_0x6e36('0x53')]=function(_0x3faac6,_0x4bb8ef){var _0x4268ea={'raw':!![],'where':{'id':_0x3faac6[_0x6e36('0x54')]['id']}},_0x389914={};_0x389914['model']=_[_0x6e36('0x42')](db[_0x6e36('0x51')][_0x6e36('0x3d')]);_0x389914['query']=_[_0x6e36('0x42')](_0x3faac6['query']);_0x389914[_0x6e36('0x43')]=_[_0x6e36('0x44')](_0x389914['model'],_0x389914[_0x6e36('0x41')]);_0x4268ea[_0x6e36('0x46')]=_[_0x6e36('0x44')](_0x389914['model'],qs[_0x6e36('0x55')](_0x3faac6['query']['fields']));_0x4268ea[_0x6e36('0x46')]=_0x4268ea[_0x6e36('0x46')][_0x6e36('0x47')]?_0x4268ea[_0x6e36('0x46')]:_0x389914[_0x6e36('0x45')];if(_0x3faac6['query'][_0x6e36('0x56')]){_0x4268ea[_0x6e36('0x57')]=[{'all':!![]}];}_0x4268ea=_[_0x6e36('0x4f')]({},_0x4268ea,_0x3faac6[_0x6e36('0x50')]);return db[_0x6e36('0x51')][_0x6e36('0x58')](_0x4268ea)['then'](handleEntityNotFound(_0x4bb8ef,null))[_0x6e36('0x34')](respondWithResult(_0x4bb8ef,null))[_0x6e36('0x29')](handleError(_0x4bb8ef,null));};exports['create']=function(_0x3e1577,_0x10d541){return db[_0x6e36('0x51')][_0x6e36('0x59')](_0x3e1577[_0x6e36('0x5a')],{})[_0x6e36('0x34')](function(_0x5d9933){var _0x363aa0=_0x3e1577[_0x6e36('0x5b')][_0x6e36('0x36')]({'plain':!![]});if(!_0x363aa0)throw new Error(_0x6e36('0x5c'));if(_0x363aa0[_0x6e36('0x5d')]==='user'){var _0x2e91ae=_0x5d9933[_0x6e36('0x36')]({'plain':!![]});var _0x208f37='ChatQueues';return db[_0x6e36('0x5e')][_0x6e36('0x58')]({'where':{'name':_0x208f37,'userProfileId':_0x363aa0['userProfileId']},'raw':!![]})[_0x6e36('0x34')](function(_0x55197b){if(_0x55197b&&_0x55197b[_0x6e36('0x5f')]===0x0){return db[_0x6e36('0x38')][_0x6e36('0x59')]({'name':_0x2e91ae[_0x6e36('0x3a')],'resourceId':_0x2e91ae['id'],'type':_0x55197b[_0x6e36('0x3a')],'sectionId':_0x55197b['id']},{})[_0x6e36('0x34')](function(){return _0x5d9933;});}else{return _0x5d9933;}})[_0x6e36('0x29')](function(_0x391580){logger['error'](_0x6e36('0x60'),_0x391580);throw _0x391580;});}return _0x5d9933;})[_0x6e36('0x34')](respondWithResult(_0x10d541,0xc9))[_0x6e36('0x29')](handleError(_0x10d541,null));};exports['update']=function(_0xecb530,_0x58a94b){if(_0xecb530[_0x6e36('0x5a')]['id']){delete _0xecb530[_0x6e36('0x5a')]['id'];}return db[_0x6e36('0x51')][_0x6e36('0x58')]({'where':{'id':_0xecb530[_0x6e36('0x54')]['id']}})['then'](handleEntityNotFound(_0x58a94b,null))[_0x6e36('0x34')](saveUpdates(_0xecb530['body'],null))[_0x6e36('0x34')](respondWithResult(_0x58a94b,null))['catch'](handleError(_0x58a94b,null));};exports['destroy']=function(_0x235e4f,_0x43dc54){return db[_0x6e36('0x51')][_0x6e36('0x58')]({'where':{'id':_0x235e4f[_0x6e36('0x54')]['id']}})[_0x6e36('0x34')](handleEntityNotFound(_0x43dc54,null))[_0x6e36('0x34')](removeEntity(_0x43dc54,null))[_0x6e36('0x29')](handleError(_0x43dc54,null));};exports[_0x6e36('0x61')]=function(_0x2c791a,_0x1c1b15){return db[_0x6e36('0x51')][_0x6e36('0x61')]()[_0x6e36('0x34')](respondWithResult(_0x1c1b15,null))[_0x6e36('0x29')](handleError(_0x1c1b15,null));};exports[_0x6e36('0x62')]=function(_0x4201cf,_0x36b5b1,_0x5bca92){var _0x16ab30={'raw':!![],'where':{}},_0xcfbb3b={},_0x33481d;return db[_0x6e36('0x51')][_0x6e36('0x63')]({'where':{'id':_0x4201cf[_0x6e36('0x54')]['id']}})[_0x6e36('0x34')](handleEntityNotFound(_0x36b5b1,null))[_0x6e36('0x34')](function(_0x35827c){if(_0x35827c){_0x33481d=_0x35827c[_0x6e36('0x36')]({'plain':!![]});_0xcfbb3b[_0x6e36('0x45')]=_[_0x6e36('0x42')](db[_0x6e36('0x64')][_0x6e36('0x3d')]);_0xcfbb3b[_0x6e36('0x41')]=_[_0x6e36('0x42')](_0x4201cf['query']);_0xcfbb3b[_0x6e36('0x43')]=_[_0x6e36('0x44')](_0xcfbb3b[_0x6e36('0x45')],_0xcfbb3b['query']);_0x16ab30[_0x6e36('0x46')]=_[_0x6e36('0x44')](_0xcfbb3b['model'],qs[_0x6e36('0x55')](_0x4201cf[_0x6e36('0x41')][_0x6e36('0x55')]));_0x16ab30['attributes']=_0x16ab30[_0x6e36('0x46')][_0x6e36('0x47')]?_0x16ab30['attributes']:_0xcfbb3b['model'];if(!_0x4201cf[_0x6e36('0x41')]['hasOwnProperty']('nolimit')){_0x16ab30[_0x6e36('0x2f')]=qs[_0x6e36('0x2f')](_0x4201cf['query'][_0x6e36('0x2f')]);_0x16ab30['offset']=qs[_0x6e36('0x2e')](_0x4201cf[_0x6e36('0x41')][_0x6e36('0x2e')]);}_0x16ab30['order']=qs[_0x6e36('0x4a')](_0x4201cf[_0x6e36('0x41')][_0x6e36('0x4a')]);_0x16ab30[_0x6e36('0x4b')]=qs['filters'](_[_0x6e36('0x4c')](_0x4201cf['query'],_0xcfbb3b['filters']));_0x16ab30[_0x6e36('0x4b')][_0x6e36('0x65')]=_0x35827c['id'];if(_0x4201cf[_0x6e36('0x41')][_0x6e36('0x4d')]){_0x16ab30[_0x6e36('0x4b')]=_[_0x6e36('0x4f')](_0x16ab30[_0x6e36('0x4b')],{'$or':_[_0x6e36('0x3c')](_0x16ab30['attributes'],function(_0x36b88b){var _0x5cb1c3={};_0x5cb1c3[_0x36b88b]={'$like':'%'+_0x4201cf[_0x6e36('0x41')][_0x6e36('0x4d')]+'%'};return _0x5cb1c3;})});}_0x16ab30=_[_0x6e36('0x4f')]({},_0x16ab30,_0x4201cf[_0x6e36('0x50')]);return db[_0x6e36('0x64')][_0x6e36('0x52')](_0x16ab30);}})['then'](function(_0x3882d0){if(_0x3882d0){return db[_0x6e36('0x66')][_0x6e36('0x67')]({'where':{'id':_[_0x6e36('0x3c')](_0x3882d0,_0x6e36('0x68')),'role':_0x6e36('0x69')},'attributes':['id',_0x6e36('0x3a'),'chatPause',_0x6e36('0x6a'),_0x6e36('0x6b')]});}})[_0x6e36('0x34')](function(_0x5b395d){if(_0x5b395d){return{'count':_0x5b395d[_0x6e36('0x30')],'rows':_[_0x6e36('0x3c')](_0x5b395d['rows'],function(_0x14c6f5){return{'membername':_0x14c6f5[_0x6e36('0x3a')],'UserId':_0x14c6f5['id'],'queue_name':_0x33481d[_0x6e36('0x3a')],'ChatQueueId':_0x33481d['id'],'interface':util[_0x6e36('0x6c')](_0x6e36('0x6d'),_0x6e36('0x6e'),_0x14c6f5[_0x6e36('0x3a')]),'penalty':0x0,'paused':_0x14c6f5[_0x6e36('0x6f')],'createdAt':_0x14c6f5[_0x6e36('0x6b')],'updatedAt':_0x14c6f5[_0x6e36('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x36b5b1,_0x16ab30))[_0x6e36('0x29')](handleError(_0x36b5b1,null));};exports['getTeams']=function(_0x5d9f1a,_0x499102,_0x553508){var _0x3fd886={};var _0x2de2a0={};var _0x12334b;var _0x37c172;return db['ChatQueue']['findOne']({'where':{'id':_0x5d9f1a['params']['id']}})[_0x6e36('0x34')](handleEntityNotFound(_0x499102,null))['then'](function(_0x28add1){if(_0x28add1){_0x12334b=_0x28add1;_0x2de2a0[_0x6e36('0x45')]=_[_0x6e36('0x42')](db[_0x6e36('0x70')][_0x6e36('0x3d')]);_0x2de2a0[_0x6e36('0x41')]=_['keys'](_0x5d9f1a[_0x6e36('0x41')]);_0x2de2a0[_0x6e36('0x43')]=_[_0x6e36('0x44')](_0x2de2a0[_0x6e36('0x45')],_0x2de2a0[_0x6e36('0x41')]);_0x3fd886[_0x6e36('0x46')]=_['intersection'](_0x2de2a0[_0x6e36('0x45')],qs['fields'](_0x5d9f1a['query'][_0x6e36('0x55')]));_0x3fd886[_0x6e36('0x46')]=_0x3fd886[_0x6e36('0x46')][_0x6e36('0x47')]?_0x3fd886['attributes']:_0x2de2a0['model'];_0x3fd886['order']=qs[_0x6e36('0x4a')](_0x5d9f1a['query']['sort']);_0x3fd886['where']=qs[_0x6e36('0x43')](_[_0x6e36('0x4c')](_0x5d9f1a[_0x6e36('0x41')],_0x2de2a0[_0x6e36('0x43')]));if(_0x5d9f1a['query'][_0x6e36('0x4d')]){_0x3fd886[_0x6e36('0x4b')]=_[_0x6e36('0x4f')](_0x3fd886[_0x6e36('0x4b')],{'$or':_[_0x6e36('0x3c')](_0x3fd886[_0x6e36('0x46')],function(_0x36ca52){var _0x1cde4a={};_0x1cde4a[_0x36ca52]={'$like':'%'+_0x5d9f1a[_0x6e36('0x41')]['filter']+'%'};return _0x1cde4a;})});}_0x3fd886=_[_0x6e36('0x4f')]({},_0x3fd886,_0x5d9f1a[_0x6e36('0x50')]);return _0x12334b[_0x6e36('0x71')](_0x3fd886);}})['then'](function(_0x3dbc56){if(_0x3dbc56){_0x37c172=_0x3dbc56['length'];if(!_0x5d9f1a[_0x6e36('0x41')]['hasOwnProperty'](_0x6e36('0x48'))){_0x3fd886['limit']=qs[_0x6e36('0x2f')](_0x5d9f1a[_0x6e36('0x41')][_0x6e36('0x2f')]);_0x3fd886[_0x6e36('0x2e')]=qs[_0x6e36('0x2e')](_0x5d9f1a[_0x6e36('0x41')][_0x6e36('0x2e')]);}return _0x12334b[_0x6e36('0x71')](_0x3fd886);}})['then'](function(_0xec7d00){if(_0xec7d00){return _0xec7d00?{'count':_0x37c172,'rows':_0xec7d00}:null;}})[_0x6e36('0x34')](respondWithResult(_0x499102,null))[_0x6e36('0x29')](handleError(_0x499102,null));};exports[_0x6e36('0x72')]=function(_0x4b4e05,_0x2e7f49,_0x470550){var _0x2347d6=_0x4b4e05['body'][_0x6e36('0x73')];return db[_0x6e36('0x70')][_0x6e36('0x52')]({'where':{'id':_0x2347d6},'attributes':['id'],'include':[{'model':db[_0x6e36('0x66')],'as':_0x6e36('0x74'),'attributes':['id',_0x6e36('0x3a'),_0x6e36('0x75'),_0x6e36('0x76'),_0x6e36('0x77')],'raw':!![]}]})['then'](function(_0x2f7a83){if(_0x2f7a83){var _0x5a2ba6=_['flatMap'](_0x2f7a83,function(_0x1bf826){var _0x25efae=_0x1bf826[_0x6e36('0x36')]({'plain':!![]});return _0x25efae[_0x6e36('0x74')];});return db[_0x6e36('0x51')][_0x6e36('0x58')]({'where':{'id':_0x4b4e05['params']['id']}})[_0x6e36('0x34')](function(_0x1c613d){return db['sequelize'][_0x6e36('0x78')](function(_0x59468b){return _0x1c613d[_0x6e36('0x72')](_0x2347d6,{'transaction':_0x59468b})[_0x6e36('0x34')](function(){return BPromise[_0x6e36('0x79')](_0x5a2ba6,function(_0x1165c6){return db[_0x6e36('0x64')][_0x6e36('0x7a')]({'where':{'UserId':_0x1165c6['id'],'ChatQueueId':_0x4b4e05[_0x6e36('0x54')]['id']},'transaction':_0x59468b});});})[_0x6e36('0x34')](function(){_0x5a2ba6[_0x6e36('0x7b')](function(_0x23d1fc){socket[_0x6e36('0x7c')](_0x6e36('0x7d'),{'UserId':_0x23d1fc['id'],'ChatQueueId':_0x1c613d['id']});});});});});}})[_0x6e36('0x34')](respondWithStatusCode(_0x2e7f49,null))['catch'](handleError(_0x2e7f49,null));};exports[_0x6e36('0x7e')]=function(_0x2d81fc,_0x28357e,_0xaee47a){return db['Team'][_0x6e36('0x52')]({'where':{'id':_0x2d81fc[_0x6e36('0x41')][_0x6e36('0x73')]},'attributes':['id'],'include':[{'model':db[_0x6e36('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x28357e,null))[_0x6e36('0x34')](function(_0x3aa1d8){var _0x1a0a14=_[_0x6e36('0x3c')](_0x3aa1d8,'id');var _0x41f9a5=[];var _0x1b24e1=[];var _0x5d4287=squel[_0x6e36('0x7f')]();_0x5d4287[_0x6e36('0x80')](_0x6e36('0x81'))[_0x6e36('0x82')](_0x6e36('0x83'),'tq')[_0x6e36('0x84')](_0x6e36('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6e36('0x4b')](_0x6e36('0x86'),_0x2d81fc['params']['id']);for(var _0x103229=0x0;_0x103229<_0x3aa1d8[_0x6e36('0x47')];_0x103229+=0x1){let _0x2bcab4=_0x3aa1d8[_0x103229];for(var _0x55c68d=0x0;_0x55c68d<_0x2bcab4['Agents'][_0x6e36('0x47')];_0x55c68d+=0x1){let _0xc12364=_0x2bcab4[_0x6e36('0x74')][_0x55c68d];var _0x113f1e=_0x5d4287['clone']();_0x113f1e[_0x6e36('0x4b')](_0x6e36('0x87'),_0xc12364['id']);_0x1b24e1[_0x6e36('0x88')](db['sequelize'][_0x6e36('0x41')](_0x113f1e[_0x6e36('0x89')](),{'type':db[_0x6e36('0x8a')][_0x6e36('0x8b')][_0x6e36('0x8c')]})[_0x6e36('0x34')](function(_0x2e8274){if(_0x2e8274[_0x6e36('0x47')]===0x1){return _0xc12364['id'];}else{var _0x31c69a=_[_0x6e36('0x8d')](_[_0x6e36('0x3c')](_0x2e8274,_0x6e36('0x8e')),function(_0x3786fd){return _[_0x6e36('0x8f')](_0x1a0a14,_0x3786fd);});if(_0x31c69a){return _0xc12364['id'];}}}));}}return BPromise[_0x6e36('0x90')](_0x1b24e1)['then'](function(_0x418b60){_0x41f9a5=_(_0x41f9a5)[_0x6e36('0x91')](_0x418b60)['compact']()[_0x6e36('0x92')]();return db[_0x6e36('0x51')][_0x6e36('0x58')]({'where':{'id':_0x2d81fc['params']['id']}})[_0x6e36('0x34')](function(_0x160656){return db[_0x6e36('0x8a')]['transaction'](function(_0x2970bc){return _0x160656['removeTeams'](_0x2d81fc[_0x6e36('0x41')]['ids'],{'transaction':_0x2970bc})[_0x6e36('0x34')](function(){if(!_[_0x6e36('0x93')](_0x41f9a5)){return _0x160656[_0x6e36('0x94')](_0x41f9a5,{'transaction':_0x2970bc});}})[_0x6e36('0x34')](function(){_0x41f9a5[_0x6e36('0x7b')](function(_0x5c3160){socket[_0x6e36('0x7c')]('userChatQueue:remove',{'UserId':_0x5c3160,'ChatQueueId':_0x160656['id']});});});});});});})[_0x6e36('0x34')](respondWithStatusCode(_0x28357e,null))[_0x6e36('0x29')](handleError(_0x28357e,null));};exports[_0x6e36('0x95')]=function(_0x292903,_0x317983,_0x3ccbab){return db[_0x6e36('0x51')][_0x6e36('0x58')]({'where':{'id':_0x292903[_0x6e36('0x54')]['id']}})[_0x6e36('0x34')](handleEntityNotFound(_0x317983,null))[_0x6e36('0x34')](function(_0x39d371){if(_0x39d371){return _0x39d371['addAgents'](_0x292903['body'][_0x6e36('0x73')],_[_0x6e36('0x96')](_0x292903[_0x6e36('0x5a')],[_0x6e36('0x73'),'id'])||{})['spread'](function(_0x4e5a3f){for(var _0x579b9e=0x0;_0x579b9e<_0x292903[_0x6e36('0x5a')][_0x6e36('0x73')][_0x6e36('0x47')];_0x579b9e+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x292903[_0x6e36('0x5a')]['ids'][_0x579b9e]),'ChatQueueId':Number(_0x292903[_0x6e36('0x54')]['id'])});}return _0x4e5a3f;});}})[_0x6e36('0x34')](respondWithResult(_0x317983,null))['catch'](handleError(_0x317983,null));};exports[_0x6e36('0x94')]=function(_0x3eb4b2,_0x148883,_0x19cd03){return db[_0x6e36('0x51')][_0x6e36('0x58')]({'where':{'id':_0x3eb4b2[_0x6e36('0x54')]['id']}})[_0x6e36('0x34')](handleEntityNotFound(_0x148883,null))[_0x6e36('0x34')](function(_0x34928d){if(_0x34928d){return _0x34928d[_0x6e36('0x94')](_0x3eb4b2['query'][_0x6e36('0x73')])[_0x6e36('0x34')](function(){if(_[_0x6e36('0x97')](_0x3eb4b2['query'][_0x6e36('0x73')])){for(var _0x51bad1=0x0;_0x51bad1<_0x3eb4b2['query'][_0x6e36('0x73')]['length'];_0x51bad1+=0x1){socket[_0x6e36('0x7c')](_0x6e36('0x98'),{'UserId':Number(_0x3eb4b2['query'][_0x6e36('0x73')][_0x51bad1]),'ChatQueueId':Number(_0x3eb4b2[_0x6e36('0x54')]['id'])});}}else{socket[_0x6e36('0x7c')](_0x6e36('0x98'),{'UserId':Number(_0x3eb4b2['query'][_0x6e36('0x73')]),'ChatQueueId':Number(_0x3eb4b2[_0x6e36('0x54')]['id'])});}});}})[_0x6e36('0x34')](respondWithStatusCode(_0x148883,null))[_0x6e36('0x29')](handleError(_0x148883,null));};exports[_0x6e36('0x99')]=function(_0x1dcec7,_0x5bc739,_0x6cb769){var _0x58208f={};var _0xe1b8c0={};var _0x2e9256;var _0x4c0de6;return db[_0x6e36('0x51')][_0x6e36('0x63')]({'where':{'id':_0x1dcec7['params']['id']}})[_0x6e36('0x34')](handleEntityNotFound(_0x5bc739,null))[_0x6e36('0x34')](function(_0x3a3824){if(_0x3a3824){_0x2e9256=_0x3a3824;_0xe1b8c0[_0x6e36('0x45')]=_[_0x6e36('0x42')](db['User'][_0x6e36('0x3d')]);_0xe1b8c0['query']=_[_0x6e36('0x42')](_0x1dcec7[_0x6e36('0x41')]);_0xe1b8c0['filters']=_[_0x6e36('0x44')](_0xe1b8c0['model'],_0xe1b8c0[_0x6e36('0x41')]);_0x58208f[_0x6e36('0x46')]=_[_0x6e36('0x44')](_0xe1b8c0[_0x6e36('0x45')],qs[_0x6e36('0x55')](_0x1dcec7[_0x6e36('0x41')][_0x6e36('0x55')]));_0x58208f[_0x6e36('0x46')]=_0x58208f[_0x6e36('0x46')][_0x6e36('0x47')]?_0x58208f[_0x6e36('0x46')]:_0xe1b8c0[_0x6e36('0x45')];_0x58208f['order']=qs['sort'](_0x1dcec7[_0x6e36('0x41')][_0x6e36('0x4a')]);_0x58208f[_0x6e36('0x4b')]=qs[_0x6e36('0x43')](_[_0x6e36('0x4c')](_0x1dcec7['query'],_0xe1b8c0[_0x6e36('0x43')]));if(_0x1dcec7[_0x6e36('0x41')][_0x6e36('0x4d')]){_0x58208f[_0x6e36('0x4b')]=_[_0x6e36('0x4f')](_0x58208f[_0x6e36('0x4b')],{'$or':_[_0x6e36('0x3c')](_0x58208f['attributes'],function(_0x31e6a6){var _0x52cce0={};_0x52cce0[_0x31e6a6]={'$like':'%'+_0x1dcec7[_0x6e36('0x41')][_0x6e36('0x4d')]+'%'};return _0x52cce0;})});}_0x58208f=_[_0x6e36('0x4f')]({},_0x58208f,_0x1dcec7[_0x6e36('0x50')]);return _0x2e9256['getAgents'](_0x58208f);}})[_0x6e36('0x34')](function(_0x44f481){if(_0x44f481){_0x4c0de6=_0x44f481[_0x6e36('0x47')];if(!_0x1dcec7[_0x6e36('0x41')]['hasOwnProperty'](_0x6e36('0x48'))){_0x58208f[_0x6e36('0x2f')]=qs[_0x6e36('0x2f')](_0x1dcec7[_0x6e36('0x41')][_0x6e36('0x2f')]);_0x58208f['offset']=qs[_0x6e36('0x2e')](_0x1dcec7['query']['offset']);}return _0x2e9256[_0x6e36('0x99')](_0x58208f);}})[_0x6e36('0x34')](function(_0x4c7252){if(_0x4c7252){return _0x4c7252?{'count':_0x4c0de6,'rows':_0x4c7252}:null;}})['then'](respondWithResult(_0x5bc739,null))['catch'](handleError(_0x5bc739,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index f25a0fa..287d33c 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 _0x5327=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x2dfa3c,_0x22280b){var _0x15dfc0=function(_0x393a1c){while(--_0x393a1c){_0x2dfa3c['push'](_0x2dfa3c['shift']());}};_0x15dfc0(++_0x22280b);}(_0x5327,0x1d2));var _0x7532=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5327[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x7532('0x0'));var ChatQueue=require(_0x7532('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7532('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7532('0x3'),'afterDestroy':_0x7532('0x4')};function emitEvent(_0x44a8f6){return function(_0xe4421c,_0x16f60c,_0x45dd16){ChatQueueEvents['emit'](_0x44a8f6+':'+_0xe4421c['id'],_0xe4421c);ChatQueueEvents[_0x7532('0x5')](_0x44a8f6,_0xe4421c);_0x45dd16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x7532('0x6')](e,emitEvent(event));}}module[_0x7532('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xd1b3=['hasOwnProperty','exports','events','../../mysqldb','save','remove','emit'];(function(_0x4f4ab3,_0x4a8171){var _0x2852e0=function(_0x598141){while(--_0x598141){_0x4f4ab3['push'](_0x4f4ab3['shift']());}};_0x2852e0(++_0x4a8171);}(_0xd1b3,0x95));var _0x3d1b=function(_0x70f16e,_0xdb33ed){_0x70f16e=_0x70f16e-0x0;var _0x352cea=_0xd1b3[_0x70f16e];return _0x352cea;};'use strict';var EventEmitter=require(_0x3d1b('0x0'));var ChatQueue=require(_0x3d1b('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3d1b('0x2'),'afterUpdate':'update','afterDestroy':_0x3d1b('0x3')};function emitEvent(_0x427299){return function(_0x5baecc,_0x3f2cd4,_0x409d4b){ChatQueueEvents[_0x3d1b('0x4')](_0x427299+':'+_0x5baecc['id'],_0x5baecc);ChatQueueEvents[_0x3d1b('0x4')](_0x427299,_0x5baecc);_0x409d4b(null);};}for(var e in events){if(events[_0x3d1b('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x3d1b('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 091406e..9d2a360 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 _0xda4b=['moment','request-promise','rimraf','./chatQueue.attributes','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x456be1,_0x248c6e){var _0x43fa66=function(_0x8c0df9){while(--_0x8c0df9){_0x456be1['push'](_0x456be1['shift']());}};_0x43fa66(++_0x248c6e);}(_0xda4b,0x14a));var _0xbda4=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xda4b[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xbda4('0x0'));var util=require(_0xbda4('0x1'));var logger=require(_0xbda4('0x2'))('api');var moment=require(_0xbda4('0x3'));var BPromise=require('bluebird');var rp=require(_0xbda4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbda4('0x5'));var config=require('../../config/environment');var attributes=require(_0xbda4('0x6'));module['exports']=function(_0x4ba27f,_0x1b4e9f){return _0x4ba27f['define'](_0xbda4('0x7'),attributes,{'tableName':_0xbda4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8258=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define'];(function(_0xc97e0,_0x5eb956){var _0x20ea86=function(_0x54e105){while(--_0x54e105){_0xc97e0['push'](_0xc97e0['shift']());}};_0x20ea86(++_0x5eb956);}(_0x8258,0x10c));var _0x8825=function(_0x41816b,_0x2ccd04){_0x41816b=_0x41816b-0x0;var _0x5537c2=_0x8258[_0x41816b];return _0x5537c2;};'use strict';var _=require(_0x8825('0x0'));var util=require(_0x8825('0x1'));var logger=require(_0x8825('0x2'))(_0x8825('0x3'));var moment=require(_0x8825('0x4'));var BPromise=require(_0x8825('0x5'));var rp=require(_0x8825('0x6'));var fs=require('fs');var path=require(_0x8825('0x7'));var rimraf=require(_0x8825('0x8'));var config=require('../../config/environment');var attributes=require(_0x8825('0x9'));module[_0x8825('0xa')]=function(_0xf8f6d3,_0x312d44){return _0xf8f6d3[_0x8825('0xb')](_0x8825('0xc'),attributes,{'tableName':_0x8825('0xd'),'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 b73fa8d..e40fcc9 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 _0x0e47=['register','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','ChatQueue','findAll','options','attributes','limit','include','map','model','catch','find','raw','ShowChatQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatQueue.socket'];(function(_0x4dac29,_0x1f558){var _0xa1c6a1=function(_0x284fee){while(--_0x284fee){_0x4dac29['push'](_0x4dac29['shift']());}};_0xa1c6a1(++_0x1f558);}(_0x0e47,0x65));var _0x70e4=function(_0x340907,_0x4a9781){_0x340907=_0x340907-0x0;var _0x1cd555=_0x0e47[_0x340907];return _0x1cd555;};'use strict';var _=require(_0x70e4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x70e4('0x1'));var rs=require(_0x70e4('0x2'));var fs=require('fs');var Redis=require(_0x70e4('0x3'));var db=require(_0x70e4('0x4'))['db'];var utils=require(_0x70e4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x70e4('0x6'));var jayson=require(_0x70e4('0x7'));var client=jayson['client'][_0x70e4('0x8')]({'port':0x232a});config[_0x70e4('0x9')]=_[_0x70e4('0xa')](config[_0x70e4('0x9')],{'host':_0x70e4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70e4('0x9')]));require(_0x70e4('0xc'))[_0x70e4('0xd')](socket);function respondWithRpcPromise(_0x3c50b6,_0x530b69,_0x2ba4d1){return new BPromise(function(_0x1f5b7d,_0x457df9){return client['request'](_0x3c50b6,_0x2ba4d1)[_0x70e4('0xe')](function(_0x91fc55){logger[_0x70e4('0xf')]('ChatQueue,\x20%s,\x20%s',_0x530b69,_0x70e4('0x10'));logger[_0x70e4('0x11')](_0x70e4('0x12'),_0x530b69,_0x70e4('0x10'),JSON[_0x70e4('0x13')](_0x91fc55));if(_0x91fc55['error']){if(_0x91fc55[_0x70e4('0x14')][_0x70e4('0x15')]===0x1f4){logger['error'](_0x70e4('0x16'),_0x530b69,_0x91fc55['error'][_0x70e4('0x17')]);return _0x457df9(_0x91fc55[_0x70e4('0x14')][_0x70e4('0x17')]);}logger[_0x70e4('0x14')](_0x70e4('0x16'),_0x530b69,_0x91fc55[_0x70e4('0x14')]['message']);return _0x1f5b7d(_0x91fc55['error'][_0x70e4('0x17')]);}else{logger['info'](_0x70e4('0x16'),_0x530b69,_0x70e4('0x10'));_0x1f5b7d(_0x91fc55[_0x70e4('0x18')][_0x70e4('0x17')]);}})['catch'](function(_0x327a9f){logger[_0x70e4('0x14')]('ChatQueue,\x20%s,\x20%s',_0x530b69,_0x327a9f);_0x457df9(_0x327a9f);});});}exports[_0x70e4('0x19')]=function(_0x22791d){var _0x562d9f=this;return new Promise(function(_0x40fb8e,_0x5f2c85){return db[_0x70e4('0x1a')][_0x70e4('0x1b')]({'raw':_0x22791d[_0x70e4('0x1c')]?_0x22791d[_0x70e4('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22791d[_0x70e4('0x1c')]?_0x22791d[_0x70e4('0x1c')]['where']||null:null,'attributes':_0x22791d['options']?_0x22791d['options'][_0x70e4('0x1d')]||null:null,'limit':_0x22791d[_0x70e4('0x1c')]?_0x22791d[_0x70e4('0x1c')][_0x70e4('0x1e')]||null:null,'include':_0x22791d[_0x70e4('0x1c')]?_0x22791d[_0x70e4('0x1c')][_0x70e4('0x1f')]?_[_0x70e4('0x20')](_0x22791d['options'][_0x70e4('0x1f')],function(_0x2c46e0){return{'model':db[_0x2c46e0['model']],'as':_0x2c46e0['as'],'attributes':_0x2c46e0['attributes'],'include':_0x2c46e0[_0x70e4('0x1f')]?_['map'](_0x2c46e0[_0x70e4('0x1f')],function(_0x3ed8f1){return{'model':db[_0x3ed8f1[_0x70e4('0x21')]],'as':_0x3ed8f1['as'],'attributes':_0x3ed8f1['attributes'],'include':_0x3ed8f1[_0x70e4('0x1f')]?_[_0x70e4('0x20')](_0x3ed8f1['include'],function(_0x2ca4d7){return{'model':db[_0x2ca4d7[_0x70e4('0x21')]],'as':_0x2ca4d7['as'],'attributes':_0x2ca4d7[_0x70e4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x70e4('0xe')](function(_0x1bf8a4){logger[_0x70e4('0xf')]('GetChatQueue',_0x22791d);logger[_0x70e4('0x11')](_0x70e4('0x19'),_0x22791d,JSON[_0x70e4('0x13')](_0x1bf8a4));_0x40fb8e(_0x1bf8a4);})[_0x70e4('0x22')](function(_0x3b06a8){logger[_0x70e4('0x14')](_0x70e4('0x19'),_0x3b06a8[_0x70e4('0x17')],_0x22791d);_0x5f2c85(_0x562d9f[_0x70e4('0x14')](0x1f4,_0x3b06a8[_0x70e4('0x17')]));});});};exports['ShowChatQueue']=function(_0x2184ad){var _0x50a960=this;return new Promise(function(_0x20ed6e,_0x40b160){return db[_0x70e4('0x1a')][_0x70e4('0x23')]({'raw':_0x2184ad['options']?_0x2184ad[_0x70e4('0x1c')][_0x70e4('0x24')]===undefined?!![]:![]:!![],'where':_0x2184ad['options']?_0x2184ad['options']['where']||null:null,'attributes':_0x2184ad['options']?_0x2184ad['options'][_0x70e4('0x1d')]||null:null,'include':_0x2184ad[_0x70e4('0x1c')]?_0x2184ad[_0x70e4('0x1c')]['include']?_[_0x70e4('0x20')](_0x2184ad[_0x70e4('0x1c')][_0x70e4('0x1f')],function(_0x1aa1fc){return{'model':db[_0x1aa1fc[_0x70e4('0x21')]],'as':_0x1aa1fc['as'],'attributes':_0x1aa1fc[_0x70e4('0x1d')],'include':_0x1aa1fc['include']?_[_0x70e4('0x20')](_0x1aa1fc[_0x70e4('0x1f')],function(_0x3c98f4){return{'model':db[_0x3c98f4[_0x70e4('0x21')]],'as':_0x3c98f4['as'],'attributes':_0x3c98f4[_0x70e4('0x1d')],'include':_0x3c98f4[_0x70e4('0x1f')]?_[_0x70e4('0x20')](_0x3c98f4['include'],function(_0x7b3089){return{'model':db[_0x7b3089[_0x70e4('0x21')]],'as':_0x7b3089['as'],'attributes':_0x7b3089[_0x70e4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x70e4('0xe')](function(_0x2230e3){logger['info'](_0x70e4('0x25'),_0x2184ad);logger[_0x70e4('0x11')]('ShowChatQueue',_0x2184ad,JSON[_0x70e4('0x13')](_0x2230e3));_0x20ed6e(_0x2230e3);})[_0x70e4('0x22')](function(_0x582272){logger[_0x70e4('0x14')]('ShowChatQueue',_0x582272[_0x70e4('0x17')],_0x2184ad);_0x40b160(_0x50a960[_0x70e4('0x14')](0x1f4,_0x582272[_0x70e4('0x17')]));});});};
\ No newline at end of file
+var _0xb0ca=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','where','limit','include','model','attributes','map','GetChatQueue','ShowChatQueue','find','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xb0ca,0x1b2));var _0xab0c=function(_0xd0809d,_0x434817){_0xd0809d=_0xd0809d-0x0;var _0x2c8946=_0xb0ca[_0xd0809d];return _0x2c8946;};'use strict';var _=require('lodash');var util=require(_0xab0c('0x0'));var moment=require('moment');var BPromise=require(_0xab0c('0x1'));var rs=require(_0xab0c('0x2'));var fs=require('fs');var Redis=require(_0xab0c('0x3'));var db=require(_0xab0c('0x4'))['db'];var utils=require(_0xab0c('0x5'));var logger=require(_0xab0c('0x6'))(_0xab0c('0x7'));var config=require('../../config/environment');var jayson=require(_0xab0c('0x8'));var client=jayson[_0xab0c('0x9')][_0xab0c('0xa')]({'port':0x232a});config[_0xab0c('0xb')]=_[_0xab0c('0xc')](config[_0xab0c('0xb')],{'host':_0xab0c('0xd'),'port':0x18eb});var socket=require(_0xab0c('0xe'))(new Redis(config[_0xab0c('0xb')]));require('./chatQueue.socket')[_0xab0c('0xf')](socket);function respondWithRpcPromise(_0x15db71,_0x52df38,_0xb79b41){return new BPromise(function(_0x17bff7,_0x11a4ae){return client['request'](_0x15db71,_0xb79b41)[_0xab0c('0x10')](function(_0x53a944){logger[_0xab0c('0x11')](_0xab0c('0x12'),_0x52df38,_0xab0c('0x13'));logger[_0xab0c('0x14')](_0xab0c('0x15'),_0x52df38,_0xab0c('0x13'),JSON[_0xab0c('0x16')](_0x53a944));if(_0x53a944[_0xab0c('0x17')]){if(_0x53a944[_0xab0c('0x17')][_0xab0c('0x18')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x52df38,_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x11a4ae(_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);}logger[_0xab0c('0x17')](_0xab0c('0x12'),_0x52df38,_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x17bff7(_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);}else{logger[_0xab0c('0x11')](_0xab0c('0x12'),_0x52df38,_0xab0c('0x13'));_0x17bff7(_0x53a944[_0xab0c('0x1a')][_0xab0c('0x19')]);}})[_0xab0c('0x1b')](function(_0x44c6f4){logger[_0xab0c('0x17')](_0xab0c('0x12'),_0x52df38,_0x44c6f4);_0x11a4ae(_0x44c6f4);});});}exports['GetChatQueue']=function(_0x29b873){var _0x4ad10e=this;return new Promise(function(_0x36794d,_0x870902){return db[_0xab0c('0x1c')][_0xab0c('0x1d')]({'raw':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x1f')]||null:null,'attributes':_0x29b873['options']?_0x29b873[_0xab0c('0x1e')]['attributes']||null:null,'limit':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x20')]||null:null,'include':_0x29b873['options']?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x21')]?_['map'](_0x29b873[_0xab0c('0x1e')][_0xab0c('0x21')],function(_0xfe7099){return{'model':db[_0xfe7099[_0xab0c('0x22')]],'as':_0xfe7099['as'],'attributes':_0xfe7099[_0xab0c('0x23')],'include':_0xfe7099[_0xab0c('0x21')]?_[_0xab0c('0x24')](_0xfe7099[_0xab0c('0x21')],function(_0x3ce281){return{'model':db[_0x3ce281[_0xab0c('0x22')]],'as':_0x3ce281['as'],'attributes':_0x3ce281[_0xab0c('0x23')],'include':_0x3ce281[_0xab0c('0x21')]?_[_0xab0c('0x24')](_0x3ce281['include'],function(_0x70f07f){return{'model':db[_0x70f07f[_0xab0c('0x22')]],'as':_0x70f07f['as'],'attributes':_0x70f07f[_0xab0c('0x23')]};}):[]};}):[]};}):[]:[]})[_0xab0c('0x10')](function(_0x47a239){logger['info']('GetChatQueue',_0x29b873);logger['debug'](_0xab0c('0x25'),_0x29b873,JSON[_0xab0c('0x16')](_0x47a239));_0x36794d(_0x47a239);})[_0xab0c('0x1b')](function(_0x3e6b6e){logger[_0xab0c('0x17')]('GetChatQueue',_0x3e6b6e['message'],_0x29b873);_0x870902(_0x4ad10e[_0xab0c('0x17')](0x1f4,_0x3e6b6e[_0xab0c('0x19')]));});});};exports[_0xab0c('0x26')]=function(_0xe36cea){var _0x2bccdb=this;return new Promise(function(_0x577c31,_0x582536){return db['ChatQueue'][_0xab0c('0x27')]({'raw':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x28')]===undefined?!![]:![]:!![],'where':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x1f')]||null:null,'attributes':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x23')]||null:null,'include':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x21')]?_['map'](_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x21')],function(_0x366ade){return{'model':db[_0x366ade[_0xab0c('0x22')]],'as':_0x366ade['as'],'attributes':_0x366ade[_0xab0c('0x23')],'include':_0x366ade['include']?_['map'](_0x366ade['include'],function(_0x4c5f21){return{'model':db[_0x4c5f21[_0xab0c('0x22')]],'as':_0x4c5f21['as'],'attributes':_0x4c5f21['attributes'],'include':_0x4c5f21['include']?_[_0xab0c('0x24')](_0x4c5f21[_0xab0c('0x21')],function(_0xd1a5fb){return{'model':db[_0xd1a5fb[_0xab0c('0x22')]],'as':_0xd1a5fb['as'],'attributes':_0xd1a5fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xab0c('0x10')](function(_0x16048c){logger[_0xab0c('0x11')](_0xab0c('0x26'),_0xe36cea);logger['debug'](_0xab0c('0x26'),_0xe36cea,JSON[_0xab0c('0x16')](_0x16048c));_0x577c31(_0x16048c);})[_0xab0c('0x1b')](function(_0x2dbd55){logger[_0xab0c('0x17')](_0xab0c('0x26'),_0x2dbd55[_0xab0c('0x19')],_0xe36cea);_0x582536(_0x2bccdb['error'](0x1f4,_0x2dbd55[_0xab0c('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index d810228..678432a 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 _0xec56=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x2583e3,_0x1ddb75){var _0x2b1747=function(_0x3fd5aa){while(--_0x3fd5aa){_0x2583e3['push'](_0x2583e3['shift']());}};_0x2b1747(++_0x1ddb75);}(_0xec56,0x1bd));var _0x6ec5=function(_0x43b356,_0x7c7f03){_0x43b356=_0x43b356-0x0;var _0x128aab=_0xec56[_0x43b356];return _0x128aab;};'use strict';var ChatQueueEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){ChatQueueEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);ChatQueueEvents['on'](_0x1f59cd,_0x3dd891);}};
\ No newline at end of file
+var _0x55ca=['removeListener','register','./chatQueue.events','save'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x55ca,0x126));var _0xa55c=function(_0x3b4585,_0x16a9c2){_0x3b4585=_0x3b4585-0x0;var _0x551be9=_0x55ca[_0x3b4585];return _0x551be9;};'use strict';var ChatQueueEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){ChatQueueEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('chatQueue:'+_0x2121fd,_0x3c97c8);ChatQueueEvents['on'](_0x2121fd,_0x2537f0);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index d089d8a..f13ca1f 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5cfcb2,_0x17d62f){var _0x362301=function(_0x188356){while(--_0x188356){_0x5cfcb2['push'](_0x5cfcb2['shift']());}};_0x362301(++_0x17d62f);}(_0x008c,0x188));var _0xc008=function(_0x1fe7e4,_0x5d39a4){_0x1fe7e4=_0x1fe7e4-0x0;var _0x4b3e54=_0x008c[_0x1fe7e4];return _0x4b3e54;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x510dcb,_0x309067){var _0x4e135d=function(_0x5385f4){while(--_0x5385f4){_0x510dcb['push'](_0x510dcb['shift']());}};_0x4e135d(++_0x309067);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index a71a7cb..fe3e999 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 _0xb465=['sequelize','exports','DATE','moment'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xb465,0x9b));var _0x5b46=function(_0x350a85,_0x175909){_0x350a85=_0x350a85-0x0;var _0x10907f=_0xb465[_0x350a85];return _0x10907f;};'use strict';var moment=require(_0x5b46('0x0'));var Sequelize=require(_0x5b46('0x1'));module[_0x5b46('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x5b46('0x3')]},'leaveAt':{'type':Sequelize[_0x5b46('0x3')]},'acceptAt':{'type':Sequelize[_0x5b46('0x3')]},'exitAt':{'type':Sequelize[_0x5b46('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3de2=['DATE','moment','exports','STRING'];(function(_0x2bda14,_0x4fab1b){var _0xb5dd49=function(_0x1da71e){while(--_0x1da71e){_0x2bda14['push'](_0x2bda14['shift']());}};_0xb5dd49(++_0x4fab1b);}(_0x3de2,0x79));var _0x23de=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x3de2[_0x16b9ed];return _0x66b1f8;};'use strict';var moment=require(_0x23de('0x0'));var Sequelize=require('sequelize');module[_0x23de('0x1')]={'uniqueid':{'type':Sequelize[_0x23de('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x23de('0x2')]},'joinAt':{'type':Sequelize[_0x23de('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x23de('0x3')]},'reason':{'type':Sequelize[_0x23de('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 1b67e58..382c480 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 _0x0324=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','include','find','catch','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x0324,0x90));var _0x4032=function(_0x189a09,_0x45460d){_0x189a09=_0x189a09-0x0;var _0x464bf8=_0x0324[_0x189a09];return _0x464bf8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4032('0x0'));var zipdir=require(_0x4032('0x1'));var jsonpatch=require(_0x4032('0x2'));var rp=require(_0x4032('0x3'));var moment=require(_0x4032('0x4'));var BPromise=require(_0x4032('0x5'));var Mustache=require('mustache');var util=require(_0x4032('0x6'));var path=require(_0x4032('0x7'));var sox=require(_0x4032('0x8'));var csv=require(_0x4032('0x9'));var ejs=require(_0x4032('0xa'));var fs=require('fs');var fs_extra=require(_0x4032('0xb'));var _=require('lodash');var squel=require(_0x4032('0xc'));var crypto=require(_0x4032('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4032('0x9'));var querystring=require(_0x4032('0xe'));var Papa=require('papaparse');var Redis=require(_0x4032('0xf'));var authService=require(_0x4032('0x10'));var qs=require(_0x4032('0x11'));var as=require(_0x4032('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4032('0x13'))(_0x4032('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4032('0x15'))['db'];function respondWithStatusCode(_0x46f120,_0x2c049d){_0x2c049d=_0x2c049d||0xcc;return function(_0x299063){if(_0x299063){return _0x46f120[_0x4032('0x16')](_0x2c049d);}return _0x46f120[_0x4032('0x17')](_0x2c049d)[_0x4032('0x18')]();};}function respondWithResult(_0x4465dd,_0x232f01){_0x232f01=_0x232f01||0xc8;return function(_0x14220e){if(_0x14220e){return _0x4465dd['status'](_0x232f01)['json'](_0x14220e);}};}function respondWithFilteredResult(_0x3222d0,_0x1ce575){return function(_0xe5f3f1){if(_0xe5f3f1){var _0x19a0bd=typeof _0x1ce575[_0x4032('0x19')]===_0x4032('0x1a')&&typeof _0x1ce575['limit']===_0x4032('0x1a');var _0x55db57=_0xe5f3f1['count'];var _0x3b2036=_0x19a0bd?0x0:_0x1ce575[_0x4032('0x19')];var _0x7bcb48=_0x19a0bd?_0xe5f3f1[_0x4032('0x1b')]:_0x1ce575[_0x4032('0x19')]+_0x1ce575[_0x4032('0x1c')];var _0x5e06b1;if(_0x7bcb48>=_0x55db57){_0x7bcb48=_0x55db57;_0x5e06b1=0xc8;}else{_0x5e06b1=0xce;}_0x3222d0[_0x4032('0x17')](_0x5e06b1);return _0x3222d0['set']('Content-Range',_0x3b2036+'-'+_0x7bcb48+'/'+_0x55db57)[_0x4032('0x1d')](_0xe5f3f1);}return null;};}function patchUpdates(_0x4ce170){return function(_0x238c3c){try{jsonpatch[_0x4032('0x1e')](_0x238c3c,_0x4ce170,!![]);}catch(_0x56baba){return BPromise[_0x4032('0x1f')](_0x56baba);}return _0x238c3c[_0x4032('0x20')]();};}function saveUpdates(_0x559191,_0x572057){return function(_0x288125){if(_0x288125){return _0x288125['update'](_0x559191)[_0x4032('0x21')](function(_0x3ac3fa){return _0x3ac3fa;});}return null;};}function removeEntity(_0x5f08cc,_0x15b3c9){return function(_0x1dd822){if(_0x1dd822){return _0x1dd822[_0x4032('0x22')]()[_0x4032('0x21')](function(){_0x5f08cc[_0x4032('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a3bb5,_0x47f7fa){return function(_0x334cfe){if(!_0x334cfe){_0x5a3bb5[_0x4032('0x16')](0x194);}return _0x334cfe;};}function handleError(_0x5c8cb7,_0x56668e){_0x56668e=_0x56668e||0x1f4;return function(_0x119648){logger[_0x4032('0x23')](_0x119648[_0x4032('0x24')]);if(_0x119648[_0x4032('0x25')]){delete _0x119648['name'];}_0x5c8cb7[_0x4032('0x17')](_0x56668e)[_0x4032('0x26')](_0x119648);};}exports[_0x4032('0x27')]=function(_0x1c5c32,_0x36df3c){var _0x541508={},_0x1f1cca={},_0x901785={'count':0x0,'rows':[]};var _0x1fd48e=_[_0x4032('0x28')](db[_0x4032('0x29')][_0x4032('0x2a')],function(_0x3c394c){return{'name':_0x3c394c[_0x4032('0x2b')],'type':_0x3c394c[_0x4032('0x2c')][_0x4032('0x2d')]};});_0x1f1cca[_0x4032('0x2e')]=_[_0x4032('0x28')](_0x1fd48e,_0x4032('0x25'));_0x1f1cca['query']=_[_0x4032('0x2f')](_0x1c5c32[_0x4032('0x30')]);_0x1f1cca[_0x4032('0x31')]=_['intersection'](_0x1f1cca['model'],_0x1f1cca[_0x4032('0x30')]);_0x541508[_0x4032('0x32')]=_[_0x4032('0x33')](_0x1f1cca[_0x4032('0x2e')],qs[_0x4032('0x34')](_0x1c5c32[_0x4032('0x30')][_0x4032('0x34')]));_0x541508[_0x4032('0x32')]=_0x541508[_0x4032('0x32')][_0x4032('0x35')]?_0x541508[_0x4032('0x32')]:_0x1f1cca[_0x4032('0x2e')];if(!_0x1c5c32[_0x4032('0x30')][_0x4032('0x36')](_0x4032('0x37'))){_0x541508[_0x4032('0x1c')]=qs['limit'](_0x1c5c32['query'][_0x4032('0x1c')]);_0x541508[_0x4032('0x19')]=qs[_0x4032('0x19')](_0x1c5c32[_0x4032('0x30')][_0x4032('0x19')]);}_0x541508[_0x4032('0x38')]=qs[_0x4032('0x39')](_0x1c5c32['query']['sort']);_0x541508[_0x4032('0x3a')]=qs[_0x4032('0x31')](_[_0x4032('0x3b')](_0x1c5c32[_0x4032('0x30')],_0x1f1cca[_0x4032('0x31')]),_0x1fd48e);if(_0x1c5c32[_0x4032('0x30')][_0x4032('0x3c')]){_0x541508[_0x4032('0x3a')]=_['merge'](_0x541508[_0x4032('0x3a')],{'$or':_[_0x4032('0x28')](_0x1fd48e,function(_0x2a3548){if(_0x2a3548[_0x4032('0x2c')]!=='VIRTUAL'){var _0x2c4025={};_0x2c4025[_0x2a3548[_0x4032('0x25')]]={'$like':'%'+_0x1c5c32[_0x4032('0x30')][_0x4032('0x3c')]+'%'};return _0x2c4025;}})});}_0x541508=_[_0x4032('0x3d')]({},_0x541508,_0x1c5c32[_0x4032('0x3e')]);var _0x392779={'where':_0x541508[_0x4032('0x3a')]};return db[_0x4032('0x29')][_0x4032('0x1b')](_0x392779)['then'](function(_0xc3b0e5){_0x901785[_0x4032('0x1b')]=_0xc3b0e5;if(_0x1c5c32[_0x4032('0x30')][_0x4032('0x3f')]){_0x541508['include']=[{'all':!![]}];}return db[_0x4032('0x29')][_0x4032('0x40')](_0x541508);})['then'](function(_0x8b43b1){_0x901785[_0x4032('0x41')]=_0x8b43b1;return _0x901785;})[_0x4032('0x21')](respondWithFilteredResult(_0x36df3c,_0x541508))['catch'](handleError(_0x36df3c,null));};exports[_0x4032('0x42')]=function(_0xa8c40a,_0x4af9a1){var _0x2b61d8={'raw':!![],'where':{'id':_0xa8c40a['params']['id']}},_0x4e9e8d={};_0x4e9e8d['model']=_['keys'](db[_0x4032('0x29')]['rawAttributes']);_0x4e9e8d[_0x4032('0x30')]=_['keys'](_0xa8c40a['query']);_0x4e9e8d[_0x4032('0x31')]=_['intersection'](_0x4e9e8d[_0x4032('0x2e')],_0x4e9e8d['query']);_0x2b61d8['attributes']=_[_0x4032('0x33')](_0x4e9e8d[_0x4032('0x2e')],qs[_0x4032('0x34')](_0xa8c40a['query'][_0x4032('0x34')]));_0x2b61d8[_0x4032('0x32')]=_0x2b61d8['attributes'][_0x4032('0x35')]?_0x2b61d8[_0x4032('0x32')]:_0x4e9e8d['model'];if(_0xa8c40a[_0x4032('0x30')][_0x4032('0x3f')]){_0x2b61d8[_0x4032('0x43')]=[{'all':!![]}];}_0x2b61d8=_['merge']({},_0x2b61d8,_0xa8c40a[_0x4032('0x3e')]);return db[_0x4032('0x29')][_0x4032('0x44')](_0x2b61d8)['then'](handleEntityNotFound(_0x4af9a1,null))['then'](respondWithResult(_0x4af9a1,null))[_0x4032('0x45')](handleError(_0x4af9a1,null));};exports[_0x4032('0x46')]=function(_0x248f1f,_0x5dec20){return db[_0x4032('0x29')][_0x4032('0x46')](_0x248f1f[_0x4032('0x47')],{})['then'](respondWithResult(_0x5dec20,0xc9))['catch'](handleError(_0x5dec20,null));};exports[_0x4032('0x48')]=function(_0x1765b0,_0x424c45){if(_0x1765b0[_0x4032('0x47')]['id']){delete _0x1765b0['body']['id'];}return db[_0x4032('0x29')][_0x4032('0x44')]({'where':{'id':_0x1765b0[_0x4032('0x49')]['id']}})[_0x4032('0x21')](handleEntityNotFound(_0x424c45,null))[_0x4032('0x21')](saveUpdates(_0x1765b0[_0x4032('0x47')],null))[_0x4032('0x21')](respondWithResult(_0x424c45,null))['catch'](handleError(_0x424c45,null));};exports[_0x4032('0x22')]=function(_0x38573e,_0x5f1b64){return db[_0x4032('0x29')]['find']({'where':{'id':_0x38573e['params']['id']}})['then'](handleEntityNotFound(_0x5f1b64,null))['then'](removeEntity(_0x5f1b64,null))['catch'](handleError(_0x5f1b64,null));};exports[_0x4032('0x4a')]=function(_0x5812e6,_0x56cca3){return db[_0x4032('0x29')][_0x4032('0x4a')]()[_0x4032('0x21')](respondWithResult(_0x56cca3,null))[_0x4032('0x45')](handleError(_0x56cca3,null));};
\ No newline at end of file
+var _0x9120=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','length','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x9120,0x1b3));var _0x0912=function(_0x1eae7f,_0xbae8fa){_0x1eae7f=_0x1eae7f-0x0;var _0x453d75=_0x9120[_0x1eae7f];return _0x453d75;};'use strict';var emlformat=require(_0x0912('0x0'));var rimraf=require(_0x0912('0x1'));var zipdir=require(_0x0912('0x2'));var jsonpatch=require(_0x0912('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0912('0x4'));var Mustache=require(_0x0912('0x5'));var util=require(_0x0912('0x6'));var path=require(_0x0912('0x7'));var sox=require(_0x0912('0x8'));var csv=require(_0x0912('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0912('0xa'));var _=require(_0x0912('0xb'));var squel=require(_0x0912('0xc'));var crypto=require('crypto');var jsforce=require(_0x0912('0xd'));var deskjs=require(_0x0912('0xe'));var toCsv=require(_0x0912('0x9'));var querystring=require(_0x0912('0xf'));var Papa=require(_0x0912('0x10'));var Redis=require('ioredis');var authService=require(_0x0912('0x11'));var qs=require(_0x0912('0x12'));var as=require(_0x0912('0x13'));var hardwareService=require(_0x0912('0x14'));var logger=require('../../config/logger')(_0x0912('0x15'));var utils=require('../../config/utils');var config=require(_0x0912('0x16'));var licenseUtil=require(_0x0912('0x17'));var db=require(_0x0912('0x18'))['db'];function respondWithStatusCode(_0xc7af62,_0x22752b){_0x22752b=_0x22752b||0xcc;return function(_0x10faac){if(_0x10faac){return _0xc7af62[_0x0912('0x19')](_0x22752b);}return _0xc7af62[_0x0912('0x1a')](_0x22752b)[_0x0912('0x1b')]();};}function respondWithResult(_0x102468,_0x17f22d){_0x17f22d=_0x17f22d||0xc8;return function(_0x350d6b){if(_0x350d6b){return _0x102468[_0x0912('0x1a')](_0x17f22d)[_0x0912('0x1c')](_0x350d6b);}};}function respondWithFilteredResult(_0x247612,_0x5eb1c9){return function(_0x4d00fd){if(_0x4d00fd){var _0x1ed3e8=typeof _0x5eb1c9['offset']===_0x0912('0x1d')&&typeof _0x5eb1c9['limit']===_0x0912('0x1d');var _0x49b581=_0x4d00fd[_0x0912('0x1e')];var _0x5eace1=_0x1ed3e8?0x0:_0x5eb1c9[_0x0912('0x1f')];var _0x5357db=_0x1ed3e8?_0x4d00fd[_0x0912('0x1e')]:_0x5eb1c9['offset']+_0x5eb1c9['limit'];var _0x3377af;if(_0x5357db>=_0x49b581){_0x5357db=_0x49b581;_0x3377af=0xc8;}else{_0x3377af=0xce;}_0x247612['status'](_0x3377af);return _0x247612[_0x0912('0x20')](_0x0912('0x21'),_0x5eace1+'-'+_0x5357db+'/'+_0x49b581)['json'](_0x4d00fd);}return null;};}function patchUpdates(_0x106008){return function(_0xb1af32){try{jsonpatch[_0x0912('0x22')](_0xb1af32,_0x106008,!![]);}catch(_0x5927d2){return BPromise['reject'](_0x5927d2);}return _0xb1af32[_0x0912('0x23')]();};}function saveUpdates(_0x626428,_0x1f04a1){return function(_0x30b7cc){if(_0x30b7cc){return _0x30b7cc[_0x0912('0x24')](_0x626428)[_0x0912('0x25')](function(_0x6c4902){return _0x6c4902;});}return null;};}function removeEntity(_0x2a3e70,_0xca7f8b){return function(_0x572d12){if(_0x572d12){return _0x572d12[_0x0912('0x26')]()[_0x0912('0x25')](function(){_0x2a3e70[_0x0912('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a938e,_0x21d65b){return function(_0x53d673){if(!_0x53d673){_0x4a938e['sendStatus'](0x194);}return _0x53d673;};}function handleError(_0x39462e,_0x39e96b){_0x39e96b=_0x39e96b||0x1f4;return function(_0x4d45d2){logger[_0x0912('0x27')](_0x4d45d2[_0x0912('0x28')]);if(_0x4d45d2[_0x0912('0x29')]){delete _0x4d45d2[_0x0912('0x29')];}_0x39462e[_0x0912('0x1a')](_0x39e96b)['send'](_0x4d45d2);};}exports[_0x0912('0x2a')]=function(_0x1d6c87,_0x4ac024){var _0x2b1653={},_0x3428a9={},_0x2ce714={'count':0x0,'rows':[]};var _0x5b3956=_[_0x0912('0x2b')](db[_0x0912('0x2c')][_0x0912('0x2d')],function(_0x176529){return{'name':_0x176529['fieldName'],'type':_0x176529[_0x0912('0x2e')][_0x0912('0x2f')]};});_0x3428a9[_0x0912('0x30')]=_[_0x0912('0x2b')](_0x5b3956,_0x0912('0x29'));_0x3428a9[_0x0912('0x31')]=_['keys'](_0x1d6c87['query']);_0x3428a9[_0x0912('0x32')]=_[_0x0912('0x33')](_0x3428a9['model'],_0x3428a9['query']);_0x2b1653[_0x0912('0x34')]=_[_0x0912('0x33')](_0x3428a9[_0x0912('0x30')],qs[_0x0912('0x35')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x35')]));_0x2b1653[_0x0912('0x34')]=_0x2b1653[_0x0912('0x34')]['length']?_0x2b1653['attributes']:_0x3428a9[_0x0912('0x30')];if(!_0x1d6c87[_0x0912('0x31')]['hasOwnProperty'](_0x0912('0x36'))){_0x2b1653[_0x0912('0x37')]=qs[_0x0912('0x37')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x37')]);_0x2b1653[_0x0912('0x1f')]=qs[_0x0912('0x1f')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x1f')]);}_0x2b1653['order']=qs[_0x0912('0x38')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x38')]);_0x2b1653[_0x0912('0x39')]=qs[_0x0912('0x32')](_[_0x0912('0x3a')](_0x1d6c87[_0x0912('0x31')],_0x3428a9['filters']),_0x5b3956);if(_0x1d6c87[_0x0912('0x31')]['filter']){_0x2b1653['where']=_['merge'](_0x2b1653[_0x0912('0x39')],{'$or':_[_0x0912('0x2b')](_0x5b3956,function(_0x5db5f9){if(_0x5db5f9[_0x0912('0x2e')]!==_0x0912('0x3b')){var _0xfdf81c={};_0xfdf81c[_0x5db5f9['name']]={'$like':'%'+_0x1d6c87[_0x0912('0x31')][_0x0912('0x3c')]+'%'};return _0xfdf81c;}})});}_0x2b1653=_['merge']({},_0x2b1653,_0x1d6c87[_0x0912('0x3d')]);var _0x40de57={'where':_0x2b1653[_0x0912('0x39')]};return db[_0x0912('0x2c')][_0x0912('0x1e')](_0x40de57)[_0x0912('0x25')](function(_0x4eb359){_0x2ce714[_0x0912('0x1e')]=_0x4eb359;if(_0x1d6c87[_0x0912('0x31')][_0x0912('0x3e')]){_0x2b1653[_0x0912('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0912('0x40')](_0x2b1653);})[_0x0912('0x25')](function(_0x10040b){_0x2ce714['rows']=_0x10040b;return _0x2ce714;})[_0x0912('0x25')](respondWithFilteredResult(_0x4ac024,_0x2b1653))[_0x0912('0x41')](handleError(_0x4ac024,null));};exports[_0x0912('0x42')]=function(_0x19839e,_0x1c5158){var _0x320f98={'raw':!![],'where':{'id':_0x19839e[_0x0912('0x43')]['id']}},_0x15e23b={};_0x15e23b['model']=_[_0x0912('0x44')](db['ChatQueueReport'][_0x0912('0x2d')]);_0x15e23b[_0x0912('0x31')]=_[_0x0912('0x44')](_0x19839e[_0x0912('0x31')]);_0x15e23b[_0x0912('0x32')]=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],_0x15e23b[_0x0912('0x31')]);_0x320f98['attributes']=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],qs[_0x0912('0x35')](_0x19839e['query'][_0x0912('0x35')]));_0x320f98[_0x0912('0x34')]=_0x320f98[_0x0912('0x34')][_0x0912('0x45')]?_0x320f98[_0x0912('0x34')]:_0x15e23b[_0x0912('0x30')];if(_0x19839e[_0x0912('0x31')][_0x0912('0x3e')]){_0x320f98[_0x0912('0x3f')]=[{'all':!![]}];}_0x320f98=_[_0x0912('0x46')]({},_0x320f98,_0x19839e[_0x0912('0x3d')]);return db[_0x0912('0x2c')][_0x0912('0x47')](_0x320f98)[_0x0912('0x25')](handleEntityNotFound(_0x1c5158,null))[_0x0912('0x25')](respondWithResult(_0x1c5158,null))[_0x0912('0x41')](handleError(_0x1c5158,null));};exports[_0x0912('0x48')]=function(_0x255ee5,_0x3b0548){return db[_0x0912('0x2c')][_0x0912('0x48')](_0x255ee5[_0x0912('0x49')],{})[_0x0912('0x25')](respondWithResult(_0x3b0548,0xc9))['catch'](handleError(_0x3b0548,null));};exports[_0x0912('0x24')]=function(_0x3b94cc,_0x591c83){if(_0x3b94cc[_0x0912('0x49')]['id']){delete _0x3b94cc[_0x0912('0x49')]['id'];}return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x3b94cc[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x591c83,null))['then'](saveUpdates(_0x3b94cc[_0x0912('0x49')],null))[_0x0912('0x25')](respondWithResult(_0x591c83,null))[_0x0912('0x41')](handleError(_0x591c83,null));};exports['destroy']=function(_0x11364e,_0x3ce4bf){return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x11364e[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x3ce4bf,null))[_0x0912('0x25')](removeEntity(_0x3ce4bf,null))[_0x0912('0x41')](handleError(_0x3ce4bf,null));};exports['describe']=function(_0x91bb1a,_0x360313){return db[_0x0912('0x2c')][_0x0912('0x4a')]()[_0x0912('0x25')](respondWithResult(_0x360313,null))['catch'](handleError(_0x360313,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index ed4fdcf..ab2222c 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0xda6247,_0x332bda){var _0xf8e1bc=function(_0x8c50d6){while(--_0x8c50d6){_0xda6247['push'](_0xda6247['shift']());}};_0xf8e1bc(++_0x332bda);}(_0x757a,0xde));var _0xa757=function(_0x25938c,_0x50440c){_0x25938c=_0x25938c-0x0;var _0x21f75a=_0x757a[_0x25938c];return _0x21f75a;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x492cdb,_0x37833d){var _0x26a4cb=function(_0x56a764){while(--_0x56a764){_0x492cdb['push'](_0x492cdb['shift']());}};_0x26a4cb(++_0x37833d);}(_0x757a,0xde));var _0xa757=function(_0x2866e2,_0x376809){_0x2866e2=_0x2866e2-0x0;var _0x2cd26e=_0x757a[_0x2866e2];return _0x2cd26e;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index ba9eda6..b75e5af 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 _0x3dd3=['update','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','UpdateChatQueueReport'];(function(_0x37357f,_0x3b23bb){var _0x505ef9=function(_0x42df61){while(--_0x42df61){_0x37357f['push'](_0x37357f['shift']());}};_0x505ef9(++_0x3b23bb);}(_0x3dd3,0x185));var _0x33dd=function(_0xe62c47,_0x37260f){_0xe62c47=_0xe62c47-0x0;var _0x4f4229=_0x3dd3[_0xe62c47];return _0x4f4229;};'use strict';var _=require(_0x33dd('0x0'));var util=require(_0x33dd('0x1'));var moment=require(_0x33dd('0x2'));var BPromise=require(_0x33dd('0x3'));var rs=require(_0x33dd('0x4'));var fs=require('fs');var Redis=require(_0x33dd('0x5'));var db=require(_0x33dd('0x6'))['db'];var utils=require(_0x33dd('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x33dd('0x8'));var jayson=require(_0x33dd('0x9'));var client=jayson['client'][_0x33dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b65cd,_0x561b9e,_0x3866e9){return new BPromise(function(_0x2390b7,_0x4320d5){return client[_0x33dd('0xb')](_0x1b65cd,_0x3866e9)[_0x33dd('0xc')](function(_0x5f148c){logger[_0x33dd('0xd')](_0x33dd('0xe'),_0x561b9e,'request\x20sent');logger[_0x33dd('0xf')](_0x33dd('0x10'),_0x561b9e,_0x33dd('0x11'),JSON[_0x33dd('0x12')](_0x5f148c));if(_0x5f148c[_0x33dd('0x13')]){if(_0x5f148c[_0x33dd('0x13')]['code']===0x1f4){logger[_0x33dd('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x561b9e,_0x5f148c[_0x33dd('0x13')]['message']);return _0x4320d5(_0x5f148c['error']['message']);}logger[_0x33dd('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x561b9e,_0x5f148c[_0x33dd('0x13')]['message']);return _0x2390b7(_0x5f148c['error'][_0x33dd('0x14')]);}else{logger[_0x33dd('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x561b9e,_0x33dd('0x11'));_0x2390b7(_0x5f148c['result'][_0x33dd('0x14')]);}})[_0x33dd('0x15')](function(_0x11dba8){logger[_0x33dd('0x13')](_0x33dd('0xe'),_0x561b9e,_0x11dba8);_0x4320d5(_0x11dba8);});});}exports[_0x33dd('0x16')]=function(_0x213162){var _0xd6c24b=this;return new Promise(function(_0xd208bf,_0x556bb4){return db[_0x33dd('0x17')][_0x33dd('0x18')](_0x213162[_0x33dd('0x19')],{'raw':_0x213162['options']?_0x213162['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0xb1204f){logger['info']('CreateChatQueueReport',_0x213162);logger[_0x33dd('0xf')]('CreateChatQueueReport',_0x213162,JSON['stringify'](_0xb1204f));_0xd208bf(_0xb1204f);})['catch'](function(_0x18bb97){logger['error'](_0x33dd('0x16'),_0x18bb97[_0x33dd('0x14')],_0x213162);_0x556bb4(_0xd6c24b[_0x33dd('0x13')](0x1f4,_0x18bb97[_0x33dd('0x14')]));});});};exports[_0x33dd('0x1a')]=function(_0xaa513f){var _0x402e3d=this;return new Promise(function(_0x25f2a8,_0x3f00b7){return db[_0x33dd('0x17')][_0x33dd('0x1b')](_0xaa513f[_0x33dd('0x19')],{'raw':_0xaa513f[_0x33dd('0x1c')]?_0xaa513f[_0x33dd('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaa513f[_0x33dd('0x1c')]?_0xaa513f[_0x33dd('0x1c')][_0x33dd('0x1d')]||null:null,'attributes':_0xaa513f[_0x33dd('0x1c')]?_0xaa513f[_0x33dd('0x1c')][_0x33dd('0x1e')]||null:null,'limit':_0xaa513f[_0x33dd('0x1c')]?_0xaa513f[_0x33dd('0x1c')][_0x33dd('0x1f')]||null:null})[_0x33dd('0xc')](function(_0x12afee){logger[_0x33dd('0xd')]('UpdateChatQueueReport',_0xaa513f);logger[_0x33dd('0xf')](_0x33dd('0x1a'),_0xaa513f,JSON[_0x33dd('0x12')](_0x12afee));_0x25f2a8(_0x12afee);})[_0x33dd('0x15')](function(_0x2cc7b6){logger[_0x33dd('0x13')](_0x33dd('0x1a'),_0x2cc7b6[_0x33dd('0x14')],_0xaa513f);_0x3f00b7(_0x402e3d['error'](0x1f4,_0x2cc7b6[_0x33dd('0x14')]));});});};
\ No newline at end of file
+var _0xd30a=['UpdateChatQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','debug'];(function(_0x5289c8,_0x5a4cb8){var _0x1904ce=function(_0x2d13d9){while(--_0x2d13d9){_0x5289c8['push'](_0x5289c8['shift']());}};_0x1904ce(++_0x5a4cb8);}(_0xd30a,0x19d));var _0xad30=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xd30a[_0x481bf7];return _0x461787;};'use strict';var _=require(_0xad30('0x0'));var util=require('util');var moment=require(_0xad30('0x1'));var BPromise=require(_0xad30('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad30('0x3'));var db=require(_0xad30('0x4'))['db'];var utils=require(_0xad30('0x5'));var logger=require(_0xad30('0x6'))(_0xad30('0x7'));var config=require(_0xad30('0x8'));var jayson=require(_0xad30('0x9'));var client=jayson[_0xad30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc0,_0x2e99d4,_0x1493da){return new BPromise(function(_0x20ac8b,_0x53e6fe){return client[_0xad30('0xb')](_0x3dc0,_0x1493da)[_0xad30('0xc')](function(_0x384583){logger['info'](_0xad30('0xd'),_0x2e99d4,_0xad30('0xe'));logger['debug'](_0xad30('0xf'),_0x2e99d4,_0xad30('0xe'),JSON[_0xad30('0x10')](_0x384583));if(_0x384583[_0xad30('0x11')]){if(_0x384583[_0xad30('0x11')][_0xad30('0x12')]===0x1f4){logger[_0xad30('0x11')](_0xad30('0xd'),_0x2e99d4,_0x384583[_0xad30('0x11')][_0xad30('0x13')]);return _0x53e6fe(_0x384583['error'][_0xad30('0x13')]);}logger[_0xad30('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x2e99d4,_0x384583[_0xad30('0x11')][_0xad30('0x13')]);return _0x20ac8b(_0x384583[_0xad30('0x11')]['message']);}else{logger[_0xad30('0x14')](_0xad30('0xd'),_0x2e99d4,_0xad30('0xe'));_0x20ac8b(_0x384583[_0xad30('0x15')][_0xad30('0x13')]);}})[_0xad30('0x16')](function(_0x2a6d9c){logger[_0xad30('0x11')](_0xad30('0xd'),_0x2e99d4,_0x2a6d9c);_0x53e6fe(_0x2a6d9c);});});}exports[_0xad30('0x17')]=function(_0x19a0cc){var _0x16cb53=this;return new Promise(function(_0x842841,_0x5068eb){return db[_0xad30('0x18')]['create'](_0x19a0cc[_0xad30('0x19')],{'raw':_0x19a0cc[_0xad30('0x1a')]?_0x19a0cc['options'][_0xad30('0x1b')]===undefined?!![]:![]:!![]})[_0xad30('0xc')](function(_0x312704){logger[_0xad30('0x14')]('CreateChatQueueReport',_0x19a0cc);logger[_0xad30('0x1c')](_0xad30('0x17'),_0x19a0cc,JSON[_0xad30('0x10')](_0x312704));_0x842841(_0x312704);})[_0xad30('0x16')](function(_0x12ec56){logger['error'](_0xad30('0x17'),_0x12ec56[_0xad30('0x13')],_0x19a0cc);_0x5068eb(_0x16cb53[_0xad30('0x11')](0x1f4,_0x12ec56[_0xad30('0x13')]));});});};exports[_0xad30('0x1d')]=function(_0x63c85d){var _0x4b395d=this;return new Promise(function(_0x4d11ae,_0x55207e){return db['ChatQueueReport'][_0xad30('0x1e')](_0x63c85d[_0xad30('0x19')],{'raw':_0x63c85d[_0xad30('0x1a')]?_0x63c85d[_0xad30('0x1a')][_0xad30('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x63c85d['options']?_0x63c85d[_0xad30('0x1a')][_0xad30('0x1f')]||null:null,'attributes':_0x63c85d['options']?_0x63c85d[_0xad30('0x1a')][_0xad30('0x20')]||null:null,'limit':_0x63c85d[_0xad30('0x1a')]?_0x63c85d[_0xad30('0x1a')][_0xad30('0x21')]||null:null})[_0xad30('0xc')](function(_0x59ba1f){logger['info'](_0xad30('0x1d'),_0x63c85d);logger['debug'](_0xad30('0x1d'),_0x63c85d,JSON[_0xad30('0x10')](_0x59ba1f));_0x4d11ae(_0x59ba1f);})[_0xad30('0x16')](function(_0x2ca5fe){logger[_0xad30('0x11')]('UpdateChatQueueReport',_0x2ca5fe[_0xad30('0x13')],_0x63c85d);_0x55207e(_0x4b395d[_0xad30('0x11')](0x1f4,_0x2ca5fe[_0xad30('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 0d0a95d..0cbaa07 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 _0xcc6e=['../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcc6e,0x9c));var _0xecc6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc6e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xecc6('0x0'));var path=require(_0xecc6('0x1'));var timeout=require(_0xecc6('0x2'));var express=require(_0xecc6('0x3'));var router=express[_0xecc6('0x4')]();var fs_extra=require(_0xecc6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xecc6('0x6'));var controller=require(_0xecc6('0x7'));router['get']('/',auth[_0xecc6('0x8')](),controller[_0xecc6('0x9')]);router[_0xecc6('0xa')]('/describe',auth[_0xecc6('0x8')](),controller['describe']);router[_0xecc6('0xa')](_0xecc6('0xb'),auth[_0xecc6('0x8')](),controller[_0xecc6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xecc6('0xd')]);router[_0xecc6('0xe')](_0xecc6('0xb'),auth['isAuthenticated'](),controller[_0xecc6('0xf')]);router[_0xecc6('0x10')](_0xecc6('0xb'),auth[_0xecc6('0x8')](),controller[_0xecc6('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x60a2=['../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','get','/describe','/:id','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5193e3,_0x4e62b9){var _0x505b84=function(_0x74f2c7){while(--_0x74f2c7){_0x5193e3['push'](_0x5193e3['shift']());}};_0x505b84(++_0x4e62b9);}(_0x60a2,0x160));var _0x260a=function(_0xdf5c13,_0x2b638c){_0xdf5c13=_0xdf5c13-0x0;var _0x4723b6=_0x60a2[_0xdf5c13];return _0x4723b6;};'use strict';var multer=require(_0x260a('0x0'));var util=require(_0x260a('0x1'));var path=require('path');var timeout=require(_0x260a('0x2'));var express=require(_0x260a('0x3'));var router=express[_0x260a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x260a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x260a('0x6'));var controller=require(_0x260a('0x7'));router['get']('/',auth[_0x260a('0x8')](),controller['index']);router[_0x260a('0x9')](_0x260a('0xa'),auth[_0x260a('0x8')](),controller['describe']);router[_0x260a('0x9')](_0x260a('0xb'),auth[_0x260a('0x8')](),controller['show']);router['post']('/',auth[_0x260a('0x8')](),controller[_0x260a('0xc')]);router[_0x260a('0xd')](_0x260a('0xb'),auth[_0x260a('0x8')](),controller[_0x260a('0xe')]);router['delete'](_0x260a('0xb'),auth[_0x260a('0x8')](),controller[_0x260a('0xf')]);module[_0x260a('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 8ded6d0..295e909 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x442c21,_0x34fdc4){var _0x5d2fcf=function(_0x1e068c){while(--_0x1e068c){_0x442c21['push'](_0x442c21['shift']());}};_0x5d2fcf(++_0x34fdc4);}(_0xedd9,0xfc));var _0x9edd=function(_0x54f835,_0x359021){_0x54f835=_0x54f835-0x0;var _0x241d4c=_0xedd9[_0x54f835];return _0x241d4c;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0xb43b,0x1b2));var _0xbb43=function(_0x46965b,_0x51a74b){_0x46965b=_0x46965b-0x0;var _0x5318e5=_0xb43b[_0x46965b];return _0x5318e5;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index ea1ad77..08cf750 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 _0x546e=['send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','end','stack','name'];(function(_0x5d1566,_0x3fed4b){var _0x3441a2=function(_0x57c3fe){while(--_0x57c3fe){_0x5d1566['push'](_0x5d1566['shift']());}};_0x3441a2(++_0x3fed4b);}(_0x546e,0x156));var _0xe546=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x546e[_0x9fd887];return _0x1a54ab;};'use strict';var emlformat=require(_0xe546('0x0'));var rimraf=require(_0xe546('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe546('0x2'));var rp=require(_0xe546('0x3'));var moment=require('moment');var BPromise=require(_0xe546('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe546('0x5'));var sox=require(_0xe546('0x6'));var csv=require(_0xe546('0x7'));var ejs=require(_0xe546('0x8'));var fs=require('fs');var fs_extra=require(_0xe546('0x9'));var _=require(_0xe546('0xa'));var squel=require(_0xe546('0xb'));var crypto=require(_0xe546('0xc'));var jsforce=require(_0xe546('0xd'));var deskjs=require(_0xe546('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe546('0xf'));var Papa=require(_0xe546('0x10'));var Redis=require('ioredis');var authService=require(_0xe546('0x11'));var qs=require(_0xe546('0x12'));var as=require(_0xe546('0x13'));var hardwareService=require(_0xe546('0x14'));var logger=require(_0xe546('0x15'))(_0xe546('0x16'));var utils=require('../../config/utils');var config=require(_0xe546('0x17'));var licenseUtil=require(_0xe546('0x18'));var db=require(_0xe546('0x19'))['db'];function respondWithStatusCode(_0x2b9c9d,_0x13d7bc){_0x13d7bc=_0x13d7bc||0xcc;return function(_0x49ab56){if(_0x49ab56){return _0x2b9c9d[_0xe546('0x1a')](_0x13d7bc);}return _0x2b9c9d[_0xe546('0x1b')](_0x13d7bc)['end']();};}function respondWithResult(_0x382ade,_0x1c1810){_0x1c1810=_0x1c1810||0xc8;return function(_0x17bc8b){if(_0x17bc8b){return _0x382ade[_0xe546('0x1b')](_0x1c1810)['json'](_0x17bc8b);}};}function respondWithFilteredResult(_0x537822,_0x42f170){return function(_0x2e43b5){if(_0x2e43b5){var _0x3ce037=typeof _0x42f170[_0xe546('0x1c')]===_0xe546('0x1d')&&typeof _0x42f170[_0xe546('0x1e')]==='undefined';var _0x241bc6=_0x2e43b5[_0xe546('0x1f')];var _0x51c109=_0x3ce037?0x0:_0x42f170[_0xe546('0x1c')];var _0x338176=_0x3ce037?_0x2e43b5[_0xe546('0x1f')]:_0x42f170[_0xe546('0x1c')]+_0x42f170['limit'];var _0x589224;if(_0x338176>=_0x241bc6){_0x338176=_0x241bc6;_0x589224=0xc8;}else{_0x589224=0xce;}_0x537822[_0xe546('0x1b')](_0x589224);return _0x537822[_0xe546('0x20')](_0xe546('0x21'),_0x51c109+'-'+_0x338176+'/'+_0x241bc6)[_0xe546('0x22')](_0x2e43b5);}return null;};}function patchUpdates(_0x237cd3){return function(_0x207da7){try{jsonpatch[_0xe546('0x23')](_0x207da7,_0x237cd3,!![]);}catch(_0x1809ea){return BPromise[_0xe546('0x24')](_0x1809ea);}return _0x207da7[_0xe546('0x25')]();};}function saveUpdates(_0x384023,_0x5c2f2a){return function(_0x10192b){if(_0x10192b){return _0x10192b['update'](_0x384023)['then'](function(_0x7f9bf9){return _0x7f9bf9;});}return null;};}function removeEntity(_0x3a4984,_0x310f0c){return function(_0x41533f){if(_0x41533f){return _0x41533f[_0xe546('0x26')]()[_0xe546('0x27')](function(){_0x3a4984['status'](0xcc)[_0xe546('0x28')]();});}};}function handleEntityNotFound(_0x115057,_0x194672){return function(_0xc0a27a){if(!_0xc0a27a){_0x115057[_0xe546('0x1a')](0x194);}return _0xc0a27a;};}function handleError(_0x42164a,_0x5bee4a){_0x5bee4a=_0x5bee4a||0x1f4;return function(_0x34b2c1){logger['error'](_0x34b2c1[_0xe546('0x29')]);if(_0x34b2c1[_0xe546('0x2a')]){delete _0x34b2c1[_0xe546('0x2a')];}_0x42164a[_0xe546('0x1b')](_0x5bee4a)[_0xe546('0x2b')](_0x34b2c1);};}exports[_0xe546('0x2c')]=function(_0x3578f3,_0x52af92){var _0x228eac={},_0x3587dd={},_0x45d288={'count':0x0,'rows':[]};var _0x21e71a=_[_0xe546('0x2d')](db[_0xe546('0x2e')][_0xe546('0x2f')],function(_0xf2106d){return{'name':_0xf2106d[_0xe546('0x30')],'type':_0xf2106d[_0xe546('0x31')]['key']};});_0x3587dd[_0xe546('0x32')]=_['map'](_0x21e71a,'name');_0x3587dd[_0xe546('0x33')]=_[_0xe546('0x34')](_0x3578f3['query']);_0x3587dd[_0xe546('0x35')]=_[_0xe546('0x36')](_0x3587dd[_0xe546('0x32')],_0x3587dd[_0xe546('0x33')]);_0x228eac['attributes']=_[_0xe546('0x36')](_0x3587dd[_0xe546('0x32')],qs[_0xe546('0x37')](_0x3578f3['query'][_0xe546('0x37')]));_0x228eac[_0xe546('0x38')]=_0x228eac[_0xe546('0x38')]['length']?_0x228eac[_0xe546('0x38')]:_0x3587dd['model'];if(!_0x3578f3[_0xe546('0x33')]['hasOwnProperty'](_0xe546('0x39'))){_0x228eac[_0xe546('0x1e')]=qs[_0xe546('0x1e')](_0x3578f3['query'][_0xe546('0x1e')]);_0x228eac['offset']=qs[_0xe546('0x1c')](_0x3578f3['query'][_0xe546('0x1c')]);}_0x228eac[_0xe546('0x3a')]=qs['sort'](_0x3578f3[_0xe546('0x33')]['sort']);_0x228eac[_0xe546('0x3b')]=qs[_0xe546('0x35')](_[_0xe546('0x3c')](_0x3578f3[_0xe546('0x33')],_0x3587dd[_0xe546('0x35')]),_0x21e71a);if(_0x3578f3[_0xe546('0x33')][_0xe546('0x3d')]){_0x228eac['where']=_[_0xe546('0x3e')](_0x228eac[_0xe546('0x3b')],{'$or':_[_0xe546('0x2d')](_0x21e71a,function(_0x230375){if(_0x230375[_0xe546('0x31')]!==_0xe546('0x3f')){var _0x3e5d34={};_0x3e5d34[_0x230375[_0xe546('0x2a')]]={'$like':'%'+_0x3578f3[_0xe546('0x33')]['filter']+'%'};return _0x3e5d34;}})});}_0x228eac=_['merge']({},_0x228eac,_0x3578f3[_0xe546('0x40')]);var _0x1f7189={'where':_0x228eac['where']};return db[_0xe546('0x2e')]['count'](_0x1f7189)[_0xe546('0x27')](function(_0x3f6a00){_0x45d288[_0xe546('0x1f')]=_0x3f6a00;if(_0x3578f3[_0xe546('0x33')][_0xe546('0x41')]){_0x228eac[_0xe546('0x42')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe546('0x43')](_0x228eac);})[_0xe546('0x27')](function(_0x113a6c){_0x45d288[_0xe546('0x44')]=_0x113a6c;return _0x45d288;})['then'](respondWithFilteredResult(_0x52af92,_0x228eac))[_0xe546('0x45')](handleError(_0x52af92,null));};exports[_0xe546('0x46')]=function(_0x389338,_0x470539){var _0x2a239c={'raw':!![],'where':{'id':_0x389338[_0xe546('0x47')]['id']}},_0x5a38c5={};_0x5a38c5['model']=_[_0xe546('0x34')](db[_0xe546('0x2e')][_0xe546('0x2f')]);_0x5a38c5[_0xe546('0x33')]=_[_0xe546('0x34')](_0x389338['query']);_0x5a38c5[_0xe546('0x35')]=_[_0xe546('0x36')](_0x5a38c5['model'],_0x5a38c5[_0xe546('0x33')]);_0x2a239c[_0xe546('0x38')]=_[_0xe546('0x36')](_0x5a38c5[_0xe546('0x32')],qs[_0xe546('0x37')](_0x389338['query'][_0xe546('0x37')]));_0x2a239c[_0xe546('0x38')]=_0x2a239c['attributes']['length']?_0x2a239c[_0xe546('0x38')]:_0x5a38c5[_0xe546('0x32')];if(_0x389338[_0xe546('0x33')]['includeAll']){_0x2a239c[_0xe546('0x42')]=[{'all':!![]}];}_0x2a239c=_[_0xe546('0x3e')]({},_0x2a239c,_0x389338[_0xe546('0x40')]);return db[_0xe546('0x2e')][_0xe546('0x48')](_0x2a239c)[_0xe546('0x27')](handleEntityNotFound(_0x470539,null))[_0xe546('0x27')](respondWithResult(_0x470539,null))[_0xe546('0x45')](handleError(_0x470539,null));};exports[_0xe546('0x49')]=function(_0xd23819,_0x3dca15){return db[_0xe546('0x2e')][_0xe546('0x49')](_0xd23819['body'],{})[_0xe546('0x27')](respondWithResult(_0x3dca15,0xc9))[_0xe546('0x45')](handleError(_0x3dca15,null));};exports[_0xe546('0x4a')]=function(_0x1ce47,_0x59ea96){if(_0x1ce47[_0xe546('0x4b')]['id']){delete _0x1ce47[_0xe546('0x4b')]['id'];}return db['ChatTransferReport'][_0xe546('0x48')]({'where':{'id':_0x1ce47['params']['id']}})[_0xe546('0x27')](handleEntityNotFound(_0x59ea96,null))['then'](saveUpdates(_0x1ce47[_0xe546('0x4b')],null))['then'](respondWithResult(_0x59ea96,null))['catch'](handleError(_0x59ea96,null));};exports['destroy']=function(_0x8053ce,_0x28ed24){return db['ChatTransferReport'][_0xe546('0x48')]({'where':{'id':_0x8053ce['params']['id']}})['then'](handleEntityNotFound(_0x28ed24,null))[_0xe546('0x27')](removeEntity(_0x28ed24,null))[_0xe546('0x45')](handleError(_0x28ed24,null));};exports[_0xe546('0x4c')]=function(_0x502976,_0x28910b){return db[_0xe546('0x2e')][_0xe546('0x4c')]()[_0xe546('0x27')](respondWithResult(_0x28910b,null))[_0xe546('0x45')](handleError(_0x28910b,null));};
\ No newline at end of file
+var _0xa042=['undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','ChatTransferReport','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xa042,0x163));var _0x2a04=function(_0x365689,_0x354de6){_0x365689=_0x365689-0x0;var _0x229a70=_0xa042[_0x365689];return _0x229a70;};'use strict';var emlformat=require(_0x2a04('0x0'));var rimraf=require(_0x2a04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a04('0x2'));var rp=require(_0x2a04('0x3'));var moment=require(_0x2a04('0x4'));var BPromise=require(_0x2a04('0x5'));var Mustache=require(_0x2a04('0x6'));var util=require('util');var path=require(_0x2a04('0x7'));var sox=require(_0x2a04('0x8'));var csv=require(_0x2a04('0x9'));var ejs=require(_0x2a04('0xa'));var fs=require('fs');var fs_extra=require(_0x2a04('0xb'));var _=require(_0x2a04('0xc'));var squel=require(_0x2a04('0xd'));var crypto=require(_0x2a04('0xe'));var jsforce=require(_0x2a04('0xf'));var deskjs=require(_0x2a04('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2a04('0x11'));var Redis=require(_0x2a04('0x12'));var authService=require(_0x2a04('0x13'));var qs=require(_0x2a04('0x14'));var as=require(_0x2a04('0x15'));var hardwareService=require(_0x2a04('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2a04('0x17'));var db=require(_0x2a04('0x18'))['db'];function respondWithStatusCode(_0x490e54,_0x34fb2f){_0x34fb2f=_0x34fb2f||0xcc;return function(_0xad19df){if(_0xad19df){return _0x490e54[_0x2a04('0x19')](_0x34fb2f);}return _0x490e54['status'](_0x34fb2f)[_0x2a04('0x1a')]();};}function respondWithResult(_0x201d17,_0x569655){_0x569655=_0x569655||0xc8;return function(_0x49d45f){if(_0x49d45f){return _0x201d17[_0x2a04('0x1b')](_0x569655)[_0x2a04('0x1c')](_0x49d45f);}};}function respondWithFilteredResult(_0x1819db,_0x43c7c7){return function(_0x182f49){if(_0x182f49){var _0x24baad=typeof _0x43c7c7[_0x2a04('0x1d')]===_0x2a04('0x1e')&&typeof _0x43c7c7[_0x2a04('0x1f')]===_0x2a04('0x1e');var _0x1bd88e=_0x182f49[_0x2a04('0x20')];var _0x17fb55=_0x24baad?0x0:_0x43c7c7[_0x2a04('0x1d')];var _0x5f1c4e=_0x24baad?_0x182f49[_0x2a04('0x20')]:_0x43c7c7[_0x2a04('0x1d')]+_0x43c7c7[_0x2a04('0x1f')];var _0x2f9f4d;if(_0x5f1c4e>=_0x1bd88e){_0x5f1c4e=_0x1bd88e;_0x2f9f4d=0xc8;}else{_0x2f9f4d=0xce;}_0x1819db['status'](_0x2f9f4d);return _0x1819db['set'](_0x2a04('0x21'),_0x17fb55+'-'+_0x5f1c4e+'/'+_0x1bd88e)[_0x2a04('0x1c')](_0x182f49);}return null;};}function patchUpdates(_0x1da682){return function(_0x169b4b){try{jsonpatch[_0x2a04('0x22')](_0x169b4b,_0x1da682,!![]);}catch(_0x407a00){return BPromise[_0x2a04('0x23')](_0x407a00);}return _0x169b4b[_0x2a04('0x24')]();};}function saveUpdates(_0x251c0d,_0x23045d){return function(_0x3ec99a){if(_0x3ec99a){return _0x3ec99a['update'](_0x251c0d)[_0x2a04('0x25')](function(_0xd6673){return _0xd6673;});}return null;};}function removeEntity(_0x3c0121,_0x11f914){return function(_0x4cdfd2){if(_0x4cdfd2){return _0x4cdfd2[_0x2a04('0x26')]()['then'](function(){_0x3c0121['status'](0xcc)[_0x2a04('0x1a')]();});}};}function handleEntityNotFound(_0x22a778,_0x482a85){return function(_0x22b98f){if(!_0x22b98f){_0x22a778[_0x2a04('0x19')](0x194);}return _0x22b98f;};}function handleError(_0x13d2a6,_0x29d0b1){_0x29d0b1=_0x29d0b1||0x1f4;return function(_0x1f96ef){logger[_0x2a04('0x27')](_0x1f96ef[_0x2a04('0x28')]);if(_0x1f96ef[_0x2a04('0x29')]){delete _0x1f96ef[_0x2a04('0x29')];}_0x13d2a6[_0x2a04('0x1b')](_0x29d0b1)['send'](_0x1f96ef);};}exports[_0x2a04('0x2a')]=function(_0x6801f6,_0x35a634){var _0x5d19bb={},_0xa6c482={},_0x2187a9={'count':0x0,'rows':[]};var _0x3393fc=_[_0x2a04('0x2b')](db[_0x2a04('0x2c')]['rawAttributes'],function(_0x49d565){return{'name':_0x49d565[_0x2a04('0x2d')],'type':_0x49d565[_0x2a04('0x2e')]['key']};});_0xa6c482[_0x2a04('0x2f')]=_['map'](_0x3393fc,_0x2a04('0x29'));_0xa6c482['query']=_[_0x2a04('0x30')](_0x6801f6[_0x2a04('0x31')]);_0xa6c482[_0x2a04('0x32')]=_[_0x2a04('0x33')](_0xa6c482['model'],_0xa6c482[_0x2a04('0x31')]);_0x5d19bb[_0x2a04('0x34')]=_[_0x2a04('0x33')](_0xa6c482[_0x2a04('0x2f')],qs[_0x2a04('0x35')](_0x6801f6[_0x2a04('0x31')][_0x2a04('0x35')]));_0x5d19bb[_0x2a04('0x34')]=_0x5d19bb['attributes'][_0x2a04('0x36')]?_0x5d19bb[_0x2a04('0x34')]:_0xa6c482[_0x2a04('0x2f')];if(!_0x6801f6[_0x2a04('0x31')][_0x2a04('0x37')](_0x2a04('0x38'))){_0x5d19bb['limit']=qs['limit'](_0x6801f6[_0x2a04('0x31')][_0x2a04('0x1f')]);_0x5d19bb[_0x2a04('0x1d')]=qs['offset'](_0x6801f6[_0x2a04('0x31')]['offset']);}_0x5d19bb[_0x2a04('0x39')]=qs[_0x2a04('0x3a')](_0x6801f6[_0x2a04('0x31')][_0x2a04('0x3a')]);_0x5d19bb[_0x2a04('0x3b')]=qs[_0x2a04('0x32')](_[_0x2a04('0x3c')](_0x6801f6['query'],_0xa6c482[_0x2a04('0x32')]),_0x3393fc);if(_0x6801f6['query']['filter']){_0x5d19bb[_0x2a04('0x3b')]=_[_0x2a04('0x3d')](_0x5d19bb['where'],{'$or':_[_0x2a04('0x2b')](_0x3393fc,function(_0x3e6934){if(_0x3e6934[_0x2a04('0x2e')]!=='VIRTUAL'){var _0x36f49b={};_0x36f49b[_0x3e6934['name']]={'$like':'%'+_0x6801f6[_0x2a04('0x31')][_0x2a04('0x3e')]+'%'};return _0x36f49b;}})});}_0x5d19bb=_['merge']({},_0x5d19bb,_0x6801f6['options']);var _0x5b6d31={'where':_0x5d19bb[_0x2a04('0x3b')]};return db[_0x2a04('0x2c')]['count'](_0x5b6d31)[_0x2a04('0x25')](function(_0x313c33){_0x2187a9['count']=_0x313c33;if(_0x6801f6['query'][_0x2a04('0x3f')]){_0x5d19bb[_0x2a04('0x40')]=[{'all':!![]}];}return db[_0x2a04('0x2c')][_0x2a04('0x41')](_0x5d19bb);})[_0x2a04('0x25')](function(_0x3a8352){_0x2187a9[_0x2a04('0x42')]=_0x3a8352;return _0x2187a9;})['then'](respondWithFilteredResult(_0x35a634,_0x5d19bb))[_0x2a04('0x43')](handleError(_0x35a634,null));};exports[_0x2a04('0x44')]=function(_0x4d8a77,_0x3d502d){var _0x51172d={'raw':!![],'where':{'id':_0x4d8a77['params']['id']}},_0x65e08b={};_0x65e08b['model']=_[_0x2a04('0x30')](db[_0x2a04('0x2c')][_0x2a04('0x45')]);_0x65e08b[_0x2a04('0x31')]=_[_0x2a04('0x30')](_0x4d8a77[_0x2a04('0x31')]);_0x65e08b[_0x2a04('0x32')]=_[_0x2a04('0x33')](_0x65e08b[_0x2a04('0x2f')],_0x65e08b[_0x2a04('0x31')]);_0x51172d[_0x2a04('0x34')]=_['intersection'](_0x65e08b[_0x2a04('0x2f')],qs['fields'](_0x4d8a77[_0x2a04('0x31')][_0x2a04('0x35')]));_0x51172d[_0x2a04('0x34')]=_0x51172d['attributes'][_0x2a04('0x36')]?_0x51172d[_0x2a04('0x34')]:_0x65e08b[_0x2a04('0x2f')];if(_0x4d8a77[_0x2a04('0x31')][_0x2a04('0x3f')]){_0x51172d[_0x2a04('0x40')]=[{'all':!![]}];}_0x51172d=_[_0x2a04('0x3d')]({},_0x51172d,_0x4d8a77[_0x2a04('0x46')]);return db[_0x2a04('0x2c')][_0x2a04('0x47')](_0x51172d)[_0x2a04('0x25')](handleEntityNotFound(_0x3d502d,null))[_0x2a04('0x25')](respondWithResult(_0x3d502d,null))[_0x2a04('0x43')](handleError(_0x3d502d,null));};exports[_0x2a04('0x48')]=function(_0x3a0464,_0x52258b){return db['ChatTransferReport'][_0x2a04('0x48')](_0x3a0464[_0x2a04('0x49')],{})[_0x2a04('0x25')](respondWithResult(_0x52258b,0xc9))[_0x2a04('0x43')](handleError(_0x52258b,null));};exports[_0x2a04('0x4a')]=function(_0x13a0ef,_0x597d7a){if(_0x13a0ef[_0x2a04('0x49')]['id']){delete _0x13a0ef[_0x2a04('0x49')]['id'];}return db[_0x2a04('0x2c')]['find']({'where':{'id':_0x13a0ef[_0x2a04('0x4b')]['id']}})[_0x2a04('0x25')](handleEntityNotFound(_0x597d7a,null))['then'](saveUpdates(_0x13a0ef[_0x2a04('0x49')],null))['then'](respondWithResult(_0x597d7a,null))['catch'](handleError(_0x597d7a,null));};exports[_0x2a04('0x26')]=function(_0x2cf70d,_0x2dd3a6){return db[_0x2a04('0x2c')][_0x2a04('0x47')]({'where':{'id':_0x2cf70d[_0x2a04('0x4b')]['id']}})[_0x2a04('0x25')](handleEntityNotFound(_0x2dd3a6,null))[_0x2a04('0x25')](removeEntity(_0x2dd3a6,null))[_0x2a04('0x43')](handleError(_0x2dd3a6,null));};exports['describe']=function(_0x44996c,_0xde46b5){return db[_0x2a04('0x2c')][_0x2a04('0x4c')]()[_0x2a04('0x25')](respondWithResult(_0xde46b5,null))[_0x2a04('0x43')](handleError(_0xde46b5,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index b002608..742c075 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 _0x4a63=['request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x4a63,0x166));var _0x34a6=function(_0x5cc556,_0x158710){_0x5cc556=_0x5cc556-0x0;var _0x12103b=_0x4a63[_0x5cc556];return _0x12103b;};'use strict';var _=require(_0x34a6('0x0'));var util=require(_0x34a6('0x1'));var logger=require(_0x34a6('0x2'))(_0x34a6('0x3'));var moment=require(_0x34a6('0x4'));var BPromise=require(_0x34a6('0x5'));var rp=require(_0x34a6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x34a6('0x7'));var config=require(_0x34a6('0x8'));var attributes=require(_0x34a6('0x9'));module[_0x34a6('0xa')]=function(_0x3c47cb,_0x47a0bf){return _0x3c47cb['define']('ChatTransferReport',attributes,{'tableName':_0x34a6('0xb'),'paranoid':![],'indexes':[{'name':_0x34a6('0xc'),'fields':[_0x34a6('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5fb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x254081,_0x20731a){var _0x5d1e2a=function(_0x597854){while(--_0x597854){_0x254081['push'](_0x254081['shift']());}};_0x5d1e2a(++_0x20731a);}(_0xd5fb,0x6d));var _0xbd5f=function(_0x33a432,_0x1acced){_0x33a432=_0x33a432-0x0;var _0x45bd47=_0xd5fb[_0x33a432];return _0x45bd47;};'use strict';var _=require(_0xbd5f('0x0'));var util=require(_0xbd5f('0x1'));var logger=require(_0xbd5f('0x2'))('api');var moment=require(_0xbd5f('0x3'));var BPromise=require(_0xbd5f('0x4'));var rp=require(_0xbd5f('0x5'));var fs=require('fs');var path=require(_0xbd5f('0x6'));var rimraf=require(_0xbd5f('0x7'));var config=require(_0xbd5f('0x8'));var attributes=require(_0xbd5f('0x9'));module[_0xbd5f('0xa')]=function(_0x43c942,_0x5e592f){return _0x43c942['define'](_0xbd5f('0xb'),attributes,{'tableName':_0xbd5f('0xc'),'paranoid':![],'indexes':[{'name':_0xbd5f('0xd'),'fields':[_0xbd5f('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 716718b..618099a 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 _0xed8c=['request\x20sent','stringify','error','code','message','info','result','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatTransferReport,\x20%s,\x20%s','debug'];(function(_0x4147ff,_0x154530){var _0x1e71e6=function(_0x21f992){while(--_0x21f992){_0x4147ff['push'](_0x4147ff['shift']());}};_0x1e71e6(++_0x154530);}(_0xed8c,0x16f));var _0xced8=function(_0x3e72bf,_0x19ea8c){_0x3e72bf=_0x3e72bf-0x0;var _0x4ce1bc=_0xed8c[_0x3e72bf];return _0x4ce1bc;};'use strict';var _=require('lodash');var util=require(_0xced8('0x0'));var moment=require(_0xced8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xced8('0x3'));var logger=require(_0xced8('0x4'))(_0xced8('0x5'));var config=require(_0xced8('0x6'));var jayson=require(_0xced8('0x7'));var client=jayson[_0xced8('0x8')][_0xced8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36159e,_0x5ed615,_0x2e16bd){return new BPromise(function(_0x1c07ca,_0x1cd7ce){return client[_0xced8('0xa')](_0x36159e,_0x2e16bd)['then'](function(_0x453329){logger['info'](_0xced8('0xb'),_0x5ed615,'request\x20sent');logger[_0xced8('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5ed615,_0xced8('0xd'),JSON[_0xced8('0xe')](_0x453329));if(_0x453329[_0xced8('0xf')]){if(_0x453329[_0xced8('0xf')][_0xced8('0x10')]===0x1f4){logger[_0xced8('0xf')](_0xced8('0xb'),_0x5ed615,_0x453329[_0xced8('0xf')][_0xced8('0x11')]);return _0x1cd7ce(_0x453329['error'][_0xced8('0x11')]);}logger['error'](_0xced8('0xb'),_0x5ed615,_0x453329[_0xced8('0xf')][_0xced8('0x11')]);return _0x1c07ca(_0x453329['error'][_0xced8('0x11')]);}else{logger[_0xced8('0x12')](_0xced8('0xb'),_0x5ed615,_0xced8('0xd'));_0x1c07ca(_0x453329[_0xced8('0x13')][_0xced8('0x11')]);}})['catch'](function(_0x3eef56){logger[_0xced8('0xf')](_0xced8('0xb'),_0x5ed615,_0x3eef56);_0x1cd7ce(_0x3eef56);});});}
\ No newline at end of file
+var _0x5172=['stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x10a160,_0x1d07ce){var _0x141ec9=function(_0x302d3a){while(--_0x302d3a){_0x10a160['push'](_0x10a160['shift']());}};_0x141ec9(++_0x1d07ce);}(_0x5172,0x16c));var _0x2517=function(_0x5586fe,_0x2edbe){_0x5586fe=_0x5586fe-0x0;var _0x114a56=_0x5172[_0x5586fe];return _0x114a56;};'use strict';var _=require('lodash');var util=require(_0x2517('0x0'));var moment=require(_0x2517('0x1'));var BPromise=require('bluebird');var rs=require(_0x2517('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2517('0x3'))['db'];var utils=require(_0x2517('0x4'));var logger=require('../../config/logger')(_0x2517('0x5'));var config=require('../../config/environment');var jayson=require(_0x2517('0x6'));var client=jayson[_0x2517('0x7')][_0x2517('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x465380,_0x261b39,_0x2a13f5){return new BPromise(function(_0x225346,_0x2e8ed4){return client[_0x2517('0x9')](_0x465380,_0x2a13f5)[_0x2517('0xa')](function(_0x38ac25){logger[_0x2517('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x261b39,_0x2517('0xc'));logger[_0x2517('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x261b39,'request\x20sent',JSON[_0x2517('0xe')](_0x38ac25));if(_0x38ac25[_0x2517('0xf')]){if(_0x38ac25['error'][_0x2517('0x10')]===0x1f4){logger['error'](_0x2517('0x11'),_0x261b39,_0x38ac25[_0x2517('0xf')][_0x2517('0x12')]);return _0x2e8ed4(_0x38ac25['error'][_0x2517('0x12')]);}logger[_0x2517('0xf')](_0x2517('0x11'),_0x261b39,_0x38ac25[_0x2517('0xf')]['message']);return _0x225346(_0x38ac25[_0x2517('0xf')]['message']);}else{logger[_0x2517('0xb')](_0x2517('0x11'),_0x261b39,_0x2517('0xc'));_0x225346(_0x38ac25[_0x2517('0x13')][_0x2517('0x12')]);}})[_0x2517('0x14')](function(_0x5b389b){logger[_0x2517('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x261b39,_0x5b389b);_0x2e8ed4(_0x5b389b);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 1f2b5d3..95b7546 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 _0x643a=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer'];(function(_0x6e5e99,_0x3b3104){var _0x1145d8=function(_0x4a3527){while(--_0x4a3527){_0x6e5e99['push'](_0x6e5e99['shift']());}};_0x1145d8(++_0x3b3104);}(_0x643a,0x107));var _0xa643=function(_0x24eb13,_0x9bf446){_0x24eb13=_0x24eb13-0x0;var _0x36d230=_0x643a[_0x24eb13];return _0x36d230;};'use strict';var multer=require(_0xa643('0x0'));var util=require(_0xa643('0x1'));var path=require(_0xa643('0x2'));var timeout=require(_0xa643('0x3'));var express=require(_0xa643('0x4'));var router=express[_0xa643('0x5')]();var fs_extra=require(_0xa643('0x6'));var auth=require(_0xa643('0x7'));var interaction=require(_0xa643('0x8'));var config=require(_0xa643('0x9'));var controller=require('./chatTransferReport.controller');router[_0xa643('0xa')]('/',auth[_0xa643('0xb')](),controller[_0xa643('0xc')]);router[_0xa643('0xa')](_0xa643('0xd'),auth['isAuthenticated'](),controller[_0xa643('0xe')]);router['get'](_0xa643('0xf'),auth[_0xa643('0xb')](),controller[_0xa643('0x10')]);router[_0xa643('0x11')]('/',auth[_0xa643('0xb')](),controller[_0xa643('0x12')]);router[_0xa643('0x13')](_0xa643('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xa643('0x14')](_0xa643('0xf'),auth[_0xa643('0xb')](),controller['destroy']);module[_0xa643('0x15')]=router;
\ No newline at end of file
+var _0xa359=['update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put'];(function(_0x380d16,_0xdf0d31){var _0x5d5253=function(_0x7a25bc){while(--_0x7a25bc){_0x380d16['push'](_0x380d16['shift']());}};_0x5d5253(++_0xdf0d31);}(_0xa359,0x16c));var _0x9a35=function(_0x37358d,_0x2a91e7){_0x37358d=_0x37358d-0x0;var _0x379c7e=_0xa359[_0x37358d];return _0x379c7e;};'use strict';var multer=require(_0x9a35('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9a35('0x1'));var express=require('express');var router=express[_0x9a35('0x2')]();var fs_extra=require(_0x9a35('0x3'));var auth=require(_0x9a35('0x4'));var interaction=require(_0x9a35('0x5'));var config=require(_0x9a35('0x6'));var controller=require(_0x9a35('0x7'));router[_0x9a35('0x8')]('/',auth[_0x9a35('0x9')](),controller[_0x9a35('0xa')]);router[_0x9a35('0x8')](_0x9a35('0xb'),auth[_0x9a35('0x9')](),controller[_0x9a35('0xc')]);router[_0x9a35('0x8')](_0x9a35('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9a35('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9a35('0xf')]('/:id',auth[_0x9a35('0x9')](),controller[_0x9a35('0x10')]);router['delete'](_0x9a35('0xd'),auth[_0x9a35('0x9')](),controller[_0x9a35('0x11')]);module[_0x9a35('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index cf805f7..2c79891 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 _0x4483=['email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','star','thumb','input','name','getDataValue','parse','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Send','website_alias','bottom_right','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address'];(function(_0x4a6079,_0x2f328d){var _0x22cf53=function(_0x250fd6){while(--_0x250fd6){_0x4a6079['push'](_0x4a6079['shift']());}};_0x22cf53(++_0x2f328d);}(_0x4483,0x1a3));var _0x3448=function(_0x1ee348,_0x4a82eb){_0x1ee348=_0x1ee348-0x0;var _0x59313e=_0x4483[_0x1ee348];return _0x59313e;};'use strict';var Sequelize=require(_0x3448('0x0'));var rs=require(_0x3448('0x1'));module[_0x3448('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x3448('0x3')],'allowNull':![],'unique':_0x3448('0x4')},'description':{'type':Sequelize[_0x3448('0x3')]},'mapKey':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x5')},'key':{'type':Sequelize[_0x3448('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x6')},'customerAlias':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3448('0x3')],'allowNull':![],'defaultValue':_0x3448('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3448('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3448('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x3448('0x3')],'allowNull':![],'defaultValue':_0x3448('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3448('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3448('0x3')]},'animation':{'type':Sequelize[_0x3448('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3448('0xb')](_0x3448('0xc'),_0x3448('0xd')),'defaultValue':_0x3448('0xc')},'header_online':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0xe')},'offline_chat_button':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0xf')},'download_transcript':{'type':Sequelize[_0x3448('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3448('0x11')]},'closingQuestion':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x14')},'noteTitle':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x15')},'placeholderMessage':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x16')},'closingMessage':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x17')},'ratingType':{'type':Sequelize[_0x3448('0xb')](_0x3448('0x18'),_0x3448('0x19')),'defaultValue':_0x3448('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3448('0x1a'),'variable':null,'config':{'placeholder':_0x3448('0x1b'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x3448('0x1a'),'props':{'title':_0x3448('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3448('0x5'),'type':_0x3448('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3448('0x1c')]('onlineForm')?JSON[_0x3448('0x1d')](this[_0x3448('0x1c')](_0x3448('0x1e'))):{};},'set':function(_0x2088de){return this[_0x3448('0x1f')]('onlineForm',JSON[_0x3448('0x20')](_0x2088de));}},'offlineForm':{'type':Sequelize[_0x3448('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3448('0x1a'),'props':{'title':_0x3448('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3448('0x5'),'type':_0x3448('0x5')},'variable':null},{'type':_0x3448('0x21'),'config':{'placeholder':_0x3448('0x22')},'props':{'title':_0x3448('0x22'),'helpText':_0x3448('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x3448('0x24'))?JSON[_0x3448('0x1d')](this[_0x3448('0x1c')]('offlineForm')):{};},'set':function(_0x1b8dbb){return this['setDataValue']('offlineForm',JSON['stringify'](_0x1b8dbb));}},'token':{'type':Sequelize[_0x3448('0x3')],'defaultValue':function(){return rs[_0x3448('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3448('0x3')]},'forwardOffline':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3448('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x26')},'waitingMessage':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x28')},'offlineMessageBody':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x29')},'skipUnmanaged':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x2a')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x2b')},'enableCustomerAttachment':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3448('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3448('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3448('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3448('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3448('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x2d')},'verticalAlignment':{'type':Sequelize[_0x3448('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x3448('0x3')]},'customerAvatar':{'type':Sequelize[_0x3448('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3448('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3448('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3448('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3448('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x2f')},'systemAvatar':{'type':Sequelize[_0x3448('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3448('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![],'comment':_0x3448('0x30'),'set':function(_0x322b46){if(!_0x322b46)this[_0x3448('0x1f')](_0x3448('0x31'),null);this['setDataValue'](_0x3448('0x32'),_0x322b46);}},'vidaooEscalation':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3448('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3448('0x3')],'allowNull':![],'defaultValue':_0x3448('0x33')},'vidaooNote':{'type':Sequelize[_0x3448('0x3')],'defaultValue':function(){return _0x3448('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x3448('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3448('0x11')]}};
\ No newline at end of file
+var _0x41bb=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','name','text','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x3476ef,_0x32ea5a){var _0x3fd996=function(_0x21abd8){while(--_0x21abd8){_0x3476ef['push'](_0x3476ef['shift']());}};_0x3fd996(++_0x32ea5a);}(_0x41bb,0xc5));var _0xb41b=function(_0x17bc0b,_0x6a110c){_0x17bc0b=_0x17bc0b-0x0;var _0x3c82a2=_0x41bb[_0x17bc0b];return _0x3c82a2;};'use strict';var Sequelize=require(_0xb41b('0x0'));var rs=require(_0xb41b('0x1'));module['exports']={'name':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb41b('0x3')},'description':{'type':Sequelize[_0xb41b('0x2')]},'mapKey':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x4')},'key':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb41b('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb41b('0x2')]},'animation':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb41b('0x9'),'squared'),'defaultValue':_0xb41b('0x9')},'header_online':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xa')},'start_chat_button':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0xc')},'header_offline':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xd')},'download_transcript':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb41b('0xe')]},'closingQuestion':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x11')},'noteTitle':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x12')},'placeholderMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x13')},'closingMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xb41b('0x16')](_0xb41b('0x17'),_0xb41b('0x18')),'defaultValue':_0xb41b('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xb41b('0x19'),'type':_0xb41b('0x1a'),'required':!![]},'props':{'title':_0xb41b('0x19'),'helpText':''}},{'type':'input','props':{'title':_0xb41b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb41b('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb41b('0x1b')](_0xb41b('0x1c'))?JSON['parse'](this[_0xb41b('0x1b')]('onlineForm')):{};},'set':function(_0x2d0f27){return this[_0xb41b('0x1d')]('onlineForm',JSON[_0xb41b('0x1e')](_0x2d0f27));}},'offlineForm':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xb41b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb41b('0x4'),'type':_0xb41b('0x4')},'variable':null},{'type':_0xb41b('0x1f'),'config':{'placeholder':_0xb41b('0x20')},'props':{'title':_0xb41b('0x20'),'helpText':_0xb41b('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xb41b('0x22'))?JSON[_0xb41b('0x23')](this['getDataValue'](_0xb41b('0x22'))):{};},'set':function(_0x482764){return this[_0xb41b('0x1d')](_0xb41b('0x22'),JSON['stringify'](_0x482764));}},'token':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb41b('0x2')]},'forwardOffline':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb41b('0x2')]},'waitingTitle':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x24')},'waitingMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x26')},'offlineMessageBody':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x15')},'sendUnmanaged':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb41b('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb41b('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return _0xb41b('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x2a')},'defaultTitle':{'type':Sequelize[_0xb41b('0x2')]},'customerAvatar':{'type':Sequelize[_0xb41b('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb41b('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x2c')},'systemAvatar':{'type':Sequelize[_0xb41b('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb41b('0x7')],'comment':_0xb41b('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x49e8c4){if(!_0x49e8c4)this['setDataValue'](_0xb41b('0x2e'),null);this['setDataValue']('mandatoryDisposition',_0x49e8c4);}},'vidaooEscalation':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x2f')},'vidaooNote':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':function(){return _0xb41b('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb41b('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 22f9fe1..596a0bf 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 _0x8275=['message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','update','then','get','ChatWebsites','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','options','include','findAll','show','params','includeAll','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','file','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','headers','user-agent','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','applications','Applications','list','priority','asc','account','Contacts','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','forcedOwnership','Start','startRouting','EventManager','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','user','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','email','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','increment','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.ejs','URL','address','remote','x-real-ip','referer','virtual','replace','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8275,0x113));var _0x5827=function(_0x53da50,_0x2b4efc){_0x53da50=_0x53da50-0x0;var _0x365cb3=_0x8275[_0x53da50];return _0x365cb3;};'use strict';var BPromise=require(_0x5827('0x0'));var Mustache=require('mustache');var util=require(_0x5827('0x1'));var path=require(_0x5827('0x2'));var ejs=require(_0x5827('0x3'));var fs=require('fs');var fs_extra=require(_0x5827('0x4'));var _=require(_0x5827('0x5'));var querystring=require(_0x5827('0x6'));var Redis=require(_0x5827('0x7'));var qs=require(_0x5827('0x8'));var logger=require(_0x5827('0x9'))(_0x5827('0xa'));var config=require(_0x5827('0xb'));var url=require(_0x5827('0xc'));var db=require(_0x5827('0xd'))['db'];config['redis']=_['defaults'](config[_0x5827('0xe')],{'host':_0x5827('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5827('0x10'))[_0x5827('0x11')](socket);var htmlToText=require(_0x5827('0x12'));var jayson=require(_0x5827('0x13'));var client=jayson[_0x5827('0x14')][_0x5827('0x15')]({'port':0x232c});var client9002=jayson[_0x5827('0x14')][_0x5827('0x15')]({'port':0x232a});var client9003=jayson['client'][_0x5827('0x15')]({'port':0x232b});var client9001=jayson[_0x5827('0x14')][_0x5827('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x5b975c,_0x499bf9,_0x484390,_0x15d76b){return new BPromise(function(_0x3be335,_0x385a0b){var _0x2e71a9=_0x15d76b||client;return _0x2e71a9[_0x5827('0x16')](_0x5b975c,_0x484390)['then'](function(_0x322615){logger[_0x5827('0x17')](_0x5827('0x18'),_0x499bf9,_0x5827('0x19'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x499bf9,_0x5827('0x19'),JSON[_0x5827('0x1a')](_0x322615));if(_0x322615[_0x5827('0x1b')]){if(_0x322615[_0x5827('0x1b')]['code']===0x1f4){logger['error'](_0x5827('0x18'),_0x499bf9,_0x322615[_0x5827('0x1b')]['message']);return _0x385a0b(_0x322615[_0x5827('0x1b')][_0x5827('0x1c')]);}logger[_0x5827('0x1b')](_0x5827('0x18'),_0x499bf9,_0x322615[_0x5827('0x1b')][_0x5827('0x1c')]);return _0x3be335(_0x322615[_0x5827('0x1b')]['message']);}else{logger[_0x5827('0x17')](_0x5827('0x18'),_0x499bf9,_0x5827('0x19'));_0x3be335(_0x322615[_0x5827('0x1d')][_0x5827('0x1c')]);}})[_0x5827('0x1e')](function(_0x1e532d){logger[_0x5827('0x1b')](_0x5827('0x18'),_0x499bf9,_0x1e532d);_0x385a0b(_0x1e532d);});});}function respondWithStatusCode(_0x143083,_0x5aca1c){_0x5aca1c=_0x5aca1c||0xcc;return function(_0x50e7ba){if(_0x50e7ba){return _0x143083[_0x5827('0x1f')](_0x5aca1c);}return _0x143083[_0x5827('0x20')](_0x5aca1c)[_0x5827('0x21')]();};}function respondWithResult(_0x14ce2e,_0x1f73c6){_0x1f73c6=_0x1f73c6||0xc8;return function(_0x5e5862){if(_0x5e5862){return _0x14ce2e['status'](_0x1f73c6)[_0x5827('0x22')](_0x5e5862);}};}function respondWithFilteredResult(_0x34c91a,_0x2467e3){return function(_0x41b0a7){if(_0x41b0a7){var _0x5e2112=typeof _0x2467e3['offset']==='undefined'&&typeof _0x2467e3[_0x5827('0x23')]===_0x5827('0x24');var _0x41a719=_0x41b0a7[_0x5827('0x25')];var _0x16f857=_0x5e2112?0x0:_0x2467e3[_0x5827('0x26')];var _0xdc0284=_0x5e2112?_0x41b0a7[_0x5827('0x25')]:_0x2467e3[_0x5827('0x26')]+_0x2467e3[_0x5827('0x23')];var _0x4bf9c7;if(_0xdc0284>=_0x41a719){_0xdc0284=_0x41a719;_0x4bf9c7=0xc8;}else{_0x4bf9c7=0xce;}_0x34c91a['status'](_0x4bf9c7);return _0x34c91a[_0x5827('0x27')]('Content-Range',_0x16f857+'-'+_0xdc0284+'/'+_0x41a719)[_0x5827('0x22')](_0x41b0a7);}return null;};}function saveUpdates(_0x2a1532){return function(_0x2af046){if(_0x2af046){return _0x2af046[_0x5827('0x28')](_0x2a1532)[_0x5827('0x29')](function(_0x2c6d75){return _0x2c6d75;});}return null;};}function removeEntity(_0x17b4e9){return function(_0x3ade14){if(_0x3ade14){return _0x3ade14['destroy']()[_0x5827('0x29')](function(){var _0x319fda=_0x3ade14[_0x5827('0x2a')]({'plain':!![]});var _0x4f0f6=_0x5827('0x2b');return db[_0x5827('0x2c')][_0x5827('0x2d')]({'where':{'type':_0x4f0f6,'resourceId':_0x319fda['id']}})[_0x5827('0x29')](function(){return _0x3ade14;});})['then'](function(){_0x17b4e9[_0x5827('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ac992){return function(_0x35fc2c){if(!_0x35fc2c){_0x2ac992[_0x5827('0x1f')](0x194);}return _0x35fc2c;};}function handleError(_0x5098bc,_0x568255){_0x568255=_0x568255||0x1f4;return function(_0x8e3a11){logger[_0x5827('0x1b')](_0x8e3a11[_0x5827('0x2e')]);if(_0x8e3a11[_0x5827('0x2f')]){delete _0x8e3a11[_0x5827('0x2f')];}_0x5098bc[_0x5827('0x20')](_0x568255)['send'](_0x8e3a11);};}exports[_0x5827('0x30')]=function(_0x292bfa,_0x10873a){var _0xafad12={'include':[{'model':db[_0x5827('0x31')],'as':_0x5827('0x32')}]},_0x1ae58b={},_0x493bbd={'count':0x0,'rows':[]};var _0x472a04=_[_0x5827('0x33')](db[_0x5827('0x34')][_0x5827('0x35')],function(_0x4f5393){return{'name':_0x4f5393['fieldName'],'type':_0x4f5393[_0x5827('0x36')][_0x5827('0x37')]};});_0x1ae58b['model']=_[_0x5827('0x33')](_0x472a04,_0x5827('0x2f'));_0x1ae58b[_0x5827('0x38')]=_[_0x5827('0x39')](_0x292bfa['query']);_0x1ae58b['filters']=_[_0x5827('0x3a')](_0x1ae58b[_0x5827('0x3b')],_0x1ae58b[_0x5827('0x38')]);_0xafad12[_0x5827('0x3c')]=_[_0x5827('0x3a')](_0x1ae58b[_0x5827('0x3b')],qs[_0x5827('0x3d')](_0x292bfa[_0x5827('0x38')][_0x5827('0x3d')]));_0xafad12[_0x5827('0x3c')]=_0xafad12[_0x5827('0x3c')][_0x5827('0x3e')]?_0xafad12[_0x5827('0x3c')]:_0x1ae58b['model'];if(!_0x292bfa[_0x5827('0x38')][_0x5827('0x3f')]('nolimit')){_0xafad12[_0x5827('0x23')]=qs[_0x5827('0x23')](_0x292bfa[_0x5827('0x38')][_0x5827('0x23')]);_0xafad12[_0x5827('0x26')]=qs[_0x5827('0x26')](_0x292bfa[_0x5827('0x38')]['offset']);}_0xafad12[_0x5827('0x40')]=qs[_0x5827('0x41')](_0x292bfa[_0x5827('0x38')][_0x5827('0x41')]);_0xafad12[_0x5827('0x42')]=qs['filters'](_[_0x5827('0x43')](_0x292bfa[_0x5827('0x38')],_0x1ae58b[_0x5827('0x44')]),_0x472a04);if(_0x292bfa[_0x5827('0x38')][_0x5827('0x45')]){_0xafad12['where']=_['merge'](_0xafad12['where'],{'$or':_[_0x5827('0x33')](_0x472a04,function(_0x515c85){if(_0x515c85['type']!==_0x5827('0x46')){var _0x55b7b4={};_0x55b7b4[_0x515c85[_0x5827('0x2f')]]={'$like':'%'+_0x292bfa[_0x5827('0x38')]['filter']+'%'};return _0x55b7b4;}})});}_0xafad12=_['merge']({},_0xafad12,_0x292bfa[_0x5827('0x47')]);var _0x48ab11={'where':_0xafad12[_0x5827('0x42')]};return db[_0x5827('0x34')][_0x5827('0x25')](_0x48ab11)[_0x5827('0x29')](function(_0x5b87aa){_0x493bbd[_0x5827('0x25')]=_0x5b87aa;if(_0x292bfa[_0x5827('0x38')]['includeAll']){_0xafad12[_0x5827('0x48')]=[{'all':!![]}];}return db['ChatWebsite'][_0x5827('0x49')](_0xafad12);})[_0x5827('0x29')](function(_0x5174e9){_0x493bbd['rows']=_0x5174e9;return _0x493bbd;})[_0x5827('0x29')](respondWithFilteredResult(_0x10873a,_0xafad12))[_0x5827('0x1e')](handleError(_0x10873a,null));};exports[_0x5827('0x4a')]=function(_0x2eaa3b,_0x363fe2){var _0x45a3a6={'raw':![],'where':{'id':_0x2eaa3b[_0x5827('0x4b')]['id']},'include':[{'model':db[_0x5827('0x31')],'as':_0x5827('0x32')}]},_0xa41ba7={};_0xa41ba7[_0x5827('0x3b')]=_[_0x5827('0x39')](db[_0x5827('0x34')][_0x5827('0x35')]);_0xa41ba7[_0x5827('0x38')]=_['keys'](_0x2eaa3b[_0x5827('0x38')]);_0xa41ba7['filters']=_[_0x5827('0x3a')](_0xa41ba7[_0x5827('0x3b')],_0xa41ba7[_0x5827('0x38')]);_0x45a3a6[_0x5827('0x3c')]=_[_0x5827('0x3a')](_0xa41ba7[_0x5827('0x3b')],qs['fields'](_0x2eaa3b['query'][_0x5827('0x3d')]));_0x45a3a6['attributes']=_0x45a3a6[_0x5827('0x3c')][_0x5827('0x3e')]?_0x45a3a6[_0x5827('0x3c')]:_0xa41ba7[_0x5827('0x3b')];if(_0x2eaa3b[_0x5827('0x38')][_0x5827('0x4c')]){_0x45a3a6['include']=[{'all':!![]}];}_0x45a3a6=_[_0x5827('0x4d')]({},_0x45a3a6,_0x2eaa3b[_0x5827('0x47')]);return db[_0x5827('0x34')][_0x5827('0x4e')](_0x45a3a6)[_0x5827('0x29')](handleEntityNotFound(_0x363fe2,null))['then'](respondWithResult(_0x363fe2,null))['catch'](handleError(_0x363fe2,null));};exports[_0x5827('0x4f')]=function(_0x2375c3,_0x415135){return db['ChatWebsite'][_0x5827('0x4f')](_0x2375c3[_0x5827('0x50')],{})[_0x5827('0x29')](function(_0x411f3){var _0x41703e=_0x2375c3['user'][_0x5827('0x2a')]({'plain':!![]});if(!_0x41703e)throw new Error(_0x5827('0x51'));if(_0x41703e[_0x5827('0x52')]==='user'){var _0x51addb=_0x411f3['get']({'plain':!![]});var _0x298161=_0x5827('0x2b');return db[_0x5827('0x53')][_0x5827('0x4e')]({'where':{'name':_0x298161,'userProfileId':_0x41703e[_0x5827('0x54')]},'raw':!![]})[_0x5827('0x29')](function(_0xe08471){if(_0xe08471&&_0xe08471[_0x5827('0x55')]===0x0){return db[_0x5827('0x2c')][_0x5827('0x4f')]({'name':_0x51addb[_0x5827('0x2f')],'resourceId':_0x51addb['id'],'type':_0xe08471[_0x5827('0x2f')],'sectionId':_0xe08471['id']},{})['then'](function(){return _0x411f3;});}else{return _0x411f3;}})['catch'](function(_0x1a04e1){logger[_0x5827('0x1b')](_0x5827('0x56'),_0x1a04e1);throw _0x1a04e1;});}return _0x411f3;})[_0x5827('0x29')](respondWithResult(_0x415135,0xc9))[_0x5827('0x1e')](handleError(_0x415135,null));};exports[_0x5827('0x28')]=function(_0x40f85a,_0x137246){if(_0x40f85a['body']['id']){delete _0x40f85a[_0x5827('0x50')]['id'];}return db[_0x5827('0x34')][_0x5827('0x4e')]({'where':{'id':_0x40f85a[_0x5827('0x4b')]['id']},'include':[{'model':db[_0x5827('0x31')],'as':_0x5827('0x32')}]})[_0x5827('0x29')](handleEntityNotFound(_0x137246,null))[_0x5827('0x29')](saveUpdates(_0x40f85a[_0x5827('0x50')],null))[_0x5827('0x29')](respondWithResult(_0x137246,null))['catch'](handleError(_0x137246,null));};exports[_0x5827('0x2d')]=function(_0x3262ab,_0x535f1a){return db[_0x5827('0x34')][_0x5827('0x4e')]({'where':{'id':_0x3262ab['params']['id']}})['then'](handleEntityNotFound(_0x535f1a,null))[_0x5827('0x29')](removeEntity(_0x535f1a,null))[_0x5827('0x1e')](handleError(_0x535f1a,null));};exports[_0x5827('0x57')]=function(_0x598c1f,_0x287da3){return db[_0x5827('0x34')][_0x5827('0x57')]()[_0x5827('0x29')](respondWithResult(_0x287da3,null))[_0x5827('0x1e')](handleError(_0x287da3,null));};exports[_0x5827('0x58')]=function(_0x1f9dc8,_0x5dffc7){if(_0x1f9dc8['body']['id']){delete _0x1f9dc8[_0x5827('0x50')]['id'];}return db[_0x5827('0x34')]['find']({'where':{'id':_0x1f9dc8[_0x5827('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5dffc7,null))[_0x5827('0x29')](function(_0x2bf582){if(_0x2bf582){_0x1f9dc8[_0x5827('0x50')][_0x5827('0x59')]=_0x2bf582['id'];return db[_0x5827('0x5a')][_0x5827('0x4f')](_0x1f9dc8['body']);}})[_0x5827('0x29')](respondWithResult(_0x5dffc7,null))[_0x5827('0x1e')](handleError(_0x5dffc7,null));};exports[_0x5827('0x5b')]=function(_0x4b31ef,_0x9a655b){var _0xc66208={'raw':![],'where':{}};var _0x340436={};var _0xd48dd={'count':0x0,'rows':[]};return db[_0x5827('0x34')][_0x5827('0x5c')]({'where':{'id':_0x4b31ef[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x9a655b,null))[_0x5827('0x29')](function(_0x1a430d){if(_0x1a430d){_0x340436[_0x5827('0x3b')]=_[_0x5827('0x39')](db[_0x5827('0x5a')][_0x5827('0x35')]);_0x340436[_0x5827('0x38')]=_['keys'](_0x4b31ef['query']);_0x340436[_0x5827('0x44')]=_['intersection'](_0x340436[_0x5827('0x3b')],_0x340436[_0x5827('0x38')]);_0xc66208[_0x5827('0x3c')]=_[_0x5827('0x3a')](_0x340436['model'],qs[_0x5827('0x3d')](_0x4b31ef[_0x5827('0x38')][_0x5827('0x3d')]));_0xc66208[_0x5827('0x3c')]=_0xc66208[_0x5827('0x3c')][_0x5827('0x3e')]?_0xc66208['attributes']:_0x340436[_0x5827('0x3b')];if(!_0x4b31ef[_0x5827('0x38')][_0x5827('0x3f')](_0x5827('0x5d'))){_0xc66208[_0x5827('0x23')]=qs[_0x5827('0x23')](_0x4b31ef['query'][_0x5827('0x23')]);_0xc66208[_0x5827('0x26')]=qs['offset'](_0x4b31ef[_0x5827('0x38')][_0x5827('0x26')]);}_0xc66208[_0x5827('0x40')]=qs[_0x5827('0x41')](_0x4b31ef[_0x5827('0x38')][_0x5827('0x41')]);_0xc66208[_0x5827('0x42')]=qs[_0x5827('0x44')](_[_0x5827('0x43')](_0x4b31ef[_0x5827('0x38')],_0x340436[_0x5827('0x44')]));_0xc66208['where'][_0x5827('0x59')]=_0x1a430d['id'];if(_0x4b31ef['query'][_0x5827('0x45')]){_0xc66208[_0x5827('0x42')]=_[_0x5827('0x4d')](_0xc66208[_0x5827('0x42')],{'$or':_[_0x5827('0x33')](_0xc66208[_0x5827('0x3c')],function(_0x24d6f0){var _0x189b2c={};_0x189b2c[_0x24d6f0]={'$like':'%'+_0x4b31ef[_0x5827('0x38')][_0x5827('0x45')]+'%'};return _0x189b2c;})});}_0xc66208=_[_0x5827('0x4d')]({},_0xc66208,_0x4b31ef[_0x5827('0x47')]);return db[_0x5827('0x5a')][_0x5827('0x25')]({'where':_0xc66208[_0x5827('0x42')]})[_0x5827('0x29')](function(_0x5290bc){_0xd48dd[_0x5827('0x25')]=_0x5290bc;if(_0x4b31ef[_0x5827('0x38')][_0x5827('0x4c')]){_0xc66208[_0x5827('0x48')]=[{'all':!![]}];}return db[_0x5827('0x5a')][_0x5827('0x49')](_0xc66208);})[_0x5827('0x29')](function(_0x5d2b63){_0xd48dd[_0x5827('0x5e')]=_0x5d2b63;return _0xd48dd;});}})[_0x5827('0x29')](respondWithFilteredResult(_0x9a655b,_0xc66208))['catch'](handleError(_0x9a655b,null));};exports[_0x5827('0x5f')]=function(_0xd91d69,_0x453052){return db[_0x5827('0x34')][_0x5827('0x4e')]({'where':{'id':_0xd91d69[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x453052,null))[_0x5827('0x29')](function(_0x46695b){if(_0x46695b){return _0x46695b[_0x5827('0x5f')](_0xd91d69[_0x5827('0x38')][_0x5827('0x60')]);}})[_0x5827('0x29')](respondWithStatusCode(_0x453052,null))[_0x5827('0x1e')](handleError(_0x453052,null));};exports[_0x5827('0x61')]=function(_0x4fbe4d,_0x537cad){if(_0x4fbe4d[_0x5827('0x50')]['id']){delete _0x4fbe4d[_0x5827('0x50')]['id'];}return db[_0x5827('0x34')][_0x5827('0x4e')]({'where':{'id':_0x4fbe4d[_0x5827('0x4b')]['id']}})['then'](handleEntityNotFound(_0x537cad,null))[_0x5827('0x29')](function(_0x5ed6cc){if(_0x5ed6cc){_0x4fbe4d['body'][_0x5827('0x59')]=_0x5ed6cc['id'];return db[_0x5827('0x62')][_0x5827('0x4f')](_0x4fbe4d[_0x5827('0x50')]);}})[_0x5827('0x29')](respondWithResult(_0x537cad,null))[_0x5827('0x1e')](handleError(_0x537cad,null));};exports['getAnswers']=function(_0x44c0d0,_0x93d69b){var _0x2d7b84={'raw':![],'where':{}};var _0xb0ac34={};var _0x2c3876={'count':0x0,'rows':[]};return db[_0x5827('0x34')][_0x5827('0x5c')]({'where':{'id':_0x44c0d0[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x93d69b,null))['then'](function(_0x33b012){if(_0x33b012){_0xb0ac34['model']=_['keys'](db[_0x5827('0x62')][_0x5827('0x35')]);_0xb0ac34[_0x5827('0x38')]=_[_0x5827('0x39')](_0x44c0d0['query']);_0xb0ac34[_0x5827('0x44')]=_[_0x5827('0x3a')](_0xb0ac34[_0x5827('0x3b')],_0xb0ac34[_0x5827('0x38')]);_0x2d7b84[_0x5827('0x3c')]=_[_0x5827('0x3a')](_0xb0ac34[_0x5827('0x3b')],qs['fields'](_0x44c0d0[_0x5827('0x38')][_0x5827('0x3d')]));_0x2d7b84[_0x5827('0x3c')]=_0x2d7b84[_0x5827('0x3c')][_0x5827('0x3e')]?_0x2d7b84[_0x5827('0x3c')]:_0xb0ac34[_0x5827('0x3b')];if(!_0x44c0d0[_0x5827('0x38')]['hasOwnProperty'](_0x5827('0x5d'))){_0x2d7b84['limit']=qs[_0x5827('0x23')](_0x44c0d0['query'][_0x5827('0x23')]);_0x2d7b84[_0x5827('0x26')]=qs[_0x5827('0x26')](_0x44c0d0[_0x5827('0x38')][_0x5827('0x26')]);}_0x2d7b84[_0x5827('0x40')]=qs['sort'](_0x44c0d0[_0x5827('0x38')][_0x5827('0x41')]);_0x2d7b84[_0x5827('0x42')]=qs[_0x5827('0x44')](_['pick'](_0x44c0d0['query'],_0xb0ac34[_0x5827('0x44')]));_0x2d7b84[_0x5827('0x42')]['ChatWebsiteId']=_0x33b012['id'];if(_0x44c0d0[_0x5827('0x38')][_0x5827('0x45')]){_0x2d7b84[_0x5827('0x42')]=_[_0x5827('0x4d')](_0x2d7b84[_0x5827('0x42')],{'$or':_[_0x5827('0x33')](_0x2d7b84[_0x5827('0x3c')],function(_0x103c7f){var _0x5a7284={};_0x5a7284[_0x103c7f]={'$like':'%'+_0x44c0d0['query'][_0x5827('0x45')]+'%'};return _0x5a7284;})});}_0x2d7b84=_[_0x5827('0x4d')]({},_0x2d7b84,_0x44c0d0[_0x5827('0x47')]);return db[_0x5827('0x62')][_0x5827('0x25')]({'where':_0x2d7b84['where']})[_0x5827('0x29')](function(_0x5a9a2a){_0x2c3876[_0x5827('0x25')]=_0x5a9a2a;if(_0x44c0d0['query'][_0x5827('0x4c')]){_0x2d7b84['include']=[{'all':!![]}];}return db[_0x5827('0x62')][_0x5827('0x49')](_0x2d7b84);})['then'](function(_0x22596e){_0x2c3876[_0x5827('0x5e')]=_0x22596e;return _0x2c3876;});}})['then'](respondWithFilteredResult(_0x93d69b,_0x2d7b84))['catch'](handleError(_0x93d69b,null));};exports[_0x5827('0x63')]=function(_0x317825,_0x55b495){return db[_0x5827('0x34')]['find']({'where':{'id':_0x317825[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x55b495,null))[_0x5827('0x29')](function(_0x486107){if(_0x486107){return _0x486107[_0x5827('0x63')](_0x317825[_0x5827('0x38')][_0x5827('0x60')]);}})[_0x5827('0x29')](respondWithStatusCode(_0x55b495,null))[_0x5827('0x1e')](handleError(_0x55b495,null));};exports['addLogo']=function(_0x328549,_0x1a855d){_0x328549['body']['sitepic']=_0x328549[_0x5827('0x64')]['filename'];return db[_0x5827('0x34')][_0x5827('0x4e')]({'where':{'id':_0x328549[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x1a855d,null))[_0x5827('0x29')](saveUpdates(_0x328549[_0x5827('0x50')],null))[_0x5827('0x29')](respondWithResult(_0x1a855d,null))[_0x5827('0x1e')](handleError(_0x1a855d,null));};exports['addAvatar']=function(_0x3e56f9,_0xd715ca){_0x3e56f9[_0x5827('0x50')][_0x5827('0x65')]=_0x3e56f9[_0x5827('0x64')][_0x5827('0x66')];return db[_0x5827('0x34')]['find']({'where':{'id':_0x3e56f9[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0xd715ca,null))[_0x5827('0x29')](saveUpdates(_0x3e56f9[_0x5827('0x50')],null))['then'](respondWithResult(_0xd715ca,null))[_0x5827('0x1e')](handleError(_0xd715ca,null));};exports[_0x5827('0x67')]=function(_0xedf230,_0x110686){_0xedf230[_0x5827('0x50')][_0x5827('0x68')]=_0xedf230[_0x5827('0x64')]['filename'];return db['ChatWebsite'][_0x5827('0x4e')]({'where':{'id':_0xedf230['params']['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x110686,null))[_0x5827('0x29')](saveUpdates(_0xedf230[_0x5827('0x50')],null))[_0x5827('0x29')](respondWithResult(_0x110686,null))[_0x5827('0x1e')](handleError(_0x110686,null));};exports[_0x5827('0x69')]=function(_0x997a65,_0x57be22){_0x997a65[_0x5827('0x50')]['systemAvatar']=_0x997a65[_0x5827('0x64')][_0x5827('0x66')];return db[_0x5827('0x34')][_0x5827('0x4e')]({'where':{'id':_0x997a65['params']['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x57be22,null))['then'](saveUpdates(_0x997a65[_0x5827('0x50')],null))['then'](respondWithResult(_0x57be22,null))[_0x5827('0x1e')](handleError(_0x57be22,null));};exports[_0x5827('0x6a')]=function(_0x28f996,_0x44b53f){var _0x4c4984=path[_0x5827('0x6b')](config[_0x5827('0x6c')],_0x5827('0x6d'));var _0x869f98={'where':{'id':_0x28f996[_0x5827('0x4b')]['id']},'attributes':['id',_0x5827('0x6e')],'raw':!![]};var _0xbaa6cb=![];return require(_0x5827('0x6f'))[_0x5827('0x70')]()[_0x5827('0x29')](function(_0x3db366){if(_0x3db366){_0xbaa6cb=_0x3db366[_0x5827('0x71')];}})[_0x5827('0x29')](function(){return db[_0x5827('0x34')][_0x5827('0x4e')](_0x869f98);})[_0x5827('0x29')](handleEntityNotFound(_0x44b53f,null))[_0x5827('0x29')](function(_0x819a2e){if(_0x819a2e){if(!_[_0x5827('0x72')](_0x819a2e[_0x5827('0x6e')])){if(fs[_0x5827('0x73')](path['join'](config[_0x5827('0x6c')],'server/files/images/logos/',_0x819a2e[_0x5827('0x6e')]))&&_0xbaa6cb){_0x4c4984=path[_0x5827('0x6b')](config[_0x5827('0x6c')],'server/files/images/logos/',_0x819a2e[_0x5827('0x6e')]);}}return _0x44b53f['download'](_0x4c4984);}})['catch'](handleError(_0x44b53f,null));};exports[_0x5827('0x74')]=function(_0x5d626d,_0x1cb146){var _0x2c1c68=path[_0x5827('0x6b')](config[_0x5827('0x6c')],_0x5827('0x75'));var _0x5830ad={'where':{'id':_0x5d626d[_0x5827('0x4b')]['id']},'attributes':['id',_0x5827('0x65')],'raw':!![]};return db[_0x5827('0x34')][_0x5827('0x4e')](_0x5830ad)[_0x5827('0x29')](handleEntityNotFound(_0x1cb146,null))[_0x5827('0x29')](function(_0x5705c9){if(_0x5705c9){if(!_['isNil'](_0x5705c9['agentAvatar'])){if(fs[_0x5827('0x73')](path[_0x5827('0x6b')](config[_0x5827('0x6c')],_0x5827('0x76'),_0x5705c9['agentAvatar']))){_0x2c1c68=path['join'](config[_0x5827('0x6c')],'server/files/images/avatars/',_0x5705c9[_0x5827('0x65')]);}}return _0x1cb146[_0x5827('0x77')](_0x2c1c68);}})['catch'](handleError(_0x1cb146,null));};exports[_0x5827('0x78')]=function(_0x302746,_0x53271d){var _0x56cda7=path['join'](config['root'],_0x5827('0x79'));var _0x1d32bc={'where':{'id':_0x302746['params']['id']},'attributes':['id',_0x5827('0x68'),_0x5827('0x7a')],'raw':!![]};return db[_0x5827('0x34')]['find'](_0x1d32bc)[_0x5827('0x29')](handleEntityNotFound(_0x53271d,null))[_0x5827('0x29')](function(_0xb0805d){if(_0xb0805d){if(!_[_0x5827('0x72')](_0xb0805d[_0x5827('0x68')])){if(fs[_0x5827('0x73')](path[_0x5827('0x6b')](config[_0x5827('0x6c')],_0x5827('0x76'),_0xb0805d[_0x5827('0x68')]))&&_0xb0805d[_0x5827('0x7a')]){_0x56cda7=path[_0x5827('0x6b')](config[_0x5827('0x6c')],_0x5827('0x76'),_0xb0805d[_0x5827('0x68')]);}}return _0x53271d[_0x5827('0x77')](_0x56cda7);}})['catch'](handleError(_0x53271d,null));};exports[_0x5827('0x7b')]=function(_0x5def84,_0x46eb09){var _0x28f51c=path[_0x5827('0x6b')](config[_0x5827('0x6c')],_0x5827('0x7c'));var _0x3e7e6c={'where':{'id':_0x5def84[_0x5827('0x4b')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x5827('0x34')]['find'](_0x3e7e6c)[_0x5827('0x29')](handleEntityNotFound(_0x46eb09,null))[_0x5827('0x29')](function(_0x70c62f){if(_0x70c62f){if(!_[_0x5827('0x72')](_0x70c62f[_0x5827('0x7d')])){if(fs[_0x5827('0x73')](path['join'](config[_0x5827('0x6c')],_0x5827('0x76'),_0x70c62f[_0x5827('0x7d')]))){_0x28f51c=path[_0x5827('0x6b')](config['root'],_0x5827('0x76'),_0x70c62f['systemAvatar']);}}return _0x46eb09['download'](_0x28f51c);}})[_0x5827('0x1e')](handleError(_0x46eb09,null));};exports[_0x5827('0x7e')]=function(_0xf849a1,_0x5963cc){var _0x5d95c0=require('user-agent-parser');var _0x49b47c=new _0x5d95c0();var _0xacb3d8=_0x49b47c['setUA'](_0xf849a1[_0x5827('0x7f')][_0x5827('0x80')])['getResult']();var _0x4cff5e={'body':_0xf849a1[_0x5827('0x50')],'channel':'chat'};var _0x2cfe35=[];var _0x51fe27=[];var _0x54a01f={};var _0xf82880=![];return db[_0x5827('0x81')][_0x5827('0x57')]()[_0x5827('0x29')](function(_0x1e1a01){if(!_0x1e1a01){throw new db[(_0x5827('0x82'))]['ValidationError'](_0x5827('0x83'));}_0x2cfe35=_[_0x5827('0x84')](_[_0x5827('0x39')](_0x1e1a01),[_0x5827('0x85'),_0x5827('0x86')]);_0x51fe27=_[_0x5827('0x84')](_[_0x5827('0x39')](_0x1e1a01),[_0x5827('0x85'),'updatedAt',_0x5827('0x87'),_0x5827('0x88')]);if(_0xf849a1[_0x5827('0x50')]['id']){delete _0xf849a1[_0x5827('0x50')]['id'];}if(_[_0x5827('0x72')](_0xf849a1[_0x5827('0x50')][_0x5827('0x89')])){throw new db['Sequelize'][(_0x5827('0x8a'))](_0x5827('0x8b'));}if(_[_0x5827('0x72')](_0xf849a1['body']['body'])||_0xf849a1[_0x5827('0x50')][_0x5827('0x50')]===''){throw new db[(_0x5827('0x82'))][(_0x5827('0x8a'))](_0x5827('0x8c'));}if(_[_0x5827('0x72')](_0xf849a1[_0x5827('0x50')]['mapKey'])){throw new db[(_0x5827('0x82'))]['ValidationError'](_0x5827('0x8d')+_0x51fe27);}if(!_[_0x5827('0x8e')](_0x51fe27,_0xf849a1[_0x5827('0x50')][_0x5827('0x8f')])){throw new db[(_0x5827('0x82'))][(_0x5827('0x8a'))](_0x5827('0x90')+_0x51fe27);}_0x54a01f[_0xf849a1[_0x5827('0x50')][_0x5827('0x8f')]]=_0xf849a1[_0x5827('0x50')][_0x5827('0x89')];})[_0x5827('0x29')](function(){return db[_0x5827('0x34')][_0x5827('0x4e')]({'where':{'id':_0xf849a1[_0x5827('0x4b')]['id']},'include':[{'model':db['CmList'],'as':_0x5827('0x91'),'include':[{'model':db[_0x5827('0x81')],'as':'Contacts','where':_0x54a01f,'limit':0x1,'order':[[_0x5827('0x86'),_0x5827('0x92')]]}]},{'model':db[_0x5827('0x93')],'as':'Applications'}]});})[_0x5827('0x29')](handleEntityNotFound(_0x5963cc,null))['then'](function(_0x127432){if(_0x127432&&_0x127432[_0x5827('0x91')]){_0x4cff5e['account']=_0x127432;_0x4cff5e[_0x5827('0x94')]=_0x127432[_0x5827('0x95')];_0x4cff5e[_0x5827('0x96')]=_0x127432[_0x5827('0x91')];_0x4cff5e['applications']=_['orderBy'](_0x4cff5e['applications'],[_0x5827('0x97')],[_0x5827('0x98')]);if(_0x4cff5e['account'][_0x5827('0x95')]){delete _0x4cff5e[_0x5827('0x99')][_0x5827('0x95')];}if(_0x4cff5e[_0x5827('0x99')][_0x5827('0x91')]&&_0x4cff5e[_0x5827('0x99')][_0x5827('0x91')]['Contacts'][_0x5827('0x3e')]){return _0x4cff5e[_0x5827('0x99')][_0x5827('0x91')][_0x5827('0x9a')][0x0];}var _0x10e27d=_[_0x5827('0x9b')](_0xf849a1['body'],{'firstName':_0xf849a1[_0x5827('0x50')][_0x5827('0x89')],'ListId':_0x127432['ListId']});_0x10e27d[_0xf849a1[_0x5827('0x50')][_0x5827('0x8f')]]=_0xf849a1[_0x5827('0x50')][_0x5827('0x89')];return db[_0x5827('0x81')][_0x5827('0x4f')](_0x10e27d,{'fields':_0x2cfe35,'raw':!![]});}})[_0x5827('0x29')](handleEntityNotFound(_0x5963cc,null))[_0x5827('0x29')](function(_0x2e6e0b){_0x4cff5e[_0x5827('0x9c')]=_0x2e6e0b;var _0x30c403=_0xf849a1[_0x5827('0x50')][_0x5827('0x9d')];if(_0xf849a1[_0x5827('0x7f')][_0x5827('0x9e')]){_0x30c403=_0xf849a1['headers'][_0x5827('0x9e')];}else if(_0xf849a1[_0x5827('0x7f')][_0x5827('0x9f')]){_0x30c403=_[_0x5827('0xa0')](_0xf849a1['headers'][_0x5827('0x9f')][_0x5827('0xa1')](','));}if(_0x2e6e0b){var _0x434c21={'ContactId':_0x2e6e0b['id'],'ChatWebsiteId':_0xf849a1[_0x5827('0x4b')]['id'],'from':(_0x2e6e0b[_0x5827('0xa2')]||'')+'\x20'+(_0x2e6e0b[_0x5827('0xa3')]||''),'customerIp':_0x30c403,'customerPort':_0xf849a1[_0x5827('0x7f')]['x-real-port']?_0xf849a1['headers'][_0x5827('0xa4')]:null,'referer':_0xf849a1[_0x5827('0x50')]['referer'],'browserName':_0xacb3d8[_0x5827('0xa5')][_0x5827('0x2f')]&&_0xacb3d8[_0x5827('0xa5')][_0x5827('0xa6')]?util['format'](_0x5827('0xa7'),_0xacb3d8['browser'][_0x5827('0x2f')],_0xacb3d8[_0x5827('0xa5')][_0x5827('0xa6')]):_0x5827('0xa8'),'browserVersion':_0xacb3d8[_0x5827('0xa5')][_0x5827('0xa6')]||_0x5827('0xa8'),'osName':util[_0x5827('0xa9')](_0x5827('0xa7'),_0xacb3d8['os'][_0x5827('0x2f')],_0xacb3d8['os'][_0x5827('0xa6')]),'osVersion':_0xacb3d8['os'][_0x5827('0xa6')],'deviceModel':_0xacb3d8[_0x5827('0xaa')]['model']&&_0xacb3d8[_0x5827('0xaa')][_0x5827('0xab')]?util['format'](_0x5827('0xac'),_0xacb3d8[_0x5827('0xaa')][_0x5827('0x3b')],_0xacb3d8[_0x5827('0xaa')]['vendor'],_0xacb3d8[_0x5827('0xaa')][_0x5827('0x36')]):null,'deviceVendor':_0xacb3d8['device'][_0x5827('0xab')],'deviceType':_0xacb3d8[_0x5827('0xaa')][_0x5827('0x36')],'formData':JSON[_0x5827('0x1a')](_0xf849a1['body'])};var _0x16e0db={'ChatWebsiteId':_0xf849a1[_0x5827('0x4b')]['id'],'closed':![]};if(_0xf849a1['body']['threadId']){_0x16e0db[_0x5827('0xad')]=_0xf849a1[_0x5827('0x50')][_0x5827('0xad')];return db[_0x5827('0xae')][_0x5827('0x4e')]({'where':_0x16e0db})[_0x5827('0x29')](function(_0x2afb97){if(_0x2afb97){return[_0x2afb97,![]];}_0x434c21[_0x5827('0xad')]=_0xf849a1[_0x5827('0x50')][_0x5827('0xad')];_0x434c21[_0x5827('0xaf')]=_0xf849a1['body'][_0x5827('0xaf')];return db[_0x5827('0xae')][_0x5827('0x4f')](_0x434c21)[_0x5827('0x29')](function(_0x14402c){return[_0x14402c,!![]];});});}_0x16e0db[_0x5827('0xb0')]=_0x2e6e0b['id'];if(_0xf849a1['body'][_0x5827('0xb1')]&&_0xf849a1[_0x5827('0x50')][_0x5827('0xb1')]['id']){_0x16e0db['id']=_0xf849a1[_0x5827('0x50')][_0x5827('0xb1')]['id'];return db['ChatInteraction'][_0x5827('0x4e')]({'where':_0x16e0db})[_0x5827('0x29')](function(_0x21d057){if(_0x21d057){return[_0x21d057,![]];}return db[_0x5827('0xae')][_0x5827('0x4f')](_0x434c21)['then'](function(_0x9e9eab){return[_0x9e9eab,!![]];});});}return db[_0x5827('0xae')][_0x5827('0x4f')](_0x434c21)[_0x5827('0x29')](function(_0xeab5a4){return[_0xeab5a4,!![]];});}})['spread'](function(_0x1dba05,_0x53259){if(_0x1dba05){_0xf82880=_0x53259;if(!_0x53259){var _0x58bd9e={'from':(_0x4cff5e[_0x5827('0x9c')][_0x5827('0xa2')]||'')+'\x20'+(_0x4cff5e['contact'][_0x5827('0xa3')]||'')};if(_0xf849a1[_0x5827('0x50')]['threadId']&&_0xf849a1[_0x5827('0x50')][_0x5827('0xb2')]&&_0xf849a1[_0x5827('0x50')]['threadId']!=_0xf849a1[_0x5827('0x50')][_0x5827('0xb2')]){_0x58bd9e['threadId']=_0xf849a1[_0x5827('0x50')]['messageId'];}return _0x1dba05[_0x5827('0x28')](_0x58bd9e);}else{return _0x1dba05;}}})[_0x5827('0x29')](function(_0x2d33a1){_0x4cff5e[_0x5827('0xb1')]=_0x2d33a1[_0x5827('0x2a')]({'plain':!![]});_0x4cff5e['interaction']['created']=_0xf82880;if(_0x4cff5e[_0x5827('0xb1')][_0x5827('0xb3')]){if(_0x4cff5e[_0x5827('0x99')][_0x5827('0xb4')]){_0x4cff5e[_0x5827('0x94')][_0x5827('0xb5')]({'id':0x0,'priority':_0x4cff5e[_0x5827('0x94')][_0x5827('0x3e')]+0x1,'app':_0x5827('0xb6'),'appdata':'unmanaged','interval':_0x5827('0xb7')});}}return db[_0x5827('0xb8')][_0x5827('0x4f')]({'body':_0xf849a1[_0x5827('0x50')]['body'],'ChatWebsiteId':_0xf849a1[_0x5827('0x4b')]['id'],'ChatInteractionId':_0x2d33a1['id'],'direction':'in','ContactId':_0x4cff5e[_0x5827('0x9c')]['id'],'AttachmentId':_0xf849a1[_0x5827('0x50')][_0x5827('0xb9')]});})['then'](function(_0x480588){_0x4cff5e['message']=_0x480588;if(_0x4cff5e[_0x5827('0xb1')][_0x5827('0xba')]){return db[_0x5827('0xbb')]['find']({'attributes':['id',_0x5827('0x2f')],'where':{'id':_0x4cff5e[_0x5827('0xb1')]['UserId']}})['then'](function(_0x46305d){if(_0x46305d){_0x4cff5e[_0x5827('0x94')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x46305d['name']+','+(_0x4cff5e[_0x5827('0x99')]['waitForTheAssignedAgent']||0xa),'interval':_0x5827('0xb7')});_0x4cff5e[_0x5827('0xbc')]=!![];}return respondWithRpcPromise(_0x5827('0xbd'),'startRouting',_0x4cff5e);});}return respondWithRpcPromise('Start',_0x5827('0xbe'),_0x4cff5e);})['then'](function(_0x338195){respondWithRpcPromise(_0x5827('0xbf'),_0x5827('0xbf'),{'event':'notify','message':_0x338195},client9002);return _0x338195;})[_0x5827('0x29')](respondWithResult(_0x5963cc,null))[_0x5827('0x1e')](handleError(_0x5963cc,null));};exports[_0x5827('0xc0')]=function(_0xbe822c,_0x2c0f8e){var _0x424aad,_0x3eefc3,_0x116f88;var _0x85d8df=[];var _0x4f678b={};var _0x14a9c3=_0xbe822c[_0x5827('0xc1')]||[];var _0x144917=[];var _0x1ba428;return db[_0x5827('0x81')][_0x5827('0x57')]()[_0x5827('0x29')](function(_0x409f3c){if(!_0x409f3c){throw new db[(_0x5827('0x82'))][(_0x5827('0x8a'))](_0x5827('0x83'));}_0x85d8df=_['difference'](_[_0x5827('0x39')](_0x409f3c),[_0x5827('0x85'),'updatedAt','CompanyId',_0x5827('0x88')]);if(_0xbe822c[_0x5827('0x50')]['id']){delete _0xbe822c[_0x5827('0x50')]['id'];}if(_[_0x5827('0x72')](_0xbe822c[_0x5827('0x50')][_0x5827('0x89')])){throw _0x2c0f8e[_0x5827('0x20')](0x1f4)[_0x5827('0xc2')](new db[(_0x5827('0x82'))][(_0x5827('0x8a'))](_0x5827('0x8b')));}if(_[_0x5827('0x72')](_0xbe822c['body'][_0x5827('0x50')])||_0xbe822c[_0x5827('0x50')]['body']===''){throw _0x2c0f8e[_0x5827('0x20')](0x1f4)['send'](new db[(_0x5827('0x82'))]['ValidationError'](_0x5827('0x8c')));}if(_[_0x5827('0x72')](_0xbe822c[_0x5827('0x50')][_0x5827('0xc3')])){throw _0x2c0f8e[_0x5827('0x20')](0x1f4)[_0x5827('0xc2')](new db[(_0x5827('0x82'))][(_0x5827('0x8a'))](_0x5827('0xc4')+_0x85d8df));}if(!_[_0x5827('0x8e')](_0x85d8df,_0xbe822c[_0x5827('0x50')][_0x5827('0xc3')])){throw _0x2c0f8e[_0x5827('0x20')](0x1f4)[_0x5827('0xc2')](new db[(_0x5827('0x82'))][(_0x5827('0x8a'))](_0x5827('0xc5')+_0x85d8df));}_0x4f678b[_0xbe822c[_0x5827('0x50')][_0x5827('0xc3')]]=_0xbe822c[_0x5827('0x50')][_0x5827('0x89')];})[_0x5827('0x29')](function(){return db[_0x5827('0x34')][_0x5827('0x4e')]({'where':{'id':_0xbe822c[_0x5827('0x4b')]['id']},'include':[{'model':db[_0x5827('0xc6')],'as':_0x5827('0x91')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x5827('0x29')](handleEntityNotFound(_0x2c0f8e,null))[_0x5827('0x29')](function(_0xa76c65){if(_0xa76c65&&_0xa76c65[_0x5827('0x91')]){_0x3eefc3=_0xa76c65;var _0x19fdd7=_[_0x5827('0x9b')](_0xbe822c['body'],{'firstName':_0xbe822c[_0x5827('0x50')][_0x5827('0x89')],'phone':_0xbe822c[_0x5827('0x50')][_0x5827('0x89')],'ListId':_0xa76c65[_0x5827('0x88')]});_0x19fdd7[_0xbe822c['body'][_0x5827('0xc3')]]=_0xbe822c[_0x5827('0x50')]['from'];return db[_0x5827('0x81')][_0x5827('0xc7')]({'where':_0x4f678b,'defaults':_0x19fdd7});}})[_0x5827('0xc8')](function(_0x20ccf8){if(_0x20ccf8){_0x116f88=_0x20ccf8;var _0x2efa66=fs[_0x5827('0xc9')](path['join'](config[_0x5827('0x6c')],_0x5827('0xca')),_0x5827('0xcb'));var _0x311e7c=ejs[_0x5827('0xcc')](_0x2efa66,{'body':_['toPairs'](_0xbe822c[_0x5827('0x50')][_0x5827('0x50')]),'bodyTitle':_0x3eefc3[_0x5827('0xcd')]});return db[_0x5827('0xce')][_0x5827('0x4f')]({'body':_0x311e7c,'plainBody':htmlToText[_0x5827('0xcf')](_0x311e7c),'ContactId':_0x20ccf8['id'],'ChatWebsiteId':_0x3eefc3['id']});}})[_0x5827('0x29')](function(_0x56892c){_0x1ba428=_0x56892c;if(_0x14a9c3[_0x5827('0x3e')]){var _0x5f248=_0x14a9c3['map'](function(_0x412b68){return{'name':_0x412b68[_0x5827('0xd0')],'basename':_0x412b68[_0x5827('0x66')],'type':_0x412b68[_0x5827('0xd1')],'ChatOfflineMessageId':_0x56892c['id']};});_0x144917=_0x5f248[_0x5827('0x33')](_0x32b783=>{var _0x39b836={'filename':_0x32b783['name'],'path':path[_0x5827('0x6b')](config[_0x5827('0x6c')],'server',_0x5827('0xc1'),_0x5827('0xd2'),_0x5827('0xd3'),_0x32b783[_0x5827('0xd4')])};return _0x39b836;});if(!_0x3eefc3[_0x5827('0xd5')]){return db[_0x5827('0xd6')][_0x5827('0xd7')](function(_0x288099){return db['Attachment'][_0x5827('0xd8')](_0x5f248,{'transaction':_0x288099});});}}})['then'](function(){if(_0x1ba428){_0x424aad=_0x1ba428;return db[_0x5827('0xd9')][_0x5827('0x5c')]({'where':{'service':!![]},'include':[{'model':db[_0x5827('0xda')],'as':_0x5827('0xdb'),'raw':!![],'include':[{'model':db[_0x5827('0xdc')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x27de54){if(_0x27de54&&_0x27de54[_0x5827('0xdb')]&&_0x3eefc3[_0x5827('0xdd')]&&_0x3eefc3[_0x5827('0xde')]){var _0x4227b9=_0x27de54[_0x5827('0xdf')]();return respondWithRpcPromise(_0x5827('0xe0'),_0x5827('0xe1'),{'account':_0x4227b9,'message':{'from':util[_0x5827('0xa9')](_0x5827('0xe2'),_0x27de54[_0x5827('0x2f')],_0x27de54['email']||_0x27de54[_0x5827('0xdb')][_0x5827('0xe3')]),'to':_0x3eefc3['forwardOfflineAddress'],'subject':_0x3eefc3[_0x5827('0xe4')],'html':_0x424aad['body'],'attachments':_0x144917}},client9003)[_0x5827('0x29')](function(){return _0x424aad;})[_0x5827('0x1e')](function(_0x33955c){logger[_0x5827('0x1b')](_0x33955c);});}})[_0x5827('0x29')](function(){if(_0x3eefc3&&_0x3eefc3[_0x5827('0xd5')]&&_0x3eefc3[_0x5827('0xe5')]){var _0x420d6d=[];if(_0x14a9c3['length']){_0x420d6d=_0x14a9c3[_0x5827('0x33')](function(_0x1f30a3){return{'name':_0x1f30a3[_0x5827('0xd0')],'basename':_0x1f30a3['filename'],'type':_0x1f30a3[_0x5827('0xd1')],'ChatOfflineMessageId':_0x1ba428['id']};});}var _0x1e47bb;if(!_['isNil'](_0x3eefc3['subjectOffline'])){var _0x495a24=_[_0x5827('0x33')](_0xbe822c[_0x5827('0x50')],function(_0x1aca55){return _0x1aca55;});var _0xf43368=_[_0x5827('0xe6')](_0x495a24)[0x0];var _0x1c0e7c=_[_0x5827('0xe7')](_0xf43368,function(_0x5f6bc8){return _0x5f6bc8;});_0x1e47bb=_0x1c0e7c[0x1][_0x3eefc3['subjectOffline']];}var _0x25582e={'from':_0x116f88[_0x5827('0xe8')],'firstName':_0x116f88[_0x5827('0xa2')],'lastName':_0x116f88[_0x5827('0xa3')],'mapKey':'email','message':{'from':_0x116f88[_0x5827('0xe8')],'to':_0x3eefc3[_0x5827('0xd9')][_0x5827('0xe8')],'cc':'','subject':_[_0x5827('0x72')](_0x1e47bb)?_0x3eefc3[_0x5827('0xe4')]:_0x1e47bb,'messageId':'','sentAt':new Date(),'attach':_0x420d6d[_0x5827('0x3e')],'attachments':_0x420d6d,'originChannel':'Chat','ChatWebsiteId':_0x3eefc3['id'],'ChatOfflineMessageId':_0x424aad['id'],'originTo':_0x3eefc3['MailAccount']['email']},'body':_0x424aad[_0x5827('0x50')]};var _0x879b59={'account':{'id':_0x3eefc3['MailAccountId']},'body':_0x25582e,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x5827('0xe9'),_0x5827('0xea'),_0x879b59,client9001)[_0x5827('0x29')](function(){return _0x424aad;})[_0x5827('0x1e')](function(_0xb9fec6){logger['error'](_0xb9fec6);});}return;})[_0x5827('0x29')](function(){if(_0x424aad){return _0x424aad;}})['then'](respondWithResult(_0x2c0f8e,null))[_0x5827('0x1e')](function(_0x573613){logger[_0x5827('0x1b')](_0x5827('0x1e'),_0x573613);for(var _0x2ce8e2 of _0x14a9c3){var _0x25a49b=path['join'](config[_0x5827('0x6c')],_0x5827('0xeb'),_0x5827('0xc1'),_0x5827('0xd2'),_0x5827('0xd3'),_0x2ce8e2[_0x5827('0x66')]);fs_extra[_0x5827('0xec')](_0x25a49b)[_0x5827('0x1e')](function(_0xedcadd){logger[_0x5827('0x1b')](_0x5827('0xed'),_0x25a49b,_0xedcadd);});}});};exports[_0x5827('0xee')]=function(_0x4a8791,_0x2d1628){return db[_0x5827('0xae')]['find']({'where':{'id':_0x4a8791[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x2d1628,null))[_0x5827('0x29')](function(_0x281eab){if(_0x281eab){return _0x281eab['addInteraction'](_0x4a8791[_0x5827('0x50')][_0x5827('0x60')],_[_0x5827('0xef')](_0x4a8791['body'],['ids','id'])||{});}})[_0x5827('0x29')](respondWithResult(_0x2d1628,null))[_0x5827('0x1e')](handleError(_0x2d1628,null));};exports['getInteractions']=function(_0x5850d9,_0xcec404){var _0x1ce394={'raw':![],'where':{}};var _0x4ebcba={};var _0x434aa5={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5827('0x5c')]({'where':{'id':_0x5850d9[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0xcec404,null))[_0x5827('0x29')](function(_0x3d8560){if(_0x3d8560){_0x4ebcba[_0x5827('0x3b')]=_[_0x5827('0x39')](db[_0x5827('0xae')][_0x5827('0x35')]);_0x4ebcba[_0x5827('0x38')]=_['keys'](_0x5850d9[_0x5827('0x38')]);_0x4ebcba[_0x5827('0x44')]=_['intersection'](_0x4ebcba[_0x5827('0x3b')],_0x4ebcba[_0x5827('0x38')]);_0x1ce394['attributes']=_[_0x5827('0x3a')](_0x4ebcba['model'],qs['fields'](_0x5850d9['query']['fields']));_0x1ce394['attributes']=_0x1ce394[_0x5827('0x3c')][_0x5827('0x3e')]?_0x1ce394['attributes']:_0x4ebcba['model'];if(!_0x5850d9['query'][_0x5827('0x3f')]('nolimit')){_0x1ce394['limit']=qs[_0x5827('0x23')](_0x5850d9[_0x5827('0x38')]['limit']);_0x1ce394[_0x5827('0x26')]=qs['offset'](_0x5850d9[_0x5827('0x38')][_0x5827('0x26')]);}_0x1ce394['order']=qs['sort'](_0x5850d9['query'][_0x5827('0x41')]);_0x1ce394[_0x5827('0x42')]=qs['filters'](_[_0x5827('0x43')](_0x5850d9['query'],_0x4ebcba['filters']));_0x1ce394[_0x5827('0x42')][_0x5827('0x59')]=_0x3d8560['id'];if(_0x5850d9[_0x5827('0x38')][_0x5827('0x45')]){_0x1ce394[_0x5827('0x42')]=_[_0x5827('0x4d')](_0x1ce394['where'],{'$or':_[_0x5827('0x33')](_0x1ce394[_0x5827('0x3c')],function(_0x500c07){var _0xddb0f2={};_0xddb0f2[_0x500c07]={'$like':'%'+_0x5850d9[_0x5827('0x38')]['filter']+'%'};return _0xddb0f2;})});}_0x1ce394=_[_0x5827('0x4d')]({},_0x1ce394,_0x5850d9[_0x5827('0x47')]);return db[_0x5827('0xae')][_0x5827('0x25')]({'where':_0x1ce394[_0x5827('0x42')]})[_0x5827('0x29')](function(_0x4ccbaf){_0x434aa5[_0x5827('0x25')]=_0x4ccbaf;if(_0x5850d9[_0x5827('0x38')][_0x5827('0x4c')]){_0x1ce394['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x5827('0xbb')],'as':_0x5827('0xf0'),'attributes':[_0x5827('0x2f'),_0x5827('0xf1'),_0x5827('0xf2')],'required':![]},{'model':db[_0x5827('0xf3')],'as':_0x5827('0xf4'),'attributes':['id','name',_0x5827('0xf5')],'where':_0x5850d9['query'][_0x5827('0xf6')]?{'id':_0x5850d9[_0x5827('0x38')]['tag']}:undefined,'required':_0x5850d9['query'][_0x5827('0xf6')]?!![]:![]}];}return db[_0x5827('0xae')][_0x5827('0x49')](_0x1ce394);})[_0x5827('0x29')](function(_0x3b79cf){_0x434aa5[_0x5827('0x5e')]=_0x3b79cf;return _0x434aa5;});}})[_0x5827('0x29')](respondWithFilteredResult(_0xcec404,_0x1ce394))[_0x5827('0x1e')](handleError(_0xcec404,null));};function iftimePromise(_0x16efd8,_0x19f0bf){return respondWithRpcPromise(_0x5827('0xf7'),_0x5827('0xf8'),{'command':_0x19f0bf[_0x5827('0xf9')]?util[_0x5827('0xa9')]('iftime\x20%s,%s',_0x16efd8[_0x5827('0xfa')],_0x19f0bf[_0x5827('0xf9')]):util['format'](_0x5827('0xfb'),_0x16efd8[_0x5827('0xfa')])},client9002)[_0x5827('0x29')](function(_0x4ee886){var _0x299651=_0x4ee886&&_0x4ee886[_0x5827('0xfc')](_0x5827('0xfd'))>=0x0?!![]:![];logger[_0x5827('0x17')](_0x5827('0xfe'),_0x19f0bf['id'],_0x16efd8['id'],_0x16efd8[_0x5827('0xfa')],_0x299651?_0x5827('0xff'):_0x5827('0x100'),_0x19f0bf[_0x5827('0xf9')]?_0x19f0bf[_0x5827('0xf9')]:_0x5827('0x101'));return _0x299651;})[_0x5827('0x1e')](function(_0x42f16b){logger[_0x5827('0x1b')](_0x5827('0xfe'),_0x19f0bf['id'],_0x16efd8['id'],_0x16efd8[_0x5827('0xfa')],util[_0x5827('0x102')](_0x42f16b,{'showHidden':![],'depth':null}),_0x19f0bf[_0x5827('0xf9')]?_0x19f0bf[_0x5827('0xf9')]:_0x5827('0x101'));return![];});}exports[_0x5827('0xf8')]=function(_0x10b073,_0x430db4){var _0x15733f=0x0;var _0x16b245=0x0;var _0x3b5a7b=![];var _0x532f7d;var _0x98ce24;return db[_0x5827('0x34')]['find']({'where':{'id':_0x10b073['params']['id']},'include':[{'model':db[_0x5827('0x103')],'as':_0x5827('0x103'),'include':[{'model':db[_0x5827('0x103')],'as':'Intervals','attributes':['id',_0x5827('0xfa')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x430db4,null))[_0x5827('0x29')](function(_0x3d42af){if(_0x3d42af){_0x532f7d=_0x3d42af;return _0x3d42af[_0x5827('0x104')]({'raw':!![]});}})[_0x5827('0x29')](function(_0x240c68){if(_0x532f7d){if(_0x240c68){_0x98ce24=_0x240c68;}}return require(_0x5827('0x6f'))[_0x5827('0x70')]();})['then'](function(_0x2d63ed){if(_0x2d63ed){_0x16b245=_0x2d63ed['virtual'];_0x3b5a7b=_0x2d63ed[_0x5827('0x71')];}})[_0x5827('0x29')](function(){return db[_0x5827('0xae')][_0x5827('0x25')]({'where':{'closed':![]}});})[_0x5827('0x29')](function(_0x3d2a05){_0x15733f=_0x3d2a05;if(_0x16b245&&_0x3d2a05>_0x16b245){return db['License'][_0x5827('0x5c')]({'where':{'id':0x1}})['then'](function(_0x134b82){if(_0x134b82){_0x134b82[_0x5827('0x105')](_0x5827('0x106'));}});}})[_0x5827('0x29')](function(){if(_0x532f7d[_0x5827('0x103')]&&_0x532f7d[_0x5827('0x103')][_0x5827('0x107')]){var _0xb933b0=[];for(var _0x5707a4=0x0;_0x5707a4<_0x532f7d['Interval'][_0x5827('0x107')][_0x5827('0x3e')];_0x5707a4++){var _0x38d93d=_0x532f7d[_0x5827('0x103')][_0x5827('0x107')][_0x5707a4]['get']({'plain':!![]});_0xb933b0[_0x5827('0xb5')](iftimePromise(_0x38d93d,_0x532f7d));}return BPromise['all'](_0xb933b0)[_0x5827('0x29')](function(_0x3af7ae){return _[_0x5827('0x108')](_0x3af7ae);});}else{return!![];}})[_0x5827('0x29')](function(_0x3afbbc){var _0x1afcf3=fs[_0x5827('0xc9')](path[_0x5827('0x6b')](config[_0x5827('0x6c')],_0x5827('0x109')),_0x5827('0xcb'));var _0x14f88e=new url[(_0x5827('0x10a'))](_0x532f7d[_0x5827('0x10b')])['origin'];var _0x12678b='3.1.0';var _0x1c3d39=![];var _0x4468c1={'chatVersion':_0x12678b,'chatWebsiteAddressOrigin':_0x14f88e,'remote':_0x532f7d[_0x5827('0x10c')],'query':querystring[_0x5827('0x1a')](_[_0x5827('0x4d')](_0x532f7d['get']({'plain':!![]}),{'customerIp':_0x10b073[_0x5827('0x7f')]['x-forwarded-for']||_0x10b073['headers'][_0x5827('0x10d')]||_0x10b073['connection']['remoteAddress']||_0x10b073['ip'],'referer':_0x10b073[_0x5827('0x7f')][_0x5827('0x10e')],'openedInteractions':_0x15733f,'maxInteractions':_0x16b245,'virtual':_0x3b5a7b[_0x5827('0x10f')],'online':_0x3afbbc,'custom':_0x3b5a7b}))[_0x5827('0x110')](/'/g,'\x5c\x27')};_0x430db4[_0x5827('0xc2')](ejs[_0x5827('0xcc')](Mustache[_0x5827('0xcc')](_0x1afcf3,_0x4468c1),{'proactiveActions':_0x98ce24,'alignment':_0x532f7d[_0x5827('0x111')],'verticalAlignment':_0x532f7d['verticalAlignment'],'div_color':_0x532f7d['color'],'labelText':_0x532f7d[_0x5827('0x112')],'text_color':_0x532f7d[_0x5827('0x113')],'text_button_color':_0x532f7d[_0x5827('0x114')],'button_color':_0x532f7d[_0x5827('0x115')],'background_color':_0x532f7d[_0x5827('0x116')],'hideWhenOffline':_0x532f7d[_0x5827('0x117')],'intervalId':_0x532f7d[_0x5827('0x118')],'isDevelopment':_0x1c3d39,'chatVersion':_0x12678b}));})[_0x5827('0x1e')](handleError(_0x430db4,null));};exports['addApplications']=function(_0x32662a,_0x520c1d){var _0x126d4e=_0x32662a['params']['id'];var _0x474586=_0x32662a['body'];var _0x88b4b3=0xc8;var _0x4579a6=null;return db[_0x5827('0xd6')][_0x5827('0xd7')]({'isolationLevel':db[_0x5827('0xd6')]['Transaction'][_0x5827('0x119')]['READ_COMMITTED']},function(_0x8c9cf7){return db['ChatWebsite'][_0x5827('0x5c')]({'where':{'id':_0x126d4e},'transaction':_0x8c9cf7})[_0x5827('0x29')](function(_0x38e9c3){if(_0x38e9c3){return db['ChatApplication'][_0x5827('0x2d')]({'where':{'ChatWebsiteId':_0x126d4e},'transaction':_0x8c9cf7})[_0x5827('0x29')](function(){var _0x222c07=_[_0x5827('0x33')](_0x474586,function(_0x2a83e0){_0x2a83e0[_0x5827('0x59')]=_0x126d4e;return _0x2a83e0;});return db[_0x5827('0x93')][_0x5827('0xd8')](_0x222c07,{'transaction':_0x8c9cf7});});}else{_0x88b4b3=0x194;_0x4579a6=[];}});})[_0x5827('0x29')](function(){if(_0x88b4b3!==0x194){return db[_0x5827('0x93')][_0x5827('0x11a')]({'where':{'ChatWebsiteId':_0x126d4e},'order':'priority'})[_0x5827('0x29')](function(_0x35bf56){_0x4579a6=_0x35bf56;});}})[_0x5827('0x1e')](function(_0x30cc93){_0x88b4b3=0x1f4;logger[_0x5827('0x1b')](_0x30cc93[_0x5827('0x2e')]);if(_0x30cc93[_0x5827('0x2f')]){delete _0x30cc93[_0x5827('0x2f')];}_0x4579a6=_0x30cc93;})[_0x5827('0x11b')](function(){if(_0x4579a6===null){_0x520c1d[_0x5827('0x1f')](_0x88b4b3);}else{if(_0x88b4b3===0x1f4){_0x520c1d[_0x5827('0x20')](_0x88b4b3)[_0x5827('0xc2')](_0x4579a6);}else{_0x520c1d[_0x5827('0x20')](_0x88b4b3)[_0x5827('0x22')](_0x4579a6);}}});};exports['getApplications']=function(_0x47f34e,_0x277c60){var _0x3a6d9d={};var _0x12b665={};var _0x263818;var _0x1e0793;return db[_0x5827('0x34')]['findOne']({'where':{'id':_0x47f34e[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x277c60,null))['then'](function(_0x528ad7){if(_0x528ad7){_0x263818=_0x528ad7;_0x12b665[_0x5827('0x3b')]=_[_0x5827('0x39')](db[_0x5827('0x93')][_0x5827('0x35')]);_0x12b665[_0x5827('0x38')]=_[_0x5827('0x39')](_0x47f34e['query']);_0x12b665[_0x5827('0x44')]=_['intersection'](_0x12b665[_0x5827('0x3b')],_0x12b665['query']);_0x3a6d9d[_0x5827('0x3c')]=_['intersection'](_0x12b665[_0x5827('0x3b')],qs[_0x5827('0x3d')](_0x47f34e[_0x5827('0x38')][_0x5827('0x3d')]));_0x3a6d9d[_0x5827('0x3c')]=_0x3a6d9d[_0x5827('0x3c')][_0x5827('0x3e')]?_0x3a6d9d[_0x5827('0x3c')]:_0x12b665[_0x5827('0x3b')];_0x3a6d9d[_0x5827('0x40')]=qs[_0x5827('0x41')](_0x47f34e[_0x5827('0x38')]['sort']);_0x3a6d9d[_0x5827('0x42')]=qs['filters'](_[_0x5827('0x43')](_0x47f34e[_0x5827('0x38')],_0x12b665[_0x5827('0x44')]));if(_0x47f34e[_0x5827('0x38')][_0x5827('0x45')]){_0x3a6d9d[_0x5827('0x42')]=_[_0x5827('0x4d')](_0x3a6d9d[_0x5827('0x42')],{'$or':_[_0x5827('0x33')](_0x3a6d9d[_0x5827('0x3c')],function(_0x33d295){var _0xba65af={};_0xba65af[_0x33d295]={'$like':'%'+_0x47f34e[_0x5827('0x38')]['filter']+'%'};return _0xba65af;})});}_0x3a6d9d=_[_0x5827('0x4d')]({},_0x3a6d9d,_0x47f34e['options']);return _0x263818['getApplications'](_0x3a6d9d);}})[_0x5827('0x29')](function(_0x470b9e){if(_0x470b9e){_0x1e0793=_0x470b9e[_0x5827('0x3e')];if(!_0x47f34e[_0x5827('0x38')][_0x5827('0x3f')](_0x5827('0x5d'))){_0x3a6d9d[_0x5827('0x23')]=qs[_0x5827('0x23')](_0x47f34e['query'][_0x5827('0x23')]);_0x3a6d9d[_0x5827('0x26')]=qs[_0x5827('0x26')](_0x47f34e[_0x5827('0x38')]['offset']);}return _0x263818[_0x5827('0x11c')](_0x3a6d9d);}})[_0x5827('0x29')](function(_0x593751){if(_0x593751){return _0x593751?{'count':_0x1e0793,'rows':_0x593751}:null;}})[_0x5827('0x29')](respondWithResult(_0x277c60,null))[_0x5827('0x1e')](handleError(_0x277c60,null));};exports[_0x5827('0x11d')]=function(_0x15a9fc,_0x49b144){return db[_0x5827('0x11e')]['find']({'where':{'id':_0x15a9fc[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x49b144,null))[_0x5827('0x29')](function(_0x5b9bef){if(_0x5b9bef){return _0x5b9bef[_0x5827('0x11d')](_0x15a9fc[_0x5827('0x50')]['ids'],_[_0x5827('0xef')](_0x15a9fc[_0x5827('0x50')],[_0x5827('0x60'),'id'])||{});}})[_0x5827('0x29')](respondWithResult(_0x49b144,null))[_0x5827('0x1e')](handleError(_0x49b144,null));};exports[_0x5827('0x104')]=function(_0x34f4ee,_0x517db3){var _0x11da64={};var _0x502ffd={};var _0x477f60;var _0x20b0c3;return db[_0x5827('0x34')][_0x5827('0x5c')]({'where':{'id':_0x34f4ee['params']['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x517db3,null))[_0x5827('0x29')](function(_0x74331a){if(_0x74331a){_0x477f60=_0x74331a;_0x502ffd['model']=_[_0x5827('0x39')](db['ChatProactiveAction'][_0x5827('0x35')]);_0x502ffd[_0x5827('0x38')]=_[_0x5827('0x39')](_0x34f4ee[_0x5827('0x38')]);_0x502ffd[_0x5827('0x44')]=_['intersection'](_0x502ffd[_0x5827('0x3b')],_0x502ffd[_0x5827('0x38')]);_0x11da64[_0x5827('0x3c')]=_['intersection'](_0x502ffd[_0x5827('0x3b')],qs[_0x5827('0x3d')](_0x34f4ee[_0x5827('0x38')][_0x5827('0x3d')]));_0x11da64['attributes']=_0x11da64[_0x5827('0x3c')][_0x5827('0x3e')]?_0x11da64[_0x5827('0x3c')]:_0x502ffd['model'];_0x11da64[_0x5827('0x40')]=qs[_0x5827('0x41')](_0x34f4ee[_0x5827('0x38')][_0x5827('0x41')]);_0x11da64[_0x5827('0x42')]=qs['filters'](_[_0x5827('0x43')](_0x34f4ee[_0x5827('0x38')],_0x502ffd[_0x5827('0x44')]));if(_0x34f4ee[_0x5827('0x38')][_0x5827('0x45')]){_0x11da64[_0x5827('0x42')]=_[_0x5827('0x4d')](_0x11da64[_0x5827('0x42')],{'$or':_[_0x5827('0x33')](_0x11da64[_0x5827('0x3c')],function(_0x5043cf){var _0x188243={};_0x188243[_0x5043cf]={'$like':'%'+_0x34f4ee['query'][_0x5827('0x45')]+'%'};return _0x188243;})});}_0x11da64=_[_0x5827('0x4d')]({},_0x11da64,_0x34f4ee['options']);return _0x477f60[_0x5827('0x104')](_0x11da64);}})[_0x5827('0x29')](function(_0x463fd6){if(_0x463fd6){_0x20b0c3=_0x463fd6[_0x5827('0x3e')];if(!_0x34f4ee[_0x5827('0x38')]['hasOwnProperty'](_0x5827('0x5d'))){_0x11da64[_0x5827('0x23')]=qs['limit'](_0x34f4ee[_0x5827('0x38')][_0x5827('0x23')]);_0x11da64[_0x5827('0x26')]=qs['offset'](_0x34f4ee[_0x5827('0x38')][_0x5827('0x26')]);}return _0x477f60[_0x5827('0x104')](_0x11da64);}})['then'](function(_0x181778){if(_0x181778){return _0x181778?{'count':_0x20b0c3,'rows':_0x181778}:null;}})[_0x5827('0x29')](respondWithResult(_0x517db3,null))[_0x5827('0x1e')](handleError(_0x517db3,null));};exports[_0x5827('0x11f')]=function(_0xecceff,_0x1a652c){var _0x39aa6b=_0xecceff[_0x5827('0x38')][_0x5827('0x120')]==='false'?_0x5827('0x121'):_0x5827('0x122');return db[_0x5827('0x34')][_0x5827('0x4e')]({'attributes':['id',_0x39aa6b],'where':{'id':_0xecceff[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x1a652c,null))[_0x5827('0x29')](function(_0x4c43f9){if(_0x4c43f9){var _0x305e0c=_0x4c43f9[_0x39aa6b];var _0x125867=_0x305e0c&&_0x305e0c[_0x5827('0x123')]?_0x305e0c['items']:[];_0x1a652c['send']({'fromKey':_[_0x5827('0x72')](_0x305e0c[_0x5827('0x124')])?undefined:_0x305e0c[_0x5827('0x124')],'count':_0x125867[_0x5827('0x3e')],'rows':_0x125867});}})['catch'](handleError(_0x1a652c,null));};exports[_0x5827('0x125')]=function(_0x477e1c,_0x1d562b){var _0x325a0d={'raw':![],'where':{}};var _0x564760={};var _0x2faaff={'count':0x0,'rows':[]};return db[_0x5827('0x34')]['findOne']({'where':{'id':_0x477e1c[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x1d562b,null))[_0x5827('0x29')](function(_0xc192ee){if(_0xc192ee){_0x564760[_0x5827('0x3b')]=_[_0x5827('0x39')](db[_0x5827('0xce')][_0x5827('0x35')]);_0x564760[_0x5827('0x38')]=_['keys'](_0x477e1c['query']);_0x564760[_0x5827('0x44')]=_[_0x5827('0x3a')](_0x564760['model'],_0x564760[_0x5827('0x38')]);_0x325a0d[_0x5827('0x3c')]=_[_0x5827('0x3a')](_0x564760[_0x5827('0x3b')],qs[_0x5827('0x3d')](_0x477e1c[_0x5827('0x38')][_0x5827('0x3d')]));_0x325a0d['attributes']=_0x325a0d['attributes']['length']?_0x325a0d[_0x5827('0x3c')]:_0x564760[_0x5827('0x3b')];if(!_0x477e1c[_0x5827('0x38')][_0x5827('0x3f')](_0x5827('0x5d'))){_0x325a0d['limit']=qs[_0x5827('0x23')](_0x477e1c['query'][_0x5827('0x23')]);_0x325a0d['offset']=qs[_0x5827('0x26')](_0x477e1c['query'][_0x5827('0x26')]);}_0x325a0d[_0x5827('0x40')]=qs[_0x5827('0x41')](_0x477e1c[_0x5827('0x38')]['sort']);_0x325a0d[_0x5827('0x42')]=qs[_0x5827('0x44')](_['pick'](_0x477e1c['query'],_0x564760[_0x5827('0x44')]));_0x325a0d[_0x5827('0x42')]['ChatWebsiteId']=_0xc192ee['id'];if(_0x477e1c[_0x5827('0x38')][_0x5827('0x45')]){_0x325a0d[_0x5827('0x42')]=_[_0x5827('0x4d')](_0x325a0d['where'],{'$or':_[_0x5827('0x33')](_0x325a0d[_0x5827('0x3c')],function(_0x186966){var _0xa4abea={};_0xa4abea[_0x186966]={'$like':'%'+_0x477e1c[_0x5827('0x38')][_0x5827('0x45')]+'%'};return _0xa4abea;})});}_0x325a0d=_[_0x5827('0x4d')]({},_0x325a0d,_0x477e1c[_0x5827('0x47')]);return db[_0x5827('0xce')][_0x5827('0x25')]({'where':_0x325a0d[_0x5827('0x42')]})[_0x5827('0x29')](function(_0x6a521e){_0x2faaff['count']=_0x6a521e;if(_0x477e1c[_0x5827('0x38')]['includeAll']){_0x325a0d[_0x5827('0x48')]=[{'all':!![]}];}else{_0x325a0d[_0x5827('0x48')]=[{'model':db[_0x5827('0x81')],'as':_0x5827('0x126'),'required':![]},{'model':db['Attachment'],'as':_0x5827('0x127'),'required':![]}];}return db[_0x5827('0xce')][_0x5827('0x49')](_0x325a0d);})[_0x5827('0x29')](function(_0x14950a){_0x2faaff[_0x5827('0x5e')]=_0x14950a;return _0x2faaff;});}})['then'](respondWithFilteredResult(_0x1d562b,_0x325a0d))[_0x5827('0x1e')](handleError(_0x1d562b,null));};exports[_0x5827('0x128')]=function(_0x2026bf,_0x333df4){return db[_0x5827('0x34')]['find']({'where':{'id':_0x2026bf[_0x5827('0x4b')]['id']}})['then'](handleEntityNotFound(_0x333df4,null))[_0x5827('0x29')](function(_0xea7887){if(_0xea7887){return _0xea7887['addAgents'](_0x2026bf[_0x5827('0x50')][_0x5827('0x60')],_['omit'](_0x2026bf[_0x5827('0x50')],[_0x5827('0x60'),'id'])||{})['spread'](function(_0x4cfed0){for(var _0x22023c=0x0;_0x22023c<_0x2026bf[_0x5827('0x50')]['ids'][_0x5827('0x3e')];_0x22023c+=0x1){socket['emit'](_0x5827('0x129'),{'UserId':Number(_0x2026bf[_0x5827('0x50')][_0x5827('0x60')][_0x22023c]),'ChatWebsiteId':Number(_0x2026bf[_0x5827('0x4b')]['id'])});}return _0x4cfed0;});}})[_0x5827('0x29')](respondWithResult(_0x333df4,null))[_0x5827('0x1e')](handleError(_0x333df4,null));};exports[_0x5827('0x12a')]=function(_0x48e6d3,_0x4351a7){return db[_0x5827('0x34')][_0x5827('0x4e')]({'where':{'id':_0x48e6d3[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x4351a7,null))[_0x5827('0x29')](function(_0x595b09){if(_0x595b09){return _0x595b09['removeAgents'](_0x48e6d3[_0x5827('0x38')]['ids'])['then'](function(){if(_[_0x5827('0x12b')](_0x48e6d3['query'][_0x5827('0x60')])){for(var _0x2f602e=0x0;_0x2f602e<_0x48e6d3[_0x5827('0x38')][_0x5827('0x60')]['length'];_0x2f602e+=0x1){socket[_0x5827('0x12c')](_0x5827('0x12d'),{'UserId':Number(_0x48e6d3[_0x5827('0x38')][_0x5827('0x60')][_0x2f602e]),'ChatWebsiteId':Number(_0x48e6d3[_0x5827('0x4b')]['id'])});}}else{socket[_0x5827('0x12c')](_0x5827('0x12d'),{'UserId':Number(_0x48e6d3[_0x5827('0x38')]['ids']),'ChatWebsiteId':Number(_0x48e6d3[_0x5827('0x4b')]['id'])});}});}})[_0x5827('0x29')](respondWithStatusCode(_0x4351a7,null))[_0x5827('0x1e')](handleError(_0x4351a7,null));};exports[_0x5827('0x12e')]=function(_0x80bd3e,_0x183cf2){var _0x5d590b={};var _0x52b9c6={};var _0x351493;var _0x5cb9c4;return db[_0x5827('0x34')][_0x5827('0x5c')]({'where':{'id':_0x80bd3e[_0x5827('0x4b')]['id']}})[_0x5827('0x29')](handleEntityNotFound(_0x183cf2,null))[_0x5827('0x29')](function(_0x5c603a){if(_0x5c603a){_0x351493=_0x5c603a;_0x52b9c6['model']=_[_0x5827('0x39')](db[_0x5827('0xbb')][_0x5827('0x35')]);_0x52b9c6['query']=_[_0x5827('0x39')](_0x80bd3e[_0x5827('0x38')]);_0x52b9c6[_0x5827('0x44')]=_['intersection'](_0x52b9c6[_0x5827('0x3b')],_0x52b9c6[_0x5827('0x38')]);_0x5d590b[_0x5827('0x3c')]=_[_0x5827('0x3a')](_0x52b9c6[_0x5827('0x3b')],qs[_0x5827('0x3d')](_0x80bd3e[_0x5827('0x38')][_0x5827('0x3d')]));_0x5d590b['attributes']=_0x5d590b[_0x5827('0x3c')]['length']?_0x5d590b[_0x5827('0x3c')]:_0x52b9c6['model'];_0x5d590b[_0x5827('0x40')]=qs['sort'](_0x80bd3e[_0x5827('0x38')][_0x5827('0x41')]);_0x5d590b['where']=qs[_0x5827('0x44')](_[_0x5827('0x43')](_0x80bd3e[_0x5827('0x38')],_0x52b9c6['filters']));if(_0x80bd3e['query'][_0x5827('0x45')]){_0x5d590b[_0x5827('0x42')]=_['merge'](_0x5d590b['where'],{'$or':_[_0x5827('0x33')](_0x5d590b[_0x5827('0x3c')],function(_0x3647d7){var _0x415326={};_0x415326[_0x3647d7]={'$like':'%'+_0x80bd3e[_0x5827('0x38')]['filter']+'%'};return _0x415326;})});}_0x5d590b=_['merge']({},_0x5d590b,_0x80bd3e[_0x5827('0x47')]);return _0x351493[_0x5827('0x12e')](_0x5d590b);}})[_0x5827('0x29')](function(_0x6c8359){if(_0x6c8359){_0x5cb9c4=_0x6c8359[_0x5827('0x3e')];if(!_0x80bd3e['query'][_0x5827('0x3f')](_0x5827('0x5d'))){_0x5d590b[_0x5827('0x23')]=qs[_0x5827('0x23')](_0x80bd3e[_0x5827('0x38')][_0x5827('0x23')]);_0x5d590b['offset']=qs[_0x5827('0x26')](_0x80bd3e[_0x5827('0x38')][_0x5827('0x26')]);}return _0x351493['getAgents'](_0x5d590b);}})[_0x5827('0x29')](function(_0x1de738){if(_0x1de738){return _0x1de738?{'count':_0x5cb9c4,'rows':_0x1de738}:null;}})['then'](respondWithResult(_0x183cf2,null))[_0x5827('0x1e')](handleError(_0x183cf2,null));};
\ No newline at end of file
+var _0x68db=['systemAvatar','getLogo','join','root','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','account','list','applications','orderBy','priority','asc','Contacts','defaults','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','browser','version','format','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','lastName','messageId','get','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','ids','omit','getInteractions','Contact','fullname','internal','Tags','color','tag','iftime\x20%s,%s','timezone','iftime\x20%s','interval','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','getProactiveActions','../../config/license/util','chatLicenseExceeded','Intervals','push','all','some','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','referer','virtual','replace','alignment','verticalAlignment','labelText','textButtonColor','color_button','backgroundColor','hideWhenOffline','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','fs-extra','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','redis','localhost','./chatWebsite.socket','html-to-text','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','sendStatus','status','end','json','offset','undefined','limit','set','destroy','ChatWebsites','UserProfileResource','stack','send','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','name','keys','intersection','model','attributes','fields','query','nolimit','order','sort','where','pick','filters','merge','options','count','includeAll','include','catch','show','params','mandatoryDispositionPause','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','filter','findAll','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','rows','removeAnswers','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','file','addSystemAvatar'];(function(_0x194ab1,_0x4f038c){var _0x34c079=function(_0x51e5bb){while(--_0x51e5bb){_0x194ab1['push'](_0x194ab1['shift']());}};_0x34c079(++_0x4f038c);}(_0x68db,0xc3));var _0xb68d=function(_0x215c2a,_0x52e74c){_0x215c2a=_0x215c2a-0x0;var _0x538f0d=_0x68db[_0x215c2a];return _0x538f0d;};'use strict';var BPromise=require(_0xb68d('0x0'));var Mustache=require(_0xb68d('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb68d('0x2'));var _=require('lodash');var querystring=require(_0xb68d('0x3'));var Redis=require(_0xb68d('0x4'));var qs=require(_0xb68d('0x5'));var logger=require('../../config/logger')(_0xb68d('0x6'));var config=require(_0xb68d('0x7'));var url=require(_0xb68d('0x8'));var db=require(_0xb68d('0x9'))['db'];config[_0xb68d('0xa')]=_['defaults'](config['redis'],{'host':_0xb68d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb68d('0xa')]));require(_0xb68d('0xc'))['register'](socket);var htmlToText=require(_0xb68d('0xd'));var jayson=require(_0xb68d('0xe'));var client=jayson[_0xb68d('0xf')]['http']({'port':0x232c});var client9002=jayson[_0xb68d('0xf')]['http']({'port':0x232a});var client9003=jayson[_0xb68d('0xf')][_0xb68d('0x10')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x534395,_0x135a55,_0x257272,_0x251ae8){return new BPromise(function(_0x15a9f0,_0x54c5b9){var _0x439048=_0x251ae8||client;return _0x439048['request'](_0x534395,_0x257272)[_0xb68d('0x11')](function(_0x4416e9){logger[_0xb68d('0x12')](_0xb68d('0x13'),_0x135a55,_0xb68d('0x14'));logger['debug'](_0xb68d('0x15'),_0x135a55,'request\x20sent',JSON[_0xb68d('0x16')](_0x4416e9));if(_0x4416e9[_0xb68d('0x17')]){if(_0x4416e9[_0xb68d('0x17')][_0xb68d('0x18')]===0x1f4){logger[_0xb68d('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x135a55,_0x4416e9[_0xb68d('0x17')]['message']);return _0x54c5b9(_0x4416e9['error'][_0xb68d('0x19')]);}logger[_0xb68d('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x135a55,_0x4416e9['error'][_0xb68d('0x19')]);return _0x15a9f0(_0x4416e9[_0xb68d('0x17')]['message']);}else{logger[_0xb68d('0x12')](_0xb68d('0x13'),_0x135a55,_0xb68d('0x14'));_0x15a9f0(_0x4416e9[_0xb68d('0x1a')][_0xb68d('0x19')]);}})['catch'](function(_0x44a318){logger[_0xb68d('0x17')](_0xb68d('0x13'),_0x135a55,_0x44a318);_0x54c5b9(_0x44a318);});});}function respondWithStatusCode(_0x3cf1ea,_0x2a9871){_0x2a9871=_0x2a9871||0xcc;return function(_0x3620f8){if(_0x3620f8){return _0x3cf1ea[_0xb68d('0x1b')](_0x2a9871);}return _0x3cf1ea[_0xb68d('0x1c')](_0x2a9871)[_0xb68d('0x1d')]();};}function respondWithResult(_0x31cd11,_0x39024e){_0x39024e=_0x39024e||0xc8;return function(_0x304131){if(_0x304131){return _0x31cd11[_0xb68d('0x1c')](_0x39024e)[_0xb68d('0x1e')](_0x304131);}};}function respondWithFilteredResult(_0x38f9d8,_0x32a933){return function(_0x4fb373){if(_0x4fb373){var _0x505750=typeof _0x32a933[_0xb68d('0x1f')]===_0xb68d('0x20')&&typeof _0x32a933[_0xb68d('0x21')]===_0xb68d('0x20');var _0x4af57b=_0x4fb373['count'];var _0x390a03=_0x505750?0x0:_0x32a933[_0xb68d('0x1f')];var _0x51e3ff=_0x505750?_0x4fb373['count']:_0x32a933[_0xb68d('0x1f')]+_0x32a933[_0xb68d('0x21')];var _0x430411;if(_0x51e3ff>=_0x4af57b){_0x51e3ff=_0x4af57b;_0x430411=0xc8;}else{_0x430411=0xce;}_0x38f9d8[_0xb68d('0x1c')](_0x430411);return _0x38f9d8[_0xb68d('0x22')]('Content-Range',_0x390a03+'-'+_0x51e3ff+'/'+_0x4af57b)['json'](_0x4fb373);}return null;};}function saveUpdates(_0x5e21a3){return function(_0x2b89e5){if(_0x2b89e5){return _0x2b89e5['update'](_0x5e21a3)['then'](function(_0x271d25){return _0x271d25;});}return null;};}function removeEntity(_0x139341){return function(_0x190400){if(_0x190400){return _0x190400[_0xb68d('0x23')]()['then'](function(){var _0x3934d5=_0x190400['get']({'plain':!![]});var _0x402665=_0xb68d('0x24');return db[_0xb68d('0x25')]['destroy']({'where':{'type':_0x402665,'resourceId':_0x3934d5['id']}})['then'](function(){return _0x190400;});})['then'](function(){_0x139341[_0xb68d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25c3dc){return function(_0x14e8ff){if(!_0x14e8ff){_0x25c3dc[_0xb68d('0x1b')](0x194);}return _0x14e8ff;};}function handleError(_0x39b675,_0x3a4f7c){_0x3a4f7c=_0x3a4f7c||0x1f4;return function(_0x12cd8d){logger['error'](_0x12cd8d[_0xb68d('0x26')]);if(_0x12cd8d['name']){delete _0x12cd8d['name'];}_0x39b675[_0xb68d('0x1c')](_0x3a4f7c)[_0xb68d('0x27')](_0x12cd8d);};}exports['index']=function(_0x2914f1,_0x5e417d){var _0x26baaa={'include':[{'model':db[_0xb68d('0x28')],'as':'mandatoryDispositionPause'}]},_0x38c561={},_0x4c1995={'count':0x0,'rows':[]};var _0x36b242=_[_0xb68d('0x29')](db[_0xb68d('0x2a')][_0xb68d('0x2b')],function(_0x4229c7){return{'name':_0x4229c7[_0xb68d('0x2c')],'type':_0x4229c7[_0xb68d('0x2d')][_0xb68d('0x2e')]};});_0x38c561['model']=_[_0xb68d('0x29')](_0x36b242,_0xb68d('0x2f'));_0x38c561['query']=_[_0xb68d('0x30')](_0x2914f1['query']);_0x38c561['filters']=_[_0xb68d('0x31')](_0x38c561[_0xb68d('0x32')],_0x38c561['query']);_0x26baaa[_0xb68d('0x33')]=_[_0xb68d('0x31')](_0x38c561['model'],qs[_0xb68d('0x34')](_0x2914f1[_0xb68d('0x35')][_0xb68d('0x34')]));_0x26baaa[_0xb68d('0x33')]=_0x26baaa[_0xb68d('0x33')]['length']?_0x26baaa[_0xb68d('0x33')]:_0x38c561[_0xb68d('0x32')];if(!_0x2914f1[_0xb68d('0x35')]['hasOwnProperty'](_0xb68d('0x36'))){_0x26baaa['limit']=qs[_0xb68d('0x21')](_0x2914f1[_0xb68d('0x35')][_0xb68d('0x21')]);_0x26baaa[_0xb68d('0x1f')]=qs['offset'](_0x2914f1['query']['offset']);}_0x26baaa[_0xb68d('0x37')]=qs[_0xb68d('0x38')](_0x2914f1[_0xb68d('0x35')][_0xb68d('0x38')]);_0x26baaa[_0xb68d('0x39')]=qs['filters'](_[_0xb68d('0x3a')](_0x2914f1[_0xb68d('0x35')],_0x38c561[_0xb68d('0x3b')]),_0x36b242);if(_0x2914f1[_0xb68d('0x35')]['filter']){_0x26baaa['where']=_[_0xb68d('0x3c')](_0x26baaa[_0xb68d('0x39')],{'$or':_['map'](_0x36b242,function(_0x25e71c){if(_0x25e71c['type']!=='VIRTUAL'){var _0x584d1f={};_0x584d1f[_0x25e71c[_0xb68d('0x2f')]]={'$like':'%'+_0x2914f1[_0xb68d('0x35')]['filter']+'%'};return _0x584d1f;}})});}_0x26baaa=_[_0xb68d('0x3c')]({},_0x26baaa,_0x2914f1[_0xb68d('0x3d')]);var _0x25e78e={'where':_0x26baaa[_0xb68d('0x39')]};return db[_0xb68d('0x2a')]['count'](_0x25e78e)['then'](function(_0x25146f){_0x4c1995[_0xb68d('0x3e')]=_0x25146f;if(_0x2914f1[_0xb68d('0x35')][_0xb68d('0x3f')]){_0x26baaa[_0xb68d('0x40')]=[{'all':!![]}];}return db[_0xb68d('0x2a')]['findAll'](_0x26baaa);})[_0xb68d('0x11')](function(_0x1c8daf){_0x4c1995['rows']=_0x1c8daf;return _0x4c1995;})[_0xb68d('0x11')](respondWithFilteredResult(_0x5e417d,_0x26baaa))[_0xb68d('0x41')](handleError(_0x5e417d,null));};exports[_0xb68d('0x42')]=function(_0x4377ff,_0x35bb77){var _0x18e645={'raw':![],'where':{'id':_0x4377ff[_0xb68d('0x43')]['id']},'include':[{'model':db['Pause'],'as':_0xb68d('0x44')}]},_0x5cb028={};_0x5cb028['model']=_[_0xb68d('0x30')](db['ChatWebsite'][_0xb68d('0x2b')]);_0x5cb028[_0xb68d('0x35')]=_[_0xb68d('0x30')](_0x4377ff[_0xb68d('0x35')]);_0x5cb028[_0xb68d('0x3b')]=_[_0xb68d('0x31')](_0x5cb028[_0xb68d('0x32')],_0x5cb028['query']);_0x18e645[_0xb68d('0x33')]=_[_0xb68d('0x31')](_0x5cb028['model'],qs[_0xb68d('0x34')](_0x4377ff['query']['fields']));_0x18e645[_0xb68d('0x33')]=_0x18e645['attributes'][_0xb68d('0x45')]?_0x18e645[_0xb68d('0x33')]:_0x5cb028['model'];if(_0x4377ff['query']['includeAll']){_0x18e645[_0xb68d('0x40')]=[{'all':!![]}];}_0x18e645=_[_0xb68d('0x3c')]({},_0x18e645,_0x4377ff[_0xb68d('0x3d')]);return db['ChatWebsite']['find'](_0x18e645)[_0xb68d('0x11')](handleEntityNotFound(_0x35bb77,null))[_0xb68d('0x11')](respondWithResult(_0x35bb77,null))[_0xb68d('0x41')](handleError(_0x35bb77,null));};exports['create']=function(_0x2e3f32,_0x4fde99){return db[_0xb68d('0x2a')][_0xb68d('0x46')](_0x2e3f32[_0xb68d('0x47')],{})[_0xb68d('0x11')](function(_0x316730){var _0x3c6509=_0x2e3f32[_0xb68d('0x48')]['get']({'plain':!![]});if(!_0x3c6509)throw new Error(_0xb68d('0x49'));if(_0x3c6509[_0xb68d('0x4a')]===_0xb68d('0x48')){var _0x552351=_0x316730['get']({'plain':!![]});var _0x58e0c7='ChatWebsites';return db[_0xb68d('0x4b')][_0xb68d('0x4c')]({'where':{'name':_0x58e0c7,'userProfileId':_0x3c6509[_0xb68d('0x4d')]},'raw':!![]})[_0xb68d('0x11')](function(_0x17d021){if(_0x17d021&&_0x17d021[_0xb68d('0x4e')]===0x0){return db[_0xb68d('0x25')][_0xb68d('0x46')]({'name':_0x552351[_0xb68d('0x2f')],'resourceId':_0x552351['id'],'type':_0x17d021['name'],'sectionId':_0x17d021['id']},{})['then'](function(){return _0x316730;});}else{return _0x316730;}})[_0xb68d('0x41')](function(_0x3769bd){logger[_0xb68d('0x17')](_0xb68d('0x4f'),_0x3769bd);throw _0x3769bd;});}return _0x316730;})[_0xb68d('0x11')](respondWithResult(_0x4fde99,0xc9))[_0xb68d('0x41')](handleError(_0x4fde99,null));};exports[_0xb68d('0x50')]=function(_0x5d47e4,_0x4877cf){if(_0x5d47e4[_0xb68d('0x47')]['id']){delete _0x5d47e4['body']['id'];}return db[_0xb68d('0x2a')]['find']({'where':{'id':_0x5d47e4['params']['id']},'include':[{'model':db[_0xb68d('0x28')],'as':'mandatoryDispositionPause'}]})[_0xb68d('0x11')](handleEntityNotFound(_0x4877cf,null))[_0xb68d('0x11')](saveUpdates(_0x5d47e4[_0xb68d('0x47')],null))[_0xb68d('0x11')](respondWithResult(_0x4877cf,null))['catch'](handleError(_0x4877cf,null));};exports[_0xb68d('0x23')]=function(_0x584a5d,_0x421203){return db[_0xb68d('0x2a')]['find']({'where':{'id':_0x584a5d['params']['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x421203,null))[_0xb68d('0x11')](removeEntity(_0x421203,null))[_0xb68d('0x41')](handleError(_0x421203,null));};exports[_0xb68d('0x51')]=function(_0x478356,_0x2ec16a){return db['ChatWebsite'][_0xb68d('0x51')]()[_0xb68d('0x11')](respondWithResult(_0x2ec16a,null))[_0xb68d('0x41')](handleError(_0x2ec16a,null));};exports[_0xb68d('0x52')]=function(_0x14d8b9,_0x38773b){if(_0x14d8b9['body']['id']){delete _0x14d8b9[_0xb68d('0x47')]['id'];}return db[_0xb68d('0x2a')][_0xb68d('0x4c')]({'where':{'id':_0x14d8b9[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x38773b,null))[_0xb68d('0x11')](function(_0x2cadd6){if(_0x2cadd6){_0x14d8b9[_0xb68d('0x47')][_0xb68d('0x53')]=_0x2cadd6['id'];return db[_0xb68d('0x54')][_0xb68d('0x46')](_0x14d8b9[_0xb68d('0x47')]);}})[_0xb68d('0x11')](respondWithResult(_0x38773b,null))[_0xb68d('0x41')](handleError(_0x38773b,null));};exports['getDispositions']=function(_0x5cbcb5,_0x3ec8cc){var _0x27fd7c={'raw':![],'where':{}};var _0x24f739={};var _0x3e6cbc={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x5cbcb5[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x3ec8cc,null))[_0xb68d('0x11')](function(_0x39ba9c){if(_0x39ba9c){_0x24f739[_0xb68d('0x32')]=_[_0xb68d('0x30')](db['Disposition']['rawAttributes']);_0x24f739['query']=_['keys'](_0x5cbcb5['query']);_0x24f739[_0xb68d('0x3b')]=_[_0xb68d('0x31')](_0x24f739[_0xb68d('0x32')],_0x24f739[_0xb68d('0x35')]);_0x27fd7c[_0xb68d('0x33')]=_[_0xb68d('0x31')](_0x24f739[_0xb68d('0x32')],qs[_0xb68d('0x34')](_0x5cbcb5['query']['fields']));_0x27fd7c[_0xb68d('0x33')]=_0x27fd7c['attributes'][_0xb68d('0x45')]?_0x27fd7c[_0xb68d('0x33')]:_0x24f739[_0xb68d('0x32')];if(!_0x5cbcb5[_0xb68d('0x35')][_0xb68d('0x55')](_0xb68d('0x36'))){_0x27fd7c[_0xb68d('0x21')]=qs['limit'](_0x5cbcb5['query'][_0xb68d('0x21')]);_0x27fd7c[_0xb68d('0x1f')]=qs['offset'](_0x5cbcb5[_0xb68d('0x35')][_0xb68d('0x1f')]);}_0x27fd7c[_0xb68d('0x37')]=qs[_0xb68d('0x38')](_0x5cbcb5[_0xb68d('0x35')][_0xb68d('0x38')]);_0x27fd7c['where']=qs[_0xb68d('0x3b')](_[_0xb68d('0x3a')](_0x5cbcb5['query'],_0x24f739[_0xb68d('0x3b')]));_0x27fd7c[_0xb68d('0x39')][_0xb68d('0x53')]=_0x39ba9c['id'];if(_0x5cbcb5[_0xb68d('0x35')][_0xb68d('0x56')]){_0x27fd7c['where']=_['merge'](_0x27fd7c[_0xb68d('0x39')],{'$or':_[_0xb68d('0x29')](_0x27fd7c[_0xb68d('0x33')],function(_0x4a7dc5){var _0x260dce={};_0x260dce[_0x4a7dc5]={'$like':'%'+_0x5cbcb5[_0xb68d('0x35')][_0xb68d('0x56')]+'%'};return _0x260dce;})});}_0x27fd7c=_['merge']({},_0x27fd7c,_0x5cbcb5[_0xb68d('0x3d')]);return db[_0xb68d('0x54')][_0xb68d('0x3e')]({'where':_0x27fd7c['where']})[_0xb68d('0x11')](function(_0x122d30){_0x3e6cbc['count']=_0x122d30;if(_0x5cbcb5['query']['includeAll']){_0x27fd7c[_0xb68d('0x40')]=[{'all':!![]}];}return db[_0xb68d('0x54')][_0xb68d('0x57')](_0x27fd7c);})[_0xb68d('0x11')](function(_0x29113a){_0x3e6cbc['rows']=_0x29113a;return _0x3e6cbc;});}})['then'](respondWithFilteredResult(_0x3ec8cc,_0x27fd7c))[_0xb68d('0x41')](handleError(_0x3ec8cc,null));};exports[_0xb68d('0x58')]=function(_0x51c995,_0x21d0e7){return db[_0xb68d('0x2a')][_0xb68d('0x4c')]({'where':{'id':_0x51c995[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x21d0e7,null))[_0xb68d('0x11')](function(_0x4734c1){if(_0x4734c1){return _0x4734c1[_0xb68d('0x58')](_0x51c995['query']['ids']);}})['then'](respondWithStatusCode(_0x21d0e7,null))[_0xb68d('0x41')](handleError(_0x21d0e7,null));};exports[_0xb68d('0x59')]=function(_0x54a01d,_0x10d385){if(_0x54a01d['body']['id']){delete _0x54a01d[_0xb68d('0x47')]['id'];}return db[_0xb68d('0x2a')][_0xb68d('0x4c')]({'where':{'id':_0x54a01d['params']['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x10d385,null))[_0xb68d('0x11')](function(_0x276a7d){if(_0x276a7d){_0x54a01d[_0xb68d('0x47')][_0xb68d('0x53')]=_0x276a7d['id'];return db['CannedAnswer'][_0xb68d('0x46')](_0x54a01d['body']);}})[_0xb68d('0x11')](respondWithResult(_0x10d385,null))[_0xb68d('0x41')](handleError(_0x10d385,null));};exports[_0xb68d('0x5a')]=function(_0x418a48,_0x21d895){var _0x39888e={'raw':![],'where':{}};var _0x466415={};var _0x276c08={'count':0x0,'rows':[]};return db[_0xb68d('0x2a')][_0xb68d('0x5b')]({'where':{'id':_0x418a48[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x21d895,null))[_0xb68d('0x11')](function(_0x177b16){if(_0x177b16){_0x466415[_0xb68d('0x32')]=_[_0xb68d('0x30')](db[_0xb68d('0x5c')]['rawAttributes']);_0x466415['query']=_[_0xb68d('0x30')](_0x418a48[_0xb68d('0x35')]);_0x466415[_0xb68d('0x3b')]=_['intersection'](_0x466415[_0xb68d('0x32')],_0x466415[_0xb68d('0x35')]);_0x39888e[_0xb68d('0x33')]=_[_0xb68d('0x31')](_0x466415['model'],qs[_0xb68d('0x34')](_0x418a48['query'][_0xb68d('0x34')]));_0x39888e[_0xb68d('0x33')]=_0x39888e['attributes'][_0xb68d('0x45')]?_0x39888e[_0xb68d('0x33')]:_0x466415[_0xb68d('0x32')];if(!_0x418a48[_0xb68d('0x35')][_0xb68d('0x55')](_0xb68d('0x36'))){_0x39888e['limit']=qs[_0xb68d('0x21')](_0x418a48[_0xb68d('0x35')]['limit']);_0x39888e[_0xb68d('0x1f')]=qs[_0xb68d('0x1f')](_0x418a48[_0xb68d('0x35')][_0xb68d('0x1f')]);}_0x39888e[_0xb68d('0x37')]=qs[_0xb68d('0x38')](_0x418a48[_0xb68d('0x35')][_0xb68d('0x38')]);_0x39888e[_0xb68d('0x39')]=qs[_0xb68d('0x3b')](_[_0xb68d('0x3a')](_0x418a48['query'],_0x466415['filters']));_0x39888e[_0xb68d('0x39')][_0xb68d('0x53')]=_0x177b16['id'];if(_0x418a48[_0xb68d('0x35')][_0xb68d('0x56')]){_0x39888e[_0xb68d('0x39')]=_[_0xb68d('0x3c')](_0x39888e[_0xb68d('0x39')],{'$or':_[_0xb68d('0x29')](_0x39888e[_0xb68d('0x33')],function(_0x4e08be){var _0x19ec1f={};_0x19ec1f[_0x4e08be]={'$like':'%'+_0x418a48[_0xb68d('0x35')][_0xb68d('0x56')]+'%'};return _0x19ec1f;})});}_0x39888e=_['merge']({},_0x39888e,_0x418a48['options']);return db[_0xb68d('0x5c')]['count']({'where':_0x39888e[_0xb68d('0x39')]})[_0xb68d('0x11')](function(_0x4494eb){_0x276c08['count']=_0x4494eb;if(_0x418a48['query'][_0xb68d('0x3f')]){_0x39888e[_0xb68d('0x40')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb68d('0x57')](_0x39888e);})[_0xb68d('0x11')](function(_0x44b455){_0x276c08[_0xb68d('0x5d')]=_0x44b455;return _0x276c08;});}})['then'](respondWithFilteredResult(_0x21d895,_0x39888e))[_0xb68d('0x41')](handleError(_0x21d895,null));};exports['removeAnswers']=function(_0x1afbfb,_0x2edffa){return db['ChatWebsite'][_0xb68d('0x4c')]({'where':{'id':_0x1afbfb[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x2edffa,null))['then'](function(_0x4217c5){if(_0x4217c5){return _0x4217c5[_0xb68d('0x5e')](_0x1afbfb[_0xb68d('0x35')]['ids']);}})[_0xb68d('0x11')](respondWithStatusCode(_0x2edffa,null))['catch'](handleError(_0x2edffa,null));};exports['addLogo']=function(_0x44a90d,_0xd73a71){_0x44a90d[_0xb68d('0x47')][_0xb68d('0x5f')]=_0x44a90d['file'][_0xb68d('0x60')];return db[_0xb68d('0x2a')][_0xb68d('0x4c')]({'where':{'id':_0x44a90d[_0xb68d('0x43')]['id']}})['then'](handleEntityNotFound(_0xd73a71,null))[_0xb68d('0x11')](saveUpdates(_0x44a90d[_0xb68d('0x47')],null))[_0xb68d('0x11')](respondWithResult(_0xd73a71,null))[_0xb68d('0x41')](handleError(_0xd73a71,null));};exports[_0xb68d('0x61')]=function(_0x2f7553,_0x41edab){_0x2f7553['body'][_0xb68d('0x62')]=_0x2f7553['file']['filename'];return db[_0xb68d('0x2a')][_0xb68d('0x4c')]({'where':{'id':_0x2f7553[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x41edab,null))['then'](saveUpdates(_0x2f7553[_0xb68d('0x47')],null))[_0xb68d('0x11')](respondWithResult(_0x41edab,null))[_0xb68d('0x41')](handleError(_0x41edab,null));};exports[_0xb68d('0x63')]=function(_0x32b322,_0x18d3ec){_0x32b322[_0xb68d('0x47')][_0xb68d('0x64')]=_0x32b322[_0xb68d('0x65')][_0xb68d('0x60')];return db[_0xb68d('0x2a')]['find']({'where':{'id':_0x32b322['params']['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x18d3ec,null))[_0xb68d('0x11')](saveUpdates(_0x32b322[_0xb68d('0x47')],null))[_0xb68d('0x11')](respondWithResult(_0x18d3ec,null))['catch'](handleError(_0x18d3ec,null));};exports[_0xb68d('0x66')]=function(_0x163d6f,_0xdf988e){_0x163d6f[_0xb68d('0x47')][_0xb68d('0x67')]=_0x163d6f[_0xb68d('0x65')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x163d6f['params']['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0xdf988e,null))[_0xb68d('0x11')](saveUpdates(_0x163d6f[_0xb68d('0x47')],null))['then'](respondWithResult(_0xdf988e,null))['catch'](handleError(_0xdf988e,null));};exports[_0xb68d('0x68')]=function(_0x344b15,_0xc765f3){var _0x27e6b1=path[_0xb68d('0x69')](config[_0xb68d('0x6a')],'server/files/images/logos/default_logo.svg');var _0x28e516={'where':{'id':_0x344b15['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x568c12=![];return require('../../config/license/util')[_0xb68d('0x6b')]()[_0xb68d('0x11')](function(_0x589675){if(_0x589675){_0x568c12=_0x589675[_0xb68d('0x6c')];}})[_0xb68d('0x11')](function(){return db[_0xb68d('0x2a')]['find'](_0x28e516);})['then'](handleEntityNotFound(_0xc765f3,null))[_0xb68d('0x11')](function(_0xe78575){if(_0xe78575){if(!_[_0xb68d('0x6d')](_0xe78575[_0xb68d('0x5f')])){if(fs[_0xb68d('0x6e')](path[_0xb68d('0x69')](config[_0xb68d('0x6a')],_0xb68d('0x6f'),_0xe78575[_0xb68d('0x5f')]))&&_0x568c12){_0x27e6b1=path[_0xb68d('0x69')](config['root'],_0xb68d('0x6f'),_0xe78575[_0xb68d('0x5f')]);}}return _0xc765f3[_0xb68d('0x70')](_0x27e6b1);}})[_0xb68d('0x41')](handleError(_0xc765f3,null));};exports[_0xb68d('0x71')]=function(_0x458790,_0x11b4a1){var _0x2570bf=path[_0xb68d('0x69')](config[_0xb68d('0x6a')],_0xb68d('0x72'));var _0x563077={'where':{'id':_0x458790[_0xb68d('0x43')]['id']},'attributes':['id',_0xb68d('0x62')],'raw':!![]};return db[_0xb68d('0x2a')][_0xb68d('0x4c')](_0x563077)[_0xb68d('0x11')](handleEntityNotFound(_0x11b4a1,null))['then'](function(_0xe4100d){if(_0xe4100d){if(!_[_0xb68d('0x6d')](_0xe4100d[_0xb68d('0x62')])){if(fs[_0xb68d('0x6e')](path[_0xb68d('0x69')](config['root'],_0xb68d('0x73'),_0xe4100d['agentAvatar']))){_0x2570bf=path[_0xb68d('0x69')](config[_0xb68d('0x6a')],'server/files/images/avatars/',_0xe4100d[_0xb68d('0x62')]);}}return _0x11b4a1[_0xb68d('0x70')](_0x2570bf);}})[_0xb68d('0x41')](handleError(_0x11b4a1,null));};exports[_0xb68d('0x74')]=function(_0x139069,_0x27c444){var _0x4244b5=path[_0xb68d('0x69')](config[_0xb68d('0x6a')],'server/files/images/avatars/customer_avatar.png');var _0x15777={'where':{'id':_0x139069[_0xb68d('0x43')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xb68d('0x2a')][_0xb68d('0x4c')](_0x15777)[_0xb68d('0x11')](handleEntityNotFound(_0x27c444,null))[_0xb68d('0x11')](function(_0x4316d8){if(_0x4316d8){if(!_[_0xb68d('0x6d')](_0x4316d8[_0xb68d('0x64')])){if(fs[_0xb68d('0x6e')](path[_0xb68d('0x69')](config[_0xb68d('0x6a')],_0xb68d('0x73'),_0x4316d8['customerAvatar']))&&_0x4316d8['showCustomerAvatar']){_0x4244b5=path[_0xb68d('0x69')](config['root'],_0xb68d('0x73'),_0x4316d8[_0xb68d('0x64')]);}}return _0x27c444[_0xb68d('0x70')](_0x4244b5);}})['catch'](handleError(_0x27c444,null));};exports[_0xb68d('0x75')]=function(_0x506540,_0x2c377e){var _0xc47be6=path[_0xb68d('0x69')](config['root'],_0xb68d('0x76'));var _0x42104b={'where':{'id':_0x506540['params']['id']},'attributes':['id',_0xb68d('0x67')],'raw':!![]};return db[_0xb68d('0x2a')][_0xb68d('0x4c')](_0x42104b)[_0xb68d('0x11')](handleEntityNotFound(_0x2c377e,null))[_0xb68d('0x11')](function(_0xd88fa1){if(_0xd88fa1){if(!_[_0xb68d('0x6d')](_0xd88fa1[_0xb68d('0x67')])){if(fs[_0xb68d('0x6e')](path['join'](config[_0xb68d('0x6a')],_0xb68d('0x73'),_0xd88fa1[_0xb68d('0x67')]))){_0xc47be6=path[_0xb68d('0x69')](config[_0xb68d('0x6a')],_0xb68d('0x73'),_0xd88fa1[_0xb68d('0x67')]);}}return _0x2c377e[_0xb68d('0x70')](_0xc47be6);}})['catch'](handleError(_0x2c377e,null));};exports[_0xb68d('0x77')]=function(_0x48c786,_0x365b2b){var _0x3ea0fd=require(_0xb68d('0x78'));var _0x419997=new _0x3ea0fd();var _0x4fcf86=_0x419997[_0xb68d('0x79')](_0x48c786[_0xb68d('0x7a')][_0xb68d('0x7b')])[_0xb68d('0x7c')]();var _0x277800={'body':_0x48c786[_0xb68d('0x47')],'channel':_0xb68d('0x7d')};var _0x45a9e6=[];var _0x364047=[];var _0x43ea3a={};var _0x21a8a3=![];return db[_0xb68d('0x7e')]['describe']()[_0xb68d('0x11')](function(_0x252c54){if(!_0x252c54){throw new db[(_0xb68d('0x7f'))][(_0xb68d('0x80'))](_0xb68d('0x81'));}_0x45a9e6=_[_0xb68d('0x82')](_[_0xb68d('0x30')](_0x252c54),['createdAt',_0xb68d('0x83')]);_0x364047=_['difference'](_[_0xb68d('0x30')](_0x252c54),[_0xb68d('0x84'),'updatedAt',_0xb68d('0x85'),_0xb68d('0x86')]);if(_0x48c786['body']['id']){delete _0x48c786[_0xb68d('0x47')]['id'];}if(_[_0xb68d('0x6d')](_0x48c786['body'][_0xb68d('0x87')])){throw new db[(_0xb68d('0x7f'))]['ValidationError'](_0xb68d('0x88'));}if(_[_0xb68d('0x6d')](_0x48c786[_0xb68d('0x47')][_0xb68d('0x47')])||_0x48c786[_0xb68d('0x47')]['body']===''){throw new db['Sequelize'][(_0xb68d('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x48c786[_0xb68d('0x47')]['mapKey'])){throw new db[(_0xb68d('0x7f'))][(_0xb68d('0x80'))](_0xb68d('0x89')+_0x364047);}if(!_['includes'](_0x364047,_0x48c786[_0xb68d('0x47')][_0xb68d('0x8a')])){throw new db[(_0xb68d('0x7f'))]['ValidationError'](_0xb68d('0x8b')+_0x364047);}_0x43ea3a[_0x48c786[_0xb68d('0x47')][_0xb68d('0x8a')]]=_0x48c786[_0xb68d('0x47')][_0xb68d('0x87')];})['then'](function(){return db['ChatWebsite'][_0xb68d('0x4c')]({'where':{'id':_0x48c786[_0xb68d('0x43')]['id']},'include':[{'model':db['CmList'],'as':_0xb68d('0x8c'),'include':[{'model':db[_0xb68d('0x7e')],'as':'Contacts','where':_0x43ea3a,'limit':0x1,'order':[[_0xb68d('0x83'),_0xb68d('0x8d')]]}]},{'model':db[_0xb68d('0x8e')],'as':_0xb68d('0x8f')}]});})[_0xb68d('0x11')](handleEntityNotFound(_0x365b2b,null))[_0xb68d('0x11')](function(_0x28c5b7){if(_0x28c5b7&&_0x28c5b7[_0xb68d('0x8c')]){_0x277800[_0xb68d('0x90')]=_0x28c5b7;_0x277800['applications']=_0x28c5b7[_0xb68d('0x8f')];_0x277800[_0xb68d('0x91')]=_0x28c5b7[_0xb68d('0x8c')];_0x277800[_0xb68d('0x92')]=_[_0xb68d('0x93')](_0x277800[_0xb68d('0x92')],[_0xb68d('0x94')],[_0xb68d('0x95')]);if(_0x277800[_0xb68d('0x90')]['Applications']){delete _0x277800[_0xb68d('0x90')][_0xb68d('0x8f')];}if(_0x277800[_0xb68d('0x90')][_0xb68d('0x8c')]&&_0x277800[_0xb68d('0x90')][_0xb68d('0x8c')][_0xb68d('0x96')][_0xb68d('0x45')]){return _0x277800['account'][_0xb68d('0x8c')][_0xb68d('0x96')][0x0];}var _0x272f1c=_[_0xb68d('0x97')](_0x48c786['body'],{'firstName':_0x48c786[_0xb68d('0x47')][_0xb68d('0x87')],'ListId':_0x28c5b7[_0xb68d('0x86')]});_0x272f1c[_0x48c786[_0xb68d('0x47')][_0xb68d('0x8a')]]=_0x48c786[_0xb68d('0x47')][_0xb68d('0x87')];return db['CmContact'][_0xb68d('0x46')](_0x272f1c,{'fields':_0x45a9e6,'raw':!![]});}})['then'](handleEntityNotFound(_0x365b2b,null))[_0xb68d('0x11')](function(_0x4b1d6b){_0x277800['contact']=_0x4b1d6b;var _0xc634a8=_0x48c786[_0xb68d('0x47')][_0xb68d('0x98')];if(_0x48c786[_0xb68d('0x7a')][_0xb68d('0x99')]){_0xc634a8=_0x48c786[_0xb68d('0x7a')][_0xb68d('0x99')];}else if(_0x48c786[_0xb68d('0x7a')]['x-forwarded-for']){_0xc634a8=_[_0xb68d('0x9a')](_0x48c786[_0xb68d('0x7a')][_0xb68d('0x9b')][_0xb68d('0x9c')](','));}if(_0x4b1d6b){var _0x471767={'ContactId':_0x4b1d6b['id'],'ChatWebsiteId':_0x48c786[_0xb68d('0x43')]['id'],'from':(_0x4b1d6b[_0xb68d('0x9d')]||'')+'\x20'+(_0x4b1d6b['lastName']||''),'customerIp':_0xc634a8,'customerPort':_0x48c786[_0xb68d('0x7a')]['x-real-port']?_0x48c786[_0xb68d('0x7a')]['x-real-port']:null,'referer':_0x48c786[_0xb68d('0x47')]['referer'],'browserName':_0x4fcf86[_0xb68d('0x9e')][_0xb68d('0x2f')]&&_0x4fcf86[_0xb68d('0x9e')][_0xb68d('0x9f')]?util[_0xb68d('0xa0')]('%s\x20%s',_0x4fcf86[_0xb68d('0x9e')][_0xb68d('0x2f')],_0x4fcf86[_0xb68d('0x9e')][_0xb68d('0x9f')]):_0xb68d('0xa1'),'browserVersion':_0x4fcf86[_0xb68d('0x9e')][_0xb68d('0x9f')]||_0xb68d('0xa1'),'osName':util[_0xb68d('0xa0')]('%s\x20%s',_0x4fcf86['os']['name'],_0x4fcf86['os']['version']),'osVersion':_0x4fcf86['os'][_0xb68d('0x9f')],'deviceModel':_0x4fcf86[_0xb68d('0xa2')][_0xb68d('0x32')]&&_0x4fcf86[_0xb68d('0xa2')][_0xb68d('0xa3')]?util['format'](_0xb68d('0xa4'),_0x4fcf86[_0xb68d('0xa2')][_0xb68d('0x32')],_0x4fcf86[_0xb68d('0xa2')]['vendor'],_0x4fcf86['device']['type']):null,'deviceVendor':_0x4fcf86['device'][_0xb68d('0xa3')],'deviceType':_0x4fcf86[_0xb68d('0xa2')][_0xb68d('0x2d')],'formData':JSON['stringify'](_0x48c786[_0xb68d('0x47')])};var _0x4bc7b3={'ChatWebsiteId':_0x48c786[_0xb68d('0x43')]['id'],'closed':![]};if(_0x48c786[_0xb68d('0x47')]['threadId']){_0x4bc7b3[_0xb68d('0xa5')]=_0x48c786['body'][_0xb68d('0xa5')];return db[_0xb68d('0xa6')][_0xb68d('0x4c')]({'where':_0x4bc7b3})[_0xb68d('0x11')](function(_0x1b203b){if(_0x1b203b){return[_0x1b203b,![]];}_0x471767[_0xb68d('0xa5')]=_0x48c786[_0xb68d('0x47')][_0xb68d('0xa5')];_0x471767[_0xb68d('0xa7')]=_0x48c786[_0xb68d('0x47')][_0xb68d('0xa7')];return db[_0xb68d('0xa6')]['create'](_0x471767)[_0xb68d('0x11')](function(_0x4b49ec){return[_0x4b49ec,!![]];});});}_0x4bc7b3[_0xb68d('0xa8')]=_0x4b1d6b['id'];if(_0x48c786[_0xb68d('0x47')][_0xb68d('0xa9')]&&_0x48c786[_0xb68d('0x47')]['interaction']['id']){_0x4bc7b3['id']=_0x48c786[_0xb68d('0x47')]['interaction']['id'];return db[_0xb68d('0xa6')][_0xb68d('0x4c')]({'where':_0x4bc7b3})[_0xb68d('0x11')](function(_0x52b5a4){if(_0x52b5a4){return[_0x52b5a4,![]];}return db[_0xb68d('0xa6')][_0xb68d('0x46')](_0x471767)[_0xb68d('0x11')](function(_0x410ab3){return[_0x410ab3,!![]];});});}return db[_0xb68d('0xa6')][_0xb68d('0x46')](_0x471767)[_0xb68d('0x11')](function(_0x4fe9ef){return[_0x4fe9ef,!![]];});}})[_0xb68d('0xaa')](function(_0x59b984,_0x1a8e85){if(_0x59b984){_0x21a8a3=_0x1a8e85;if(!_0x1a8e85){var _0x4d5409={'from':(_0x277800['contact'][_0xb68d('0x9d')]||'')+'\x20'+(_0x277800[_0xb68d('0xab')][_0xb68d('0xac')]||'')};if(_0x48c786['body'][_0xb68d('0xa5')]&&_0x48c786[_0xb68d('0x47')][_0xb68d('0xad')]&&_0x48c786[_0xb68d('0x47')][_0xb68d('0xa5')]!=_0x48c786[_0xb68d('0x47')][_0xb68d('0xad')]){_0x4d5409['threadId']=_0x48c786[_0xb68d('0x47')][_0xb68d('0xad')];}return _0x59b984['update'](_0x4d5409);}else{return _0x59b984;}}})[_0xb68d('0x11')](function(_0x5618d5){_0x277800[_0xb68d('0xa9')]=_0x5618d5[_0xb68d('0xae')]({'plain':!![]});_0x277800['interaction'][_0xb68d('0xaf')]=_0x21a8a3;if(_0x277800[_0xb68d('0xa9')]['created']){if(_0x277800[_0xb68d('0x90')][_0xb68d('0xb0')]){_0x277800['applications']['push']({'id':0x0,'priority':_0x277800[_0xb68d('0x92')][_0xb68d('0x45')]+0x1,'app':_0xb68d('0xb1'),'appdata':_0xb68d('0xb2'),'interval':_0xb68d('0xb3')});}}return db[_0xb68d('0xb4')][_0xb68d('0x46')]({'body':_0x48c786['body'][_0xb68d('0x47')],'ChatWebsiteId':_0x48c786['params']['id'],'ChatInteractionId':_0x5618d5['id'],'direction':'in','ContactId':_0x277800['contact']['id'],'AttachmentId':_0x48c786[_0xb68d('0x47')][_0xb68d('0xb5')]});})[_0xb68d('0x11')](function(_0x532f66){_0x277800['message']=_0x532f66;if(_0x277800['interaction'][_0xb68d('0xb6')]){return db[_0xb68d('0xb7')]['find']({'attributes':['id',_0xb68d('0x2f')],'where':{'id':_0x277800[_0xb68d('0xa9')]['UserId']}})[_0xb68d('0x11')](function(_0x5251ab){if(_0x5251ab){_0x277800['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5251ab[_0xb68d('0x2f')]+','+(_0x277800[_0xb68d('0x90')][_0xb68d('0xb8')]||0xa),'interval':'*,*,*,*'});_0x277800[_0xb68d('0xb9')]=!![];}return respondWithRpcPromise(_0xb68d('0xba'),'startRouting',_0x277800);});}return respondWithRpcPromise(_0xb68d('0xba'),'startRouting',_0x277800);})['then'](function(_0x322eaf){respondWithRpcPromise(_0xb68d('0xbb'),'EventManager',{'event':'notify','message':_0x322eaf},client9002);return _0x322eaf;})[_0xb68d('0x11')](respondWithResult(_0x365b2b,null))[_0xb68d('0x41')](handleError(_0x365b2b,null));};exports[_0xb68d('0xbc')]=function(_0x4cb164,_0x5ad478){var _0x5c3467,_0x2d2f6d,_0x5e8f21;var _0x5dd619=[];var _0x32e755={};var _0x75fe19=_0x4cb164[_0xb68d('0xbd')]||[];var _0x5c22af=[];var _0x5aced2;return db[_0xb68d('0x7e')][_0xb68d('0x51')]()[_0xb68d('0x11')](function(_0x3e5d77){if(!_0x3e5d77){throw new db[(_0xb68d('0x7f'))][(_0xb68d('0x80'))](_0xb68d('0x81'));}_0x5dd619=_['difference'](_[_0xb68d('0x30')](_0x3e5d77),[_0xb68d('0x84'),'updatedAt','CompanyId',_0xb68d('0x86')]);if(_0x4cb164[_0xb68d('0x47')]['id']){delete _0x4cb164['body']['id'];}if(_[_0xb68d('0x6d')](_0x4cb164['body']['from'])){throw _0x5ad478['status'](0x1f4)['send'](new db[(_0xb68d('0x7f'))]['ValidationError'](_0xb68d('0x88')));}if(_[_0xb68d('0x6d')](_0x4cb164[_0xb68d('0x47')][_0xb68d('0x47')])||_0x4cb164['body'][_0xb68d('0x47')]===''){throw _0x5ad478[_0xb68d('0x1c')](0x1f4)[_0xb68d('0x27')](new db[(_0xb68d('0x7f'))]['ValidationError'](_0xb68d('0xbe')));}if(_['isNil'](_0x4cb164[_0xb68d('0x47')][_0xb68d('0xbf')])){throw _0x5ad478[_0xb68d('0x1c')](0x1f4)['send'](new db[(_0xb68d('0x7f'))][(_0xb68d('0x80'))](_0xb68d('0xc0')+_0x5dd619));}if(!_[_0xb68d('0xc1')](_0x5dd619,_0x4cb164[_0xb68d('0x47')][_0xb68d('0xbf')])){throw _0x5ad478[_0xb68d('0x1c')](0x1f4)[_0xb68d('0x27')](new db[(_0xb68d('0x7f'))][(_0xb68d('0x80'))](_0xb68d('0xc2')+_0x5dd619));}_0x32e755[_0x4cb164[_0xb68d('0x47')][_0xb68d('0xbf')]]=_0x4cb164[_0xb68d('0x47')][_0xb68d('0x87')];})[_0xb68d('0x11')](function(){return db[_0xb68d('0x2a')][_0xb68d('0x4c')]({'where':{'id':_0x4cb164[_0xb68d('0x43')]['id']},'include':[{'model':db[_0xb68d('0xc3')],'as':_0xb68d('0x8c')},{'model':db['MailAccount'],'as':_0xb68d('0xc4')}]});})['then'](handleEntityNotFound(_0x5ad478,null))['then'](function(_0x5b8ef2){if(_0x5b8ef2&&_0x5b8ef2[_0xb68d('0x8c')]){_0x2d2f6d=_0x5b8ef2;var _0x4fbc87=_[_0xb68d('0x97')](_0x4cb164[_0xb68d('0x47')],{'firstName':_0x4cb164['body'][_0xb68d('0x87')],'phone':_0x4cb164[_0xb68d('0x47')][_0xb68d('0x87')],'ListId':_0x5b8ef2[_0xb68d('0x86')]});_0x4fbc87[_0x4cb164[_0xb68d('0x47')]['mapKeyOffline']]=_0x4cb164[_0xb68d('0x47')][_0xb68d('0x87')];return db[_0xb68d('0x7e')][_0xb68d('0xc5')]({'where':_0x32e755,'defaults':_0x4fbc87});}})[_0xb68d('0xaa')](function(_0x51bcef){if(_0x51bcef){_0x5e8f21=_0x51bcef;var _0x5e23fd=fs['readFileSync'](path[_0xb68d('0x69')](config['root'],_0xb68d('0xc6')),_0xb68d('0xc7'));var _0x25eafb=ejs[_0xb68d('0xc8')](_0x5e23fd,{'body':_['toPairs'](_0x4cb164[_0xb68d('0x47')][_0xb68d('0x47')]),'bodyTitle':_0x2d2f6d[_0xb68d('0xc9')]});return db[_0xb68d('0xca')][_0xb68d('0x46')]({'body':_0x25eafb,'plainBody':htmlToText[_0xb68d('0xcb')](_0x25eafb),'ContactId':_0x51bcef['id'],'ChatWebsiteId':_0x2d2f6d['id']});}})['then'](function(_0x42f902){_0x5aced2=_0x42f902;if(_0x75fe19[_0xb68d('0x45')]){var _0x1b70f4=_0x75fe19[_0xb68d('0x29')](function(_0x5d4028){return{'name':_0x5d4028[_0xb68d('0xcc')],'basename':_0x5d4028[_0xb68d('0x60')],'type':_0x5d4028[_0xb68d('0xcd')],'ChatOfflineMessageId':_0x42f902['id']};});_0x5c22af=_0x1b70f4[_0xb68d('0x29')](_0x43288a=>{var _0x5bbd1a={'filename':_0x43288a[_0xb68d('0x2f')],'path':path['join'](config[_0xb68d('0x6a')],_0xb68d('0xce'),_0xb68d('0xbd'),_0xb68d('0xcf'),_0xb68d('0xd0'),_0x43288a['basename'])};return _0x5bbd1a;});if(!_0x2d2f6d[_0xb68d('0xd1')]){return db[_0xb68d('0xd2')][_0xb68d('0xd3')](function(_0x1a4106){return db[_0xb68d('0xd4')][_0xb68d('0xd5')](_0x1b70f4,{'transaction':_0x1a4106});});}}})[_0xb68d('0x11')](function(){if(_0x5aced2){_0x5c3467=_0x5aced2;return db['MailAccount'][_0xb68d('0x5b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xb68d('0xd6')],'as':_0xb68d('0xd6'),'raw':!![]}]}]});}})['then'](function(_0x4cdfe0){if(_0x4cdfe0&&_0x4cdfe0[_0xb68d('0xd7')]&&_0x2d2f6d['forwardOffline']&&_0x2d2f6d['forwardOfflineAddress']){var _0x208eb8=_0x4cdfe0[_0xb68d('0xd8')]();return respondWithRpcPromise(_0xb68d('0xd9'),_0xb68d('0xda'),{'account':_0x208eb8,'message':{'from':util[_0xb68d('0xa0')](_0xb68d('0xdb'),_0x4cdfe0[_0xb68d('0x2f')],_0x4cdfe0[_0xb68d('0xdc')]||_0x4cdfe0['Smtp'][_0xb68d('0x48')]),'to':_0x2d2f6d['forwardOfflineAddress'],'subject':_0x2d2f6d[_0xb68d('0xdd')],'html':_0x5c3467[_0xb68d('0x47')],'attachments':_0x5c22af}},client9003)['then'](function(){return _0x5c3467;})[_0xb68d('0x41')](function(_0x4229a5){logger[_0xb68d('0x17')](_0x4229a5);});}})[_0xb68d('0x11')](function(){if(_0x2d2f6d&&_0x2d2f6d['openNewInteraction']&&_0x2d2f6d[_0xb68d('0xde')]){var _0x5784d4=[];if(_0x75fe19[_0xb68d('0x45')]){_0x5784d4=_0x75fe19[_0xb68d('0x29')](function(_0x48860c){return{'name':_0x48860c[_0xb68d('0xcc')],'basename':_0x48860c[_0xb68d('0x60')],'type':_0x48860c[_0xb68d('0xcd')],'ChatOfflineMessageId':_0x5aced2['id']};});}var _0x52147c;if(!_['isNil'](_0x2d2f6d[_0xb68d('0xdf')])){var _0x754c5b=_[_0xb68d('0x29')](_0x4cb164[_0xb68d('0x47')],function(_0x2ff05b){return _0x2ff05b;});var _0x27f7da=_[_0xb68d('0xe0')](_0x754c5b)[0x0];var _0x59c851=_['mapValues'](_0x27f7da,function(_0xcafd6d){return _0xcafd6d;});_0x52147c=_0x59c851[0x1][_0x2d2f6d[_0xb68d('0xdf')]];}var _0x56bbca={'from':_0x5e8f21[_0xb68d('0xdc')],'firstName':_0x5e8f21[_0xb68d('0x9d')],'lastName':_0x5e8f21[_0xb68d('0xac')],'mapKey':_0xb68d('0xdc'),'message':{'from':_0x5e8f21[_0xb68d('0xdc')],'to':_0x2d2f6d[_0xb68d('0xc4')][_0xb68d('0xdc')],'cc':'','subject':_['isNil'](_0x52147c)?_0x2d2f6d['offlineMessageSubject']:_0x52147c,'messageId':'','sentAt':new Date(),'attach':_0x5784d4[_0xb68d('0x45')],'attachments':_0x5784d4,'originChannel':_0xb68d('0xe1'),'ChatWebsiteId':_0x2d2f6d['id'],'ChatOfflineMessageId':_0x5c3467['id'],'originTo':_0x2d2f6d['MailAccount'][_0xb68d('0xdc')]},'body':_0x5c3467['body']};var _0x4bc9a3={'account':{'id':_0x2d2f6d[_0xb68d('0xde')]},'body':_0x56bbca,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xb68d('0xe2'),_0xb68d('0xe3'),_0x4bc9a3,client9001)[_0xb68d('0x11')](function(){return _0x5c3467;})[_0xb68d('0x41')](function(_0xede9d8){logger['error'](_0xede9d8);});}return;})[_0xb68d('0x11')](function(){if(_0x5c3467){return _0x5c3467;}})['then'](respondWithResult(_0x5ad478,null))[_0xb68d('0x41')](function(_0x378aec){logger[_0xb68d('0x17')](_0xb68d('0x41'),_0x378aec);for(var _0x4f41bc of _0x75fe19){var _0x463cf0=path[_0xb68d('0x69')](config[_0xb68d('0x6a')],_0xb68d('0xce'),_0xb68d('0xbd'),_0xb68d('0xcf'),_0xb68d('0xd0'),_0x4f41bc['filename']);fs_extra[_0xb68d('0xe4')](_0x463cf0)[_0xb68d('0x41')](function(_0x2423c2){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x463cf0,_0x2423c2);});}});};exports[_0xb68d('0xe5')]=function(_0xed9930,_0x4ff86a){return db[_0xb68d('0xa6')][_0xb68d('0x4c')]({'where':{'id':_0xed9930[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x4ff86a,null))['then'](function(_0x730bee){if(_0x730bee){return _0x730bee[_0xb68d('0xe5')](_0xed9930[_0xb68d('0x47')][_0xb68d('0xe6')],_[_0xb68d('0xe7')](_0xed9930[_0xb68d('0x47')],['ids','id'])||{});}})[_0xb68d('0x11')](respondWithResult(_0x4ff86a,null))['catch'](handleError(_0x4ff86a,null));};exports[_0xb68d('0xe8')]=function(_0x420cb9,_0x504532){var _0x59cb42={'raw':![],'where':{}};var _0x4ae4c7={};var _0x4effa9={'count':0x0,'rows':[]};return db[_0xb68d('0x2a')]['findOne']({'where':{'id':_0x420cb9[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x504532,null))['then'](function(_0x9ba0fe){if(_0x9ba0fe){_0x4ae4c7[_0xb68d('0x32')]=_['keys'](db[_0xb68d('0xa6')][_0xb68d('0x2b')]);_0x4ae4c7[_0xb68d('0x35')]=_[_0xb68d('0x30')](_0x420cb9['query']);_0x4ae4c7[_0xb68d('0x3b')]=_[_0xb68d('0x31')](_0x4ae4c7[_0xb68d('0x32')],_0x4ae4c7['query']);_0x59cb42[_0xb68d('0x33')]=_[_0xb68d('0x31')](_0x4ae4c7['model'],qs[_0xb68d('0x34')](_0x420cb9[_0xb68d('0x35')][_0xb68d('0x34')]));_0x59cb42[_0xb68d('0x33')]=_0x59cb42['attributes']['length']?_0x59cb42[_0xb68d('0x33')]:_0x4ae4c7[_0xb68d('0x32')];if(!_0x420cb9[_0xb68d('0x35')][_0xb68d('0x55')](_0xb68d('0x36'))){_0x59cb42[_0xb68d('0x21')]=qs[_0xb68d('0x21')](_0x420cb9[_0xb68d('0x35')]['limit']);_0x59cb42[_0xb68d('0x1f')]=qs['offset'](_0x420cb9[_0xb68d('0x35')][_0xb68d('0x1f')]);}_0x59cb42['order']=qs[_0xb68d('0x38')](_0x420cb9[_0xb68d('0x35')][_0xb68d('0x38')]);_0x59cb42[_0xb68d('0x39')]=qs[_0xb68d('0x3b')](_[_0xb68d('0x3a')](_0x420cb9[_0xb68d('0x35')],_0x4ae4c7[_0xb68d('0x3b')]));_0x59cb42['where']['ChatWebsiteId']=_0x9ba0fe['id'];if(_0x420cb9[_0xb68d('0x35')][_0xb68d('0x56')]){_0x59cb42[_0xb68d('0x39')]=_['merge'](_0x59cb42[_0xb68d('0x39')],{'$or':_[_0xb68d('0x29')](_0x59cb42[_0xb68d('0x33')],function(_0x2a17f7){var _0x22b92b={};_0x22b92b[_0x2a17f7]={'$like':'%'+_0x420cb9['query'][_0xb68d('0x56')]+'%'};return _0x22b92b;})});}_0x59cb42=_['merge']({},_0x59cb42,_0x420cb9[_0xb68d('0x3d')]);return db['ChatInteraction'][_0xb68d('0x3e')]({'where':_0x59cb42[_0xb68d('0x39')]})[_0xb68d('0x11')](function(_0x4c5fa2){_0x4effa9[_0xb68d('0x3e')]=_0x4c5fa2;if(_0x420cb9['query'][_0xb68d('0x3f')]){_0x59cb42[_0xb68d('0x40')]=[{'model':db[_0xb68d('0x7e')],'as':_0xb68d('0xe9'),'required':![]},{'model':db[_0xb68d('0xb7')],'as':'Owner','attributes':[_0xb68d('0x2f'),_0xb68d('0xea'),_0xb68d('0xeb')],'required':![]},{'model':db['Tag'],'as':_0xb68d('0xec'),'attributes':['id',_0xb68d('0x2f'),_0xb68d('0xed')],'where':_0x420cb9[_0xb68d('0x35')][_0xb68d('0xee')]?{'id':_0x420cb9['query'][_0xb68d('0xee')]}:undefined,'required':_0x420cb9[_0xb68d('0x35')][_0xb68d('0xee')]?!![]:![]}];}return db[_0xb68d('0xa6')][_0xb68d('0x57')](_0x59cb42);})[_0xb68d('0x11')](function(_0x50dd59){_0x4effa9[_0xb68d('0x5d')]=_0x50dd59;return _0x4effa9;});}})['then'](respondWithFilteredResult(_0x504532,_0x59cb42))['catch'](handleError(_0x504532,null));};function iftimePromise(_0x329766,_0x149063){return respondWithRpcPromise('Command','getSnippet',{'command':_0x149063['timezone']?util['format'](_0xb68d('0xef'),_0x329766['interval'],_0x149063[_0xb68d('0xf0')]):util[_0xb68d('0xa0')](_0xb68d('0xf1'),_0x329766[_0xb68d('0xf2')])},client9002)[_0xb68d('0x11')](function(_0x12e25b){var _0x67863c=_0x12e25b&&_0x12e25b['indexOf']('true')>=0x0?!![]:![];logger[_0xb68d('0x12')](_0xb68d('0xf3'),_0x149063['id'],_0x329766['id'],_0x329766[_0xb68d('0xf2')],_0x67863c?_0xb68d('0xf4'):_0xb68d('0xf5'),_0x149063[_0xb68d('0xf0')]?_0x149063['timezone']:_0xb68d('0xf6'));return _0x67863c;})[_0xb68d('0x41')](function(_0x4fb9bd){logger[_0xb68d('0x17')](_0xb68d('0xf3'),_0x149063['id'],_0x329766['id'],_0x329766['interval'],util['inspect'](_0x4fb9bd,{'showHidden':![],'depth':null}),_0x149063[_0xb68d('0xf0')]?_0x149063['timezone']:_0xb68d('0xf6'));return![];});}exports[_0xb68d('0xf7')]=function(_0x44a1f6,_0x508ffd){var _0x248270=0x0;var _0x73c731=0x0;var _0x559739=![];var _0x203214;var _0x5c9ee4;return db[_0xb68d('0x2a')][_0xb68d('0x4c')]({'where':{'id':_0x44a1f6[_0xb68d('0x43')]['id']},'include':[{'model':db[_0xb68d('0xf8')],'as':_0xb68d('0xf8'),'include':[{'model':db[_0xb68d('0xf8')],'as':'Intervals','attributes':['id',_0xb68d('0xf2')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x508ffd,null))[_0xb68d('0x11')](function(_0x2dc280){if(_0x2dc280){_0x203214=_0x2dc280;return _0x2dc280[_0xb68d('0xf9')]({'raw':!![]});}})[_0xb68d('0x11')](function(_0x999f8){if(_0x203214){if(_0x999f8){_0x5c9ee4=_0x999f8;}}return require(_0xb68d('0xfa'))[_0xb68d('0x6b')]();})[_0xb68d('0x11')](function(_0x4dbaa){if(_0x4dbaa){_0x73c731=_0x4dbaa['virtual'];_0x559739=_0x4dbaa[_0xb68d('0x6c')];}})[_0xb68d('0x11')](function(){return db[_0xb68d('0xa6')][_0xb68d('0x3e')]({'where':{'closed':![]}});})[_0xb68d('0x11')](function(_0x4b271f){_0x248270=_0x4b271f;if(_0x73c731&&_0x4b271f>_0x73c731){return db['License'][_0xb68d('0x5b')]({'where':{'id':0x1}})[_0xb68d('0x11')](function(_0x51ae0c){if(_0x51ae0c){_0x51ae0c['increment'](_0xb68d('0xfb'));}});}})[_0xb68d('0x11')](function(){if(_0x203214[_0xb68d('0xf8')]&&_0x203214[_0xb68d('0xf8')][_0xb68d('0xfc')]){var _0x1e308a=[];for(var _0x3f2a84=0x0;_0x3f2a84<_0x203214[_0xb68d('0xf8')][_0xb68d('0xfc')]['length'];_0x3f2a84++){var _0x9683b2=_0x203214[_0xb68d('0xf8')]['Intervals'][_0x3f2a84][_0xb68d('0xae')]({'plain':!![]});_0x1e308a[_0xb68d('0xfd')](iftimePromise(_0x9683b2,_0x203214));}return BPromise[_0xb68d('0xfe')](_0x1e308a)[_0xb68d('0x11')](function(_0x50520d){return _[_0xb68d('0xff')](_0x50520d);});}else{return!![];}})[_0xb68d('0x11')](function(_0x506e0e){var _0x5e87eb=fs[_0xb68d('0x100')](path[_0xb68d('0x69')](config[_0xb68d('0x6a')],_0xb68d('0x101')),'utf8');var _0x4ae289=new url[(_0xb68d('0x102'))](_0x203214[_0xb68d('0x103')])[_0xb68d('0x104')];var _0xfdd95b=_0xb68d('0x105');var _0x2e95d6=![];var _0x4c0855={'chatVersion':_0xfdd95b,'chatWebsiteAddressOrigin':_0x4ae289,'remote':_0x203214[_0xb68d('0x106')],'query':querystring['stringify'](_[_0xb68d('0x3c')](_0x203214[_0xb68d('0xae')]({'plain':!![]}),{'customerIp':_0x44a1f6['headers'][_0xb68d('0x9b')]||_0x44a1f6[_0xb68d('0x7a')][_0xb68d('0x107')]||_0x44a1f6[_0xb68d('0x108')][_0xb68d('0x109')]||_0x44a1f6['ip'],'referer':_0x44a1f6['headers'][_0xb68d('0x10a')],'openedInteractions':_0x248270,'maxInteractions':_0x73c731,'virtual':_0x559739[_0xb68d('0x10b')],'online':_0x506e0e,'custom':_0x559739}))[_0xb68d('0x10c')](/'/g,'\x5c\x27')};_0x508ffd['send'](ejs[_0xb68d('0xc8')](Mustache[_0xb68d('0xc8')](_0x5e87eb,_0x4c0855),{'proactiveActions':_0x5c9ee4,'alignment':_0x203214[_0xb68d('0x10d')],'verticalAlignment':_0x203214[_0xb68d('0x10e')],'div_color':_0x203214[_0xb68d('0xed')],'labelText':_0x203214[_0xb68d('0x10f')],'text_color':_0x203214['textColor'],'text_button_color':_0x203214[_0xb68d('0x110')],'button_color':_0x203214[_0xb68d('0x111')],'background_color':_0x203214[_0xb68d('0x112')],'hideWhenOffline':_0x203214[_0xb68d('0x113')],'intervalId':_0x203214['IntervalId'],'isDevelopment':_0x2e95d6,'chatVersion':_0xfdd95b}));})[_0xb68d('0x41')](handleError(_0x508ffd,null));};exports['addApplications']=function(_0x27bbaa,_0x3bb59b){var _0x4b8664=_0x27bbaa[_0xb68d('0x43')]['id'];var _0x1be744=_0x27bbaa[_0xb68d('0x47')];var _0x32b110=0xc8;var _0xc5cf1a=null;return db[_0xb68d('0xd2')][_0xb68d('0xd3')]({'isolationLevel':db[_0xb68d('0xd2')]['Transaction'][_0xb68d('0x114')][_0xb68d('0x115')]},function(_0x592a72){return db[_0xb68d('0x2a')][_0xb68d('0x5b')]({'where':{'id':_0x4b8664},'transaction':_0x592a72})[_0xb68d('0x11')](function(_0x576b68){if(_0x576b68){return db['ChatApplication'][_0xb68d('0x23')]({'where':{'ChatWebsiteId':_0x4b8664},'transaction':_0x592a72})[_0xb68d('0x11')](function(){var _0x116242=_[_0xb68d('0x29')](_0x1be744,function(_0x363012){_0x363012[_0xb68d('0x53')]=_0x4b8664;return _0x363012;});return db[_0xb68d('0x8e')][_0xb68d('0xd5')](_0x116242,{'transaction':_0x592a72});});}else{_0x32b110=0x194;_0xc5cf1a=[];}});})['then'](function(){if(_0x32b110!==0x194){return db[_0xb68d('0x8e')][_0xb68d('0x116')]({'where':{'ChatWebsiteId':_0x4b8664},'order':_0xb68d('0x94')})[_0xb68d('0x11')](function(_0x5c3ef3){_0xc5cf1a=_0x5c3ef3;});}})[_0xb68d('0x41')](function(_0x19dbd6){_0x32b110=0x1f4;logger[_0xb68d('0x17')](_0x19dbd6[_0xb68d('0x26')]);if(_0x19dbd6[_0xb68d('0x2f')]){delete _0x19dbd6[_0xb68d('0x2f')];}_0xc5cf1a=_0x19dbd6;})[_0xb68d('0x117')](function(){if(_0xc5cf1a===null){_0x3bb59b[_0xb68d('0x1b')](_0x32b110);}else{if(_0x32b110===0x1f4){_0x3bb59b[_0xb68d('0x1c')](_0x32b110)[_0xb68d('0x27')](_0xc5cf1a);}else{_0x3bb59b['status'](_0x32b110)[_0xb68d('0x1e')](_0xc5cf1a);}}});};exports[_0xb68d('0x118')]=function(_0x147175,_0x38e5b0){var _0x5003cc={};var _0x3ef63e={};var _0x5680ea;var _0x347d14;return db[_0xb68d('0x2a')][_0xb68d('0x5b')]({'where':{'id':_0x147175[_0xb68d('0x43')]['id']}})['then'](handleEntityNotFound(_0x38e5b0,null))['then'](function(_0xbfa34a){if(_0xbfa34a){_0x5680ea=_0xbfa34a;_0x3ef63e[_0xb68d('0x32')]=_['keys'](db[_0xb68d('0x8e')][_0xb68d('0x2b')]);_0x3ef63e[_0xb68d('0x35')]=_['keys'](_0x147175['query']);_0x3ef63e[_0xb68d('0x3b')]=_[_0xb68d('0x31')](_0x3ef63e['model'],_0x3ef63e[_0xb68d('0x35')]);_0x5003cc[_0xb68d('0x33')]=_[_0xb68d('0x31')](_0x3ef63e['model'],qs['fields'](_0x147175['query']['fields']));_0x5003cc['attributes']=_0x5003cc['attributes']['length']?_0x5003cc[_0xb68d('0x33')]:_0x3ef63e[_0xb68d('0x32')];_0x5003cc[_0xb68d('0x37')]=qs[_0xb68d('0x38')](_0x147175['query'][_0xb68d('0x38')]);_0x5003cc[_0xb68d('0x39')]=qs[_0xb68d('0x3b')](_[_0xb68d('0x3a')](_0x147175[_0xb68d('0x35')],_0x3ef63e[_0xb68d('0x3b')]));if(_0x147175['query'][_0xb68d('0x56')]){_0x5003cc['where']=_['merge'](_0x5003cc[_0xb68d('0x39')],{'$or':_['map'](_0x5003cc['attributes'],function(_0x5d6225){var _0x4bfdf5={};_0x4bfdf5[_0x5d6225]={'$like':'%'+_0x147175['query'][_0xb68d('0x56')]+'%'};return _0x4bfdf5;})});}_0x5003cc=_['merge']({},_0x5003cc,_0x147175[_0xb68d('0x3d')]);return _0x5680ea[_0xb68d('0x118')](_0x5003cc);}})[_0xb68d('0x11')](function(_0x354e38){if(_0x354e38){_0x347d14=_0x354e38[_0xb68d('0x45')];if(!_0x147175[_0xb68d('0x35')][_0xb68d('0x55')](_0xb68d('0x36'))){_0x5003cc[_0xb68d('0x21')]=qs[_0xb68d('0x21')](_0x147175[_0xb68d('0x35')][_0xb68d('0x21')]);_0x5003cc[_0xb68d('0x1f')]=qs[_0xb68d('0x1f')](_0x147175[_0xb68d('0x35')][_0xb68d('0x1f')]);}return _0x5680ea[_0xb68d('0x118')](_0x5003cc);}})[_0xb68d('0x11')](function(_0x6b4b27){if(_0x6b4b27){return _0x6b4b27?{'count':_0x347d14,'rows':_0x6b4b27}:null;}})[_0xb68d('0x11')](respondWithResult(_0x38e5b0,null))['catch'](handleError(_0x38e5b0,null));};exports[_0xb68d('0x119')]=function(_0x4f1182,_0x4fdbe6){return db['chatProactiveAction'][_0xb68d('0x4c')]({'where':{'id':_0x4f1182['params']['id']}})['then'](handleEntityNotFound(_0x4fdbe6,null))[_0xb68d('0x11')](function(_0x88f24b){if(_0x88f24b){return _0x88f24b[_0xb68d('0x119')](_0x4f1182[_0xb68d('0x47')][_0xb68d('0xe6')],_[_0xb68d('0xe7')](_0x4f1182[_0xb68d('0x47')],[_0xb68d('0xe6'),'id'])||{});}})[_0xb68d('0x11')](respondWithResult(_0x4fdbe6,null))['catch'](handleError(_0x4fdbe6,null));};exports[_0xb68d('0xf9')]=function(_0xb317c1,_0x3f4a5e){var _0x52b2c1={};var _0x3d2755={};var _0x1b553a;var _0x5bbeb1;return db[_0xb68d('0x2a')][_0xb68d('0x5b')]({'where':{'id':_0xb317c1[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x3f4a5e,null))[_0xb68d('0x11')](function(_0x54f7ee){if(_0x54f7ee){_0x1b553a=_0x54f7ee;_0x3d2755[_0xb68d('0x32')]=_['keys'](db[_0xb68d('0x11a')][_0xb68d('0x2b')]);_0x3d2755[_0xb68d('0x35')]=_[_0xb68d('0x30')](_0xb317c1[_0xb68d('0x35')]);_0x3d2755['filters']=_[_0xb68d('0x31')](_0x3d2755[_0xb68d('0x32')],_0x3d2755['query']);_0x52b2c1[_0xb68d('0x33')]=_[_0xb68d('0x31')](_0x3d2755[_0xb68d('0x32')],qs[_0xb68d('0x34')](_0xb317c1['query'][_0xb68d('0x34')]));_0x52b2c1[_0xb68d('0x33')]=_0x52b2c1[_0xb68d('0x33')][_0xb68d('0x45')]?_0x52b2c1['attributes']:_0x3d2755[_0xb68d('0x32')];_0x52b2c1[_0xb68d('0x37')]=qs[_0xb68d('0x38')](_0xb317c1['query'][_0xb68d('0x38')]);_0x52b2c1[_0xb68d('0x39')]=qs['filters'](_[_0xb68d('0x3a')](_0xb317c1['query'],_0x3d2755[_0xb68d('0x3b')]));if(_0xb317c1[_0xb68d('0x35')]['filter']){_0x52b2c1[_0xb68d('0x39')]=_[_0xb68d('0x3c')](_0x52b2c1['where'],{'$or':_['map'](_0x52b2c1[_0xb68d('0x33')],function(_0x58c182){var _0x4c4da2={};_0x4c4da2[_0x58c182]={'$like':'%'+_0xb317c1[_0xb68d('0x35')][_0xb68d('0x56')]+'%'};return _0x4c4da2;})});}_0x52b2c1=_[_0xb68d('0x3c')]({},_0x52b2c1,_0xb317c1['options']);return _0x1b553a[_0xb68d('0xf9')](_0x52b2c1);}})[_0xb68d('0x11')](function(_0x3fccb1){if(_0x3fccb1){_0x5bbeb1=_0x3fccb1[_0xb68d('0x45')];if(!_0xb317c1['query'][_0xb68d('0x55')](_0xb68d('0x36'))){_0x52b2c1[_0xb68d('0x21')]=qs[_0xb68d('0x21')](_0xb317c1[_0xb68d('0x35')]['limit']);_0x52b2c1['offset']=qs[_0xb68d('0x1f')](_0xb317c1[_0xb68d('0x35')][_0xb68d('0x1f')]);}return _0x1b553a[_0xb68d('0xf9')](_0x52b2c1);}})['then'](function(_0x35ce2b){if(_0x35ce2b){return _0x35ce2b?{'count':_0x5bbeb1,'rows':_0x35ce2b}:null;}})[_0xb68d('0x11')](respondWithResult(_0x3f4a5e,null))[_0xb68d('0x41')](handleError(_0x3f4a5e,null));};exports[_0xb68d('0x11b')]=function(_0x392016,_0x577f0d){var _0x509b9c=_0x392016[_0xb68d('0x35')][_0xb68d('0x11c')]===_0xb68d('0x11d')?_0xb68d('0x11e'):'onlineForm';return db[_0xb68d('0x2a')][_0xb68d('0x4c')]({'attributes':['id',_0x509b9c],'where':{'id':_0x392016[_0xb68d('0x43')]['id']}})['then'](handleEntityNotFound(_0x577f0d,null))['then'](function(_0x148551){if(_0x148551){var _0xfd848=_0x148551[_0x509b9c];var _0x2d9499=_0xfd848&&_0xfd848[_0xb68d('0x11f')]?_0xfd848[_0xb68d('0x11f')]:[];_0x577f0d[_0xb68d('0x27')]({'fromKey':_[_0xb68d('0x6d')](_0xfd848[_0xb68d('0x120')])?undefined:_0xfd848[_0xb68d('0x120')],'count':_0x2d9499[_0xb68d('0x45')],'rows':_0x2d9499});}})['catch'](handleError(_0x577f0d,null));};exports[_0xb68d('0x121')]=function(_0x1cd25c,_0x479078){var _0x1c278a={'raw':![],'where':{}};var _0x8362f3={};var _0x54b116={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb68d('0x5b')]({'where':{'id':_0x1cd25c['params']['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x479078,null))[_0xb68d('0x11')](function(_0x56ae25){if(_0x56ae25){_0x8362f3['model']=_[_0xb68d('0x30')](db[_0xb68d('0xca')][_0xb68d('0x2b')]);_0x8362f3[_0xb68d('0x35')]=_[_0xb68d('0x30')](_0x1cd25c['query']);_0x8362f3['filters']=_[_0xb68d('0x31')](_0x8362f3['model'],_0x8362f3['query']);_0x1c278a[_0xb68d('0x33')]=_[_0xb68d('0x31')](_0x8362f3['model'],qs[_0xb68d('0x34')](_0x1cd25c[_0xb68d('0x35')][_0xb68d('0x34')]));_0x1c278a[_0xb68d('0x33')]=_0x1c278a[_0xb68d('0x33')][_0xb68d('0x45')]?_0x1c278a[_0xb68d('0x33')]:_0x8362f3[_0xb68d('0x32')];if(!_0x1cd25c[_0xb68d('0x35')][_0xb68d('0x55')]('nolimit')){_0x1c278a['limit']=qs['limit'](_0x1cd25c[_0xb68d('0x35')][_0xb68d('0x21')]);_0x1c278a[_0xb68d('0x1f')]=qs[_0xb68d('0x1f')](_0x1cd25c[_0xb68d('0x35')][_0xb68d('0x1f')]);}_0x1c278a[_0xb68d('0x37')]=qs[_0xb68d('0x38')](_0x1cd25c[_0xb68d('0x35')][_0xb68d('0x38')]);_0x1c278a[_0xb68d('0x39')]=qs['filters'](_['pick'](_0x1cd25c[_0xb68d('0x35')],_0x8362f3['filters']));_0x1c278a[_0xb68d('0x39')][_0xb68d('0x53')]=_0x56ae25['id'];if(_0x1cd25c['query']['filter']){_0x1c278a[_0xb68d('0x39')]=_[_0xb68d('0x3c')](_0x1c278a['where'],{'$or':_[_0xb68d('0x29')](_0x1c278a[_0xb68d('0x33')],function(_0x423172){var _0x26cc59={};_0x26cc59[_0x423172]={'$like':'%'+_0x1cd25c['query'][_0xb68d('0x56')]+'%'};return _0x26cc59;})});}_0x1c278a=_[_0xb68d('0x3c')]({},_0x1c278a,_0x1cd25c[_0xb68d('0x3d')]);return db[_0xb68d('0xca')][_0xb68d('0x3e')]({'where':_0x1c278a['where']})[_0xb68d('0x11')](function(_0x3d06ed){_0x54b116[_0xb68d('0x3e')]=_0x3d06ed;if(_0x1cd25c[_0xb68d('0x35')][_0xb68d('0x3f')]){_0x1c278a[_0xb68d('0x40')]=[{'all':!![]}];}else{_0x1c278a['include']=[{'model':db[_0xb68d('0x7e')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0xb68d('0x122'),'required':![]}];}return db[_0xb68d('0xca')]['findAll'](_0x1c278a);})['then'](function(_0x1c3498){_0x54b116['rows']=_0x1c3498;return _0x54b116;});}})['then'](respondWithFilteredResult(_0x479078,_0x1c278a))[_0xb68d('0x41')](handleError(_0x479078,null));};exports[_0xb68d('0x123')]=function(_0x5f0670,_0x415af3){return db[_0xb68d('0x2a')][_0xb68d('0x4c')]({'where':{'id':_0x5f0670[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x415af3,null))[_0xb68d('0x11')](function(_0x3a2b16){if(_0x3a2b16){return _0x3a2b16[_0xb68d('0x123')](_0x5f0670[_0xb68d('0x47')]['ids'],_[_0xb68d('0xe7')](_0x5f0670[_0xb68d('0x47')],[_0xb68d('0xe6'),'id'])||{})[_0xb68d('0xaa')](function(_0x547038){for(var _0x4c6e16=0x0;_0x4c6e16<_0x5f0670[_0xb68d('0x47')]['ids']['length'];_0x4c6e16+=0x1){socket['emit'](_0xb68d('0x124'),{'UserId':Number(_0x5f0670[_0xb68d('0x47')][_0xb68d('0xe6')][_0x4c6e16]),'ChatWebsiteId':Number(_0x5f0670[_0xb68d('0x43')]['id'])});}return _0x547038;});}})[_0xb68d('0x11')](respondWithResult(_0x415af3,null))[_0xb68d('0x41')](handleError(_0x415af3,null));};exports[_0xb68d('0x125')]=function(_0x22de4a,_0x527865){return db['ChatWebsite'][_0xb68d('0x4c')]({'where':{'id':_0x22de4a[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x527865,null))[_0xb68d('0x11')](function(_0x5d255f){if(_0x5d255f){return _0x5d255f['removeAgents'](_0x22de4a[_0xb68d('0x35')][_0xb68d('0xe6')])['then'](function(){if(_[_0xb68d('0x126')](_0x22de4a['query']['ids'])){for(var _0x41612c=0x0;_0x41612c<_0x22de4a[_0xb68d('0x35')][_0xb68d('0xe6')][_0xb68d('0x45')];_0x41612c+=0x1){socket[_0xb68d('0x127')](_0xb68d('0x128'),{'UserId':Number(_0x22de4a[_0xb68d('0x35')][_0xb68d('0xe6')][_0x41612c]),'ChatWebsiteId':Number(_0x22de4a[_0xb68d('0x43')]['id'])});}}else{socket[_0xb68d('0x127')](_0xb68d('0x128'),{'UserId':Number(_0x22de4a[_0xb68d('0x35')][_0xb68d('0xe6')]),'ChatWebsiteId':Number(_0x22de4a[_0xb68d('0x43')]['id'])});}});}})['then'](respondWithStatusCode(_0x527865,null))[_0xb68d('0x41')](handleError(_0x527865,null));};exports[_0xb68d('0x129')]=function(_0x203a8d,_0x52a83a){var _0x28c453={};var _0x17723d={};var _0xc85c0;var _0x7931eb;return db['ChatWebsite'][_0xb68d('0x5b')]({'where':{'id':_0x203a8d[_0xb68d('0x43')]['id']}})[_0xb68d('0x11')](handleEntityNotFound(_0x52a83a,null))['then'](function(_0x2287a5){if(_0x2287a5){_0xc85c0=_0x2287a5;_0x17723d['model']=_[_0xb68d('0x30')](db['User']['rawAttributes']);_0x17723d['query']=_['keys'](_0x203a8d[_0xb68d('0x35')]);_0x17723d[_0xb68d('0x3b')]=_[_0xb68d('0x31')](_0x17723d[_0xb68d('0x32')],_0x17723d[_0xb68d('0x35')]);_0x28c453['attributes']=_[_0xb68d('0x31')](_0x17723d[_0xb68d('0x32')],qs[_0xb68d('0x34')](_0x203a8d[_0xb68d('0x35')]['fields']));_0x28c453['attributes']=_0x28c453[_0xb68d('0x33')][_0xb68d('0x45')]?_0x28c453[_0xb68d('0x33')]:_0x17723d[_0xb68d('0x32')];_0x28c453[_0xb68d('0x37')]=qs[_0xb68d('0x38')](_0x203a8d[_0xb68d('0x35')][_0xb68d('0x38')]);_0x28c453[_0xb68d('0x39')]=qs['filters'](_[_0xb68d('0x3a')](_0x203a8d[_0xb68d('0x35')],_0x17723d[_0xb68d('0x3b')]));if(_0x203a8d['query'][_0xb68d('0x56')]){_0x28c453[_0xb68d('0x39')]=_['merge'](_0x28c453[_0xb68d('0x39')],{'$or':_[_0xb68d('0x29')](_0x28c453['attributes'],function(_0x136cc2){var _0x466454={};_0x466454[_0x136cc2]={'$like':'%'+_0x203a8d[_0xb68d('0x35')][_0xb68d('0x56')]+'%'};return _0x466454;})});}_0x28c453=_['merge']({},_0x28c453,_0x203a8d[_0xb68d('0x3d')]);return _0xc85c0['getAgents'](_0x28c453);}})[_0xb68d('0x11')](function(_0x4476da){if(_0x4476da){_0x7931eb=_0x4476da[_0xb68d('0x45')];if(!_0x203a8d[_0xb68d('0x35')]['hasOwnProperty'](_0xb68d('0x36'))){_0x28c453['limit']=qs['limit'](_0x203a8d[_0xb68d('0x35')][_0xb68d('0x21')]);_0x28c453[_0xb68d('0x1f')]=qs[_0xb68d('0x1f')](_0x203a8d[_0xb68d('0x35')]['offset']);}return _0xc85c0[_0xb68d('0x129')](_0x28c453);}})[_0xb68d('0x11')](function(_0x185892){if(_0x185892){return _0x185892?{'count':_0x7931eb,'rows':_0x185892}:null;}})['then'](respondWithResult(_0x52a83a,null))['catch'](handleError(_0x52a83a,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index f1300e4..a141631 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 _0xe953=['hook','exports','update','remove','emit','hasOwnProperty'];(function(_0x5f00ef,_0x56a1d9){var _0x4ade54=function(_0x221acd){while(--_0x221acd){_0x5f00ef['push'](_0x5f00ef['shift']());}};_0x4ade54(++_0x56a1d9);}(_0xe953,0x1d0));var _0x3e95=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xe953[_0xd1c39b];return _0x58f5bc;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3e95('0x0'),'afterDestroy':_0x3e95('0x1')};function emitEvent(_0x49d837){return function(_0x46f343,_0x5a0541,_0x12b498){ChatWebsiteEvents['emit'](_0x49d837+':'+_0x46f343['id'],_0x46f343);ChatWebsiteEvents[_0x3e95('0x2')](_0x49d837,_0x46f343);_0x12b498(null);};}for(var e in events){if(events[_0x3e95('0x3')](e)){var event=events[e];ChatWebsite[_0x3e95('0x4')](e,emitEvent(event));}}module[_0x3e95('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x54da=['hasOwnProperty','hook','events','ChatWebsite','update'];(function(_0x4595f1,_0x4e53d6){var _0x574302=function(_0x54144b){while(--_0x54144b){_0x4595f1['push'](_0x4595f1['shift']());}};_0x574302(++_0x4e53d6);}(_0x54da,0x9d));var _0xa54d=function(_0x5cd8c2,_0x4bc8ee){_0x5cd8c2=_0x5cd8c2-0x0;var _0x4d2440=_0x54da[_0x5cd8c2];return _0x4d2440;};'use strict';var EventEmitter=require(_0xa54d('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa54d('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa54d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x22184a){return function(_0x280f78,_0x936fe1,_0x34cb88){ChatWebsiteEvents['emit'](_0x22184a+':'+_0x280f78['id'],_0x280f78);ChatWebsiteEvents['emit'](_0x22184a,_0x280f78);_0x34cb88(null);};}for(var e in events){if(events[_0xa54d('0x3')](e)){var event=events[e];ChatWebsite[_0xa54d('0x4')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 45477d9..8b02da3 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 _0xb749=['chat_websites','util','../../config/logger','moment','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x36189d,_0x2940d0){var _0x562991=function(_0x3b3577){while(--_0x3b3577){_0x36189d['push'](_0x36189d['shift']());}};_0x562991(++_0x2940d0);}(_0xb749,0x18d));var _0x9b74=function(_0x3bc6ee,_0x5ee4d8){_0x3bc6ee=_0x3bc6ee-0x0;var _0x369102=_0xb749[_0x3bc6ee];return _0x369102;};'use strict';var _=require('lodash');var util=require(_0x9b74('0x0'));var logger=require(_0x9b74('0x1'))('api');var moment=require(_0x9b74('0x2'));var BPromise=require('bluebird');var rp=require(_0x9b74('0x3'));var fs=require('fs');var path=require(_0x9b74('0x4'));var rimraf=require(_0x9b74('0x5'));var config=require('../../config/environment');var attributes=require(_0x9b74('0x6'));module[_0x9b74('0x7')]=function(_0x1c1731,_0x1e5a34){return _0x1c1731[_0x9b74('0x8')](_0x9b74('0x9'),attributes,{'tableName':_0x9b74('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x291a=['lodash','api','bluebird','request-promise','path','rimraf','define','ChatWebsite','chat_websites'];(function(_0xfaf561,_0x31d66a){var _0x565997=function(_0x3999b5){while(--_0x3999b5){_0xfaf561['push'](_0xfaf561['shift']());}};_0x565997(++_0x31d66a);}(_0x291a,0xbd));var _0xa291=function(_0x2cd160,_0xce27af){_0x2cd160=_0x2cd160-0x0;var _0x20f054=_0x291a[_0x2cd160];return _0x20f054;};'use strict';var _=require(_0xa291('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa291('0x1'));var moment=require('moment');var BPromise=require(_0xa291('0x2'));var rp=require(_0xa291('0x3'));var fs=require('fs');var path=require(_0xa291('0x4'));var rimraf=require(_0xa291('0x5'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x10944f,_0x189738){return _0x10944f[_0xa291('0x6')](_0xa291('0x7'),attributes,{'tableName':_0xa291('0x8'),'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 c23c9f0..a1ad996 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 _0x1b51=['request\x20sent','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','info','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatWebsite.socket','register','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x5436a2,_0x56780f){var _0xcaab06=function(_0x296ff4){while(--_0x296ff4){_0x5436a2['push'](_0x5436a2['shift']());}};_0xcaab06(++_0x56780f);}(_0x1b51,0x170));var _0x11b5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1b51[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x11b5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x11b5('0x1'));var fs=require('fs');var Redis=require(_0x11b5('0x2'));var db=require(_0x11b5('0x3'))['db'];var utils=require(_0x11b5('0x4'));var logger=require('../../config/logger')(_0x11b5('0x5'));var config=require(_0x11b5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x11b5('0x7')][_0x11b5('0x8')]({'port':0x232a});config[_0x11b5('0x9')]=_[_0x11b5('0xa')](config['redis'],{'host':_0x11b5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x11b5('0x9')]));require(_0x11b5('0xc'))[_0x11b5('0xd')](socket);function respondWithRpcPromise(_0x42c4f3,_0x4598ca,_0xdc0ff7){return new BPromise(function(_0x3dffc2,_0x25bc5c){return client['request'](_0x42c4f3,_0xdc0ff7)['then'](function(_0xc44ddd){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4598ca,'request\x20sent');logger[_0x11b5('0xe')](_0x11b5('0xf'),_0x4598ca,_0x11b5('0x10'),JSON[_0x11b5('0x11')](_0xc44ddd));if(_0xc44ddd[_0x11b5('0x12')]){if(_0xc44ddd[_0x11b5('0x12')][_0x11b5('0x13')]===0x1f4){logger[_0x11b5('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x4598ca,_0xc44ddd[_0x11b5('0x12')][_0x11b5('0x14')]);return _0x25bc5c(_0xc44ddd['error'][_0x11b5('0x14')]);}logger[_0x11b5('0x12')](_0x11b5('0x15'),_0x4598ca,_0xc44ddd['error'][_0x11b5('0x14')]);return _0x3dffc2(_0xc44ddd[_0x11b5('0x12')][_0x11b5('0x14')]);}else{logger[_0x11b5('0x16')](_0x11b5('0x15'),_0x4598ca,'request\x20sent');_0x3dffc2(_0xc44ddd['result'][_0x11b5('0x14')]);}})[_0x11b5('0x17')](function(_0xb05b5a){logger[_0x11b5('0x12')](_0x11b5('0x15'),_0x4598ca,_0xb05b5a);_0x25bc5c(_0xb05b5a);});});}
\ No newline at end of file
+var _0x513e=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./chatWebsite.socket','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x17a789,_0x88e56e){var _0x291f50=function(_0xc9686e){while(--_0xc9686e){_0x17a789['push'](_0x17a789['shift']());}};_0x291f50(++_0x88e56e);}(_0x513e,0xd5));var _0xe513=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x513e[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0xe513('0x0'));var util=require('util');var moment=require(_0xe513('0x1'));var BPromise=require(_0xe513('0x2'));var rs=require(_0xe513('0x3'));var fs=require('fs');var Redis=require(_0xe513('0x4'));var db=require(_0xe513('0x5'))['db'];var utils=require(_0xe513('0x6'));var logger=require(_0xe513('0x7'))(_0xe513('0x8'));var config=require(_0xe513('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe513('0xa')]['http']({'port':0x232a});config[_0xe513('0xb')]=_[_0xe513('0xc')](config[_0xe513('0xb')],{'host':_0xe513('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe513('0xb')]));require(_0xe513('0xe'))['register'](socket);function respondWithRpcPromise(_0x57f902,_0xc510ae,_0x3680c2){return new BPromise(function(_0x483073,_0x4c4ddb){return client[_0xe513('0xf')](_0x57f902,_0x3680c2)[_0xe513('0x10')](function(_0x1d26c9){logger['info'](_0xe513('0x11'),_0xc510ae,_0xe513('0x12'));logger[_0xe513('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xc510ae,'request\x20sent',JSON[_0xe513('0x14')](_0x1d26c9));if(_0x1d26c9[_0xe513('0x15')]){if(_0x1d26c9[_0xe513('0x15')][_0xe513('0x16')]===0x1f4){logger['error'](_0xe513('0x11'),_0xc510ae,_0x1d26c9['error']['message']);return _0x4c4ddb(_0x1d26c9[_0xe513('0x15')]['message']);}logger[_0xe513('0x15')](_0xe513('0x11'),_0xc510ae,_0x1d26c9[_0xe513('0x15')]['message']);return _0x483073(_0x1d26c9[_0xe513('0x15')][_0xe513('0x17')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0xc510ae,_0xe513('0x12'));_0x483073(_0x1d26c9[_0xe513('0x18')][_0xe513('0x17')]);}})[_0xe513('0x19')](function(_0x33ffcf){logger['error'](_0xe513('0x11'),_0xc510ae,_0x33ffcf);_0x4c4ddb(_0x33ffcf);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 7705197..7947a70 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 _0x66da=['update','emit','chatWebsite:','./chatWebsite.events'];(function(_0x161aaf,_0x5bb6ce){var _0x3354e6=function(_0x3f858c){while(--_0x3f858c){_0x161aaf['push'](_0x161aaf['shift']());}};_0x3354e6(++_0x5bb6ce);}(_0x66da,0x14f));var _0xa66d=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x66da[_0x145b3c];return _0x1b6e36;};'use strict';var ChatWebsiteEvents=require(_0xa66d('0x0'));var events=['save','remove',_0xa66d('0x1')];function createListener(_0x5587ad,_0x532c46){return function(_0x52cea8){_0x532c46[_0xa66d('0x2')](_0x5587ad,_0x52cea8);};}function removeListener(_0x468b88,_0x5c41ac){return function(){ChatWebsiteEvents['removeListener'](_0x468b88,_0x5c41ac);};}exports['register']=function(_0x5add0a){for(var _0x453dc8=0x0,_0x59ef89=events['length'];_0x453dc8<_0x59ef89;_0x453dc8++){var _0xc56fc2=events[_0x453dc8];var _0x206faa=createListener(_0xa66d('0x3')+_0xc56fc2,_0x5add0a);ChatWebsiteEvents['on'](_0xc56fc2,_0x206faa);}};
\ No newline at end of file
+var _0x38b7=['emit','removeListener','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x55a5e8,_0xc4b04f){var _0x31e1d9=function(_0x5d181b){while(--_0x5d181b){_0x55a5e8['push'](_0x55a5e8['shift']());}};_0x31e1d9(++_0xc4b04f);}(_0x38b7,0x11b));var _0x738b=function(_0x5284bb,_0x4303ee){_0x5284bb=_0x5284bb-0x0;var _0x3c6d49=_0x38b7[_0x5284bb];return _0x3c6d49;};'use strict';var ChatWebsiteEvents=require(_0x738b('0x0'));var events=[_0x738b('0x1'),_0x738b('0x2'),_0x738b('0x3')];function createListener(_0xa99fb8,_0x3e94ce){return function(_0x39d0c6){_0x3e94ce[_0x738b('0x4')](_0xa99fb8,_0x39d0c6);};}function removeListener(_0x550b58,_0x42d42e){return function(){ChatWebsiteEvents[_0x738b('0x5')](_0x550b58,_0x42d42e);};}exports['register']=function(_0x51ab60){for(var _0x24c8c5=0x0,_0x4adaec=events['length'];_0x24c8c5<_0x4adaec;_0x24c8c5++){var _0x3122e0=events[_0x24c8c5];var _0x500696=createListener(_0x738b('0x6')+_0x3122e0,_0x51ab60);ChatWebsiteEvents['on'](_0x3122e0,_0x500696);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index acb3cc3..bd22f2f 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 _0x65f0=['getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','/:id/canned_answers','join','root','server/files/images/logos/','format','/:id/logo','single','file','diskStorage','server/files/images/avatars/','%s-%s','addAvatar','now','originalname','addCustomerAvatar','/:id/notify','notify','server/files','attachments','replace','extname','/:id/offline','any','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar'];(function(_0x472ae8,_0x2a0fc7){var _0x48240f=function(_0x25d53e){while(--_0x25d53e){_0x472ae8['push'](_0x472ae8['shift']());}};_0x48240f(++_0x2a0fc7);}(_0x65f0,0x15a));var _0x065f=function(_0x467627,_0x27f29f){_0x467627=_0x467627-0x0;var _0x535627=_0x65f0[_0x467627];return _0x535627;};'use strict';var multer=require('multer');var util=require(_0x065f('0x0'));var path=require('path');var timeout=require(_0x065f('0x1'));var express=require(_0x065f('0x2'));var router=express[_0x065f('0x3')]();var fs_extra=require(_0x065f('0x4'));var auth=require(_0x065f('0x5'));var interaction=require(_0x065f('0x6'));var config=require('../../config/environment');var controller=require(_0x065f('0x7'));router[_0x065f('0x8')]('/',auth[_0x065f('0x9')](),controller[_0x065f('0xa')]);router[_0x065f('0x8')](_0x065f('0xb'),auth[_0x065f('0x9')](),controller['describe']);router['get'](_0x065f('0xc'),auth[_0x065f('0x9')](),controller[_0x065f('0xd')]);router[_0x065f('0x8')](_0x065f('0xe'),auth[_0x065f('0x9')](),controller[_0x065f('0xf')]);router['get']('/:id/canned_answers',auth[_0x065f('0x9')](),controller[_0x065f('0x10')]);router[_0x065f('0x8')]('/:id/logo',controller[_0x065f('0x11')]);router[_0x065f('0x8')](_0x065f('0x12'),controller[_0x065f('0x13')]);router['get'](_0x065f('0x14'),controller[_0x065f('0x15')]);router[_0x065f('0x8')](_0x065f('0x16'),controller[_0x065f('0x17')]);router[_0x065f('0x8')](_0x065f('0x18'),auth[_0x065f('0x9')](),controller[_0x065f('0x19')]);router['get'](_0x065f('0x1a'),controller['getSnippet']);router['get']('/:id/applications',auth[_0x065f('0x9')](),controller[_0x065f('0x1b')]);router['get'](_0x065f('0x1c'),auth[_0x065f('0x9')](),controller[_0x065f('0x1d')]);router[_0x065f('0x8')](_0x065f('0x1e'),controller[_0x065f('0x1f')]);router[_0x065f('0x8')](_0x065f('0x20'),auth[_0x065f('0x9')](),controller[_0x065f('0x21')]);router[_0x065f('0x8')](_0x065f('0x22'),auth[_0x065f('0x9')](),controller['getAgents']);router[_0x065f('0x23')]('/',auth[_0x065f('0x9')](),controller[_0x065f('0x24')]);router[_0x065f('0x23')](_0x065f('0xe'),auth['isAuthenticated'](),controller[_0x065f('0x25')]);router['post'](_0x065f('0x26'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52f024,_0x3cf748,_0x3be363){_0x3be363(null,path[_0x065f('0x27')](config[_0x065f('0x28')],_0x065f('0x29')));},'filename':function(_0x24eba3,_0x1678b4,_0x18244f){_0x18244f(null,util[_0x065f('0x2a')]('%s-%s',Date['now'](),_0x1678b4['originalname']));}})});router['post'](_0x065f('0x2b'),upload[_0x065f('0x2c')](_0x065f('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x065f('0x2e')]({'destination':function(_0x5f078e,_0x22255d,_0x2a95ff){_0x2a95ff(null,path[_0x065f('0x27')](config[_0x065f('0x28')],_0x065f('0x2f')));},'filename':function(_0x2c1f29,_0x2c5b2a,_0x410196){_0x410196(null,util[_0x065f('0x2a')](_0x065f('0x30'),Date['now'](),_0x2c5b2a['originalname']));}})});router[_0x065f('0x23')](_0x065f('0x12'),upload[_0x065f('0x2c')](_0x065f('0x2d')),controller[_0x065f('0x31')]);var upload=multer({'storage':multer[_0x065f('0x2e')]({'destination':function(_0x369be8,_0x42a710,_0x1647f2){_0x1647f2(null,path['join'](config['root'],_0x065f('0x2f')));},'filename':function(_0x379952,_0x5d6d5f,_0x264ab6){_0x264ab6(null,util[_0x065f('0x2a')]('%s-%s',Date[_0x065f('0x32')](),_0x5d6d5f[_0x065f('0x33')]));}})});router['post'](_0x065f('0x14'),upload[_0x065f('0x2c')]('file'),controller[_0x065f('0x34')]);var upload=multer({'storage':multer[_0x065f('0x2e')]({'destination':function(_0x14231c,_0x261c3d,_0x807f47){_0x807f47(null,path[_0x065f('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xeac100,_0x1a82fe,_0x5a208e){_0x5a208e(null,util['format']('%s-%s',Date[_0x065f('0x32')](),_0x1a82fe[_0x065f('0x33')]));}})});router['post'](_0x065f('0x16'),upload['single'](_0x065f('0x2d')),controller['addSystemAvatar']);router[_0x065f('0x23')](_0x065f('0x35'),controller[_0x065f('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x065f('0x2e')]({'destination':function(_0x50978e,_0x25de16,_0x2f5b57){const _0x54d8cf=path[_0x065f('0x27')](config[_0x065f('0x28')],_0x065f('0x37'),_0x065f('0x38'),'offline-chat');fs_extra['ensureDir'](_0x54d8cf,function(){_0x2f5b57(null,_0x54d8cf);});},'filename':function(_0x10ab1a,_0x5187f8,_0x25039b){const _0x1fa9ac=_0x5187f8[_0x065f('0x33')][_0x065f('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x470a65=path[_0x065f('0x3a')](_0x1fa9ac);const _0x54d805=Date[_0x065f('0x32')]()+'-'+_0x1fa9ac[_0x065f('0x39')](_0x470a65,'')+_0x470a65;_0x25039b(null,_0x54d805);}})});router[_0x065f('0x23')](_0x065f('0x3b'),offlineUploadMulter[_0x065f('0x3c')](),controller['offline']);router[_0x065f('0x23')](_0x065f('0x18'),auth['isAuthenticated'](),controller[_0x065f('0x3d')]);router[_0x065f('0x23')](_0x065f('0x3e'),auth['isAuthenticated'](),controller[_0x065f('0x3f')]);router[_0x065f('0x23')](_0x065f('0x1c'),auth[_0x065f('0x9')](),controller[_0x065f('0x40')]);router['post']('/:id/users',auth[_0x065f('0x9')](),controller[_0x065f('0x41')]);router[_0x065f('0x42')]('/:id',auth[_0x065f('0x9')](),controller[_0x065f('0x43')]);router['delete'](_0x065f('0xc'),auth[_0x065f('0x9')](),controller[_0x065f('0x44')]);router['delete'](_0x065f('0xe'),auth[_0x065f('0x9')](),controller[_0x065f('0x45')]);router[_0x065f('0x46')](_0x065f('0x26'),auth[_0x065f('0x9')](),controller[_0x065f('0x47')]);router['delete'](_0x065f('0x22'),auth[_0x065f('0x9')](),controller[_0x065f('0x48')]);module['exports']=router;
\ No newline at end of file
+var _0x6106=['/:id/logo','single','file','addLogo','diskStorage','server/files/images/avatars/','addAvatar','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','post','addDisposition','join','root','server/files/images/logos/','format','now'];(function(_0x581e1d,_0x1ed7d4){var _0x39965b=function(_0x3cf384){while(--_0x3cf384){_0x581e1d['push'](_0x581e1d['shift']());}};_0x39965b(++_0x1ed7d4);}(_0x6106,0x1cf));var _0x6610=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x6106[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x6610('0x0'));var util=require(_0x6610('0x1'));var path=require(_0x6610('0x2'));var timeout=require(_0x6610('0x3'));var express=require(_0x6610('0x4'));var router=express[_0x6610('0x5')]();var fs_extra=require(_0x6610('0x6'));var auth=require(_0x6610('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6610('0x8'));var controller=require(_0x6610('0x9'));router[_0x6610('0xa')]('/',auth[_0x6610('0xb')](),controller[_0x6610('0xc')]);router[_0x6610('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x6610('0xd')]);router[_0x6610('0xa')](_0x6610('0xe'),auth[_0x6610('0xb')](),controller['show']);router[_0x6610('0xa')](_0x6610('0xf'),auth[_0x6610('0xb')](),controller['getDispositions']);router['get'](_0x6610('0x10'),auth[_0x6610('0xb')](),controller['getAnswers']);router['get']('/:id/logo',controller[_0x6610('0x11')]);router[_0x6610('0xa')](_0x6610('0x12'),controller[_0x6610('0x13')]);router[_0x6610('0xa')](_0x6610('0x14'),controller['getCustomerAvatar']);router[_0x6610('0xa')](_0x6610('0x15'),controller['getSystemAvatar']);router[_0x6610('0xa')](_0x6610('0x16'),auth[_0x6610('0xb')](),controller[_0x6610('0x17')]);router[_0x6610('0xa')]('/:id/snippet',controller['getSnippet']);router['get'](_0x6610('0x18'),auth[_0x6610('0xb')](),controller[_0x6610('0x19')]);router['get'](_0x6610('0x1a'),auth[_0x6610('0xb')](),controller[_0x6610('0x1b')]);router[_0x6610('0xa')](_0x6610('0x1c'),controller[_0x6610('0x1d')]);router[_0x6610('0xa')](_0x6610('0x1e'),auth[_0x6610('0xb')](),controller[_0x6610('0x1f')]);router[_0x6610('0xa')]('/:id/users',auth[_0x6610('0xb')](),controller[_0x6610('0x20')]);router['post']('/',auth[_0x6610('0xb')](),controller[_0x6610('0x21')]);router[_0x6610('0x22')](_0x6610('0xf'),auth['isAuthenticated'](),controller[_0x6610('0x23')]);router[_0x6610('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29248b,_0x1edb09,_0x331e1a){_0x331e1a(null,path[_0x6610('0x24')](config[_0x6610('0x25')],_0x6610('0x26')));},'filename':function(_0x56449f,_0x15d00a,_0x532642){_0x532642(null,util[_0x6610('0x27')]('%s-%s',Date[_0x6610('0x28')](),_0x15d00a['originalname']));}})});router[_0x6610('0x22')](_0x6610('0x29'),upload[_0x6610('0x2a')](_0x6610('0x2b')),controller[_0x6610('0x2c')]);var upload=multer({'storage':multer[_0x6610('0x2d')]({'destination':function(_0x127a3,_0x3a3d72,_0x40c09c){_0x40c09c(null,path[_0x6610('0x24')](config[_0x6610('0x25')],_0x6610('0x2e')));},'filename':function(_0x322d37,_0x2a0235,_0x811bd9){_0x811bd9(null,util[_0x6610('0x27')]('%s-%s',Date[_0x6610('0x28')](),_0x2a0235['originalname']));}})});router['post'](_0x6610('0x12'),upload[_0x6610('0x2a')](_0x6610('0x2b')),controller[_0x6610('0x2f')]);var upload=multer({'storage':multer[_0x6610('0x2d')]({'destination':function(_0x1c50b7,_0x9d9138,_0x47a46f){_0x47a46f(null,path[_0x6610('0x24')](config[_0x6610('0x25')],_0x6610('0x2e')));},'filename':function(_0x1c4fcb,_0x5e4699,_0x53f0f3){_0x53f0f3(null,util[_0x6610('0x27')]('%s-%s',Date[_0x6610('0x28')](),_0x5e4699[_0x6610('0x30')]));}})});router[_0x6610('0x22')](_0x6610('0x14'),upload[_0x6610('0x2a')](_0x6610('0x2b')),controller[_0x6610('0x31')]);var upload=multer({'storage':multer[_0x6610('0x2d')]({'destination':function(_0x496664,_0x2d6242,_0x5d7b99){_0x5d7b99(null,path[_0x6610('0x24')](config[_0x6610('0x25')],_0x6610('0x2e')));},'filename':function(_0x7e15f9,_0x3abdb3,_0x24133f){_0x24133f(null,util[_0x6610('0x27')]('%s-%s',Date[_0x6610('0x28')](),_0x3abdb3[_0x6610('0x30')]));}})});router['post'](_0x6610('0x15'),upload[_0x6610('0x2a')](_0x6610('0x2b')),controller[_0x6610('0x32')]);router[_0x6610('0x22')](_0x6610('0x33'),controller[_0x6610('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3cb609,_0x41f817,_0x307aeb){const _0x33f934=path[_0x6610('0x24')](config[_0x6610('0x25')],_0x6610('0x35'),'attachments',_0x6610('0x36'));fs_extra[_0x6610('0x37')](_0x33f934,function(){_0x307aeb(null,_0x33f934);});},'filename':function(_0x181c34,_0x5b3374,_0x24fe33){const _0x14f10f=_0x5b3374['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2a2ec3=path[_0x6610('0x38')](_0x14f10f);const _0x269293=Date[_0x6610('0x28')]()+'-'+_0x14f10f['replace'](_0x2a2ec3,'')+_0x2a2ec3;_0x24fe33(null,_0x269293);}})});router[_0x6610('0x22')](_0x6610('0x39'),offlineUploadMulter[_0x6610('0x3a')](),controller[_0x6610('0x3b')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x6610('0x3c')]);router['post'](_0x6610('0x18'),auth[_0x6610('0xb')](),controller[_0x6610('0x3d')]);router[_0x6610('0x22')](_0x6610('0x1a'),auth['isAuthenticated'](),controller[_0x6610('0x3e')]);router[_0x6610('0x22')](_0x6610('0x3f'),auth[_0x6610('0xb')](),controller[_0x6610('0x40')]);router[_0x6610('0x41')](_0x6610('0xe'),auth[_0x6610('0xb')](),controller['update']);router['delete'](_0x6610('0xe'),auth[_0x6610('0xb')](),controller[_0x6610('0x42')]);router['delete']('/:id/dispositions',auth[_0x6610('0xb')](),controller[_0x6610('0x43')]);router[_0x6610('0x44')](_0x6610('0x10'),auth[_0x6610('0xb')](),controller[_0x6610('0x45')]);router['delete'](_0x6610('0x3f'),auth[_0x6610('0xb')](),controller[_0x6610('0x46')]);module[_0x6610('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index e31040e..dad775b 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7177=['use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','env','production','app','get','client-side-logger','expressEndpoint'];(function(_0x36c777,_0x2616f2){var _0x8c2dc5=function(_0x1539a0){while(--_0x1539a0){_0x36c777['push'](_0x36c777['shift']());}};_0x8c2dc5(++_0x2616f2);}(_0x7177,0xfa));var _0x7717=function(_0xb0f253,_0x476cc1){_0xb0f253=_0xb0f253-0x0;var _0x25dbbe=_0x7177[_0xb0f253];return _0x25dbbe;};var beaverLogger=require(_0x7717('0x0'));var express=require(_0x7717('0x1'));var auth=require(_0x7717('0x2'));var config=require('../config/environment');var router=express[_0x7717('0x3')]();var isProduction=config[_0x7717('0x4')]===_0x7717('0x5')||![];function clientSideLogs(_0x4c378f,_0x39616e,_0x3f3c1b){var _0xdf3607=_0x4c378f[_0x7717('0x6')][_0x7717('0x7')](_0x7717('0x8'));if(!_0xdf3607){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x7717('0x9')]({'uri':'/client-logs','logger':_0xdf3607,'enableCors':!isProduction})(_0x4c378f,_0x39616e,_0x3f3c1b);}router[_0x7717('0xa')](auth[_0x7717('0xb')](),clientSideLogs);module[_0x7717('0xc')]=router;
\ No newline at end of file
+var _0xaf28=['beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','isAuthenticated'];(function(_0xb2e868,_0x3b2184){var _0x172f42=function(_0x593f9c){while(--_0x593f9c){_0xb2e868['push'](_0xb2e868['shift']());}};_0x172f42(++_0x3b2184);}(_0xaf28,0x1b8));var _0x8af2=function(_0x4aff38,_0x532d4f){_0x4aff38=_0x4aff38-0x0;var _0x300a0b=_0xaf28[_0x4aff38];return _0x300a0b;};var beaverLogger=require(_0x8af2('0x0'));var express=require(_0x8af2('0x1'));var auth=require(_0x8af2('0x2'));var config=require(_0x8af2('0x3'));var router=express[_0x8af2('0x4')]();var isProduction=config[_0x8af2('0x5')]==='production'||![];function clientSideLogs(_0x219eb2,_0x1f5542,_0x1736a3){var _0x2ca223=_0x219eb2[_0x8af2('0x6')]['get'](_0x8af2('0x7'));if(!_0x2ca223){throw new Error(_0x8af2('0x8'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x2ca223,'enableCors':!isProduction})(_0x219eb2,_0x1f5542,_0x1736a3);}router['use'](auth[_0x8af2('0x9')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 61016d2..b34cf85 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 _0xc107=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','Google','MicrosoftAzure'];(function(_0x2056c1,_0x42068f){var _0x5a0f4f=function(_0xd66084){while(--_0xd66084){_0x2056c1['push'](_0x2056c1['shift']());}};_0x5a0f4f(++_0x42068f);}(_0xc107,0xcd));var _0x7c10=function(_0x3d801b,_0x12d6e9){_0x3d801b=_0x3d801b-0x0;var _0x4065ef=_0xc107[_0x3d801b];return _0x4065ef;};'use strict';var Sequelize=require('sequelize');module[_0x7c10('0x0')]={'name':{'type':Sequelize[_0x7c10('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7c10('0x2')]('AmazonAWS',_0x7c10('0x3'),_0x7c10('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x7c10('0x5'))},'data1':{'type':Sequelize[_0x7c10('0x1')],'comment':_0x7c10('0x6')},'data2':{'type':Sequelize[_0x7c10('0x1')],'comment':_0x7c10('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0x7c10('0x8')},'data4':{'type':Sequelize[_0x7c10('0x1')],'comment':_0x7c10('0x9')},'data5':{'type':Sequelize[_0x7c10('0xa')],'comment':_0x7c10('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x7c10('0xc')},'data7':{'type':Sequelize[_0x7c10('0xa')],'comment':_0x7c10('0xd')}};
\ No newline at end of file
+var _0xea31=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xea31,0xd8));var _0x1ea3=function(_0x1a850e,_0x3f5312){_0x1a850e=_0x1a850e-0x0;var _0x285c5a=_0xea31[_0x1a850e];return _0x285c5a;};'use strict';var Sequelize=require(_0x1ea3('0x0'));module[_0x1ea3('0x1')]={'name':{'type':Sequelize[_0x1ea3('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x4'),_0x1ea3('0x5'),_0x1ea3('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x7'),_0x1ea3('0x8'))},'data1':{'type':Sequelize[_0x1ea3('0x2')],'comment':_0x1ea3('0x9')},'data2':{'type':Sequelize['STRING'],'comment':_0x1ea3('0xa')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x1ea3('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0x1ea3('0xc')},'data6':{'type':Sequelize[_0x1ea3('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x1ea3('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index f76a726..409faa8 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 _0x486c=['then','destroy','end','stack','send','padEnd','slice','map','CloudProvider','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','fields','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','join','encryptString','catch','params','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','error','get','state','from','base64','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','update'];(function(_0x9858f1,_0x40140d){var _0x36516f=function(_0x2083ea){while(--_0x2083ea){_0x9858f1['push'](_0x9858f1['shift']());}};_0x36516f(++_0x40140d);}(_0x486c,0x1d2));var _0xc486=function(_0xb69f6,_0x553a11){_0xb69f6=_0xb69f6-0x0;var _0x5df3af=_0x486c[_0xb69f6];return _0x5df3af;};'use strict';var _=require(_0xc486('0x0'));var Redis=require('ioredis');var qs=require(_0xc486('0x1'));var encryptor=require(_0xc486('0x2'));var config=require('../../config/environment');var logger=require(_0xc486('0x3'))(_0xc486('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0xc486('0x5'));config[_0xc486('0x6')]=_['defaults'](config[_0xc486('0x6')],{'host':_0xc486('0x7'),'port':0x18eb});var socket=require(_0xc486('0x8'))(new Redis(config[_0xc486('0x6')]));var redis=new Redis(config[_0xc486('0x6')]);function respondWithStatusCode(_0x1dbcec,_0x579b0b){_0x579b0b=_0x579b0b||0xcc;return function(_0x243742){if(_0x243742){return _0x1dbcec[_0xc486('0x9')](_0x579b0b);}return _0x1dbcec['status'](_0x579b0b)['end']();};}function respondWithResult(_0x2b6e5e,_0x4cc229){_0x4cc229=_0x4cc229||0xc8;return function(_0x10f734){if(_0x10f734){return _0x2b6e5e['status'](_0x4cc229)[_0xc486('0xa')](_0x10f734);}};}function respondWithFilteredResult(_0x5be06b,_0x1abba1){return function(_0xae72d6){if(_0xae72d6){var _0x105b1a=typeof _0x1abba1[_0xc486('0xb')]===_0xc486('0xc')&&typeof _0x1abba1['limit']===_0xc486('0xc');var _0x6f68b4=_0xae72d6[_0xc486('0xd')];var _0x4dee43=_0x105b1a?0x0:_0x1abba1[_0xc486('0xb')];var _0x2c771e=_0x105b1a?_0xae72d6['count']:_0x1abba1[_0xc486('0xb')]+_0x1abba1[_0xc486('0xe')];var _0x1d138d;if(_0x2c771e>=_0x6f68b4){_0x2c771e=_0x6f68b4;_0x1d138d=0xc8;}else{_0x1d138d=0xce;}_0x5be06b[_0xc486('0xf')](_0x1d138d);return _0x5be06b[_0xc486('0x10')](_0xc486('0x11'),_0x4dee43+'-'+_0x2c771e+'/'+_0x6f68b4)['json'](_0xae72d6);}return null;};}function saveUpdates(_0x124824){return function(_0xfe0127){if(_0xfe0127){return _0xfe0127[_0xc486('0x12')](_0x124824)[_0xc486('0x13')](function(_0x1fb26b){return _0x1fb26b;});}return null;};}function removeEntity(_0x554159){return function(_0x523f98){if(_0x523f98){return _0x523f98[_0xc486('0x14')]()[_0xc486('0x13')](function(){_0x554159[_0xc486('0xf')](0xcc)[_0xc486('0x15')]();});}};}function handleEntityNotFound(_0x111bbc){return function(_0x2fc1af){if(!_0x2fc1af){_0x111bbc['sendStatus'](0x194);}return _0x2fc1af;};}function handleError(_0x320af4,_0x36ac1e){_0x36ac1e=_0x36ac1e||0x1f4;return function(_0x124d1a){logger['error'](_0x124d1a[_0xc486('0x16')]);if(_0x124d1a['name']){delete _0x124d1a['name'];}_0x320af4[_0xc486('0xf')](_0x36ac1e)[_0xc486('0x17')](_0x124d1a);};}function maskClientSecret(_0x317a56){return _[_0xc486('0x18')](_0x317a56[_0xc486('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x49fedf,_0x458202){var _0x343cd1={},_0x23303a={},_0x28c25a={'count':0x0,'rows':[]};var _0x593193=_[_0xc486('0x1a')](db[_0xc486('0x1b')][_0xc486('0x1c')],function(_0xda100f){return{'name':_0xda100f[_0xc486('0x1d')],'type':_0xda100f[_0xc486('0x1e')][_0xc486('0x1f')]};});_0x23303a['model']=_['map'](_0x593193,_0xc486('0x20'));_0x23303a[_0xc486('0x21')]=_[_0xc486('0x22')](_0x49fedf[_0xc486('0x21')]);_0x23303a[_0xc486('0x23')]=_[_0xc486('0x24')](_0x23303a[_0xc486('0x25')],_0x23303a[_0xc486('0x21')]);_0x343cd1[_0xc486('0x26')]=_['intersection'](_0x23303a[_0xc486('0x25')],qs['fields'](_0x49fedf[_0xc486('0x21')]['fields']));_0x343cd1[_0xc486('0x26')]=_0x343cd1[_0xc486('0x26')][_0xc486('0x27')]?_0x343cd1['attributes']:_0x23303a['model'];if(!_0x49fedf[_0xc486('0x21')][_0xc486('0x28')](_0xc486('0x29'))){_0x343cd1['limit']=qs[_0xc486('0xe')](_0x49fedf[_0xc486('0x21')][_0xc486('0xe')]);_0x343cd1[_0xc486('0xb')]=qs[_0xc486('0xb')](_0x49fedf[_0xc486('0x21')]['offset']);}_0x343cd1[_0xc486('0x2a')]=qs[_0xc486('0x2b')](_0x49fedf['query'][_0xc486('0x2b')]);_0x343cd1[_0xc486('0x2c')]=qs[_0xc486('0x23')](_[_0xc486('0x2d')](_0x49fedf[_0xc486('0x21')],_0x23303a[_0xc486('0x23')]),_0x593193);if(_0x49fedf[_0xc486('0x21')][_0xc486('0x2e')]){_0x343cd1[_0xc486('0x2c')]=_[_0xc486('0x2f')](_0x343cd1['where'],{'$or':_['map'](_0x593193,function(_0x403be3){if(_0x403be3[_0xc486('0x1e')]!==_0xc486('0x30')){var _0x5e187c={};_0x5e187c[_0x403be3['name']]={'$like':'%'+_0x49fedf[_0xc486('0x21')][_0xc486('0x2e')]+'%'};return _0x5e187c;}})});}_0x343cd1=_[_0xc486('0x2f')]({},_0x343cd1,_0x49fedf[_0xc486('0x31')]);var _0x48f90a={'where':_0x343cd1[_0xc486('0x2c')]};return db[_0xc486('0x1b')]['count'](_0x48f90a)[_0xc486('0x13')](function(_0x79fa3e){_0x28c25a[_0xc486('0xd')]=_0x79fa3e;if(_0x49fedf['query'][_0xc486('0x32')]){_0x343cd1[_0xc486('0x33')]=[{'all':!![]}];}return db[_0xc486('0x1b')][_0xc486('0x34')](_0x343cd1);})[_0xc486('0x13')](function(_0x4fd074){_0x28c25a[_0xc486('0x35')]=_[_0xc486('0x1a')](_0x4fd074,function(_0xfa56fe){if(_0xfa56fe[_0xc486('0x36')]===_0xc486('0x37')){var _0xb22f75=encryptor['decryptString'](_0xfa56fe[_0xc486('0x38')]);_0xfa56fe[_0xc486('0x38')]=maskClientSecret(_0xb22f75);}return _0xfa56fe;});return _0x28c25a;})[_0xc486('0x13')](respondWithFilteredResult(_0x458202,_0x343cd1))['catch'](handleError(_0x458202,null));};exports['show']=function(_0xe4f4ab,_0x3c15c0){var _0x3a19ca={'raw':!![],'where':{'id':_0xe4f4ab['params']['id']}},_0x16a41e={};_0x16a41e[_0xc486('0x25')]=_['keys'](db['CloudProvider'][_0xc486('0x1c')]);_0x16a41e[_0xc486('0x21')]=_[_0xc486('0x22')](_0xe4f4ab[_0xc486('0x21')]);_0x16a41e['filters']=_['intersection'](_0x16a41e[_0xc486('0x25')],_0x16a41e[_0xc486('0x21')]);_0x3a19ca[_0xc486('0x26')]=_['intersection'](_0x16a41e[_0xc486('0x25')],qs[_0xc486('0x39')](_0xe4f4ab['query'][_0xc486('0x39')]));_0x3a19ca[_0xc486('0x26')]=_0x3a19ca[_0xc486('0x26')][_0xc486('0x27')]?_0x3a19ca[_0xc486('0x26')]:_0x16a41e[_0xc486('0x25')];if(_0xe4f4ab[_0xc486('0x21')]['includeAll']){_0x3a19ca[_0xc486('0x33')]=[{'all':!![]}];}_0x3a19ca=_[_0xc486('0x2f')]({},_0x3a19ca,_0xe4f4ab[_0xc486('0x31')]);return db[_0xc486('0x1b')][_0xc486('0x3a')](_0x3a19ca)[_0xc486('0x13')](handleEntityNotFound(_0x3c15c0,null))['then'](function(_0x43f704){if(_0x43f704[_0xc486('0x36')]==='MicrosoftAzure'){var _0x9427cd=encryptor[_0xc486('0x3b')](_0x43f704[_0xc486('0x38')]);_0x43f704['data3']=maskClientSecret(_0x9427cd);}return _0x43f704;})[_0xc486('0x13')](respondWithResult(_0x3c15c0,null))['catch'](handleError(_0x3c15c0,null));};exports[_0xc486('0x3c')]=function(_0x19cc09,_0x3e8280){if(!_0x19cc09[_0xc486('0x3d')]['name'])throw new Error(_0xc486('0x3e'));if(!_0x19cc09[_0xc486('0x3d')][_0xc486('0x36')])throw new Error(_0xc486('0x3f'));var _0x4a7aab=db[_0xc486('0x1b')][_0xc486('0x1c')][_0xc486('0x36')][_0xc486('0x40')];if(!_0x4a7aab['includes'](_0x19cc09['body'][_0xc486('0x36')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x4a7aab[_0xc486('0x41')](',\x20'));if(_0x19cc09[_0xc486('0x3d')]['service']==='MicrosoftAzure'&&_0x19cc09['body'][_0xc486('0x38')]){_0x19cc09[_0xc486('0x3d')][_0xc486('0x38')]=encryptor[_0xc486('0x42')](_0x19cc09[_0xc486('0x3d')][_0xc486('0x38')]);}return db[_0xc486('0x1b')][_0xc486('0x3c')](_0x19cc09['body'],{})[_0xc486('0x13')](respondWithResult(_0x3e8280,0xc9))[_0xc486('0x43')](handleError(_0x3e8280,null));};exports[_0xc486('0x12')]=function(_0x57eda0,_0xe41b3b){if(_0x57eda0[_0xc486('0x3d')]['id']){delete _0x57eda0[_0xc486('0x3d')]['id'];}return db[_0xc486('0x1b')][_0xc486('0x3a')]({'where':{'id':_0x57eda0[_0xc486('0x44')]['id']}})[_0xc486('0x13')](handleEntityNotFound(_0xe41b3b,null))[_0xc486('0x13')](function(_0x414a46){if(_0x414a46[_0xc486('0x36')]===_0xc486('0x37')&&_0x57eda0['body'][_0xc486('0x38')]){_0x57eda0[_0xc486('0x3d')][_0xc486('0x38')]=encryptor[_0xc486('0x42')](_0x57eda0['body'][_0xc486('0x38')]);}return _0x414a46;})[_0xc486('0x13')](saveUpdates(_0x57eda0[_0xc486('0x3d')],null))[_0xc486('0x13')](respondWithResult(_0xe41b3b,null))[_0xc486('0x43')](handleError(_0xe41b3b,null));};exports[_0xc486('0x14')]=function(_0x304e2e,_0x22bfe3){return db['CloudProvider']['find']({'where':{'id':_0x304e2e[_0xc486('0x44')]['id']}})[_0xc486('0x13')](handleEntityNotFound(_0x22bfe3,null))[_0xc486('0x13')](removeEntity(_0x22bfe3,null))['catch'](handleError(_0x22bfe3,null));};exports[_0xc486('0x45')]=function(_0x17711b,_0x25ce2a){return db[_0xc486('0x1b')]['findOne']({'where':{'id':_0x17711b[_0xc486('0x44')]['id']},'raw':!![]})[_0xc486('0x13')](function(_0x22e422){if(!_0x22e422)return _0x25ce2a[_0xc486('0x9')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x22e422,_0x17711b[_0xc486('0x46')]['id'])};})[_0xc486('0x13')](respondWithResult(_0x25ce2a,null))[_0xc486('0x43')](handleError(_0x25ce2a,null));};exports[_0xc486('0x47')]=function(_0x898309,_0x49e9cf){var _0x18ecc0=_0x898309[_0xc486('0x3d')];var _0x53f237;var _0x3eb397;if(_0x18ecc0[_0xc486('0x48')])throw _0x18ecc0;redis[_0xc486('0x49')](_0x18ecc0[_0xc486('0x4a')])[_0xc486('0x13')](function(_0x300fdc){if(!_0x300fdc)throw new Error('Invalid\x20state\x20parameter');_0x53f237=JSON['parse'](_0x300fdc);var _0x482652=Buffer[_0xc486('0x4b')](_0x18ecc0[_0xc486('0x4a')],_0xc486('0x4c'))['toString']('ascii');_0x3eb397=JSON[_0xc486('0x4d')](_0x482652);if(!oauth[_0xc486('0x4e')](_0x18ecc0[_0xc486('0x4f')],_0x53f237[_0xc486('0x50')]))throw new Error(_0xc486('0x51'));redis[_0xc486('0x52')](_0x18ecc0[_0xc486('0x4a')]);return oauth[_0xc486('0x53')](_0x18ecc0[_0xc486('0x54')],_0x53f237);})[_0xc486('0x13')](function(_0x568682){_0x53f237[_0xc486('0x55')]=_0x568682[_0xc486('0x56')];_0x53f237['data6']=_0x568682[_0xc486('0x57')];return db[_0xc486('0x1b')][_0xc486('0x12')]({'data5':_0x53f237[_0xc486('0x55')],'data6':_0x53f237[_0xc486('0x58')]},{'where':{'id':_0x53f237['id']}});})[_0xc486('0x13')](function(){oauth[_0xc486('0x59')](_0x53f237);socket[_0xc486('0x5a')](_0xc486('0x5b'),{'id':_0x3eb397['id']});return;})[_0xc486('0x13')](respondWithStatusCode(_0x49e9cf,null))[_0xc486('0x43')](function(_0x4eab1a){if(_0x3eb397){socket[_0xc486('0x5a')](_0xc486('0x5c'),{'id':_0x3eb397['id']});}if(!_0x53f237){logger[_0xc486('0x48')](_0xc486('0x5d'),_0x4eab1a);return _0x49e9cf[_0xc486('0xf')](0x1f4)[_0xc486('0x17')](_0x4eab1a[_0xc486('0x5e')]);}logger[_0xc486('0x48')](_0xc486('0x5f'),_0x53f237['id'],JSON[_0xc486('0x60')](_0x4eab1a));});};
\ No newline at end of file
+var _0x7f38=['send','padEnd','index','CloudProvider','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','create','body','Name\x20parameter\x20not\x20specified','rawAttributes','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','error','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','json','undefined','limit','count','offset','status','Content-Range','update','then','end','stack','name'];(function(_0x207cf0,_0x450001){var _0x4e98a6=function(_0x25e7e1){while(--_0x25e7e1){_0x207cf0['push'](_0x207cf0['shift']());}};_0x4e98a6(++_0x450001);}(_0x7f38,0x102));var _0x87f3=function(_0x568bf2,_0x2258c4){_0x568bf2=_0x568bf2-0x0;var _0x294089=_0x7f38[_0x568bf2];return _0x294089;};'use strict';var _=require(_0x87f3('0x0'));var Redis=require(_0x87f3('0x1'));var qs=require(_0x87f3('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x87f3('0x3'))(_0x87f3('0x4'));var db=require(_0x87f3('0x5'))['db'];var oauth=require(_0x87f3('0x6'));config[_0x87f3('0x7')]=_[_0x87f3('0x8')](config[_0x87f3('0x7')],{'host':_0x87f3('0x9'),'port':0x18eb});var socket=require(_0x87f3('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x87f3('0x7')]);function respondWithStatusCode(_0x37eae3,_0x403718){_0x403718=_0x403718||0xcc;return function(_0x40eb7a){if(_0x40eb7a){return _0x37eae3[_0x87f3('0xb')](_0x403718);}return _0x37eae3['status'](_0x403718)['end']();};}function respondWithResult(_0x3c65d7,_0x108b08){_0x108b08=_0x108b08||0xc8;return function(_0x17ca7a){if(_0x17ca7a){return _0x3c65d7['status'](_0x108b08)[_0x87f3('0xc')](_0x17ca7a);}};}function respondWithFilteredResult(_0x31202a,_0x5769fa){return function(_0x4ad493){if(_0x4ad493){var _0x2b9505=typeof _0x5769fa['offset']===_0x87f3('0xd')&&typeof _0x5769fa[_0x87f3('0xe')]===_0x87f3('0xd');var _0x4d0e45=_0x4ad493[_0x87f3('0xf')];var _0x489add=_0x2b9505?0x0:_0x5769fa[_0x87f3('0x10')];var _0x260555=_0x2b9505?_0x4ad493[_0x87f3('0xf')]:_0x5769fa[_0x87f3('0x10')]+_0x5769fa[_0x87f3('0xe')];var _0x4f17fe;if(_0x260555>=_0x4d0e45){_0x260555=_0x4d0e45;_0x4f17fe=0xc8;}else{_0x4f17fe=0xce;}_0x31202a[_0x87f3('0x11')](_0x4f17fe);return _0x31202a['set'](_0x87f3('0x12'),_0x489add+'-'+_0x260555+'/'+_0x4d0e45)['json'](_0x4ad493);}return null;};}function saveUpdates(_0x2b4384){return function(_0x4a7866){if(_0x4a7866){return _0x4a7866[_0x87f3('0x13')](_0x2b4384)[_0x87f3('0x14')](function(_0x4b5a01){return _0x4b5a01;});}return null;};}function removeEntity(_0x116673){return function(_0x22a183){if(_0x22a183){return _0x22a183['destroy']()[_0x87f3('0x14')](function(){_0x116673[_0x87f3('0x11')](0xcc)[_0x87f3('0x15')]();});}};}function handleEntityNotFound(_0x623d07){return function(_0x509353){if(!_0x509353){_0x623d07[_0x87f3('0xb')](0x194);}return _0x509353;};}function handleError(_0x4a6ae9,_0x36221b){_0x36221b=_0x36221b||0x1f4;return function(_0x3370b0){logger['error'](_0x3370b0[_0x87f3('0x16')]);if(_0x3370b0[_0x87f3('0x17')]){delete _0x3370b0['name'];}_0x4a6ae9[_0x87f3('0x11')](_0x36221b)[_0x87f3('0x18')](_0x3370b0);};}function maskClientSecret(_0x36224f){return _[_0x87f3('0x19')](_0x36224f['slice'](0x0,0x3),0x14,'*');}exports[_0x87f3('0x1a')]=function(_0x17e105,_0x166495){var _0x542b83={},_0x2c43e7={},_0x1826ed={'count':0x0,'rows':[]};var _0x2c913e=_['map'](db[_0x87f3('0x1b')]['rawAttributes'],function(_0x3a4094){return{'name':_0x3a4094[_0x87f3('0x1c')],'type':_0x3a4094['type'][_0x87f3('0x1d')]};});_0x2c43e7['model']=_[_0x87f3('0x1e')](_0x2c913e,'name');_0x2c43e7[_0x87f3('0x1f')]=_[_0x87f3('0x20')](_0x17e105['query']);_0x2c43e7[_0x87f3('0x21')]=_[_0x87f3('0x22')](_0x2c43e7['model'],_0x2c43e7[_0x87f3('0x1f')]);_0x542b83['attributes']=_['intersection'](_0x2c43e7[_0x87f3('0x23')],qs[_0x87f3('0x24')](_0x17e105[_0x87f3('0x1f')]['fields']));_0x542b83['attributes']=_0x542b83[_0x87f3('0x25')][_0x87f3('0x26')]?_0x542b83[_0x87f3('0x25')]:_0x2c43e7[_0x87f3('0x23')];if(!_0x17e105[_0x87f3('0x1f')][_0x87f3('0x27')]('nolimit')){_0x542b83[_0x87f3('0xe')]=qs[_0x87f3('0xe')](_0x17e105[_0x87f3('0x1f')][_0x87f3('0xe')]);_0x542b83[_0x87f3('0x10')]=qs['offset'](_0x17e105[_0x87f3('0x1f')][_0x87f3('0x10')]);}_0x542b83[_0x87f3('0x28')]=qs[_0x87f3('0x29')](_0x17e105[_0x87f3('0x1f')][_0x87f3('0x29')]);_0x542b83[_0x87f3('0x2a')]=qs[_0x87f3('0x21')](_['pick'](_0x17e105[_0x87f3('0x1f')],_0x2c43e7[_0x87f3('0x21')]),_0x2c913e);if(_0x17e105[_0x87f3('0x1f')][_0x87f3('0x2b')]){_0x542b83[_0x87f3('0x2a')]=_[_0x87f3('0x2c')](_0x542b83[_0x87f3('0x2a')],{'$or':_[_0x87f3('0x1e')](_0x2c913e,function(_0x25eb94){if(_0x25eb94[_0x87f3('0x2d')]!==_0x87f3('0x2e')){var _0x43f405={};_0x43f405[_0x25eb94[_0x87f3('0x17')]]={'$like':'%'+_0x17e105[_0x87f3('0x1f')][_0x87f3('0x2b')]+'%'};return _0x43f405;}})});}_0x542b83=_['merge']({},_0x542b83,_0x17e105[_0x87f3('0x2f')]);var _0x52573c={'where':_0x542b83[_0x87f3('0x2a')]};return db['CloudProvider'][_0x87f3('0xf')](_0x52573c)[_0x87f3('0x14')](function(_0x3f293d){_0x1826ed[_0x87f3('0xf')]=_0x3f293d;if(_0x17e105[_0x87f3('0x1f')][_0x87f3('0x30')]){_0x542b83[_0x87f3('0x31')]=[{'all':!![]}];}return db[_0x87f3('0x1b')][_0x87f3('0x32')](_0x542b83);})[_0x87f3('0x14')](function(_0x534ff1){_0x1826ed[_0x87f3('0x33')]=_['map'](_0x534ff1,function(_0x5978cd){if(_0x5978cd[_0x87f3('0x34')]===_0x87f3('0x35')){var _0x4aa095=encryptor[_0x87f3('0x36')](_0x5978cd[_0x87f3('0x37')]);_0x5978cd[_0x87f3('0x37')]=maskClientSecret(_0x4aa095);}return _0x5978cd;});return _0x1826ed;})[_0x87f3('0x14')](respondWithFilteredResult(_0x166495,_0x542b83))[_0x87f3('0x38')](handleError(_0x166495,null));};exports['show']=function(_0x80e992,_0x231bba){var _0x413b65={'raw':!![],'where':{'id':_0x80e992[_0x87f3('0x39')]['id']}},_0x4ba6f8={};_0x4ba6f8[_0x87f3('0x23')]=_[_0x87f3('0x20')](db['CloudProvider']['rawAttributes']);_0x4ba6f8['query']=_[_0x87f3('0x20')](_0x80e992[_0x87f3('0x1f')]);_0x4ba6f8[_0x87f3('0x21')]=_['intersection'](_0x4ba6f8[_0x87f3('0x23')],_0x4ba6f8['query']);_0x413b65[_0x87f3('0x25')]=_[_0x87f3('0x22')](_0x4ba6f8[_0x87f3('0x23')],qs[_0x87f3('0x24')](_0x80e992[_0x87f3('0x1f')][_0x87f3('0x24')]));_0x413b65[_0x87f3('0x25')]=_0x413b65['attributes'][_0x87f3('0x26')]?_0x413b65[_0x87f3('0x25')]:_0x4ba6f8['model'];if(_0x80e992['query']['includeAll']){_0x413b65['include']=[{'all':!![]}];}_0x413b65=_['merge']({},_0x413b65,_0x80e992['options']);return db['CloudProvider']['find'](_0x413b65)['then'](handleEntityNotFound(_0x231bba,null))[_0x87f3('0x14')](function(_0x3266bc){if(_0x3266bc[_0x87f3('0x34')]===_0x87f3('0x35')){var _0x1fe05e=encryptor[_0x87f3('0x36')](_0x3266bc['data3']);_0x3266bc['data3']=maskClientSecret(_0x1fe05e);}return _0x3266bc;})[_0x87f3('0x14')](respondWithResult(_0x231bba,null))[_0x87f3('0x38')](handleError(_0x231bba,null));};exports[_0x87f3('0x3a')]=function(_0x3b6592,_0x34432b){if(!_0x3b6592[_0x87f3('0x3b')]['name'])throw new Error(_0x87f3('0x3c'));if(!_0x3b6592[_0x87f3('0x3b')][_0x87f3('0x34')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x464715=db[_0x87f3('0x1b')][_0x87f3('0x3d')]['service'][_0x87f3('0x3e')];if(!_0x464715[_0x87f3('0x3f')](_0x3b6592[_0x87f3('0x3b')][_0x87f3('0x34')]))throw new Error(_0x87f3('0x40')+_0x464715[_0x87f3('0x41')](',\x20'));if(_0x3b6592[_0x87f3('0x3b')][_0x87f3('0x34')]===_0x87f3('0x35')&&_0x3b6592[_0x87f3('0x3b')][_0x87f3('0x37')]){_0x3b6592[_0x87f3('0x3b')][_0x87f3('0x37')]=encryptor[_0x87f3('0x42')](_0x3b6592['body']['data3']);}return db['CloudProvider'][_0x87f3('0x3a')](_0x3b6592[_0x87f3('0x3b')],{})['then'](respondWithResult(_0x34432b,0xc9))[_0x87f3('0x38')](handleError(_0x34432b,null));};exports[_0x87f3('0x13')]=function(_0x3c21f1,_0x1bd35a){if(_0x3c21f1[_0x87f3('0x3b')]['id']){delete _0x3c21f1[_0x87f3('0x3b')]['id'];}return db['CloudProvider'][_0x87f3('0x43')]({'where':{'id':_0x3c21f1[_0x87f3('0x39')]['id']}})[_0x87f3('0x14')](handleEntityNotFound(_0x1bd35a,null))['then'](function(_0x8f0ebd){if(_0x8f0ebd[_0x87f3('0x34')]===_0x87f3('0x35')&&_0x3c21f1['body'][_0x87f3('0x37')]){_0x3c21f1[_0x87f3('0x3b')][_0x87f3('0x37')]=encryptor[_0x87f3('0x42')](_0x3c21f1[_0x87f3('0x3b')][_0x87f3('0x37')]);}return _0x8f0ebd;})['then'](saveUpdates(_0x3c21f1[_0x87f3('0x3b')],null))[_0x87f3('0x14')](respondWithResult(_0x1bd35a,null))[_0x87f3('0x38')](handleError(_0x1bd35a,null));};exports[_0x87f3('0x44')]=function(_0x51b170,_0x1fb23e){return db[_0x87f3('0x1b')]['find']({'where':{'id':_0x51b170['params']['id']}})[_0x87f3('0x14')](handleEntityNotFound(_0x1fb23e,null))[_0x87f3('0x14')](removeEntity(_0x1fb23e,null))[_0x87f3('0x38')](handleError(_0x1fb23e,null));};exports[_0x87f3('0x45')]=function(_0x55ec03,_0xfb81e4){return db[_0x87f3('0x1b')][_0x87f3('0x46')]({'where':{'id':_0x55ec03[_0x87f3('0x39')]['id']},'raw':!![]})[_0x87f3('0x14')](function(_0x21104c){if(!_0x21104c)return _0xfb81e4[_0x87f3('0xb')](0x194);return{'url':oauth[_0x87f3('0x47')](_0x21104c,_0x55ec03[_0x87f3('0x48')]['id'])};})['then'](respondWithResult(_0xfb81e4,null))['catch'](handleError(_0xfb81e4,null));};exports['oauth2MicrosoftCallback']=function(_0x5a786f,_0x20989a){var _0x3cf231=_0x5a786f[_0x87f3('0x3b')];var _0x5cccb0;var _0x1570f4;if(_0x3cf231[_0x87f3('0x49')])throw _0x3cf231;redis[_0x87f3('0x4a')](_0x3cf231[_0x87f3('0x4b')])[_0x87f3('0x14')](function(_0x11f5d1){if(!_0x11f5d1)throw new Error(_0x87f3('0x4c'));_0x5cccb0=JSON[_0x87f3('0x4d')](_0x11f5d1);var _0x22dbae=Buffer[_0x87f3('0x4e')](_0x3cf231['state'],'base64')[_0x87f3('0x4f')](_0x87f3('0x50'));_0x1570f4=JSON['parse'](_0x22dbae);if(!oauth['isValidIdToken'](_0x3cf231['id_token'],_0x5cccb0[_0x87f3('0x51')]))throw new Error(_0x87f3('0x52'));redis['del'](_0x3cf231['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x3cf231[_0x87f3('0x53')],_0x5cccb0);})[_0x87f3('0x14')](function(_0x37af1c){_0x5cccb0[_0x87f3('0x54')]=_0x37af1c[_0x87f3('0x55')];_0x5cccb0[_0x87f3('0x56')]=_0x37af1c['refresh_token'];return db[_0x87f3('0x1b')][_0x87f3('0x13')]({'data5':_0x5cccb0[_0x87f3('0x54')],'data6':_0x5cccb0[_0x87f3('0x56')]},{'where':{'id':_0x5cccb0['id']}});})[_0x87f3('0x14')](function(){oauth[_0x87f3('0x57')](_0x5cccb0);socket[_0x87f3('0x58')](_0x87f3('0x59'),{'id':_0x1570f4['id']});return;})[_0x87f3('0x14')](respondWithStatusCode(_0x20989a,null))[_0x87f3('0x38')](function(_0x2b1e14){if(_0x1570f4){socket[_0x87f3('0x58')](_0x87f3('0x5a'),{'id':_0x1570f4['id']});}if(!_0x5cccb0){logger[_0x87f3('0x49')](_0x87f3('0x5b'),_0x2b1e14);return _0x20989a[_0x87f3('0x11')](0x1f4)[_0x87f3('0x18')](_0x2b1e14[_0x87f3('0x5c')]);}logger['error'](_0x87f3('0x5d'),_0x5cccb0['id'],JSON['stringify'](_0x2b1e14));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 49be90a..296b1ac 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 _0x84c4=['define','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x419406,_0x4d7ce3){var _0x42dd47=function(_0x4725e7){while(--_0x4725e7){_0x419406['push'](_0x419406['shift']());}};_0x42dd47(++_0x4d7ce3);}(_0x84c4,0x16f));var _0x484c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84c4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x484c('0x0'));var util=require('util');var logger=require(_0x484c('0x1'))(_0x484c('0x2'));var moment=require(_0x484c('0x3'));var BPromise=require(_0x484c('0x4'));var rp=require(_0x484c('0x5'));var fs=require('fs');var path=require(_0x484c('0x6'));var rimraf=require(_0x484c('0x7'));var config=require(_0x484c('0x8'));var attributes=require(_0x484c('0x9'));module[_0x484c('0xa')]=function(_0x1571cc,_0x4d034d){return _0x1571cc[_0x484c('0xb')](_0x484c('0xc'),attributes,{'tableName':_0x484c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x158d=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3d7a7a,_0x5ad2eb){var _0x422fea=function(_0x5ccf20){while(--_0x5ccf20){_0x3d7a7a['push'](_0x3d7a7a['shift']());}};_0x422fea(++_0x5ad2eb);}(_0x158d,0x1b5));var _0xd158=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x158d[_0x30033a];return _0x5e3518;};'use strict';var _=require(_0xd158('0x0'));var util=require(_0xd158('0x1'));var logger=require(_0xd158('0x2'))('api');var moment=require(_0xd158('0x3'));var BPromise=require(_0xd158('0x4'));var rp=require(_0xd158('0x5'));var fs=require('fs');var path=require(_0xd158('0x6'));var rimraf=require(_0xd158('0x7'));var config=require(_0xd158('0x8'));var attributes=require(_0xd158('0x9'));module[_0xd158('0xa')]=function(_0x5dc9bf,_0x62cce8){return _0x5dc9bf[_0xd158('0xb')]('CloudProvider',attributes,{'tableName':_0xd158('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 5cbd441..88e6e88 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f79=['authorization_code','POST','intervals','bind','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','data7','/.default','replace','{TENANT_ID}','code','from','stringify','base64','randomBytes','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','nonce','login','oauth2/','set','decode','payload','iss','issuer','aud','audience','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data4','decryptString','data2','data5','data6','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s'];(function(_0x232a11,_0x337a69){var _0x19388f=function(_0x13b37a){while(--_0x13b37a){_0x232a11['push'](_0x232a11['shift']());}};_0x19388f(++_0x337a69);}(_0x7f79,0x97));var _0x97f7=function(_0xf80ed8,_0x3431ee){_0xf80ed8=_0xf80ed8-0x0;var _0x3b2c66=_0x7f79[_0xf80ed8];return _0x3b2c66;};'use strict';var _=require(_0x97f7('0x0'));var crypto=require('crypto');var jwt=require(_0x97f7('0x1'));var moment=require(_0x97f7('0x2'));var Redis=require('ioredis');var rp=require(_0x97f7('0x3'));var util=require(_0x97f7('0x4'));var encryptor=require(_0x97f7('0x5'));var config=require('../../config/environment');var logger=require(_0x97f7('0x6'))(_0x97f7('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x97f7('0x8'))['db'];config[_0x97f7('0x9')]=_[_0x97f7('0xa')](config[_0x97f7('0x9')],{'host':_0x97f7('0xb'),'port':0x18eb});var redis=new Redis(config[_0x97f7('0x9')]);var MICROSOFT_AUTH_URL=_0x97f7('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x97f7('0xd'),_0x97f7('0xe'),_0x97f7('0xf'),_0x97f7('0x10'),_0x97f7('0x11'),_0x97f7('0x12'),_0x97f7('0x13')],'Dynamics365':[_0x97f7('0xd'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x97f7('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x19cab4){var _0x57ebf6=_[_0x97f7('0x15')](AZURE_AUTH_SCOPES[_0x19cab4[_0x97f7('0x16')]]);if(_0x19cab4['type']===_0x97f7('0x17'))_0x57ebf6['push'](_0x19cab4[_0x97f7('0x18')]+'/.default');return _0x57ebf6['join']('\x20');}function getAccessTokenScope(_0x4e72d5){if(_0x4e72d5['type']==='Outlook365')return _0x97f7('0x11');if(_0x4e72d5['type']===_0x97f7('0x17'))return _0x4e72d5[_0x97f7('0x18')]+_0x97f7('0x19');}function generateMicrosoftAuthorizationUrl(_0x584926,_0x37f6c1){var _0x4f99ec=MICROSOFT_AUTH_URL[_0x97f7('0x1a')](_0x97f7('0x1b'),_0x584926['data2']);var _0x204d54=[_0x97f7('0x1c'),'id_token'];var _0xfd6d85=Buffer[_0x97f7('0x1d')](JSON[_0x97f7('0x1e')]({'id':_0x37f6c1}))['toString'](_0x97f7('0x1f'));var _0x4d7d32=crypto[_0x97f7('0x20')](0x10)['toString']('hex');var _0xd80945=getAuthorizationScopes(_0x584926);var _0x53864b=[{'key':_0x97f7('0x21'),'value':_0x584926[_0x97f7('0x22')]},{'key':_0x97f7('0x23'),'value':encodeURIComponent(_0x204d54['join']('\x20'))},{'key':_0x97f7('0x24'),'value':_0x584926['data4']},{'key':_0x97f7('0x25'),'value':_0x97f7('0x26')},{'key':_0x97f7('0x27'),'value':encodeURIComponent(_0xd80945)},{'key':'state','value':_0xfd6d85},{'key':_0x97f7('0x28'),'value':_0x4d7d32},{'key':'prompt','value':_0x97f7('0x29')}];var _0x38c20e=_0x4f99ec+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x97f7('0x15')](_0x53864b,function(_0x44c9fd){return _0x44c9fd['key']+'='+_0x44c9fd['value'];})['join']('&');_0x584926['oauth2Claims']={'issuer':_0x4f99ec[_0x97f7('0x1a')](_0x97f7('0x2a'),''),'audience':_0x584926[_0x97f7('0x22')],'state':_0xfd6d85,'nonce':_0x4d7d32};redis[_0x97f7('0x2b')](_0xfd6d85,JSON[_0x97f7('0x1e')](_0x584926));return _0x38c20e;}function isValidIdToken(_0x4e1248,_0x48fb6f){try{var _0x392e01=jwt[_0x97f7('0x2c')](_0x4e1248,{'complete':!![]});var _0x1a7144=_0x392e01[_0x97f7('0x2d')];if(_0x1a7144[_0x97f7('0x2e')]!==_0x48fb6f[_0x97f7('0x2f')])return![];if(_0x1a7144[_0x97f7('0x30')]!==_0x48fb6f[_0x97f7('0x31')])return![];if(_0x1a7144[_0x97f7('0x28')]!==_0x48fb6f[_0x97f7('0x28')])return![];if(moment()['isAfter'](moment[_0x97f7('0x32')](_0x1a7144['exp'])))return![];return!![];}catch(_0x24c876){throw _0x24c876;}}function refreshOauth2MicrosoftAccessToken(_0x249c62){return Promise[_0x97f7('0x33')]()[_0x97f7('0x34')](function(){if(_0x249c62[_0x97f7('0x35')])return _0x249c62;return db[_0x97f7('0x36')][_0x97f7('0x37')]({'where':{'id':_0x249c62['id']},'raw':!![]});})[_0x97f7('0x34')](function(_0x3cf518){var _0x5642ad={'grant_type':_0x97f7('0x38'),'refresh_token':_0x3cf518['data6'],'scope':getAccessTokenScope(_0x3cf518),'redirect_uri':_0x3cf518[_0x97f7('0x39')],'client_id':_0x3cf518[_0x97f7('0x22')],'client_secret':encryptor[_0x97f7('0x3a')](_0x3cf518[_0x97f7('0x35')])};var _0x5cd37b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x97f7('0x1a')]('{TENANT_ID}',_0x3cf518[_0x97f7('0x3b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5642ad,'json':!![]};return rp(_0x5cd37b);})[_0x97f7('0x34')](function(_0x4cc03e){_0x249c62[_0x97f7('0x3c')]=_0x4cc03e['access_token'];_0x249c62[_0x97f7('0x3d')]=_0x4cc03e['refresh_token'];return db[_0x97f7('0x36')][_0x97f7('0x3e')]({'data5':_0x249c62['data5'],'data6':_0x249c62[_0x97f7('0x3d')]},{'where':{'id':_0x249c62['id']}});})['then'](function(){return _0x249c62;})[_0x97f7('0x3f')](function(_0x1be34d){logger['error'](_0x97f7('0x40'),_0x249c62['id'],_0x1be34d);});}function getOauth2MicrosoftAccessToken(_0x1dcad4,_0x2ba7e2){var _0x3f0a38={'grant_type':_0x97f7('0x41'),'code':_0x1dcad4,'scope':getAccessTokenScope(_0x2ba7e2),'redirect_uri':_0x2ba7e2[_0x97f7('0x39')],'client_id':_0x2ba7e2[_0x97f7('0x22')],'client_secret':encryptor[_0x97f7('0x3a')](_0x2ba7e2[_0x97f7('0x35')])};var _0x4afe17={'method':_0x97f7('0x42'),'uri':MICROSOFT_AUTH_URL[_0x97f7('0x1a')]('{TENANT_ID}',_0x2ba7e2['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f0a38,'json':!![]};return rp(_0x4afe17);}function startRefreshInterval(_0x57149c){var _0x1d2b7b=schedule[_0x97f7('0x43')];if(_0x1d2b7b[_0x57149c['id']])clearInterval(_0x1d2b7b[_0x57149c['id']]);_0x1d2b7b[_0x57149c['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x97f7('0x44')](this,{'id':_0x57149c['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x97f7('0x43')]=_0x1d2b7b;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x97f7('0x34')](function(_0x407f05){var _0x3281e8=_0x407f05['map'](function(_0x4191bd){return refreshOauth2MicrosoftAccessToken(_0x4191bd)[_0x97f7('0x34')](function(_0x495200){startRefreshInterval(_0x495200);});});return Promise[_0x97f7('0x45')](_0x3281e8);})[_0x97f7('0x3f')](function(_0x3aa01f){var _0x187406=_0x3aa01f?util['inspect'](_0x3aa01f,{'showHidden':![],'depth':null}):'';logger['error'](_0x97f7('0x46'),_0x187406);});}module[_0x97f7('0x47')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x9b13=['resolve','then','data3','CloudProvider','findOne','refresh_token','data4','data5','access_token','data6','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','map','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','Dynamics365','push','data7','/.default','join','replace','{TENANT_ID}','data2','code','from','stringify','base64','toString','hex','client_id','data1','response_type','redirect_uri','response_mode','state','nonce','login','key','value','oauth2Claims','set','payload','iss','issuer','aud','audience','unix'];(function(_0x2ea046,_0x5ab912){var _0x433e5a=function(_0x13202c){while(--_0x13202c){_0x2ea046['push'](_0x2ea046['shift']());}};_0x433e5a(++_0x5ab912);}(_0x9b13,0xfb));var _0x39b1=function(_0x2931b8,_0x1f5b3c){_0x2931b8=_0x2931b8-0x0;var _0xde7fac=_0x9b13[_0x2931b8];return _0xde7fac;};'use strict';var _=require(_0x39b1('0x0'));var crypto=require(_0x39b1('0x1'));var jwt=require(_0x39b1('0x2'));var moment=require('moment');var Redis=require(_0x39b1('0x3'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0x39b1('0x4'));var config=require(_0x39b1('0x5'));var logger=require(_0x39b1('0x6'))(_0x39b1('0x7'));var schedule=require(_0x39b1('0x8'));var db=require(_0x39b1('0x9'))['db'];config['redis']=_[_0x39b1('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x39b1('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x39b1('0xc'),_0x39b1('0xd'),_0x39b1('0xe'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0x39b1('0xf'),_0x39b1('0x10')],'Dynamics365':[_0x39b1('0xc'),_0x39b1('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x39b1('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x39b1('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2c5886){var _0x39f0bf=_['map'](AZURE_AUTH_SCOPES[_0x2c5886[_0x39b1('0x14')]]);if(_0x2c5886[_0x39b1('0x14')]===_0x39b1('0x15'))_0x39f0bf[_0x39b1('0x16')](_0x2c5886[_0x39b1('0x17')]+_0x39b1('0x18'));return _0x39f0bf[_0x39b1('0x19')]('\x20');}function getAccessTokenScope(_0x35ae5c){if(_0x35ae5c[_0x39b1('0x14')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x35ae5c['type']==='Dynamics365')return _0x35ae5c[_0x39b1('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x1d90e6,_0x12dd6e){var _0x145437=MICROSOFT_AUTH_URL[_0x39b1('0x1a')](_0x39b1('0x1b'),_0x1d90e6[_0x39b1('0x1c')]);var _0x49429f=[_0x39b1('0x1d'),'id_token'];var _0x37f22a=Buffer[_0x39b1('0x1e')](JSON[_0x39b1('0x1f')]({'id':_0x12dd6e}))['toString'](_0x39b1('0x20'));var _0x24607d=crypto['randomBytes'](0x10)[_0x39b1('0x21')](_0x39b1('0x22'));var _0x1ee860=getAuthorizationScopes(_0x1d90e6);var _0x23c9bb=[{'key':_0x39b1('0x23'),'value':_0x1d90e6[_0x39b1('0x24')]},{'key':_0x39b1('0x25'),'value':encodeURIComponent(_0x49429f[_0x39b1('0x19')]('\x20'))},{'key':_0x39b1('0x26'),'value':_0x1d90e6['data4']},{'key':_0x39b1('0x27'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x1ee860)},{'key':_0x39b1('0x28'),'value':_0x37f22a},{'key':_0x39b1('0x29'),'value':_0x24607d},{'key':'prompt','value':_0x39b1('0x2a')}];var _0x25433b=_0x145437+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x23c9bb,function(_0x2eb983){return _0x2eb983[_0x39b1('0x2b')]+'='+_0x2eb983[_0x39b1('0x2c')];})[_0x39b1('0x19')]('&');_0x1d90e6[_0x39b1('0x2d')]={'issuer':_0x145437[_0x39b1('0x1a')]('oauth2/',''),'audience':_0x1d90e6[_0x39b1('0x24')],'state':_0x37f22a,'nonce':_0x24607d};redis[_0x39b1('0x2e')](_0x37f22a,JSON[_0x39b1('0x1f')](_0x1d90e6));return _0x25433b;}function isValidIdToken(_0x21fbf9,_0x3924d3){try{var _0xb1b4b2=jwt['decode'](_0x21fbf9,{'complete':!![]});var _0x570673=_0xb1b4b2[_0x39b1('0x2f')];if(_0x570673[_0x39b1('0x30')]!==_0x3924d3[_0x39b1('0x31')])return![];if(_0x570673[_0x39b1('0x32')]!==_0x3924d3[_0x39b1('0x33')])return![];if(_0x570673[_0x39b1('0x29')]!==_0x3924d3[_0x39b1('0x29')])return![];if(moment()['isAfter'](moment[_0x39b1('0x34')](_0x570673['exp'])))return![];return!![];}catch(_0x2e64b8){throw _0x2e64b8;}}function refreshOauth2MicrosoftAccessToken(_0x23a800){return Promise[_0x39b1('0x35')]()[_0x39b1('0x36')](function(){if(_0x23a800[_0x39b1('0x37')])return _0x23a800;return db[_0x39b1('0x38')][_0x39b1('0x39')]({'where':{'id':_0x23a800['id']},'raw':!![]});})['then'](function(_0xd5bb24){var _0x239f8b={'grant_type':_0x39b1('0x3a'),'refresh_token':_0xd5bb24['data6'],'scope':getAccessTokenScope(_0xd5bb24),'redirect_uri':_0xd5bb24[_0x39b1('0x3b')],'client_id':_0xd5bb24[_0x39b1('0x24')],'client_secret':encryptor['decryptString'](_0xd5bb24[_0x39b1('0x37')])};var _0x1ea644={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x39b1('0x1a')](_0x39b1('0x1b'),_0xd5bb24['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x239f8b,'json':!![]};return rp(_0x1ea644);})[_0x39b1('0x36')](function(_0x3126bf){_0x23a800[_0x39b1('0x3c')]=_0x3126bf[_0x39b1('0x3d')];_0x23a800[_0x39b1('0x3e')]=_0x3126bf[_0x39b1('0x3a')];return db['CloudProvider'][_0x39b1('0x3f')]({'data5':_0x23a800[_0x39b1('0x3c')],'data6':_0x23a800[_0x39b1('0x3e')]},{'where':{'id':_0x23a800['id']}});})[_0x39b1('0x36')](function(){return _0x23a800;})['catch'](function(_0x5e15f1){logger[_0x39b1('0x40')](_0x39b1('0x41'),_0x23a800['id'],_0x5e15f1);});}function getOauth2MicrosoftAccessToken(_0x10ca56,_0x49b140){var _0x39732e={'grant_type':_0x39b1('0x42'),'code':_0x10ca56,'scope':getAccessTokenScope(_0x49b140),'redirect_uri':_0x49b140['data4'],'client_id':_0x49b140[_0x39b1('0x24')],'client_secret':encryptor[_0x39b1('0x43')](_0x49b140[_0x39b1('0x37')])};var _0x4a5ca0={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x39b1('0x1a')](_0x39b1('0x1b'),_0x49b140[_0x39b1('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x39732e,'json':!![]};return rp(_0x4a5ca0);}function startRefreshInterval(_0x4fcfe1){var _0x2a2618=schedule[_0x39b1('0x44')];if(_0x2a2618[_0x4fcfe1['id']])clearInterval(_0x2a2618[_0x4fcfe1['id']]);_0x2a2618[_0x4fcfe1['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x39b1('0x45')](this,{'id':_0x4fcfe1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x39b1('0x44')]=_0x2a2618;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x39b1('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x39b1('0x36')](function(_0x248603){var _0xf4d998=_0x248603[_0x39b1('0x47')](function(_0x340e23){return refreshOauth2MicrosoftAccessToken(_0x340e23)[_0x39b1('0x36')](function(_0x4c5c7a){startRefreshInterval(_0x4c5c7a);});});return Promise[_0x39b1('0x48')](_0xf4d998);})[_0x39b1('0x49')](function(_0x7e50d9){var _0x4506c5=_0x7e50d9?util[_0x39b1('0x4a')](_0x7e50d9,{'showHidden':![],'depth':null}):'';logger['error'](_0x39b1('0x4b'),_0x4506c5);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 28e7a1c..a0ba40f 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 _0xf69c=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash'];(function(_0x38c1c7,_0x46f03d){var _0x1a4d68=function(_0x3c45a9){while(--_0x3c45a9){_0x38c1c7['push'](_0x38c1c7['shift']());}};_0x1a4d68(++_0x46f03d);}(_0xf69c,0x1e2));var _0xcf69=function(_0x9ff51,_0x4c951f){_0x9ff51=_0x9ff51-0x0;var _0x31959b=_0xf69c[_0x9ff51];return _0x31959b;};'use strict';var _=require(_0xcf69('0x0'));var util=require(_0xcf69('0x1'));var moment=require(_0xcf69('0x2'));var BPromise=require(_0xcf69('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf69('0x4'));var db=require(_0xcf69('0x5'))['db'];var utils=require(_0xcf69('0x6'));var logger=require('../../config/logger')(_0xcf69('0x7'));var config=require(_0xcf69('0x8'));var jayson=require(_0xcf69('0x9'));var client=jayson[_0xcf69('0xa')][_0xcf69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x352ff9,_0x170b63,_0x5b446f){return new BPromise(function(_0x3fda18,_0xe31bc0){return client['request'](_0x352ff9,_0x5b446f)[_0xcf69('0xc')](function(_0x43ce6e){logger[_0xcf69('0xd')](_0xcf69('0xe'),_0x170b63,'request\x20sent');logger[_0xcf69('0xf')](_0xcf69('0x10'),_0x170b63,_0xcf69('0x11'),JSON['stringify'](_0x43ce6e));if(_0x43ce6e[_0xcf69('0x12')]){if(_0x43ce6e[_0xcf69('0x12')]['code']===0x1f4){logger[_0xcf69('0x12')](_0xcf69('0xe'),_0x170b63,_0x43ce6e[_0xcf69('0x12')][_0xcf69('0x13')]);return _0xe31bc0(_0x43ce6e[_0xcf69('0x12')][_0xcf69('0x13')]);}logger[_0xcf69('0x12')](_0xcf69('0xe'),_0x170b63,_0x43ce6e['error'][_0xcf69('0x13')]);return _0x3fda18(_0x43ce6e['error'][_0xcf69('0x13')]);}else{logger['info'](_0xcf69('0xe'),_0x170b63,_0xcf69('0x11'));_0x3fda18(_0x43ce6e['result']['message']);}})[_0xcf69('0x14')](function(_0x5bdd0c){logger[_0xcf69('0x12')]('CloudProvider,\x20%s,\x20%s',_0x170b63,_0x5bdd0c);_0xe31bc0(_0x5bdd0c);});});}
\ No newline at end of file
+var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x3f55de,_0x3ae98f){var _0x2698de=function(_0x48f021){while(--_0x48f021){_0x3f55de['push'](_0x3f55de['shift']());}};_0x2698de(++_0x3ae98f);}(_0xda2d,0x102));var _0xdda2=function(_0x261360,_0x30a73b){_0x261360=_0x261360-0x0;var _0x862dd5=_0xda2d[_0x261360];return _0x862dd5;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('CloudProvider,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 99e9549..c957ec0 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x168568,_0x23f6cc){var _0x528b7f=function(_0x55682a){while(--_0x55682a){_0x168568['push'](_0x168568['shift']());}};_0x528b7f(++_0x23f6cc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x45eb4e,_0x109c0f){var _0x19b25e=function(_0x421359){while(--_0x421359){_0x45eb4e['push'](_0x45eb4e['shift']());}};_0x19b25e(++_0x109c0f);}(_0x2ef3,0xba));var _0x32ef=function(_0xca11d9,_0x3e208b){_0xca11d9=_0xca11d9-0x0;var _0x1e6cd9=_0x2ef3[_0xca11d9];return _0x1e6cd9;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 2f94252..a089b16 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 _0x9bf7=['STRING','name','exports'];(function(_0x2b975f,_0xf9e707){var _0xb9d4db=function(_0x37d24e){while(--_0x37d24e){_0x2b975f['push'](_0x2b975f['shift']());}};_0xb9d4db(++_0xf9e707);}(_0x9bf7,0x149));var _0x79bf=function(_0x3c66f8,_0x366ba2){_0x3c66f8=_0x3c66f8-0x0;var _0x183afc=_0x9bf7[_0x3c66f8];return _0x183afc;};'use strict';var Sequelize=require('sequelize');module[_0x79bf('0x0')]={'name':{'type':Sequelize[_0x79bf('0x1')],'unique':_0x79bf('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x79bf('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x79bf('0x1')]},'phone':{'type':Sequelize[_0x79bf('0x1')]},'fax':{'type':Sequelize[_0x79bf('0x1')]},'type':{'type':Sequelize[_0x79bf('0x1')]},'street':{'type':Sequelize[_0x79bf('0x1')]},'postalCode':{'type':Sequelize[_0x79bf('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x79bf('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x79bf('0x1')]},'sPostalCode':{'type':Sequelize[_0x79bf('0x1')]},'sCity':{'type':Sequelize[_0x79bf('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x79bf('0x1')]}};
\ No newline at end of file
+var _0x3e68=['STRING','sequelize','name'];(function(_0x4fb789,_0x6b8092){var _0x49b5e4=function(_0x256537){while(--_0x256537){_0x4fb789['push'](_0x4fb789['shift']());}};_0x49b5e4(++_0x6b8092);}(_0x3e68,0x190));var _0x83e6=function(_0x29e07f,_0x3d5a07){_0x29e07f=_0x29e07f-0x0;var _0x425287=_0x3e68[_0x29e07f];return _0x425287;};'use strict';var Sequelize=require(_0x83e6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x83e6('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x83e6('0x2')]},'website':{'type':Sequelize[_0x83e6('0x2')]},'phone':{'type':Sequelize[_0x83e6('0x2')]},'fax':{'type':Sequelize[_0x83e6('0x2')]},'type':{'type':Sequelize[_0x83e6('0x2')]},'street':{'type':Sequelize[_0x83e6('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x83e6('0x2')]},'country':{'type':Sequelize[_0x83e6('0x2')]},'email':{'type':Sequelize[_0x83e6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x83e6('0x2')]},'sStreet':{'type':Sequelize[_0x83e6('0x2')]},'sPostalCode':{'type':Sequelize[_0x83e6('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x83e6('0x2')]},'description':{'type':Sequelize[_0x83e6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 6d23bf6..c42e5d7 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 _0xb1b6=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','ids','findOne','order','map','getContacts','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','crypto','jsforce','papaparse','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb1b6,0xf4));var _0x6b1b=function(_0x21ba33,_0x1121d4){_0x21ba33=_0x21ba33-0x0;var _0x3fcc74=_0xb1b6[_0x21ba33];return _0x3fcc74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b1b('0x0'));var zipdir=require(_0x6b1b('0x1'));var jsonpatch=require(_0x6b1b('0x2'));var rp=require(_0x6b1b('0x3'));var moment=require(_0x6b1b('0x4'));var BPromise=require(_0x6b1b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6b1b('0x6'));var sox=require(_0x6b1b('0x7'));var csv=require(_0x6b1b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b1b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b1b('0xa'));var jsforce=require(_0x6b1b('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6b1b('0xc'));var Redis=require(_0x6b1b('0xd'));var authService=require(_0x6b1b('0xe'));var qs=require(_0x6b1b('0xf'));var as=require(_0x6b1b('0x10'));var hardwareService=require(_0x6b1b('0x11'));var logger=require(_0x6b1b('0x12'))(_0x6b1b('0x13'));var utils=require('../../config/utils');var config=require(_0x6b1b('0x14'));var licenseUtil=require(_0x6b1b('0x15'));var db=require(_0x6b1b('0x16'))['db'];function respondWithStatusCode(_0x3e1200,_0x5bcca8){_0x5bcca8=_0x5bcca8||0xcc;return function(_0x5e6b70){if(_0x5e6b70){return _0x3e1200['sendStatus'](_0x5bcca8);}return _0x3e1200[_0x6b1b('0x17')](_0x5bcca8)[_0x6b1b('0x18')]();};}function respondWithResult(_0x5664f5,_0x171ba1){_0x171ba1=_0x171ba1||0xc8;return function(_0x1ecba3){if(_0x1ecba3){return _0x5664f5[_0x6b1b('0x17')](_0x171ba1)['json'](_0x1ecba3);}};}function respondWithFilteredResult(_0x5c6c0a,_0x20f9c8){return function(_0x4e9613){if(_0x4e9613){var _0xd6c1a9=typeof _0x20f9c8[_0x6b1b('0x19')]===_0x6b1b('0x1a')&&typeof _0x20f9c8[_0x6b1b('0x1b')]===_0x6b1b('0x1a');var _0x2f41e7=_0x4e9613[_0x6b1b('0x1c')];var _0x251fb4=_0xd6c1a9?0x0:_0x20f9c8[_0x6b1b('0x19')];var _0x2da079=_0xd6c1a9?_0x4e9613[_0x6b1b('0x1c')]:_0x20f9c8[_0x6b1b('0x19')]+_0x20f9c8[_0x6b1b('0x1b')];var _0x3339b7;if(_0x2da079>=_0x2f41e7){_0x2da079=_0x2f41e7;_0x3339b7=0xc8;}else{_0x3339b7=0xce;}_0x5c6c0a[_0x6b1b('0x17')](_0x3339b7);return _0x5c6c0a[_0x6b1b('0x1d')](_0x6b1b('0x1e'),_0x251fb4+'-'+_0x2da079+'/'+_0x2f41e7)[_0x6b1b('0x1f')](_0x4e9613);}return null;};}function patchUpdates(_0x97d6f8){return function(_0x1e9176){try{jsonpatch['apply'](_0x1e9176,_0x97d6f8,!![]);}catch(_0x50b825){return BPromise['reject'](_0x50b825);}return _0x1e9176[_0x6b1b('0x20')]();};}function saveUpdates(_0x468a50,_0x38c77d){return function(_0x38b43d){if(_0x38b43d){return _0x38b43d[_0x6b1b('0x21')](_0x468a50)[_0x6b1b('0x22')](function(_0xe4a3c6){return _0xe4a3c6;});}return null;};}function removeEntity(_0x290254,_0x3931f6){return function(_0x52b654){if(_0x52b654){return _0x52b654[_0x6b1b('0x23')]()[_0x6b1b('0x22')](function(){var _0x4ef9b9=_0x52b654['get']({'plain':!![]});var _0x5025b5=_0x6b1b('0x24');return db[_0x6b1b('0x25')][_0x6b1b('0x23')]({'where':{'type':_0x5025b5,'resourceId':_0x4ef9b9['id']}})['then'](function(){return _0x52b654;});})[_0x6b1b('0x22')](function(){_0x290254[_0x6b1b('0x17')](0xcc)[_0x6b1b('0x18')]();});}};}function handleEntityNotFound(_0x405caf,_0x360f0d){return function(_0x406a12){if(!_0x406a12){_0x405caf['sendStatus'](0x194);}return _0x406a12;};}function handleError(_0x811f0,_0x4df852){_0x4df852=_0x4df852||0x1f4;return function(_0x266ccb){logger['error'](_0x266ccb[_0x6b1b('0x26')]);if(_0x266ccb[_0x6b1b('0x27')]){delete _0x266ccb['name'];}_0x811f0[_0x6b1b('0x17')](_0x4df852)[_0x6b1b('0x28')](_0x266ccb);};}exports[_0x6b1b('0x29')]=function(_0x2c46c2,_0x203800){var _0x44062f={},_0x327cc0={},_0x5d936a={'count':0x0,'rows':[]};return db[_0x6b1b('0x2a')][_0x6b1b('0x2b')]()['then'](function(_0x20f3fc){_0x327cc0[_0x6b1b('0x2c')]=_['keys'](_0x20f3fc);_0x327cc0['query']=_[_0x6b1b('0x2d')](_0x2c46c2[_0x6b1b('0x2e')]);_0x327cc0[_0x6b1b('0x2f')]=_[_0x6b1b('0x30')](_0x327cc0[_0x6b1b('0x2c')],_0x327cc0[_0x6b1b('0x2e')]);_0x44062f[_0x6b1b('0x31')]=_[_0x6b1b('0x30')](_0x327cc0[_0x6b1b('0x2c')],qs['fields'](_0x2c46c2['query'][_0x6b1b('0x32')]));_0x44062f[_0x6b1b('0x31')]=_0x44062f['attributes'][_0x6b1b('0x33')]?_0x44062f[_0x6b1b('0x31')]:_0x327cc0['model'];if(!_0x2c46c2[_0x6b1b('0x2e')][_0x6b1b('0x34')]('nolimit')){_0x44062f[_0x6b1b('0x1b')]=qs[_0x6b1b('0x1b')](_0x2c46c2[_0x6b1b('0x2e')]['limit']);_0x44062f[_0x6b1b('0x19')]=qs[_0x6b1b('0x19')](_0x2c46c2['query']['offset']);}_0x44062f['order']=qs[_0x6b1b('0x35')](_0x2c46c2[_0x6b1b('0x2e')]['sort']);_0x44062f[_0x6b1b('0x36')]=qs[_0x6b1b('0x2f')](_[_0x6b1b('0x37')](_0x2c46c2['query'],_0x327cc0['filters']),_0x20f3fc);if(_0x2c46c2[_0x6b1b('0x2e')][_0x6b1b('0x38')]){_0x44062f[_0x6b1b('0x36')]=_['merge'](_0x44062f[_0x6b1b('0x36')],{'$or':_['map'](_0x44062f[_0x6b1b('0x31')],function(_0x1da90e){var _0x2ad6a1={};_0x2ad6a1[_0x1da90e]={'$like':'%'+_0x2c46c2[_0x6b1b('0x2e')][_0x6b1b('0x38')]+'%'};return _0x2ad6a1;})});}_0x44062f=_[_0x6b1b('0x39')]({},_0x44062f,_0x2c46c2[_0x6b1b('0x3a')]);var _0x5a4f80={'where':_0x44062f[_0x6b1b('0x36')]};return db[_0x6b1b('0x2a')][_0x6b1b('0x1c')](_0x5a4f80)[_0x6b1b('0x22')](function(_0x5e7b90){_0x5d936a['count']=_0x5e7b90;if(_0x2c46c2[_0x6b1b('0x2e')][_0x6b1b('0x3b')]){_0x44062f[_0x6b1b('0x3c')]=[{'all':!![]}];}return db[_0x6b1b('0x2a')][_0x6b1b('0x3d')](_0x44062f);})[_0x6b1b('0x22')](function(_0x2583db){_0x5d936a[_0x6b1b('0x3e')]=_0x2583db;return _0x5d936a;})[_0x6b1b('0x22')](respondWithFilteredResult(_0x203800,_0x44062f))['catch'](handleError(_0x203800,null));})[_0x6b1b('0x3f')](handleError(_0x203800,null));};exports[_0x6b1b('0x40')]=function(_0x25c09d,_0x5cbae9){var _0x4bc32e={'raw':![],'where':{'id':_0x25c09d['params']['id']}},_0x29ef5a={};_0x29ef5a['model']=_['keys'](db[_0x6b1b('0x2a')][_0x6b1b('0x41')]);_0x29ef5a[_0x6b1b('0x2e')]=_['keys'](_0x25c09d[_0x6b1b('0x2e')]);_0x29ef5a[_0x6b1b('0x2f')]=_[_0x6b1b('0x30')](_0x29ef5a['model'],_0x29ef5a[_0x6b1b('0x2e')]);_0x4bc32e[_0x6b1b('0x31')]=_[_0x6b1b('0x30')](_0x29ef5a['model'],qs['fields'](_0x25c09d['query'][_0x6b1b('0x32')]));_0x4bc32e[_0x6b1b('0x31')]=_0x4bc32e[_0x6b1b('0x31')]['length']?_0x4bc32e[_0x6b1b('0x31')]:_0x29ef5a[_0x6b1b('0x2c')];if(_0x25c09d[_0x6b1b('0x2e')][_0x6b1b('0x3b')]){_0x4bc32e[_0x6b1b('0x3c')]=[{'all':!![]}];}_0x4bc32e=_['merge']({},_0x4bc32e,_0x25c09d['options']);return db[_0x6b1b('0x2a')][_0x6b1b('0x42')](_0x4bc32e)[_0x6b1b('0x22')](handleEntityNotFound(_0x5cbae9,null))['then'](respondWithResult(_0x5cbae9,null))[_0x6b1b('0x3f')](handleError(_0x5cbae9,null));};exports[_0x6b1b('0x43')]=function(_0x1017f6,_0x1bc255){return db[_0x6b1b('0x2a')][_0x6b1b('0x43')](_0x1017f6[_0x6b1b('0x44')],{})[_0x6b1b('0x22')](function(_0x11edc5){var _0x349bf3=_0x1017f6['user'][_0x6b1b('0x45')]({'plain':!![]});if(!_0x349bf3)throw new Error(_0x6b1b('0x46'));if(_0x349bf3[_0x6b1b('0x47')]===_0x6b1b('0x48')){var _0x15eb66=_0x11edc5[_0x6b1b('0x45')]({'plain':!![]});var _0x2c2699=_0x6b1b('0x24');return db[_0x6b1b('0x49')]['find']({'where':{'name':_0x2c2699,'userProfileId':_0x349bf3[_0x6b1b('0x4a')]},'raw':!![]})['then'](function(_0x51001e){if(_0x51001e&&_0x51001e[_0x6b1b('0x4b')]===0x0){return db[_0x6b1b('0x25')][_0x6b1b('0x43')]({'name':_0x15eb66[_0x6b1b('0x27')],'resourceId':_0x15eb66['id'],'type':_0x51001e['name'],'sectionId':_0x51001e['id']},{})[_0x6b1b('0x22')](function(){return _0x11edc5;});}else{return _0x11edc5;}})[_0x6b1b('0x3f')](function(_0x46c0ef){logger[_0x6b1b('0x4c')](_0x6b1b('0x4d'),_0x46c0ef);throw _0x46c0ef;});}return _0x11edc5;})['then'](respondWithResult(_0x1bc255,0xc9))[_0x6b1b('0x3f')](handleError(_0x1bc255,null));};exports[_0x6b1b('0x21')]=function(_0x24ec1d,_0xf09e56){if(_0x24ec1d[_0x6b1b('0x44')]['id']){delete _0x24ec1d[_0x6b1b('0x44')]['id'];}return db[_0x6b1b('0x2a')][_0x6b1b('0x42')]({'where':{'id':_0x24ec1d[_0x6b1b('0x4e')]['id']}})[_0x6b1b('0x22')](handleEntityNotFound(_0xf09e56,null))[_0x6b1b('0x22')](saveUpdates(_0x24ec1d[_0x6b1b('0x44')],null))[_0x6b1b('0x22')](respondWithResult(_0xf09e56,null))[_0x6b1b('0x3f')](handleError(_0xf09e56,null));};exports[_0x6b1b('0x23')]=function(_0x48e1bb,_0x4c9bd5){return db[_0x6b1b('0x2a')]['find']({'where':{'id':_0x48e1bb[_0x6b1b('0x4e')]['id']}})[_0x6b1b('0x22')](handleEntityNotFound(_0x4c9bd5,null))[_0x6b1b('0x22')](removeEntity(_0x4c9bd5,null))[_0x6b1b('0x3f')](handleError(_0x4c9bd5,null));};exports[_0x6b1b('0x2b')]=function(_0x2da7c1,_0x13074a){return db['CmCompany'][_0x6b1b('0x2b')]()[_0x6b1b('0x22')](respondWithResult(_0x13074a,null))[_0x6b1b('0x3f')](handleError(_0x13074a,null));};exports[_0x6b1b('0x4f')]=function(_0x3c8602,_0x5e224a,_0x3e76eb){return db['CmContact'][_0x6b1b('0x42')]({'where':{'id':_0x3c8602[_0x6b1b('0x4e')]['id']}})[_0x6b1b('0x22')](handleEntityNotFound(_0x5e224a,null))['then'](function(_0x359943){if(_0x359943){return _0x359943['addContacts'](_0x3c8602[_0x6b1b('0x44')][_0x6b1b('0x50')],_['omit'](_0x3c8602[_0x6b1b('0x44')],[_0x6b1b('0x50'),'id'])||{});}})['then'](respondWithResult(_0x5e224a,null))['catch'](handleError(_0x5e224a,null));};exports['getContacts']=function(_0x2972a5,_0x3d46df,_0x540dc9){var _0x1e6ac1={};var _0x13add2={};var _0xbc9c6a;var _0x8522b1;return db[_0x6b1b('0x2a')][_0x6b1b('0x51')]({'where':{'id':_0x2972a5[_0x6b1b('0x4e')]['id']}})[_0x6b1b('0x22')](handleEntityNotFound(_0x3d46df,null))[_0x6b1b('0x22')](function(_0x4581a9){if(_0x4581a9){_0xbc9c6a=_0x4581a9;_0x13add2[_0x6b1b('0x2c')]=_['keys'](db['CmContact'][_0x6b1b('0x41')]);_0x13add2['query']=_['keys'](_0x2972a5['query']);_0x13add2[_0x6b1b('0x2f')]=_[_0x6b1b('0x30')](_0x13add2[_0x6b1b('0x2c')],_0x13add2[_0x6b1b('0x2e')]);_0x1e6ac1[_0x6b1b('0x31')]=_[_0x6b1b('0x30')](_0x13add2[_0x6b1b('0x2c')],qs[_0x6b1b('0x32')](_0x2972a5[_0x6b1b('0x2e')][_0x6b1b('0x32')]));_0x1e6ac1[_0x6b1b('0x31')]=_0x1e6ac1[_0x6b1b('0x31')][_0x6b1b('0x33')]?_0x1e6ac1['attributes']:_0x13add2[_0x6b1b('0x2c')];_0x1e6ac1[_0x6b1b('0x52')]=qs['sort'](_0x2972a5[_0x6b1b('0x2e')][_0x6b1b('0x35')]);_0x1e6ac1['where']=qs['filters'](_[_0x6b1b('0x37')](_0x2972a5[_0x6b1b('0x2e')],_0x13add2[_0x6b1b('0x2f')]));if(_0x2972a5[_0x6b1b('0x2e')][_0x6b1b('0x38')]){_0x1e6ac1[_0x6b1b('0x36')]=_[_0x6b1b('0x39')](_0x1e6ac1[_0x6b1b('0x36')],{'$or':_[_0x6b1b('0x53')](_0x1e6ac1[_0x6b1b('0x31')],function(_0x1b6dbd){var _0x278c95={};_0x278c95[_0x1b6dbd]={'$like':'%'+_0x2972a5[_0x6b1b('0x2e')]['filter']+'%'};return _0x278c95;})});}_0x1e6ac1=_[_0x6b1b('0x39')]({},_0x1e6ac1,_0x2972a5['options']);return _0xbc9c6a[_0x6b1b('0x54')](_0x1e6ac1);}})['then'](function(_0x586298){if(_0x586298){_0x8522b1=_0x586298[_0x6b1b('0x33')];if(!_0x2972a5[_0x6b1b('0x2e')][_0x6b1b('0x34')](_0x6b1b('0x55'))){_0x1e6ac1[_0x6b1b('0x1b')]=qs[_0x6b1b('0x1b')](_0x2972a5[_0x6b1b('0x2e')][_0x6b1b('0x1b')]);_0x1e6ac1['offset']=qs[_0x6b1b('0x19')](_0x2972a5[_0x6b1b('0x2e')][_0x6b1b('0x19')]);}return _0xbc9c6a[_0x6b1b('0x54')](_0x1e6ac1);}})[_0x6b1b('0x22')](function(_0x2d5644){if(_0x2d5644){return _0x2d5644?{'count':_0x8522b1,'rows':_0x2d5644}:null;}})[_0x6b1b('0x22')](respondWithResult(_0x3d46df,null))[_0x6b1b('0x3f')](handleError(_0x3d46df,null));};
\ No newline at end of file
+var _0xc8d1=['length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','name','send','index','model','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','map','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc8d1,0x1be));var _0x1c8d=function(_0xd58823,_0x15c483){_0xd58823=_0xd58823-0x0;var _0x249c0a=_0xc8d1[_0xd58823];return _0x249c0a;};'use strict';var emlformat=require(_0x1c8d('0x0'));var rimraf=require(_0x1c8d('0x1'));var zipdir=require(_0x1c8d('0x2'));var jsonpatch=require(_0x1c8d('0x3'));var rp=require('request-promise');var moment=require(_0x1c8d('0x4'));var BPromise=require(_0x1c8d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1c8d('0x6'));var sox=require(_0x1c8d('0x7'));var csv=require(_0x1c8d('0x8'));var ejs=require(_0x1c8d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c8d('0xa'));var squel=require(_0x1c8d('0xb'));var crypto=require(_0x1c8d('0xc'));var jsforce=require(_0x1c8d('0xd'));var deskjs=require(_0x1c8d('0xe'));var toCsv=require(_0x1c8d('0x8'));var querystring=require(_0x1c8d('0xf'));var Papa=require(_0x1c8d('0x10'));var Redis=require(_0x1c8d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1c8d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c8d('0x13'));var logger=require(_0x1c8d('0x14'))('api');var utils=require(_0x1c8d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1c8d('0x16'));var db=require(_0x1c8d('0x17'))['db'];function respondWithStatusCode(_0x2d1896,_0x590ed9){_0x590ed9=_0x590ed9||0xcc;return function(_0x2e969f){if(_0x2e969f){return _0x2d1896[_0x1c8d('0x18')](_0x590ed9);}return _0x2d1896[_0x1c8d('0x19')](_0x590ed9)[_0x1c8d('0x1a')]();};}function respondWithResult(_0x2bd2e6,_0x18ff39){_0x18ff39=_0x18ff39||0xc8;return function(_0x39d3d2){if(_0x39d3d2){return _0x2bd2e6[_0x1c8d('0x19')](_0x18ff39)['json'](_0x39d3d2);}};}function respondWithFilteredResult(_0x57cea5,_0x26ba30){return function(_0x191a18){if(_0x191a18){var _0x22fb9e=typeof _0x26ba30[_0x1c8d('0x1b')]==='undefined'&&typeof _0x26ba30[_0x1c8d('0x1c')]===_0x1c8d('0x1d');var _0x2af311=_0x191a18[_0x1c8d('0x1e')];var _0x4ba9cc=_0x22fb9e?0x0:_0x26ba30[_0x1c8d('0x1b')];var _0x414f04=_0x22fb9e?_0x191a18[_0x1c8d('0x1e')]:_0x26ba30[_0x1c8d('0x1b')]+_0x26ba30[_0x1c8d('0x1c')];var _0x236b6a;if(_0x414f04>=_0x2af311){_0x414f04=_0x2af311;_0x236b6a=0xc8;}else{_0x236b6a=0xce;}_0x57cea5[_0x1c8d('0x19')](_0x236b6a);return _0x57cea5[_0x1c8d('0x1f')](_0x1c8d('0x20'),_0x4ba9cc+'-'+_0x414f04+'/'+_0x2af311)[_0x1c8d('0x21')](_0x191a18);}return null;};}function patchUpdates(_0xd4d598){return function(_0x1c27f2){try{jsonpatch[_0x1c8d('0x22')](_0x1c27f2,_0xd4d598,!![]);}catch(_0xf0ba27){return BPromise[_0x1c8d('0x23')](_0xf0ba27);}return _0x1c27f2[_0x1c8d('0x24')]();};}function saveUpdates(_0x139473,_0x57d0a6){return function(_0x2b25c9){if(_0x2b25c9){return _0x2b25c9[_0x1c8d('0x25')](_0x139473)[_0x1c8d('0x26')](function(_0x4d49ac){return _0x4d49ac;});}return null;};}function removeEntity(_0x1b270e,_0x4df04c){return function(_0xd20043){if(_0xd20043){return _0xd20043[_0x1c8d('0x27')]()[_0x1c8d('0x26')](function(){var _0x4b654e=_0xd20043[_0x1c8d('0x28')]({'plain':!![]});var _0x34a441=_0x1c8d('0x29');return db[_0x1c8d('0x2a')][_0x1c8d('0x27')]({'where':{'type':_0x34a441,'resourceId':_0x4b654e['id']}})[_0x1c8d('0x26')](function(){return _0xd20043;});})[_0x1c8d('0x26')](function(){_0x1b270e[_0x1c8d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55a492,_0x36d7e4){return function(_0x4c3f0c){if(!_0x4c3f0c){_0x55a492[_0x1c8d('0x18')](0x194);}return _0x4c3f0c;};}function handleError(_0x5e6cdc,_0x16b165){_0x16b165=_0x16b165||0x1f4;return function(_0x302e3c){logger[_0x1c8d('0x2b')](_0x302e3c['stack']);if(_0x302e3c[_0x1c8d('0x2c')]){delete _0x302e3c[_0x1c8d('0x2c')];}_0x5e6cdc[_0x1c8d('0x19')](_0x16b165)[_0x1c8d('0x2d')](_0x302e3c);};}exports[_0x1c8d('0x2e')]=function(_0x40500d,_0x15c4cf){var _0x3ae8f6={},_0x5cdcf4={},_0xcf3f32={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x1c8d('0x26')](function(_0x4a196c){_0x5cdcf4[_0x1c8d('0x2f')]=_[_0x1c8d('0x30')](_0x4a196c);_0x5cdcf4['query']=_['keys'](_0x40500d[_0x1c8d('0x31')]);_0x5cdcf4[_0x1c8d('0x32')]=_[_0x1c8d('0x33')](_0x5cdcf4[_0x1c8d('0x2f')],_0x5cdcf4[_0x1c8d('0x31')]);_0x3ae8f6[_0x1c8d('0x34')]=_['intersection'](_0x5cdcf4[_0x1c8d('0x2f')],qs[_0x1c8d('0x35')](_0x40500d[_0x1c8d('0x31')][_0x1c8d('0x35')]));_0x3ae8f6[_0x1c8d('0x34')]=_0x3ae8f6[_0x1c8d('0x34')]['length']?_0x3ae8f6[_0x1c8d('0x34')]:_0x5cdcf4[_0x1c8d('0x2f')];if(!_0x40500d[_0x1c8d('0x31')]['hasOwnProperty']('nolimit')){_0x3ae8f6[_0x1c8d('0x1c')]=qs[_0x1c8d('0x1c')](_0x40500d[_0x1c8d('0x31')][_0x1c8d('0x1c')]);_0x3ae8f6[_0x1c8d('0x1b')]=qs[_0x1c8d('0x1b')](_0x40500d[_0x1c8d('0x31')][_0x1c8d('0x1b')]);}_0x3ae8f6[_0x1c8d('0x36')]=qs['sort'](_0x40500d[_0x1c8d('0x31')][_0x1c8d('0x37')]);_0x3ae8f6[_0x1c8d('0x38')]=qs[_0x1c8d('0x32')](_[_0x1c8d('0x39')](_0x40500d[_0x1c8d('0x31')],_0x5cdcf4[_0x1c8d('0x32')]),_0x4a196c);if(_0x40500d['query'][_0x1c8d('0x3a')]){_0x3ae8f6[_0x1c8d('0x38')]=_[_0x1c8d('0x3b')](_0x3ae8f6[_0x1c8d('0x38')],{'$or':_[_0x1c8d('0x3c')](_0x3ae8f6[_0x1c8d('0x34')],function(_0x38432b){var _0x369bfd={};_0x369bfd[_0x38432b]={'$like':'%'+_0x40500d[_0x1c8d('0x31')][_0x1c8d('0x3a')]+'%'};return _0x369bfd;})});}_0x3ae8f6=_[_0x1c8d('0x3b')]({},_0x3ae8f6,_0x40500d[_0x1c8d('0x3d')]);var _0x5e8583={'where':_0x3ae8f6[_0x1c8d('0x38')]};return db[_0x1c8d('0x3e')]['count'](_0x5e8583)['then'](function(_0x36a2b5){_0xcf3f32[_0x1c8d('0x1e')]=_0x36a2b5;if(_0x40500d['query'][_0x1c8d('0x3f')]){_0x3ae8f6['include']=[{'all':!![]}];}return db[_0x1c8d('0x3e')][_0x1c8d('0x40')](_0x3ae8f6);})[_0x1c8d('0x26')](function(_0x1bf109){_0xcf3f32[_0x1c8d('0x41')]=_0x1bf109;return _0xcf3f32;})[_0x1c8d('0x26')](respondWithFilteredResult(_0x15c4cf,_0x3ae8f6))[_0x1c8d('0x42')](handleError(_0x15c4cf,null));})['catch'](handleError(_0x15c4cf,null));};exports[_0x1c8d('0x43')]=function(_0x2883da,_0x43b57e){var _0x60a647={'raw':![],'where':{'id':_0x2883da[_0x1c8d('0x44')]['id']}},_0x5d9ab1={};_0x5d9ab1[_0x1c8d('0x2f')]=_['keys'](db[_0x1c8d('0x3e')][_0x1c8d('0x45')]);_0x5d9ab1[_0x1c8d('0x31')]=_[_0x1c8d('0x30')](_0x2883da[_0x1c8d('0x31')]);_0x5d9ab1['filters']=_[_0x1c8d('0x33')](_0x5d9ab1['model'],_0x5d9ab1[_0x1c8d('0x31')]);_0x60a647[_0x1c8d('0x34')]=_[_0x1c8d('0x33')](_0x5d9ab1[_0x1c8d('0x2f')],qs['fields'](_0x2883da[_0x1c8d('0x31')]['fields']));_0x60a647[_0x1c8d('0x34')]=_0x60a647[_0x1c8d('0x34')][_0x1c8d('0x46')]?_0x60a647[_0x1c8d('0x34')]:_0x5d9ab1[_0x1c8d('0x2f')];if(_0x2883da[_0x1c8d('0x31')]['includeAll']){_0x60a647['include']=[{'all':!![]}];}_0x60a647=_['merge']({},_0x60a647,_0x2883da[_0x1c8d('0x3d')]);return db[_0x1c8d('0x3e')][_0x1c8d('0x47')](_0x60a647)[_0x1c8d('0x26')](handleEntityNotFound(_0x43b57e,null))[_0x1c8d('0x26')](respondWithResult(_0x43b57e,null))[_0x1c8d('0x42')](handleError(_0x43b57e,null));};exports[_0x1c8d('0x48')]=function(_0x297bb2,_0x448edf){return db['CmCompany'][_0x1c8d('0x48')](_0x297bb2[_0x1c8d('0x49')],{})[_0x1c8d('0x26')](function(_0x40d232){var _0x4b39c0=_0x297bb2['user'][_0x1c8d('0x28')]({'plain':!![]});if(!_0x4b39c0)throw new Error(_0x1c8d('0x4a'));if(_0x4b39c0[_0x1c8d('0x4b')]===_0x1c8d('0x4c')){var _0x532f96=_0x40d232['get']({'plain':!![]});var _0xc682ca=_0x1c8d('0x29');return db[_0x1c8d('0x4d')][_0x1c8d('0x47')]({'where':{'name':_0xc682ca,'userProfileId':_0x4b39c0['userProfileId']},'raw':!![]})[_0x1c8d('0x26')](function(_0x2b36db){if(_0x2b36db&&_0x2b36db[_0x1c8d('0x4e')]===0x0){return db[_0x1c8d('0x2a')]['create']({'name':_0x532f96['name'],'resourceId':_0x532f96['id'],'type':_0x2b36db[_0x1c8d('0x2c')],'sectionId':_0x2b36db['id']},{})['then'](function(){return _0x40d232;});}else{return _0x40d232;}})[_0x1c8d('0x42')](function(_0x4fd872){logger[_0x1c8d('0x2b')](_0x1c8d('0x4f'),_0x4fd872);throw _0x4fd872;});}return _0x40d232;})[_0x1c8d('0x26')](respondWithResult(_0x448edf,0xc9))[_0x1c8d('0x42')](handleError(_0x448edf,null));};exports[_0x1c8d('0x25')]=function(_0x559d56,_0x2bbb24){if(_0x559d56['body']['id']){delete _0x559d56[_0x1c8d('0x49')]['id'];}return db[_0x1c8d('0x3e')][_0x1c8d('0x47')]({'where':{'id':_0x559d56[_0x1c8d('0x44')]['id']}})[_0x1c8d('0x26')](handleEntityNotFound(_0x2bbb24,null))[_0x1c8d('0x26')](saveUpdates(_0x559d56['body'],null))['then'](respondWithResult(_0x2bbb24,null))[_0x1c8d('0x42')](handleError(_0x2bbb24,null));};exports['destroy']=function(_0x2fea6c,_0x3879bc){return db[_0x1c8d('0x3e')][_0x1c8d('0x47')]({'where':{'id':_0x2fea6c[_0x1c8d('0x44')]['id']}})[_0x1c8d('0x26')](handleEntityNotFound(_0x3879bc,null))['then'](removeEntity(_0x3879bc,null))[_0x1c8d('0x42')](handleError(_0x3879bc,null));};exports[_0x1c8d('0x50')]=function(_0xca8034,_0x1a36a6){return db[_0x1c8d('0x3e')][_0x1c8d('0x50')]()[_0x1c8d('0x26')](respondWithResult(_0x1a36a6,null))['catch'](handleError(_0x1a36a6,null));};exports[_0x1c8d('0x51')]=function(_0x41576c,_0x4f983c,_0x2d3eb9){return db[_0x1c8d('0x52')][_0x1c8d('0x47')]({'where':{'id':_0x41576c[_0x1c8d('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f983c,null))['then'](function(_0x23f007){if(_0x23f007){return _0x23f007[_0x1c8d('0x51')](_0x41576c[_0x1c8d('0x49')][_0x1c8d('0x53')],_['omit'](_0x41576c[_0x1c8d('0x49')],[_0x1c8d('0x53'),'id'])||{});}})['then'](respondWithResult(_0x4f983c,null))[_0x1c8d('0x42')](handleError(_0x4f983c,null));};exports[_0x1c8d('0x54')]=function(_0x20d8e7,_0x5db5a8,_0x28a951){var _0x4c540b={};var _0x2a5903={};var _0x4903fc;var _0x23239a;return db[_0x1c8d('0x3e')]['findOne']({'where':{'id':_0x20d8e7[_0x1c8d('0x44')]['id']}})[_0x1c8d('0x26')](handleEntityNotFound(_0x5db5a8,null))[_0x1c8d('0x26')](function(_0x133f91){if(_0x133f91){_0x4903fc=_0x133f91;_0x2a5903[_0x1c8d('0x2f')]=_[_0x1c8d('0x30')](db[_0x1c8d('0x52')][_0x1c8d('0x45')]);_0x2a5903[_0x1c8d('0x31')]=_[_0x1c8d('0x30')](_0x20d8e7[_0x1c8d('0x31')]);_0x2a5903[_0x1c8d('0x32')]=_[_0x1c8d('0x33')](_0x2a5903[_0x1c8d('0x2f')],_0x2a5903[_0x1c8d('0x31')]);_0x4c540b[_0x1c8d('0x34')]=_[_0x1c8d('0x33')](_0x2a5903[_0x1c8d('0x2f')],qs['fields'](_0x20d8e7[_0x1c8d('0x31')]['fields']));_0x4c540b[_0x1c8d('0x34')]=_0x4c540b['attributes']['length']?_0x4c540b[_0x1c8d('0x34')]:_0x2a5903[_0x1c8d('0x2f')];_0x4c540b[_0x1c8d('0x36')]=qs[_0x1c8d('0x37')](_0x20d8e7[_0x1c8d('0x31')][_0x1c8d('0x37')]);_0x4c540b['where']=qs[_0x1c8d('0x32')](_[_0x1c8d('0x39')](_0x20d8e7['query'],_0x2a5903['filters']));if(_0x20d8e7['query']['filter']){_0x4c540b['where']=_['merge'](_0x4c540b[_0x1c8d('0x38')],{'$or':_[_0x1c8d('0x3c')](_0x4c540b[_0x1c8d('0x34')],function(_0x46c3a8){var _0x217348={};_0x217348[_0x46c3a8]={'$like':'%'+_0x20d8e7[_0x1c8d('0x31')][_0x1c8d('0x3a')]+'%'};return _0x217348;})});}_0x4c540b=_[_0x1c8d('0x3b')]({},_0x4c540b,_0x20d8e7[_0x1c8d('0x3d')]);return _0x4903fc[_0x1c8d('0x54')](_0x4c540b);}})[_0x1c8d('0x26')](function(_0x3ef960){if(_0x3ef960){_0x23239a=_0x3ef960[_0x1c8d('0x46')];if(!_0x20d8e7[_0x1c8d('0x31')][_0x1c8d('0x55')]('nolimit')){_0x4c540b[_0x1c8d('0x1c')]=qs['limit'](_0x20d8e7[_0x1c8d('0x31')][_0x1c8d('0x1c')]);_0x4c540b[_0x1c8d('0x1b')]=qs[_0x1c8d('0x1b')](_0x20d8e7[_0x1c8d('0x31')]['offset']);}return _0x4903fc[_0x1c8d('0x54')](_0x4c540b);}})[_0x1c8d('0x26')](function(_0x54bed2){if(_0x54bed2){return _0x54bed2?{'count':_0x23239a,'rows':_0x54bed2}:null;}})[_0x1c8d('0x26')](respondWithResult(_0x5db5a8,null))[_0x1c8d('0x42')](handleError(_0x5db5a8,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 4b8dd11..5a1ec55 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 _0x2bc3=['CmCompany','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x162766,_0x5b8655){var _0x404a17=function(_0x33521d){while(--_0x33521d){_0x162766['push'](_0x162766['shift']());}};_0x404a17(++_0x5b8655);}(_0x2bc3,0x1ae));var _0x32bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bc3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32bc('0x0'));var util=require(_0x32bc('0x1'));var logger=require(_0x32bc('0x2'))(_0x32bc('0x3'));var moment=require(_0x32bc('0x4'));var BPromise=require(_0x32bc('0x5'));var rp=require(_0x32bc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32bc('0x7'));var config=require(_0x32bc('0x8'));var attributes=require(_0x32bc('0x9'));module[_0x32bc('0xa')]=function(_0x2c8ca5,_0xf64c6){return _0x2c8ca5[_0x32bc('0xb')](_0x32bc('0xc'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb8a3=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0xb8a3,0x125));var _0x3b8a=function(_0x876501,_0x2edd2d){_0x876501=_0x876501-0x0;var _0x1b9799=_0xb8a3[_0x876501];return _0x1b9799;};'use strict';var _=require(_0x3b8a('0x0'));var util=require('util');var logger=require(_0x3b8a('0x1'))(_0x3b8a('0x2'));var moment=require(_0x3b8a('0x3'));var BPromise=require(_0x3b8a('0x4'));var rp=require(_0x3b8a('0x5'));var fs=require('fs');var path=require(_0x3b8a('0x6'));var rimraf=require(_0x3b8a('0x7'));var config=require(_0x3b8a('0x8'));var attributes=require(_0x3b8a('0x9'));module['exports']=function(_0x13bbbe,_0xb1a42d){return _0x13bbbe[_0x3b8a('0xa')](_0x3b8a('0xb'),attributes,{'tableName':_0x3b8a('0xc'),'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 27a1f55..a71cc8d 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 _0x868a=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x275ceb,_0x3425af){var _0x5c3d03=function(_0xc04f34){while(--_0xc04f34){_0x275ceb['push'](_0x275ceb['shift']());}};_0x5c3d03(++_0x3425af);}(_0x868a,0xf7));var _0xa868=function(_0x49f5e6,_0x7d189e){_0x49f5e6=_0x49f5e6-0x0;var _0x14195f=_0x868a[_0x49f5e6];return _0x14195f;};'use strict';var _=require(_0xa868('0x0'));var util=require(_0xa868('0x1'));var moment=require(_0xa868('0x2'));var BPromise=require(_0xa868('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa868('0x4'));var db=require(_0xa868('0x5'))['db'];var utils=require(_0xa868('0x6'));var logger=require(_0xa868('0x7'))('rpc');var config=require(_0xa868('0x8'));var jayson=require(_0xa868('0x9'));var client=jayson[_0xa868('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x95b93c,_0x5bb8d6,_0x1029b8){return new BPromise(function(_0x580bed,_0x26f856){return client['request'](_0x95b93c,_0x1029b8)[_0xa868('0xb')](function(_0x34be01){logger['info'](_0xa868('0xc'),_0x5bb8d6,'request\x20sent');logger['debug'](_0xa868('0xd'),_0x5bb8d6,'request\x20sent',JSON[_0xa868('0xe')](_0x34be01));if(_0x34be01[_0xa868('0xf')]){if(_0x34be01[_0xa868('0xf')][_0xa868('0x10')]===0x1f4){logger['error'](_0xa868('0xc'),_0x5bb8d6,_0x34be01[_0xa868('0xf')]['message']);return _0x26f856(_0x34be01['error']['message']);}logger[_0xa868('0xf')](_0xa868('0xc'),_0x5bb8d6,_0x34be01[_0xa868('0xf')][_0xa868('0x11')]);return _0x580bed(_0x34be01[_0xa868('0xf')][_0xa868('0x11')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x5bb8d6,_0xa868('0x12'));_0x580bed(_0x34be01[_0xa868('0x13')][_0xa868('0x11')]);}})[_0xa868('0x14')](function(_0x1ab6d8){logger['error'](_0xa868('0xc'),_0x5bb8d6,_0x1ab6d8);_0x26f856(_0x1ab6d8);});});}
\ No newline at end of file
+var _0x48a0=['jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment'];(function(_0xbcd76,_0x1c1d1d){var _0x5d1109=function(_0x29102f){while(--_0x29102f){_0xbcd76['push'](_0xbcd76['shift']());}};_0x5d1109(++_0x1c1d1d);}(_0x48a0,0x189));var _0x048a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x48a0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x048a('0x0'));var util=require(_0x048a('0x1'));var moment=require(_0x048a('0x2'));var BPromise=require(_0x048a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x048a('0x4'));var db=require(_0x048a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x048a('0x6'));var jayson=require(_0x048a('0x7'));var client=jayson['client'][_0x048a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9759a4,_0x4938bc,_0x1952c4){return new BPromise(function(_0x3cad03,_0x35dc17){return client['request'](_0x9759a4,_0x1952c4)[_0x048a('0x9')](function(_0x89b13e){logger[_0x048a('0xa')](_0x048a('0xb'),_0x4938bc,_0x048a('0xc'));logger['debug'](_0x048a('0xd'),_0x4938bc,'request\x20sent',JSON[_0x048a('0xe')](_0x89b13e));if(_0x89b13e[_0x048a('0xf')]){if(_0x89b13e[_0x048a('0xf')][_0x048a('0x10')]===0x1f4){logger[_0x048a('0xf')]('CmCompany,\x20%s,\x20%s',_0x4938bc,_0x89b13e[_0x048a('0xf')]['message']);return _0x35dc17(_0x89b13e[_0x048a('0xf')][_0x048a('0x11')]);}logger[_0x048a('0xf')](_0x048a('0xb'),_0x4938bc,_0x89b13e['error'][_0x048a('0x11')]);return _0x3cad03(_0x89b13e['error'][_0x048a('0x11')]);}else{logger[_0x048a('0xa')](_0x048a('0xb'),_0x4938bc,_0x048a('0xc'));_0x3cad03(_0x89b13e[_0x048a('0x12')]['message']);}})[_0x048a('0x13')](function(_0x4a6963){logger[_0x048a('0xf')]('CmCompany,\x20%s,\x20%s',_0x4938bc,_0x4a6963);_0x35dc17(_0x4a6963);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index a091bfd..7dbcdf4 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 _0x6126=['index','/describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated'];(function(_0xf0334b,_0x4151fe){var _0x6d41ac=function(_0x1708e6){while(--_0x1708e6){_0xf0334b['push'](_0xf0334b['shift']());}};_0x6d41ac(++_0x4151fe);}(_0x6126,0x186));var _0x6612=function(_0x11f1fd,_0xce95a8){_0x11f1fd=_0x11f1fd-0x0;var _0x2d1215=_0x6126[_0x11f1fd];return _0x2d1215;};'use strict';var multer=require('multer');var util=require(_0x6612('0x0'));var path=require('path');var timeout=require(_0x6612('0x1'));var express=require(_0x6612('0x2'));var router=express[_0x6612('0x3')]();var fs_extra=require(_0x6612('0x4'));var auth=require(_0x6612('0x5'));var interaction=require(_0x6612('0x6'));var config=require('../../config/environment');var controller=require(_0x6612('0x7'));router[_0x6612('0x8')]('/',auth[_0x6612('0x9')](),controller[_0x6612('0xa')]);router['get'](_0x6612('0xb'),auth[_0x6612('0x9')](),controller['describe']);router[_0x6612('0x8')](_0x6612('0xc'),auth['isAuthenticated'](),controller[_0x6612('0xd')]);router[_0x6612('0x8')](_0x6612('0xe'),auth[_0x6612('0x9')](),controller[_0x6612('0xf')]);router[_0x6612('0x10')]('/',auth['isAuthenticated'](),controller[_0x6612('0x11')]);router[_0x6612('0x10')](_0x6612('0xe'),auth[_0x6612('0x9')](),controller[_0x6612('0x12')]);router['put']('/:id',auth[_0x6612('0x9')](),controller[_0x6612('0x13')]);router['delete'](_0x6612('0xc'),auth[_0x6612('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa4a4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','describe','/:id','show','/:id/contacts','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x20d152,_0x28c92f){var _0x5e9682=function(_0x1b4dd3){while(--_0x1b4dd3){_0x20d152['push'](_0x20d152['shift']());}};_0x5e9682(++_0x28c92f);}(_0xa4a4,0x1b3));var _0x4a4a=function(_0xeb26d1,_0x301de1){_0xeb26d1=_0xeb26d1-0x0;var _0x4a4e2e=_0xa4a4[_0xeb26d1];return _0x4a4e2e;};'use strict';var multer=require(_0x4a4a('0x0'));var util=require(_0x4a4a('0x1'));var path=require('path');var timeout=require(_0x4a4a('0x2'));var express=require(_0x4a4a('0x3'));var router=express[_0x4a4a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4a4a('0x5'));var interaction=require(_0x4a4a('0x6'));var config=require(_0x4a4a('0x7'));var controller=require(_0x4a4a('0x8'));router[_0x4a4a('0x9')]('/',auth[_0x4a4a('0xa')](),controller['index']);router[_0x4a4a('0x9')]('/describe',auth[_0x4a4a('0xa')](),controller[_0x4a4a('0xb')]);router[_0x4a4a('0x9')](_0x4a4a('0xc'),auth[_0x4a4a('0xa')](),controller[_0x4a4a('0xd')]);router['get'](_0x4a4a('0xe'),auth['isAuthenticated'](),controller['getContacts']);router[_0x4a4a('0xf')]('/',auth[_0x4a4a('0xa')](),controller[_0x4a4a('0x10')]);router[_0x4a4a('0xf')](_0x4a4a('0xe'),auth[_0x4a4a('0xa')](),controller['addContacts']);router[_0x4a4a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x4a4a('0x12')]);router[_0x4a4a('0x13')](_0x4a4a('0xc'),auth[_0x4a4a('0xa')](),controller[_0x4a4a('0x14')]);module[_0x4a4a('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index cdf666c..ef5083e 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 _0x5500=['INTEGER','UNSIGNED','NOW','lodash','sequelize','STRING'];(function(_0x9a9525,_0x62cee7){var _0x244963=function(_0x1df29c){while(--_0x1df29c){_0x9a9525['push'](_0x9a9525['shift']());}};_0x244963(++_0x62cee7);}(_0x5500,0xcf));var _0x0550=function(_0x36d7a7,_0x59eb23){_0x36d7a7=_0x36d7a7-0x0;var _0x1805e1=_0x5500[_0x36d7a7];return _0x1805e1;};'use strict';var _=require(_0x0550('0x0'));var Sequelize=require(_0x0550('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x0550('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0550('0x2')]},'street':{'type':Sequelize[_0x0550('0x2')]},'postalCode':{'type':Sequelize[_0x0550('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0550('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x0550('0x2')]},'mobile':{'type':Sequelize[_0x0550('0x2')]},'fax':{'type':Sequelize[_0x0550('0x2')]},'email':{'type':Sequelize[_0x0550('0x2')]},'url':{'type':Sequelize[_0x0550('0x2')]},'facebook':{'type':Sequelize[_0x0550('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0550('0x2')]},'skype':{'type':Sequelize[_0x0550('0x2')]},'teams':{'type':Sequelize[_0x0550('0x2')]},'viber':{'type':Sequelize[_0x0550('0x2')]},'line':{'type':Sequelize[_0x0550('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x0550('0x2')]},'UserId':{'type':Sequelize[_0x0550('0x3')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0550('0x3')](0x2)[_0x0550('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x0550('0x5')]},'dialTimezone':{'type':Sequelize[_0x0550('0x2')]},'utcOffset':{'type':Sequelize[_0x0550('0x3')]}};
\ No newline at end of file
+var _0xc413=['INTEGER','DATE','NOW','sequelize','exports','STRING','TEXT'];(function(_0x25f277,_0x225b1d){var _0x5f4384=function(_0x1dbc08){while(--_0x1dbc08){_0x25f277['push'](_0x25f277['shift']());}};_0x5f4384(++_0x225b1d);}(_0xc413,0xe3));var _0x3c41=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc413[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var Sequelize=require(_0x3c41('0x0'));module[_0x3c41('0x1')]={'firstName':{'type':Sequelize[_0x3c41('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3c41('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3c41('0x2')]},'city':{'type':Sequelize[_0x3c41('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x3c41('0x2')]},'description':{'type':Sequelize[_0x3c41('0x3')]},'phone':{'type':Sequelize[_0x3c41('0x2')]},'mobile':{'type':Sequelize[_0x3c41('0x2')]},'fax':{'type':Sequelize[_0x3c41('0x2')]},'email':{'type':Sequelize[_0x3c41('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x3c41('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x3c41('0x2')]},'skype':{'type':Sequelize[_0x3c41('0x2')]},'teams':{'type':Sequelize[_0x3c41('0x2')]},'viber':{'type':Sequelize[_0x3c41('0x2')]},'line':{'type':Sequelize[_0x3c41('0x2')]},'wechat':{'type':Sequelize[_0x3c41('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x3c41('0x2')]},'priority':{'type':Sequelize[_0x3c41('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3c41('0x5')],'defaultValue':Sequelize[_0x3c41('0x6')]},'dialTimezone':{'type':Sequelize[_0x3c41('0x2')]},'utcOffset':{'type':Sequelize[_0x3c41('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 3d49555..fcd2fc7 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','toString','base64','lodash','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','name','length','join'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6553,0x7b));var _0x3655=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6553[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x3655('0x0'));var moment=require('moment');var random=require(_0x3655('0x1'));var fs=require('fs');var path=require(_0x3655('0x2'));var util=require('util');var tnef=require(_0x3655('0x3'));var logger=require(_0x3655('0x4'))(_0x3655('0x5'));var config=require(_0x3655('0x6'));function getAddress(_0x564345){var _0x4dd13c=_[_0x3655('0x7')](_0x564345[_0x3655('0x8')]);return _0x4dd13c&&_0x4dd13c[_0x3655('0x9')]?_0x4dd13c[_0x3655('0x9')]:_0x3655('0xa')+random[_0x3655('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x3322da){var _0x46bdcf=_[_0x3655('0x7')](_0x3322da[_0x3655('0x8')]);if(_0x46bdcf&&_0x46bdcf[_0x3655('0xc')]){if(_0x46bdcf[_0x3655('0xc')]==_0x46bdcf['address']){return _0x46bdcf['name']['substring'](0x0,_0x46bdcf[_0x3655('0xc')]['indexOf']('@'));}var _0x28eb6f=_0x46bdcf[_0x3655('0xc')]['split'](/\s+/);return _0x28eb6f[_0x3655('0xd')]>0x1?_0x28eb6f['slice'](0x0,-0x1)[_0x3655('0xe')]('\x20'):_0x46bdcf[_0x3655('0xc')];}return _0x3655('0xf');}function getLastName(_0x43b69b){var _0x192549=_[_0x3655('0x7')](_0x43b69b[_0x3655('0x8')]);if(_0x192549&&_0x192549[_0x3655('0xc')]){var _0x388827=_0x192549['name'][_0x3655('0x10')](/\s+/);return _0x388827[_0x3655('0xd')]>0x1?_0x388827['pop']():'';}return'';}function getMails(_0xbebeb1,_0x34a65d){var _0x1d3899='';for(var _0x4d3a3e=0x0;_0x4d3a3e<_0x34a65d[_0x3655('0x8')][_0x3655('0xd')];_0x4d3a3e+=0x1){if(_0x34a65d[_0x3655('0x8')][_0x4d3a3e][_0x3655('0x9')]!==_0xbebeb1){if(!_[_0x3655('0x11')](_0x1d3899)){_0x1d3899+=',';}_0x1d3899+=_0x34a65d[_0x3655('0x8')][_0x4d3a3e][_0x3655('0xc')]||_0x34a65d[_0x3655('0x8')][_0x4d3a3e][_0x3655('0x9')]||'';_0x1d3899+='\x20<';_0x1d3899+=_0x34a65d[_0x3655('0x8')][_0x4d3a3e][_0x3655('0x9')]?_0x34a65d[_0x3655('0x8')][_0x4d3a3e][_0x3655('0x9')]:_0x3655('0xa')+random['generate'](0x6)+_0x3655('0x12');_0x1d3899+='>';}}return _0x1d3899;}function parseEmail(_0x39f668,_0x2851ed,_0x18b076){if(_0x2851ed['html']){var _0x2e0e21=/