From 2f467a0e1318d215d9d71c62729797b12605d836 Mon Sep 17 00:00:00 2001
From: support
Date: Fri, 25 Mar 2022 10:54:08 +0000
Subject: [PATCH] Built motion from commit 85f7de3e.|2.6.7
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
server/api/client-side-logs.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.oauth.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/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/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/cloud-provider.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/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/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/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/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
1189 files changed, 1189 insertions(+), 1189 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 998f392..1f7df51 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-03-25T10:20:45.080Z",
+ "time": "2022-03-25T10:46:05.594Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index f63628a..347e9ea 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-25T10:20:45.080Z",
+ "time": "2022-03-25T10:46:05.594Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 18c2667..a3c7632 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 _0xcefd=['urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xcefd,0x1e1));var _0xdcef=function(_0x3333bb,_0x1df222){_0x3333bb=_0x3333bb-0x0;var _0x273d39=_0xcefd[_0x3333bb];return _0x273d39;};'use strict';var Sequelize=require(_0xdcef('0x0'));module[_0xdcef('0x1')]={'name':{'type':Sequelize[_0xdcef('0x2')],'get':function(_0x2c0f36){return this[_0xdcef('0x3')](_0xdcef('0x4'));}},'action':{'type':Sequelize[_0xdcef('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xdcef('0x6'),'integration',_0xdcef('0x7'),_0xdcef('0x8'),_0xdcef('0x9'),_0xdcef('0xa'),'bot','script']],'msg':_0xdcef('0xb')}},'comment':_0xdcef('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[_0xdcef('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xdcef('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xdcef('0x5')](0x1000),'comments':_0xdcef('0xc')},'data5':{'type':Sequelize[_0xdcef('0x5')](0x1000),'comments':_0xdcef('0xd')},'data6':{'type':Sequelize[_0xdcef('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xdcef('0xe')],'comments':_0xdcef('0xf')}};
\ No newline at end of file
+var _0x5495=['urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','urlForward','browser','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[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5495,0x6d));var _0x5549=function(_0x4fe535,_0x567cf2){_0x4fe535=_0x4fe535-0x0;var _0x912b77=_0x5495[_0x4fe535];return _0x912b77;};'use strict';var Sequelize=require('sequelize');module[_0x5549('0x0')]={'name':{'type':Sequelize[_0x5549('0x1')],'get':function(_0x8f7d31){return this[_0x5549('0x2')](_0x5549('0x3'));}},'action':{'type':Sequelize[_0x5549('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5549('0x5'),'integration',_0x5549('0x6'),'jscripty',_0x5549('0x7'),_0x5549('0x8'),'bot',_0x5549('0x9')]],'msg':_0x5549('0xa')}},'comment':_0x5549('0xa')},'data1':{'type':Sequelize[_0x5549('0x4')](0x1000),'comment':_0x5549('0xb')},'data2':{'type':Sequelize[_0x5549('0x4')](0x1000),'comment':_0x5549('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x5549('0xd')},'data4':{'type':Sequelize[_0x5549('0x4')](0x1000),'comments':_0x5549('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x5549('0x4')],'comments':_0x5549('0xf')},'data7':{'type':Sequelize[_0x5549('0x10')],'comments':_0x5549('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 6e2015c..59b5d05 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 _0x67a4=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','end','stack','name','send','body','Action','find','params','catch','eml-format'];(function(_0x388550,_0x3fd74b){var _0x735860=function(_0x50783c){while(--_0x50783c){_0x388550['push'](_0x388550['shift']());}};_0x735860(++_0x3fd74b);}(_0x67a4,0x141));var _0x467a=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x67a4[_0x15d18f];return _0xd12bf7;};'use strict';var emlformat=require(_0x467a('0x0'));var rimraf=require(_0x467a('0x1'));var zipdir=require(_0x467a('0x2'));var jsonpatch=require(_0x467a('0x3'));var rp=require(_0x467a('0x4'));var moment=require(_0x467a('0x5'));var BPromise=require(_0x467a('0x6'));var Mustache=require(_0x467a('0x7'));var util=require(_0x467a('0x8'));var path=require(_0x467a('0x9'));var sox=require(_0x467a('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x467a('0xb'));var _=require('lodash');var squel=require(_0x467a('0xc'));var crypto=require(_0x467a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x467a('0xe'));var toCsv=require(_0x467a('0xf'));var querystring=require(_0x467a('0x10'));var Papa=require(_0x467a('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x467a('0x12'));var as=require(_0x467a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x467a('0x14'))(_0x467a('0x15'));var utils=require('../../config/utils');var config=require(_0x467a('0x16'));var licenseUtil=require(_0x467a('0x17'));var db=require(_0x467a('0x18'))['db'];function respondWithStatusCode(_0x3464e9,_0x43e280){_0x43e280=_0x43e280||0xcc;return function(_0x8a5bc8){if(_0x8a5bc8){return _0x3464e9[_0x467a('0x19')](_0x43e280);}return _0x3464e9[_0x467a('0x1a')](_0x43e280)['end']();};}function respondWithResult(_0x289312,_0x52221b){_0x52221b=_0x52221b||0xc8;return function(_0x105392){if(_0x105392){return _0x289312[_0x467a('0x1a')](_0x52221b)['json'](_0x105392);}};}function respondWithFilteredResult(_0x498f4c,_0x4920d7){return function(_0x4e9f44){if(_0x4e9f44){var _0x198d21=typeof _0x4920d7['offset']==='undefined'&&typeof _0x4920d7[_0x467a('0x1b')]===_0x467a('0x1c');var _0x1f626f=_0x4e9f44[_0x467a('0x1d')];var _0x48ba0c=_0x198d21?0x0:_0x4920d7[_0x467a('0x1e')];var _0x3898e8=_0x198d21?_0x4e9f44[_0x467a('0x1d')]:_0x4920d7[_0x467a('0x1e')]+_0x4920d7[_0x467a('0x1b')];var _0x238e89;if(_0x3898e8>=_0x1f626f){_0x3898e8=_0x1f626f;_0x238e89=0xc8;}else{_0x238e89=0xce;}_0x498f4c[_0x467a('0x1a')](_0x238e89);return _0x498f4c['set'](_0x467a('0x1f'),_0x48ba0c+'-'+_0x3898e8+'/'+_0x1f626f)['json'](_0x4e9f44);}return null;};}function patchUpdates(_0x25e997){return function(_0xd40754){try{jsonpatch['apply'](_0xd40754,_0x25e997,!![]);}catch(_0x58b98c){return BPromise[_0x467a('0x20')](_0x58b98c);}return _0xd40754[_0x467a('0x21')]();};}function saveUpdates(_0x31f2b3,_0x292b53){return function(_0x2d6f7a){if(_0x2d6f7a){return _0x2d6f7a[_0x467a('0x22')](_0x31f2b3)[_0x467a('0x23')](function(_0x280be4){return _0x280be4;});}return null;};}function removeEntity(_0x33e8d0,_0x54a88a){return function(_0x4d70b4){if(_0x4d70b4){return _0x4d70b4[_0x467a('0x24')]()['then'](function(){_0x33e8d0['status'](0xcc)[_0x467a('0x25')]();});}};}function handleEntityNotFound(_0x3d6dd1,_0x28dd19){return function(_0xff2f){if(!_0xff2f){_0x3d6dd1[_0x467a('0x19')](0x194);}return _0xff2f;};}function handleError(_0x52db3c,_0x19b1f9){_0x19b1f9=_0x19b1f9||0x1f4;return function(_0x3c4fac){logger['error'](_0x3c4fac[_0x467a('0x26')]);if(_0x3c4fac[_0x467a('0x27')]){delete _0x3c4fac[_0x467a('0x27')];}_0x52db3c[_0x467a('0x1a')](_0x19b1f9)[_0x467a('0x28')](_0x3c4fac);};}exports[_0x467a('0x22')]=function(_0x4be1f4,_0xb8ef06){if(_0x4be1f4[_0x467a('0x29')]['id']){delete _0x4be1f4[_0x467a('0x29')]['id'];}return db[_0x467a('0x2a')][_0x467a('0x2b')]({'where':{'id':_0x4be1f4[_0x467a('0x2c')]['id']}})['then'](handleEntityNotFound(_0xb8ef06,null))[_0x467a('0x23')](saveUpdates(_0x4be1f4[_0x467a('0x29')],null))[_0x467a('0x23')](respondWithResult(_0xb8ef06,null))[_0x467a('0x2d')](handleError(_0xb8ef06,null));};exports['destroy']=function(_0x433735,_0x4dbe8f){return db[_0x467a('0x2a')][_0x467a('0x2b')]({'where':{'id':_0x433735['params']['id']}})[_0x467a('0x23')](handleEntityNotFound(_0x4dbe8f,null))[_0x467a('0x23')](removeEntity(_0x4dbe8f,null))[_0x467a('0x2d')](handleError(_0x4dbe8f,null));};
\ No newline at end of file
+var _0xfdf5=['count','reject','save','then','destroy','error','stack','name','send','update','body','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x45ed49,_0x73e49){var _0x259eb3=function(_0x1429ee){while(--_0x1429ee){_0x45ed49['push'](_0x45ed49['shift']());}};_0x259eb3(++_0x73e49);}(_0xfdf5,0x173));var _0x5fdf=function(_0x2865b0,_0x56c0b8){_0x2865b0=_0x2865b0-0x0;var _0x17d419=_0xfdf5[_0x2865b0];return _0x17d419;};'use strict';var emlformat=require(_0x5fdf('0x0'));var rimraf=require(_0x5fdf('0x1'));var zipdir=require(_0x5fdf('0x2'));var jsonpatch=require(_0x5fdf('0x3'));var rp=require(_0x5fdf('0x4'));var moment=require(_0x5fdf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5fdf('0x6'));var util=require(_0x5fdf('0x7'));var path=require('path');var sox=require(_0x5fdf('0x8'));var csv=require(_0x5fdf('0x9'));var ejs=require(_0x5fdf('0xa'));var fs=require('fs');var fs_extra=require(_0x5fdf('0xb'));var _=require(_0x5fdf('0xc'));var squel=require(_0x5fdf('0xd'));var crypto=require(_0x5fdf('0xe'));var jsforce=require(_0x5fdf('0xf'));var deskjs=require(_0x5fdf('0x10'));var toCsv=require(_0x5fdf('0x9'));var querystring=require(_0x5fdf('0x11'));var Papa=require(_0x5fdf('0x12'));var Redis=require(_0x5fdf('0x13'));var authService=require(_0x5fdf('0x14'));var qs=require(_0x5fdf('0x15'));var as=require(_0x5fdf('0x16'));var hardwareService=require(_0x5fdf('0x17'));var logger=require(_0x5fdf('0x18'))(_0x5fdf('0x19'));var utils=require(_0x5fdf('0x1a'));var config=require(_0x5fdf('0x1b'));var licenseUtil=require(_0x5fdf('0x1c'));var db=require(_0x5fdf('0x1d'))['db'];function respondWithStatusCode(_0x13c354,_0x2c15ae){_0x2c15ae=_0x2c15ae||0xcc;return function(_0x39a60d){if(_0x39a60d){return _0x13c354[_0x5fdf('0x1e')](_0x2c15ae);}return _0x13c354[_0x5fdf('0x1f')](_0x2c15ae)[_0x5fdf('0x20')]();};}function respondWithResult(_0x8447f,_0x5288bd){_0x5288bd=_0x5288bd||0xc8;return function(_0x11c9a0){if(_0x11c9a0){return _0x8447f[_0x5fdf('0x1f')](_0x5288bd)[_0x5fdf('0x21')](_0x11c9a0);}};}function respondWithFilteredResult(_0x20fbc4,_0x3e9d33){return function(_0x3a7417){if(_0x3a7417){var _0x1ce0e6=typeof _0x3e9d33[_0x5fdf('0x22')]===_0x5fdf('0x23')&&typeof _0x3e9d33[_0x5fdf('0x24')]===_0x5fdf('0x23');var _0xf84e07=_0x3a7417[_0x5fdf('0x25')];var _0x25df90=_0x1ce0e6?0x0:_0x3e9d33[_0x5fdf('0x22')];var _0x5dde32=_0x1ce0e6?_0x3a7417['count']:_0x3e9d33[_0x5fdf('0x22')]+_0x3e9d33['limit'];var _0x54f9b8;if(_0x5dde32>=_0xf84e07){_0x5dde32=_0xf84e07;_0x54f9b8=0xc8;}else{_0x54f9b8=0xce;}_0x20fbc4[_0x5fdf('0x1f')](_0x54f9b8);return _0x20fbc4['set']('Content-Range',_0x25df90+'-'+_0x5dde32+'/'+_0xf84e07)[_0x5fdf('0x21')](_0x3a7417);}return null;};}function patchUpdates(_0x67d2c5){return function(_0x3de7a1){try{jsonpatch['apply'](_0x3de7a1,_0x67d2c5,!![]);}catch(_0x38d09a){return BPromise[_0x5fdf('0x26')](_0x38d09a);}return _0x3de7a1[_0x5fdf('0x27')]();};}function saveUpdates(_0x18f8ea,_0x5d6ce4){return function(_0x1d566){if(_0x1d566){return _0x1d566['update'](_0x18f8ea)[_0x5fdf('0x28')](function(_0x5aeb8f){return _0x5aeb8f;});}return null;};}function removeEntity(_0x395486,_0x365cb2){return function(_0x4e6e96){if(_0x4e6e96){return _0x4e6e96[_0x5fdf('0x29')]()[_0x5fdf('0x28')](function(){_0x395486['status'](0xcc)[_0x5fdf('0x20')]();});}};}function handleEntityNotFound(_0x129889,_0xf953a3){return function(_0x30a889){if(!_0x30a889){_0x129889[_0x5fdf('0x1e')](0x194);}return _0x30a889;};}function handleError(_0x2eb4b9,_0x213f8a){_0x213f8a=_0x213f8a||0x1f4;return function(_0x2cde3a){logger[_0x5fdf('0x2a')](_0x2cde3a[_0x5fdf('0x2b')]);if(_0x2cde3a['name']){delete _0x2cde3a[_0x5fdf('0x2c')];}_0x2eb4b9[_0x5fdf('0x1f')](_0x213f8a)[_0x5fdf('0x2d')](_0x2cde3a);};}exports[_0x5fdf('0x2e')]=function(_0x37882b,_0x499350){if(_0x37882b['body']['id']){delete _0x37882b[_0x5fdf('0x2f')]['id'];}return db['Action'][_0x5fdf('0x30')]({'where':{'id':_0x37882b['params']['id']}})[_0x5fdf('0x28')](handleEntityNotFound(_0x499350,null))[_0x5fdf('0x28')](saveUpdates(_0x37882b[_0x5fdf('0x2f')],null))[_0x5fdf('0x28')](respondWithResult(_0x499350,null))[_0x5fdf('0x31')](handleError(_0x499350,null));};exports[_0x5fdf('0x29')]=function(_0x549f4f,_0x310141){return db['Action']['find']({'where':{'id':_0x549f4f[_0x5fdf('0x32')]['id']}})[_0x5fdf('0x28')](handleEntityNotFound(_0x310141,null))['then'](removeEntity(_0x310141,null))[_0x5fdf('0x31')](handleError(_0x310141,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 709c211..dcabd0c 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 _0x045c=['bluebird','request-promise','path','../../config/environment','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment'];(function(_0x25d94f,_0x32630c){var _0x54ac19=function(_0x6afe25){while(--_0x6afe25){_0x25d94f['push'](_0x25d94f['shift']());}};_0x54ac19(++_0x32630c);}(_0x045c,0x8a));var _0xc045=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x045c[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xc045('0x0'));var util=require(_0xc045('0x1'));var logger=require(_0xc045('0x2'))(_0xc045('0x3'));var moment=require(_0xc045('0x4'));var BPromise=require(_0xc045('0x5'));var rp=require(_0xc045('0x6'));var fs=require('fs');var path=require(_0xc045('0x7'));var rimraf=require('rimraf');var config=require(_0xc045('0x8'));var attributes=require('./action.attributes');module[_0xc045('0x9')]=function(_0xa1d0a6,_0x40ae6c){return _0xa1d0a6[_0xc045('0xa')](_0xc045('0xb'),attributes,{'tableName':_0xc045('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8efe=['Action','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x50f2bb,_0x42641e){var _0xec3f85=function(_0x10b2a5){while(--_0x10b2a5){_0x50f2bb['push'](_0x50f2bb['shift']());}};_0xec3f85(++_0x42641e);}(_0x8efe,0x1e2));var _0xe8ef=function(_0x5f3031,_0xe82925){_0x5f3031=_0x5f3031-0x0;var _0x3721f1=_0x8efe[_0x5f3031];return _0x3721f1;};'use strict';var _=require('lodash');var util=require(_0xe8ef('0x0'));var logger=require(_0xe8ef('0x1'))(_0xe8ef('0x2'));var moment=require(_0xe8ef('0x3'));var BPromise=require(_0xe8ef('0x4'));var rp=require(_0xe8ef('0x5'));var fs=require('fs');var path=require(_0xe8ef('0x6'));var rimraf=require('rimraf');var config=require(_0xe8ef('0x7'));var attributes=require('./action.attributes');module[_0xe8ef('0x8')]=function(_0x38b959,_0x5f027e){return _0x38b959[_0xe8ef('0x9')](_0xe8ef('0xa'),attributes,{'tableName':_0xe8ef('0xb'),'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 276e52e..b2c7349 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5a0735,_0x1bfc03){var _0x53fa8c=function(_0x2bf3b3){while(--_0x2bf3b3){_0x5a0735['push'](_0x5a0735['shift']());}};_0x53fa8c(++_0x1bfc03);}(_0x1261,0x144));var _0x1126=function(_0x5ebe63,_0x2956bc){_0x5ebe63=_0x5ebe63-0x0;var _0x1f91ee=_0x1261[_0x5ebe63];return _0x1f91ee;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x814b,0x1a2));var _0xb814=function(_0x3fd50c,_0x1b41ed){_0x3fd50c=_0x3fd50c-0x0;var _0x4cebb2=_0x814b[_0x3fd50c];return _0x4cebb2;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index d5fe78a..0b406b2 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 _0x7f86=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x240ebb,_0x1c2de3){var _0x1e6842=function(_0x10b804){while(--_0x10b804){_0x240ebb['push'](_0x240ebb['shift']());}};_0x1e6842(++_0x1c2de3);}(_0x7f86,0x174));var _0x67f8=function(_0x3c1080,_0x376fad){_0x3c1080=_0x3c1080-0x0;var _0x2f9f3c=_0x7f86[_0x3c1080];return _0x2f9f3c;};'use strict';var multer=require(_0x67f8('0x0'));var util=require(_0x67f8('0x1'));var path=require('path');var timeout=require(_0x67f8('0x2'));var express=require(_0x67f8('0x3'));var router=express[_0x67f8('0x4')]();var fs_extra=require(_0x67f8('0x5'));var auth=require(_0x67f8('0x6'));var interaction=require(_0x67f8('0x7'));var config=require(_0x67f8('0x8'));var controller=require(_0x67f8('0x9'));router['put'](_0x67f8('0xa'),auth['isAuthenticated'](),controller[_0x67f8('0xb')]);router[_0x67f8('0xc')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x67f8('0xd')]=router;
\ No newline at end of file
+var _0x8b5d=['../../components/interaction/service','../../config/environment','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x8b5d,0x1ac));var _0xd8b5=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x8b5d[_0x2e76a7];return _0x454cde;};'use strict';var multer=require(_0xd8b5('0x0'));var util=require(_0xd8b5('0x1'));var path=require(_0xd8b5('0x2'));var timeout=require(_0xd8b5('0x3'));var express=require(_0xd8b5('0x4'));var router=express['Router']();var fs_extra=require(_0xd8b5('0x5'));var auth=require(_0xd8b5('0x6'));var interaction=require(_0xd8b5('0x7'));var config=require(_0xd8b5('0x8'));var controller=require('./action.controller');router[_0xd8b5('0x9')](_0xd8b5('0xa'),auth['isAuthenticated'](),controller[_0xd8b5('0xb')]);router[_0xd8b5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xd8b5('0xd')]);module[_0xd8b5('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 60da572..9bdea68 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 _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x3ee5f2,_0x1e4594){var _0x4300f4=function(_0x510b8a){while(--_0x510b8a){_0x3ee5f2['push'](_0x3ee5f2['shift']());}};_0x4300f4(++_0x1e4594);}(_0xd8fb,0x99));var _0xbd8f=function(_0x56c760,_0x7594c0){_0x56c760=_0x56c760-0x0;var _0x28060a=_0xd8fb[_0x56c760];return _0x28060a;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
+var _0x24ca=['sequelize','STRING','TEXT'];(function(_0xe06071,_0x4eeaa1){var _0x8ad8be=function(_0xb48521){while(--_0xb48521){_0xe06071['push'](_0xe06071['shift']());}};_0x8ad8be(++_0x4eeaa1);}(_0x24ca,0x1bc));var _0xa24c=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0x24ca[_0x168127];return _0x4c99ad;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 120c72e..e756665 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 _0x6a45=['name','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show','params','options','find','catch','create','body','user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','field','condition','value','Sequelize','findAll','select','from','table','MetricId','metric','function','replace','format','groupBy','group','orderBy','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','DESC','clone','web','%s-%s.%s','randomstring','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','run','runReport','left_join','MAX(%s)','IS\x20EMPTY','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','error','stack'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0x6a45,0x11e));var _0x56a4=function(_0x260009,_0x47327e){_0x260009=_0x260009-0x0;var _0x338deb=_0x6a45[_0x260009];return _0x338deb;};'use strict';var emlformat=require(_0x56a4('0x0'));var rimraf=require(_0x56a4('0x1'));var zipdir=require(_0x56a4('0x2'));var jsonpatch=require(_0x56a4('0x3'));var rp=require('request-promise');var moment=require(_0x56a4('0x4'));var BPromise=require(_0x56a4('0x5'));var Mustache=require(_0x56a4('0x6'));var util=require(_0x56a4('0x7'));var path=require('path');var sox=require(_0x56a4('0x8'));var csv=require(_0x56a4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56a4('0xa'));var _=require('lodash');var squel=require(_0x56a4('0xb'));var crypto=require('crypto');var jsforce=require(_0x56a4('0xc'));var deskjs=require(_0x56a4('0xd'));var toCsv=require(_0x56a4('0x9'));var querystring=require(_0x56a4('0xe'));var Papa=require(_0x56a4('0xf'));var Redis=require(_0x56a4('0x10'));var authService=require(_0x56a4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x56a4('0x12'));var hardwareService=require(_0x56a4('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x56a4('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x56a4('0x15'))['db'];var dbH=require(_0x56a4('0x15'))[_0x56a4('0x16')];function respondWithStatusCode(_0x450984,_0x16a941){_0x16a941=_0x16a941||0xcc;return function(_0x51795e){if(_0x51795e){return _0x450984[_0x56a4('0x17')](_0x16a941);}return _0x450984[_0x56a4('0x18')](_0x16a941)[_0x56a4('0x19')]();};}function respondWithResult(_0x47b505,_0x27dcb8){_0x27dcb8=_0x27dcb8||0xc8;return function(_0x38e12a){if(_0x38e12a){return _0x47b505[_0x56a4('0x18')](_0x27dcb8)[_0x56a4('0x1a')](_0x38e12a);}};}function respondWithFilteredResult(_0x245345,_0x553d37){return function(_0x362b4d){if(_0x362b4d){var _0x5dff0e=typeof _0x553d37[_0x56a4('0x1b')]===_0x56a4('0x1c')&&typeof _0x553d37['limit']===_0x56a4('0x1c');var _0x5ac07c=_0x362b4d[_0x56a4('0x1d')];var _0x13d569=_0x5dff0e?0x0:_0x553d37['offset'];var _0xb44f9=_0x5dff0e?_0x362b4d[_0x56a4('0x1d')]:_0x553d37[_0x56a4('0x1b')]+_0x553d37['limit'];var _0x5c314c;if(_0xb44f9>=_0x5ac07c){_0xb44f9=_0x5ac07c;_0x5c314c=0xc8;}else{_0x5c314c=0xce;}_0x245345['status'](_0x5c314c);return _0x245345[_0x56a4('0x1e')](_0x56a4('0x1f'),_0x13d569+'-'+_0xb44f9+'/'+_0x5ac07c)[_0x56a4('0x1a')](_0x362b4d);}return null;};}function patchUpdates(_0x211172){return function(_0x596ee6){try{jsonpatch['apply'](_0x596ee6,_0x211172,!![]);}catch(_0x9db61a){return BPromise[_0x56a4('0x20')](_0x9db61a);}return _0x596ee6[_0x56a4('0x21')]();};}function saveUpdates(_0x2bcfd8,_0x5d7f4d){return function(_0x2333b9){if(_0x2333b9){return _0x2333b9[_0x56a4('0x22')](_0x2bcfd8)[_0x56a4('0x23')](function(_0x56e267){return _0x56e267;});}return null;};}function removeEntity(_0x3f590e,_0x320c26){return function(_0x373e55){if(_0x373e55){return _0x373e55['destroy']()[_0x56a4('0x23')](function(){var _0x390581=_0x373e55[_0x56a4('0x24')]({'plain':!![]});var _0x227f57=_0x56a4('0x25');return db[_0x56a4('0x26')][_0x56a4('0x27')]({'where':{'type':_0x227f57,'resourceId':_0x390581['id']}})[_0x56a4('0x23')](function(){return _0x373e55;});})[_0x56a4('0x23')](function(){_0x3f590e[_0x56a4('0x18')](0xcc)[_0x56a4('0x19')]();});}};}function handleEntityNotFound(_0x6709fa,_0x353cb3){return function(_0x45b8d8){if(!_0x45b8d8){_0x6709fa[_0x56a4('0x17')](0x194);}return _0x45b8d8;};}function handleError(_0x322263,_0x50a42a){_0x50a42a=_0x50a42a||0x1f4;return function(_0x37e989){logger[_0x56a4('0x28')](_0x37e989[_0x56a4('0x29')]);if(_0x37e989[_0x56a4('0x2a')]){delete _0x37e989[_0x56a4('0x2a')];}_0x322263['status'](_0x50a42a)['send'](_0x37e989);};}exports['index']=function(_0x1cc1a0,_0x1e0e46){var _0x133b31={},_0x581e32={},_0x1c7a79={'count':0x0,'rows':[]};var _0x49de73=_['map'](db[_0x56a4('0x2b')][_0x56a4('0x2c')],function(_0x5e8185){return{'name':_0x5e8185[_0x56a4('0x2d')],'type':_0x5e8185[_0x56a4('0x2e')][_0x56a4('0x2f')]};});_0x581e32[_0x56a4('0x30')]=_[_0x56a4('0x31')](_0x49de73,_0x56a4('0x2a'));_0x581e32[_0x56a4('0x32')]=_[_0x56a4('0x33')](_0x1cc1a0[_0x56a4('0x32')]);_0x581e32[_0x56a4('0x34')]=_['intersection'](_0x581e32[_0x56a4('0x30')],_0x581e32[_0x56a4('0x32')]);_0x133b31[_0x56a4('0x35')]=_[_0x56a4('0x36')](_0x581e32[_0x56a4('0x30')],qs[_0x56a4('0x37')](_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x37')]));_0x133b31[_0x56a4('0x35')]=_0x133b31[_0x56a4('0x35')][_0x56a4('0x38')]?_0x133b31[_0x56a4('0x35')]:_0x581e32[_0x56a4('0x30')];if(!_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x39')](_0x56a4('0x3a'))){_0x133b31['limit']=qs[_0x56a4('0x3b')](_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x3b')]);_0x133b31[_0x56a4('0x1b')]=qs['offset'](_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x1b')]);}_0x133b31[_0x56a4('0x3c')]=qs['sort'](_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x3d')]);_0x133b31[_0x56a4('0x3e')]=qs[_0x56a4('0x34')](_[_0x56a4('0x3f')](_0x1cc1a0['query'],_0x581e32[_0x56a4('0x34')]),_0x49de73);if(_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x40')]){_0x133b31[_0x56a4('0x3e')]=_[_0x56a4('0x41')](_0x133b31[_0x56a4('0x3e')],{'$or':_[_0x56a4('0x31')](_0x49de73,function(_0x5375e4){if(_0x5375e4[_0x56a4('0x2e')]!==_0x56a4('0x42')){var _0x11a06a={};_0x11a06a[_0x5375e4[_0x56a4('0x2a')]]={'$like':'%'+_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x40')]+'%'};return _0x11a06a;}})});}_0x133b31=_[_0x56a4('0x41')]({},_0x133b31,_0x1cc1a0['options']);var _0xbf2d1b={'where':_0x133b31[_0x56a4('0x3e')]};return db[_0x56a4('0x2b')][_0x56a4('0x1d')](_0xbf2d1b)['then'](function(_0x32327e){_0x1c7a79[_0x56a4('0x1d')]=_0x32327e;if(_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x43')]){_0x133b31[_0x56a4('0x44')]=[{'all':!![]}];}return db[_0x56a4('0x2b')]['findAll'](_0x133b31);})['then'](function(_0x4862f4){_0x1c7a79['rows']=_0x4862f4;return _0x1c7a79;})[_0x56a4('0x23')](respondWithFilteredResult(_0x1e0e46,_0x133b31))['catch'](handleError(_0x1e0e46,null));};exports[_0x56a4('0x45')]=function(_0x2f030e,_0x42c88d){var _0x56a9ea={'raw':![],'where':{'id':_0x2f030e[_0x56a4('0x46')]['id']}},_0xa3585f={};_0xa3585f['model']=_['keys'](db[_0x56a4('0x2b')]['rawAttributes']);_0xa3585f[_0x56a4('0x32')]=_[_0x56a4('0x33')](_0x2f030e[_0x56a4('0x32')]);_0xa3585f[_0x56a4('0x34')]=_['intersection'](_0xa3585f[_0x56a4('0x30')],_0xa3585f[_0x56a4('0x32')]);_0x56a9ea[_0x56a4('0x35')]=_[_0x56a4('0x36')](_0xa3585f[_0x56a4('0x30')],qs['fields'](_0x2f030e['query']['fields']));_0x56a9ea[_0x56a4('0x35')]=_0x56a9ea[_0x56a4('0x35')][_0x56a4('0x38')]?_0x56a9ea[_0x56a4('0x35')]:_0xa3585f[_0x56a4('0x30')];if(_0x2f030e[_0x56a4('0x32')]['includeAll']){_0x56a9ea['include']=[{'all':!![]}];}_0x56a9ea=_[_0x56a4('0x41')]({},_0x56a9ea,_0x2f030e[_0x56a4('0x47')]);return db['AnalyticCustomReport'][_0x56a4('0x48')](_0x56a9ea)['then'](handleEntityNotFound(_0x42c88d,null))['then'](respondWithResult(_0x42c88d,null))[_0x56a4('0x49')](handleError(_0x42c88d,null));};exports[_0x56a4('0x4a')]=function(_0x10de1f,_0x4c6df){return db[_0x56a4('0x2b')][_0x56a4('0x4a')](_0x10de1f[_0x56a4('0x4b')],{})[_0x56a4('0x23')](function(_0x8b9913){var _0x36be71=_0x10de1f[_0x56a4('0x4c')]['get']({'plain':!![]});if(!_0x36be71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36be71[_0x56a4('0x4d')]===_0x56a4('0x4c')){var _0x35071f=_0x8b9913['get']({'plain':!![]});var _0x3af5b1=_0x56a4('0x4e');return db[_0x56a4('0x4f')][_0x56a4('0x48')]({'where':{'name':_0x3af5b1,'userProfileId':_0x36be71[_0x56a4('0x50')]},'raw':!![]})[_0x56a4('0x23')](function(_0x3634d9){if(_0x3634d9&&_0x3634d9['autoAssociation']===0x0){return db[_0x56a4('0x26')]['create']({'name':_0x35071f[_0x56a4('0x2a')],'resourceId':_0x35071f['id'],'type':_0x56a4('0x25'),'sectionId':_0x3634d9['id']},{})['then'](function(){return _0x8b9913;});}else{return _0x8b9913;}})[_0x56a4('0x49')](function(_0x4d9d02){logger['error'](_0x56a4('0x51'),_0x4d9d02);throw _0x4d9d02;});}return _0x8b9913;})[_0x56a4('0x23')](respondWithResult(_0x4c6df,0xc9))[_0x56a4('0x49')](handleError(_0x4c6df,null));};exports[_0x56a4('0x22')]=function(_0x12818c,_0x4faaeb){if(_0x12818c[_0x56a4('0x4b')]['id']){delete _0x12818c[_0x56a4('0x4b')]['id'];}return db[_0x56a4('0x2b')][_0x56a4('0x48')]({'where':{'id':_0x12818c['params']['id']}})[_0x56a4('0x23')](handleEntityNotFound(_0x4faaeb,null))[_0x56a4('0x23')](saveUpdates(_0x12818c[_0x56a4('0x4b')],null))[_0x56a4('0x23')](respondWithResult(_0x4faaeb,null))[_0x56a4('0x49')](handleError(_0x4faaeb,null));};exports['destroy']=function(_0x387774,_0x56c94e){return db['AnalyticCustomReport'][_0x56a4('0x48')]({'where':{'id':_0x387774['params']['id']}})['then'](handleEntityNotFound(_0x56c94e,null))[_0x56a4('0x23')](removeEntity(_0x56c94e,null))[_0x56a4('0x49')](handleError(_0x56c94e,null));};exports[_0x56a4('0x52')]=function(_0xab3ed2,_0x2b236c){var _0x44fc7f=0xa;var _0x5d5cd1=['join','left_join',_0x56a4('0x53'),_0x56a4('0x54')];var _0x1b02d6={'SUM':'SUM(%s)','COUNT':_0x56a4('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x56a4('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x56a4('0x57')};var _0x16ec71={'SEC_TO_TIME':_0x56a4('0x58'),'DATE':_0x56a4('0x59'),'HOUR':_0x56a4('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x56a4('0x5b')};var _0x34956c=function(_0x26612f){return!_[_0x56a4('0x5c')]([_0x56a4('0x5d'),_0x56a4('0x5e'),'IS\x20EMPTY',_0x56a4('0x5f')],_0x26612f);};var _0x5a0825=function(_0x216bfa){if(!_0x216bfa||!_0x216bfa[_0x56a4('0x60')][_0x56a4('0x38')]){return'';}for(var _0x2c418d='(',_0x4690e0=0x0;_0x4690e0<_0x216bfa[_0x56a4('0x60')]['length'];_0x4690e0+=0x1){_0x4690e0>0x0&&(_0x2c418d+='\x20'+_0x216bfa[_0x56a4('0x61')]+'\x20');_0x2c418d+=_0x216bfa[_0x56a4('0x60')][_0x4690e0]['group']?_0x5a0825(_0x216bfa['rules'][_0x4690e0]['group']):_0x216bfa[_0x56a4('0x60')][_0x4690e0][_0x56a4('0x62')]+'\x20'+_0x216bfa['rules'][_0x4690e0][_0x56a4('0x63')]+(_0x34956c(_0x216bfa[_0x56a4('0x60')][_0x4690e0]['condition'])?'\x20'+_0x216bfa[_0x56a4('0x60')][_0x4690e0][_0x56a4('0x64')]:'');}return _0x2c418d+')';};var _0x1c7177={'where':{'id':_0xab3ed2[_0x56a4('0x46')]['id']}},_0x2a089e,_0xdc2848,_0x269e0a,_0x484344,_0x3d25fc;_0x1c7177=_[_0x56a4('0x41')]({},_0x1c7177,_0xab3ed2[_0x56a4('0x47')]);return db[_0x56a4('0x2b')]['find'](_0x1c7177)[_0x56a4('0x23')](function(_0x27d91b){if(_0x27d91b){_0x2a089e=_0x27d91b;return _0x27d91b['getFields']();}return null;})['then'](function(_0xa6c8dc){if(_0xa6c8dc){if(!_0xa6c8dc[_0x56a4('0x38')]){throw new db[(_0x56a4('0x65'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xdc2848=_0xa6c8dc;return db['AnalyticMetric'][_0x56a4('0x66')]({'raw':!![]});}return null;})['then'](function(_0x4dd675){if(_0x4dd675){_0x269e0a=_['keyBy'](_0x4dd675,'id');var _0x254114;var _0x30cac1=squel[_0x56a4('0x67')]();_0x30cac1[_0x56a4('0x68')](_0x2a089e[_0x56a4('0x69')]);for(var _0xf2bf9c=0x0;_0xf2bf9c<_0xdc2848['length'];_0xf2bf9c+=0x1){_0x254114=_0xdc2848[_0xf2bf9c][_0x56a4('0x6a')]?_0x269e0a[_0xdc2848[_0xf2bf9c][_0x56a4('0x6a')]][_0x56a4('0x6b')]:_0xdc2848[_0xf2bf9c]['field'];_0x254114=_0xdc2848[_0xf2bf9c][_0x56a4('0x6c')]?_[_0x56a4('0x6d')](_0x1b02d6[_0xdc2848[_0xf2bf9c][_0x56a4('0x6c')]],'%s',_0x254114):_0x254114;_0x254114=_0xdc2848[_0xf2bf9c][_0x56a4('0x6e')]?_[_0x56a4('0x6d')](_0x16ec71[_0xdc2848[_0xf2bf9c]['format']],'%s',_0x254114):_0x254114;if(_0xdc2848[_0xf2bf9c][_0x56a4('0x6f')]){_0x30cac1[_0x56a4('0x70')](_0x254114);}_0xdc2848[_0xf2bf9c][_0x56a4('0x71')]&&_0x30cac1[_0x56a4('0x3c')](_0x254114,_0xdc2848[_0xf2bf9c][_0x56a4('0x71')]==='DESC'?![]:!![]);_0x30cac1[_0x56a4('0x62')](_0x254114,_0xdc2848[_0xf2bf9c][_0x56a4('0x72')]||_0x254114);}if(_0x2a089e['joins']){_0x2a089e['joins']=JSON['parse'](_0x2a089e[_0x56a4('0x73')]);for(var _0x14df79=0x0;_0x14df79<_0x2a089e[_0x56a4('0x73')][_0x56a4('0x38')];_0x14df79+=0x1){if(_0x2a089e['joins'][_0x14df79][_0x56a4('0x2e')]&&_['includes'](_0x5d5cd1,_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x2e')])&&_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x74')]&&_0x2a089e[_0x56a4('0x73')][_0x14df79]['foreignTable']&&_0x2a089e['joins'][_0x14df79][_0x56a4('0x75')]){_0x30cac1[_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x2e')]](_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x76')],null,util[_0x56a4('0x6e')](_0x56a4('0x77'),_0x2a089e[_0x56a4('0x69')],_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x74')],_0x2a089e[_0x56a4('0x73')][_0x14df79]['foreignTable'],_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x75')]));}}}if(_0x2a089e[_0x56a4('0x78')]){_0x2a089e[_0x56a4('0x78')]=JSON[_0x56a4('0x79')](_0x2a089e[_0x56a4('0x78')]);_0x30cac1[_0x56a4('0x3e')](_0x5a0825(_0x2a089e['conditions'][_0x56a4('0x70')]));}_0x3d25fc=_0x30cac1['clone']();_0x30cac1[_0x56a4('0x3b')](_0x44fc7f);_0x30cac1[_0x56a4('0x1b')](0x0);logger[_0x56a4('0x7a')](_0x56a4('0x7b'),_0x30cac1[_0x56a4('0x7c')]());return dbH[_0x56a4('0x7d')][_0x56a4('0x32')](_0x30cac1[_0x56a4('0x7c')](),{'type':dbH['sequelize'][_0x56a4('0x7e')][_0x56a4('0x7f')]});}})['then'](respondWithResult(_0x2b236c,null))[_0x56a4('0x49')](handleError(_0x2b236c,null));};function runReport(_0x300dff,_0x148f52,_0x561d53){var _0x3b201d=_0x148f52['name'];var _0x1579ab=0xa;var _0x3c5b5b=[_0x56a4('0x80'),'left_join',_0x56a4('0x53'),_0x56a4('0x54')];var _0x32537c={'SUM':_0x56a4('0x81'),'COUNT':_0x56a4('0x55'),'COUNT DISTINCT':_0x56a4('0x82'),'MAX':'MAX(%s)','MIN':_0x56a4('0x56'),'AVG':_0x56a4('0x83'),'GROUP_CONCAT':_0x56a4('0x84'),'GROUP_CONCAT ASC':_0x56a4('0x85'),'GROUP_CONCAT DESC':_0x56a4('0x57')};var _0x17872a={'SEC_TO_TIME':_0x56a4('0x58'),'DATE':_0x56a4('0x59'),'HOUR':_0x56a4('0x5a'),'ROUND':_0x56a4('0x86'),'UNIX_TIMESTAMP':_0x56a4('0x5b')};var _0x50698d=function(_0x57ab2e){return!_[_0x56a4('0x5c')]([_0x56a4('0x5d'),_0x56a4('0x5e'),'IS\x20EMPTY',_0x56a4('0x5f')],_0x57ab2e);};var _0x3172f9=function(_0x518ce7){if(!_0x518ce7||!_0x518ce7[_0x56a4('0x60')][_0x56a4('0x38')]){return'';}for(var _0x55e605='(',_0x535de2=0x0;_0x535de2<_0x518ce7[_0x56a4('0x60')][_0x56a4('0x38')];_0x535de2+=0x1){_0x535de2>0x0&&(_0x55e605+='\x20'+_0x518ce7[_0x56a4('0x61')]+'\x20');_0x55e605+=_0x518ce7[_0x56a4('0x60')][_0x535de2][_0x56a4('0x70')]?_0x3172f9(_0x518ce7['rules'][_0x535de2][_0x56a4('0x70')]):_0x518ce7['rules'][_0x535de2]['field']+'\x20'+_0x518ce7[_0x56a4('0x60')][_0x535de2][_0x56a4('0x63')]+(_0x50698d(_0x518ce7[_0x56a4('0x60')][_0x535de2]['condition'])?'\x20'+_0x518ce7['rules'][_0x535de2]['value']:'');}return _0x55e605+')';};var _0x1e02aa={'where':{'id':_0x300dff['id']}},_0x236943,_0xf3eba6,_0x2f2a28,_0x58af72,_0x7ea051;_0x1e02aa=_[_0x56a4('0x41')]({},_0x1e02aa,_0x561d53);return db[_0x56a4('0x2b')]['find'](_0x1e02aa)[_0x56a4('0x23')](function(_0x11739d){if(_0x11739d){_0x236943=_0x11739d;return _0x11739d['getFields']();}return null;})[_0x56a4('0x23')](function(_0xb112d7){if(_0xb112d7){if(!_0xb112d7[_0x56a4('0x38')]){throw new db[(_0x56a4('0x65'))][(_0x56a4('0x87'))](_0x56a4('0x88'),0x193);}_0xf3eba6=_0xb112d7;return db[_0x56a4('0x89')]['findAll']({'raw':!![]});}return null;})[_0x56a4('0x23')](function(_0x3823a6){if(_0x3823a6){_0x2f2a28=_[_0x56a4('0x8a')](_0x3823a6,'id');var _0x440cea;var _0x3603e2=squel['select']();_0x3603e2[_0x56a4('0x68')](_0x236943[_0x56a4('0x69')]);for(var _0x4093f7=0x0;_0x4093f7<_0xf3eba6[_0x56a4('0x38')];_0x4093f7+=0x1){_0x440cea=_0xf3eba6[_0x4093f7][_0x56a4('0x6a')]?_0x2f2a28[_0xf3eba6[_0x4093f7][_0x56a4('0x6a')]][_0x56a4('0x6b')]:_0xf3eba6[_0x4093f7][_0x56a4('0x62')];_0x440cea=_0xf3eba6[_0x4093f7][_0x56a4('0x6c')]?_['replace'](_0x32537c[_0xf3eba6[_0x4093f7]['function']],'%s',_0x440cea):_0x440cea;_0x440cea=_0xf3eba6[_0x4093f7][_0x56a4('0x6e')]?_[_0x56a4('0x6d')](_0x17872a[_0xf3eba6[_0x4093f7][_0x56a4('0x6e')]],'%s',_0x440cea):_0x440cea;if(_0xf3eba6[_0x4093f7][_0x56a4('0x6f')]){_0x3603e2[_0x56a4('0x70')](_0x440cea);}_0xf3eba6[_0x4093f7]['orderBy']&&_0x3603e2[_0x56a4('0x3c')](_0x440cea,_0xf3eba6[_0x4093f7][_0x56a4('0x71')]===_0x56a4('0x8b')?![]:!![]);_0x3603e2['field'](_0x440cea,_0xf3eba6[_0x4093f7]['alias']||_0x440cea);}if(_0x236943[_0x56a4('0x73')]){_0x236943['joins']=JSON['parse'](_0x236943['joins']);for(var _0x5c368e=0x0;_0x5c368e<_0x236943['joins'][_0x56a4('0x38')];_0x5c368e+=0x1){if(_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x2e')]&&_[_0x56a4('0x5c')](_0x3c5b5b,_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x2e')])&&_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x74')]&&_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x76')]&&_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x75')]){_0x3603e2[_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x2e')]](_0x236943['joins'][_0x5c368e][_0x56a4('0x76')],null,util[_0x56a4('0x6e')](_0x56a4('0x77'),_0x236943[_0x56a4('0x69')],_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x74')],_0x236943[_0x56a4('0x73')][_0x5c368e]['foreignTable'],_0x236943['joins'][_0x5c368e]['foreignKey']));}}}if(_0x236943[_0x56a4('0x78')]){_0x236943[_0x56a4('0x78')]=JSON[_0x56a4('0x79')](_0x236943[_0x56a4('0x78')]);_0x3603e2['where'](_0x3172f9(_0x236943[_0x56a4('0x78')]['group']));}_0x7ea051=_0x3603e2[_0x56a4('0x8c')]();_0x3603e2[_0x56a4('0x3b')](_0x1579ab);_0x3603e2[_0x56a4('0x1b')](0x0);return;}})[_0x56a4('0x23')](function(){if(_0x148f52['output']===_0x56a4('0x8d')){return null;}var _0x47f69e=_['merge'](_0x148f52,{'name':_0x148f52['fullPath']||_0x148f52[_0x56a4('0x2a')]||_0x236943[_0x56a4('0x2a')],'basename':_0x3b201d,'savename':util[_0x56a4('0x6e')](_0x56a4('0x8e'),_0x148f52[_0x56a4('0x2a')]||_0x236943['name'],require(_0x56a4('0x8f'))['generate'](0x4),_0x148f52[_0x56a4('0x90')]||'csv'),'reportId':_0x236943['id'],'reportType':_0x56a4('0x91')});return db[_0x56a4('0x92')][_0x56a4('0x4a')](_0x47f69e,{'raw':!![]});})['then'](function(_0x2f0a06){if(_0x236943[_0x56a4('0x69')]===_0x56a4('0x93')){_0x7ea051[_0x56a4('0x3e')](_0x236943['table']+_0x56a4('0x94'),_0x148f52[_0x56a4('0x95')],_0x148f52['endDate']);}else{_0x7ea051[_0x56a4('0x3e')](_0x236943[_0x56a4('0x69')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x148f52[_0x56a4('0x95')],_0x148f52[_0x56a4('0x96')]);}if(_0x2f0a06){logger[_0x56a4('0x97')](_0x56a4('0x98'),_0x7ea051['toString']());require(_0x56a4('0x99'))['fork'](path[_0x56a4('0x80')](__dirname,'../../components/export/',_0x2f0a06[_0x56a4('0x90')]),[_0x2f0a06['id'],_0x7ea051[_0x56a4('0x7c')](),path[_0x56a4('0x80')](__dirname,_0x56a4('0x9a'),_0x2f0a06[_0x56a4('0x9b')]),_0x3b201d]);return _0x2f0a06;}else{var _0xafb339=squel[_0x56a4('0x67')]();_0xafb339[_0x56a4('0x68')]('('+_0x7ea051[_0x56a4('0x7c')]()+')',_0x56a4('0x9c'));_0xafb339[_0x56a4('0x62')](_0x56a4('0x9d'),'count');_0x7ea051['limit'](_0x148f52['limit']||_0x1579ab);_0x7ea051[_0x56a4('0x1b')](_0x148f52[_0x56a4('0x1b')]||0x0);return dbH['sequelize'][_0x56a4('0x32')](_0xafb339[_0x56a4('0x7c')](),{'type':dbH[_0x56a4('0x7d')]['QueryTypes'][_0x56a4('0x7f')]})[_0x56a4('0x23')](function(_0x132d0b){if(!_0x132d0b[_0x56a4('0x38')]){_0x58af72=0x0;}else{_0x58af72=_0x132d0b[0x0][_0x56a4('0x1d')]||0x0;}return dbH[_0x56a4('0x7d')][_0x56a4('0x32')](_0x7ea051[_0x56a4('0x7c')](),{'type':dbH[_0x56a4('0x7d')]['QueryTypes'][_0x56a4('0x7f')]});})[_0x56a4('0x23')](function(_0x4094e5){return{'rows':_0x4094e5||[],'count':_0x58af72};});}});}exports[_0x56a4('0x9e')]=function(_0x343f78,_0x574441){return runReport(_0x343f78[_0x56a4('0x46')],_0x343f78[_0x56a4('0x32')],_0x343f78[_0x56a4('0x47')])[_0x56a4('0x23')](respondWithResult(_0x574441,null))[_0x56a4('0x49')](handleError(_0x574441,null));};exports[_0x56a4('0x9f')]=runReport;exports['query']=function(_0x42de7c,_0x2707cc){var _0x986994=0xa;var _0x4b009c=[_0x56a4('0x80'),_0x56a4('0xa0'),_0x56a4('0x53'),'cross_join'];var _0x59e75a={'SUM':_0x56a4('0x81'),'COUNT':_0x56a4('0x55'),'COUNT DISTINCT':_0x56a4('0x82'),'MAX':_0x56a4('0xa1'),'MIN':_0x56a4('0x56'),'AVG':_0x56a4('0x83'),'GROUP_CONCAT':_0x56a4('0x84'),'GROUP_CONCAT ASC':_0x56a4('0x85'),'GROUP_CONCAT DESC':_0x56a4('0x57')};var _0x88045d={'SEC_TO_TIME':_0x56a4('0x58'),'DATE':_0x56a4('0x59'),'HOUR':_0x56a4('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x56a4('0x5b')};var _0x7a2b7c=function(_0x9c32f4){return!_[_0x56a4('0x5c')]([_0x56a4('0x5d'),_0x56a4('0x5e'),_0x56a4('0xa2'),_0x56a4('0x5f')],_0x9c32f4);};var _0x19e1d4=function(_0x2d3f5d){if(!_0x2d3f5d||!_0x2d3f5d['rules'][_0x56a4('0x38')]){return'';}for(var _0x109d21='(',_0x18d0a2=0x0;_0x18d0a2<_0x2d3f5d[_0x56a4('0x60')][_0x56a4('0x38')];_0x18d0a2+=0x1){_0x18d0a2>0x0&&(_0x109d21+='\x20'+_0x2d3f5d[_0x56a4('0x61')]+'\x20');_0x109d21+=_0x2d3f5d[_0x56a4('0x60')][_0x18d0a2][_0x56a4('0x70')]?_0x19e1d4(_0x2d3f5d[_0x56a4('0x60')][_0x18d0a2][_0x56a4('0x70')]):_0x2d3f5d[_0x56a4('0x60')][_0x18d0a2]['field']+'\x20'+_0x2d3f5d['rules'][_0x18d0a2][_0x56a4('0x63')]+(_0x7a2b7c(_0x2d3f5d['rules'][_0x18d0a2][_0x56a4('0x63')])?'\x20'+_0x2d3f5d[_0x56a4('0x60')][_0x18d0a2][_0x56a4('0x64')]:'');}return _0x109d21+')';};var _0x570ef0={'where':{'id':_0x42de7c[_0x56a4('0x46')]['id']}},_0x50a0e5,_0x3be68b,_0x36567d,_0x36e5dd,_0x29e024;_0x570ef0=_['merge']({},_0x570ef0,_0x42de7c[_0x56a4('0x47')]);return db[_0x56a4('0x2b')][_0x56a4('0x48')](_0x570ef0)[_0x56a4('0x23')](function(_0x12c0cc){if(_0x12c0cc){_0x50a0e5=_0x12c0cc;return _0x12c0cc[_0x56a4('0xa3')]();}return null;})[_0x56a4('0x23')](function(_0x797558){if(_0x797558){if(!_0x797558[_0x56a4('0x38')]){throw new db[(_0x56a4('0x65'))][(_0x56a4('0x87'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3be68b=_0x797558;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x56a4('0x23')](function(_0x31dde1){if(_0x31dde1){_0x36567d=_[_0x56a4('0x8a')](_0x31dde1,'id');var _0x215543;var _0x292959=squel['select']();_0x292959[_0x56a4('0x68')](_0x50a0e5[_0x56a4('0x69')]);for(var _0x5532cb=0x0;_0x5532cb<_0x3be68b[_0x56a4('0x38')];_0x5532cb+=0x1){_0x215543=_0x3be68b[_0x5532cb][_0x56a4('0x6a')]?_0x36567d[_0x3be68b[_0x5532cb][_0x56a4('0x6a')]][_0x56a4('0x6b')]:_0x3be68b[_0x5532cb][_0x56a4('0x62')];_0x215543=_0x3be68b[_0x5532cb][_0x56a4('0x6c')]?_[_0x56a4('0x6d')](_0x59e75a[_0x3be68b[_0x5532cb][_0x56a4('0x6c')]],'%s',_0x215543):_0x215543;_0x215543=_0x3be68b[_0x5532cb][_0x56a4('0x6e')]?_['replace'](_0x88045d[_0x3be68b[_0x5532cb]['format']],'%s',_0x215543):_0x215543;if(_0x3be68b[_0x5532cb][_0x56a4('0x6f')]){_0x292959[_0x56a4('0x70')](_0x215543);}_0x3be68b[_0x5532cb][_0x56a4('0x71')]&&_0x292959['order'](_0x215543,_0x3be68b[_0x5532cb][_0x56a4('0x71')]===_0x56a4('0x8b')?![]:!![]);_0x292959[_0x56a4('0x62')](_0x215543,_0x3be68b[_0x5532cb][_0x56a4('0x72')]||_0x215543);}if(_0x50a0e5[_0x56a4('0x73')]){_0x50a0e5[_0x56a4('0x73')]=JSON[_0x56a4('0x79')](_0x50a0e5[_0x56a4('0x73')]);for(var _0x5128e6=0x0;_0x5128e6<_0x50a0e5[_0x56a4('0x73')][_0x56a4('0x38')];_0x5128e6+=0x1){if(_0x50a0e5['joins'][_0x5128e6][_0x56a4('0x2e')]&&_[_0x56a4('0x5c')](_0x4b009c,_0x50a0e5[_0x56a4('0x73')][_0x5128e6]['type'])&&_0x50a0e5['joins'][_0x5128e6][_0x56a4('0x74')]&&_0x50a0e5[_0x56a4('0x73')][_0x5128e6][_0x56a4('0x76')]&&_0x50a0e5[_0x56a4('0x73')][_0x5128e6][_0x56a4('0x75')]){_0x292959[_0x50a0e5['joins'][_0x5128e6][_0x56a4('0x2e')]](_0x50a0e5[_0x56a4('0x73')][_0x5128e6][_0x56a4('0x76')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x50a0e5[_0x56a4('0x69')],_0x50a0e5[_0x56a4('0x73')][_0x5128e6][_0x56a4('0x74')],_0x50a0e5[_0x56a4('0x73')][_0x5128e6]['foreignTable'],_0x50a0e5[_0x56a4('0x73')][_0x5128e6][_0x56a4('0x75')]));}}}if(_0x50a0e5[_0x56a4('0x78')]){_0x50a0e5['conditions']=JSON['parse'](_0x50a0e5[_0x56a4('0x78')]);_0x292959[_0x56a4('0x3e')](_0x19e1d4(_0x50a0e5[_0x56a4('0x78')]['group']));}_0x29e024=_0x292959[_0x56a4('0x8c')]();_0x292959[_0x56a4('0x3b')](_0x986994);_0x292959[_0x56a4('0x1b')](0x0);logger[_0x56a4('0x7a')](_0x56a4('0x7b'),_0x292959[_0x56a4('0x7c')]());return dbH[_0x56a4('0x7d')]['query'](_0x292959[_0x56a4('0x7c')](),{'type':dbH[_0x56a4('0x7d')][_0x56a4('0x7e')][_0x56a4('0x7f')]});}})[_0x56a4('0x23')](function(){return{'sql':_0x29e024[_0x56a4('0x7c')]()};})[_0x56a4('0x23')](respondWithResult(_0x2707cc,null))[_0x56a4('0x49')](handleError(_0x2707cc,null));};
\ No newline at end of file
+var _0x509b=['order','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','sequelize','toString','QueryTypes','MAX(%s)','AVG(%s)','HOUR(%s)','IS\x20NOT\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','DESC','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','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(*)','SELECT','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','update','then','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','pick','filter','where','merge','map','count','includeAll','include','findAll','show','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','destroy','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy'];(function(_0x2c6cfa,_0x47edd1){var _0x5f5474=function(_0x27cbc1){while(--_0x27cbc1){_0x2c6cfa['push'](_0x2c6cfa['shift']());}};_0x5f5474(++_0x47edd1);}(_0x509b,0xda));var _0xb509=function(_0x2fec10,_0x2c2179){_0x2fec10=_0x2fec10-0x0;var _0x51febc=_0x509b[_0x2fec10];return _0x51febc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb509('0x0'));var zipdir=require(_0xb509('0x1'));var jsonpatch=require(_0xb509('0x2'));var rp=require(_0xb509('0x3'));var moment=require('moment');var BPromise=require(_0xb509('0x4'));var Mustache=require(_0xb509('0x5'));var util=require('util');var path=require(_0xb509('0x6'));var sox=require(_0xb509('0x7'));var csv=require('to-csv');var ejs=require(_0xb509('0x8'));var fs=require('fs');var fs_extra=require(_0xb509('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb509('0xa'));var deskjs=require(_0xb509('0xb'));var toCsv=require(_0xb509('0xc'));var querystring=require(_0xb509('0xd'));var Papa=require(_0xb509('0xe'));var Redis=require('ioredis');var authService=require(_0xb509('0xf'));var qs=require(_0xb509('0x10'));var as=require(_0xb509('0x11'));var hardwareService=require(_0xb509('0x12'));var logger=require(_0xb509('0x13'))(_0xb509('0x14'));var utils=require(_0xb509('0x15'));var config=require(_0xb509('0x16'));var licenseUtil=require(_0xb509('0x17'));var db=require(_0xb509('0x18'))['db'];var dbH=require(_0xb509('0x18'))[_0xb509('0x19')];function respondWithStatusCode(_0x5879d2,_0x2952b4){_0x2952b4=_0x2952b4||0xcc;return function(_0x43ad4f){if(_0x43ad4f){return _0x5879d2[_0xb509('0x1a')](_0x2952b4);}return _0x5879d2[_0xb509('0x1b')](_0x2952b4)['end']();};}function respondWithResult(_0x1eeb05,_0x5ded15){_0x5ded15=_0x5ded15||0xc8;return function(_0x5c9417){if(_0x5c9417){return _0x1eeb05[_0xb509('0x1b')](_0x5ded15)[_0xb509('0x1c')](_0x5c9417);}};}function respondWithFilteredResult(_0xb2a75c,_0x5bf71b){return function(_0x14e93c){if(_0x14e93c){var _0x12babe=typeof _0x5bf71b[_0xb509('0x1d')]===_0xb509('0x1e')&&typeof _0x5bf71b[_0xb509('0x1f')]==='undefined';var _0x35e4c6=_0x14e93c['count'];var _0x456730=_0x12babe?0x0:_0x5bf71b['offset'];var _0x309c34=_0x12babe?_0x14e93c['count']:_0x5bf71b[_0xb509('0x1d')]+_0x5bf71b[_0xb509('0x1f')];var _0x4ea2d0;if(_0x309c34>=_0x35e4c6){_0x309c34=_0x35e4c6;_0x4ea2d0=0xc8;}else{_0x4ea2d0=0xce;}_0xb2a75c['status'](_0x4ea2d0);return _0xb2a75c[_0xb509('0x20')](_0xb509('0x21'),_0x456730+'-'+_0x309c34+'/'+_0x35e4c6)[_0xb509('0x1c')](_0x14e93c);}return null;};}function patchUpdates(_0x67a4cf){return function(_0x17d101){try{jsonpatch['apply'](_0x17d101,_0x67a4cf,!![]);}catch(_0x51e39f){return BPromise[_0xb509('0x22')](_0x51e39f);}return _0x17d101['save']();};}function saveUpdates(_0x111ec0,_0x48bb59){return function(_0x1f0af5){if(_0x1f0af5){return _0x1f0af5[_0xb509('0x23')](_0x111ec0)[_0xb509('0x24')](function(_0x3667fa){return _0x3667fa;});}return null;};}function removeEntity(_0x101e6b,_0x2fc329){return function(_0x33c717){if(_0x33c717){return _0x33c717['destroy']()[_0xb509('0x24')](function(){var _0x6cdba7=_0x33c717[_0xb509('0x25')]({'plain':!![]});var _0x1e4799=_0xb509('0x26');return db[_0xb509('0x27')]['destroy']({'where':{'type':_0x1e4799,'resourceId':_0x6cdba7['id']}})[_0xb509('0x24')](function(){return _0x33c717;});})[_0xb509('0x24')](function(){_0x101e6b[_0xb509('0x1b')](0xcc)[_0xb509('0x28')]();});}};}function handleEntityNotFound(_0x52c89b,_0x5f1651){return function(_0x9624d2){if(!_0x9624d2){_0x52c89b['sendStatus'](0x194);}return _0x9624d2;};}function handleError(_0x15587c,_0x238ab9){_0x238ab9=_0x238ab9||0x1f4;return function(_0x36da39){logger[_0xb509('0x29')](_0x36da39[_0xb509('0x2a')]);if(_0x36da39[_0xb509('0x2b')]){delete _0x36da39[_0xb509('0x2b')];}_0x15587c[_0xb509('0x1b')](_0x238ab9)[_0xb509('0x2c')](_0x36da39);};}exports[_0xb509('0x2d')]=function(_0x425b9a,_0xd5cc52){var _0x38828d={},_0x201904={},_0x367d37={'count':0x0,'rows':[]};var _0x58ae59=_['map'](db[_0xb509('0x2e')][_0xb509('0x2f')],function(_0x14a525){return{'name':_0x14a525[_0xb509('0x30')],'type':_0x14a525[_0xb509('0x31')][_0xb509('0x32')]};});_0x201904[_0xb509('0x33')]=_['map'](_0x58ae59,_0xb509('0x2b'));_0x201904[_0xb509('0x34')]=_[_0xb509('0x35')](_0x425b9a['query']);_0x201904[_0xb509('0x36')]=_[_0xb509('0x37')](_0x201904[_0xb509('0x33')],_0x201904[_0xb509('0x34')]);_0x38828d[_0xb509('0x38')]=_[_0xb509('0x37')](_0x201904[_0xb509('0x33')],qs[_0xb509('0x39')](_0x425b9a['query'][_0xb509('0x39')]));_0x38828d[_0xb509('0x38')]=_0x38828d[_0xb509('0x38')][_0xb509('0x3a')]?_0x38828d[_0xb509('0x38')]:_0x201904[_0xb509('0x33')];if(!_0x425b9a[_0xb509('0x34')][_0xb509('0x3b')]('nolimit')){_0x38828d[_0xb509('0x1f')]=qs[_0xb509('0x1f')](_0x425b9a['query'][_0xb509('0x1f')]);_0x38828d[_0xb509('0x1d')]=qs[_0xb509('0x1d')](_0x425b9a['query']['offset']);}_0x38828d['order']=qs['sort'](_0x425b9a['query']['sort']);_0x38828d['where']=qs[_0xb509('0x36')](_[_0xb509('0x3c')](_0x425b9a['query'],_0x201904['filters']),_0x58ae59);if(_0x425b9a['query'][_0xb509('0x3d')]){_0x38828d[_0xb509('0x3e')]=_[_0xb509('0x3f')](_0x38828d[_0xb509('0x3e')],{'$or':_[_0xb509('0x40')](_0x58ae59,function(_0x3b370d){if(_0x3b370d[_0xb509('0x31')]!=='VIRTUAL'){var _0x5b7171={};_0x5b7171[_0x3b370d[_0xb509('0x2b')]]={'$like':'%'+_0x425b9a[_0xb509('0x34')]['filter']+'%'};return _0x5b7171;}})});}_0x38828d=_[_0xb509('0x3f')]({},_0x38828d,_0x425b9a['options']);var _0x1e8cb9={'where':_0x38828d[_0xb509('0x3e')]};return db['AnalyticCustomReport'][_0xb509('0x41')](_0x1e8cb9)[_0xb509('0x24')](function(_0x3a85e8){_0x367d37[_0xb509('0x41')]=_0x3a85e8;if(_0x425b9a['query'][_0xb509('0x42')]){_0x38828d[_0xb509('0x43')]=[{'all':!![]}];}return db[_0xb509('0x2e')][_0xb509('0x44')](_0x38828d);})[_0xb509('0x24')](function(_0x5ecb09){_0x367d37['rows']=_0x5ecb09;return _0x367d37;})[_0xb509('0x24')](respondWithFilteredResult(_0xd5cc52,_0x38828d))['catch'](handleError(_0xd5cc52,null));};exports[_0xb509('0x45')]=function(_0x5efe84,_0x321422){var _0xec624a={'raw':![],'where':{'id':_0x5efe84[_0xb509('0x46')]['id']}},_0x4e32a={};_0x4e32a[_0xb509('0x33')]=_[_0xb509('0x35')](db[_0xb509('0x2e')][_0xb509('0x2f')]);_0x4e32a[_0xb509('0x34')]=_[_0xb509('0x35')](_0x5efe84['query']);_0x4e32a[_0xb509('0x36')]=_[_0xb509('0x37')](_0x4e32a['model'],_0x4e32a[_0xb509('0x34')]);_0xec624a[_0xb509('0x38')]=_[_0xb509('0x37')](_0x4e32a[_0xb509('0x33')],qs[_0xb509('0x39')](_0x5efe84['query']['fields']));_0xec624a[_0xb509('0x38')]=_0xec624a[_0xb509('0x38')][_0xb509('0x3a')]?_0xec624a[_0xb509('0x38')]:_0x4e32a['model'];if(_0x5efe84[_0xb509('0x34')]['includeAll']){_0xec624a[_0xb509('0x43')]=[{'all':!![]}];}_0xec624a=_[_0xb509('0x3f')]({},_0xec624a,_0x5efe84[_0xb509('0x47')]);return db[_0xb509('0x2e')][_0xb509('0x48')](_0xec624a)['then'](handleEntityNotFound(_0x321422,null))[_0xb509('0x24')](respondWithResult(_0x321422,null))[_0xb509('0x49')](handleError(_0x321422,null));};exports['create']=function(_0x56db4d,_0x503b73){return db['AnalyticCustomReport'][_0xb509('0x4a')](_0x56db4d[_0xb509('0x4b')],{})['then'](function(_0x366b0f){var _0x539310=_0x56db4d[_0xb509('0x4c')]['get']({'plain':!![]});if(!_0x539310)throw new Error(_0xb509('0x4d'));if(_0x539310['role']===_0xb509('0x4c')){var _0x422bdc=_0x366b0f[_0xb509('0x25')]({'plain':!![]});var _0x6b83f0='Reports';return db[_0xb509('0x4e')][_0xb509('0x48')]({'where':{'name':_0x6b83f0,'userProfileId':_0x539310['userProfileId']},'raw':!![]})[_0xb509('0x24')](function(_0x4bdb75){if(_0x4bdb75&&_0x4bdb75['autoAssociation']===0x0){return db[_0xb509('0x27')][_0xb509('0x4a')]({'name':_0x422bdc[_0xb509('0x2b')],'resourceId':_0x422bdc['id'],'type':_0xb509('0x26'),'sectionId':_0x4bdb75['id']},{})['then'](function(){return _0x366b0f;});}else{return _0x366b0f;}})[_0xb509('0x49')](function(_0x978bfd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x978bfd);throw _0x978bfd;});}return _0x366b0f;})[_0xb509('0x24')](respondWithResult(_0x503b73,0xc9))[_0xb509('0x49')](handleError(_0x503b73,null));};exports[_0xb509('0x23')]=function(_0x3946f3,_0x119b4){if(_0x3946f3[_0xb509('0x4b')]['id']){delete _0x3946f3[_0xb509('0x4b')]['id'];}return db[_0xb509('0x2e')]['find']({'where':{'id':_0x3946f3[_0xb509('0x46')]['id']}})[_0xb509('0x24')](handleEntityNotFound(_0x119b4,null))[_0xb509('0x24')](saveUpdates(_0x3946f3[_0xb509('0x4b')],null))['then'](respondWithResult(_0x119b4,null))[_0xb509('0x49')](handleError(_0x119b4,null));};exports[_0xb509('0x4f')]=function(_0x3e7dab,_0x542465){return db[_0xb509('0x2e')][_0xb509('0x48')]({'where':{'id':_0x3e7dab[_0xb509('0x46')]['id']}})[_0xb509('0x24')](handleEntityNotFound(_0x542465,null))['then'](removeEntity(_0x542465,null))[_0xb509('0x49')](handleError(_0x542465,null));};exports[_0xb509('0x50')]=function(_0x1acdd9,_0x3aa0d1){var _0x36a6d9=0xa;var _0x13c1c6=[_0xb509('0x51'),_0xb509('0x52'),_0xb509('0x53'),_0xb509('0x54')];var _0x2c733d={'SUM':_0xb509('0x55'),'COUNT':_0xb509('0x56'),'COUNT DISTINCT':_0xb509('0x57'),'MAX':'MAX(%s)','MIN':_0xb509('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb509('0x59'),'GROUP_CONCAT ASC':_0xb509('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x13a955={'SEC_TO_TIME':_0xb509('0x5b'),'DATE':_0xb509('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xb509('0x5d'),'UNIX_TIMESTAMP':_0xb509('0x5e')};var _0x54caa4=function(_0x360ebd){return!_['includes']([_0xb509('0x5f'),_0xb509('0x60'),_0xb509('0x61'),'IS\x20NOT\x20EMPTY'],_0x360ebd);};var _0xf876ef=function(_0x551705){if(!_0x551705||!_0x551705[_0xb509('0x62')][_0xb509('0x3a')]){return'';}for(var _0x3e3b54='(',_0x3121d0=0x0;_0x3121d0<_0x551705[_0xb509('0x62')][_0xb509('0x3a')];_0x3121d0+=0x1){_0x3121d0>0x0&&(_0x3e3b54+='\x20'+_0x551705[_0xb509('0x63')]+'\x20');_0x3e3b54+=_0x551705[_0xb509('0x62')][_0x3121d0]['group']?_0xf876ef(_0x551705[_0xb509('0x62')][_0x3121d0][_0xb509('0x64')]):_0x551705[_0xb509('0x62')][_0x3121d0][_0xb509('0x65')]+'\x20'+_0x551705['rules'][_0x3121d0]['condition']+(_0x54caa4(_0x551705[_0xb509('0x62')][_0x3121d0][_0xb509('0x66')])?'\x20'+_0x551705[_0xb509('0x62')][_0x3121d0][_0xb509('0x67')]:'');}return _0x3e3b54+')';};var _0x2de7ef={'where':{'id':_0x1acdd9['params']['id']}},_0x35656c,_0x554590,_0x291b22,_0x230a53,_0x394f4d;_0x2de7ef=_['merge']({},_0x2de7ef,_0x1acdd9[_0xb509('0x47')]);return db[_0xb509('0x2e')][_0xb509('0x48')](_0x2de7ef)[_0xb509('0x24')](function(_0x9e54a4){if(_0x9e54a4){_0x35656c=_0x9e54a4;return _0x9e54a4['getFields']();}return null;})[_0xb509('0x24')](function(_0x51ed7f){if(_0x51ed7f){if(!_0x51ed7f[_0xb509('0x3a')]){throw new db[(_0xb509('0x68'))][(_0xb509('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x554590=_0x51ed7f;return db[_0xb509('0x6a')][_0xb509('0x44')]({'raw':!![]});}return null;})[_0xb509('0x24')](function(_0x25a23b){if(_0x25a23b){_0x291b22=_['keyBy'](_0x25a23b,'id');var _0x43f6b0;var _0x3f7999=squel['select']();_0x3f7999[_0xb509('0x6b')](_0x35656c[_0xb509('0x6c')]);for(var _0x5451f8=0x0;_0x5451f8<_0x554590[_0xb509('0x3a')];_0x5451f8+=0x1){_0x43f6b0=_0x554590[_0x5451f8][_0xb509('0x6d')]?_0x291b22[_0x554590[_0x5451f8][_0xb509('0x6d')]][_0xb509('0x6e')]:_0x554590[_0x5451f8][_0xb509('0x65')];_0x43f6b0=_0x554590[_0x5451f8][_0xb509('0x6f')]?_[_0xb509('0x70')](_0x2c733d[_0x554590[_0x5451f8][_0xb509('0x6f')]],'%s',_0x43f6b0):_0x43f6b0;_0x43f6b0=_0x554590[_0x5451f8][_0xb509('0x71')]?_[_0xb509('0x70')](_0x13a955[_0x554590[_0x5451f8][_0xb509('0x71')]],'%s',_0x43f6b0):_0x43f6b0;if(_0x554590[_0x5451f8][_0xb509('0x72')]){_0x3f7999[_0xb509('0x64')](_0x43f6b0);}_0x554590[_0x5451f8][_0xb509('0x73')]&&_0x3f7999[_0xb509('0x74')](_0x43f6b0,_0x554590[_0x5451f8][_0xb509('0x73')]==='DESC'?![]:!![]);_0x3f7999[_0xb509('0x65')](_0x43f6b0,_0x554590[_0x5451f8][_0xb509('0x75')]||_0x43f6b0);}if(_0x35656c['joins']){_0x35656c[_0xb509('0x76')]=JSON[_0xb509('0x77')](_0x35656c[_0xb509('0x76')]);for(var _0x5db81b=0x0;_0x5db81b<_0x35656c[_0xb509('0x76')]['length'];_0x5db81b+=0x1){if(_0x35656c[_0xb509('0x76')][_0x5db81b][_0xb509('0x31')]&&_[_0xb509('0x78')](_0x13c1c6,_0x35656c['joins'][_0x5db81b][_0xb509('0x31')])&&_0x35656c['joins'][_0x5db81b][_0xb509('0x79')]&&_0x35656c[_0xb509('0x76')][_0x5db81b][_0xb509('0x7a')]&&_0x35656c[_0xb509('0x76')][_0x5db81b][_0xb509('0x7b')]){_0x3f7999[_0x35656c['joins'][_0x5db81b]['type']](_0x35656c[_0xb509('0x76')][_0x5db81b][_0xb509('0x7a')],null,util[_0xb509('0x71')](_0xb509('0x7c'),_0x35656c['table'],_0x35656c[_0xb509('0x76')][_0x5db81b]['parentKey'],_0x35656c[_0xb509('0x76')][_0x5db81b][_0xb509('0x7a')],_0x35656c[_0xb509('0x76')][_0x5db81b][_0xb509('0x7b')]));}}}if(_0x35656c[_0xb509('0x7d')]){_0x35656c[_0xb509('0x7d')]=JSON[_0xb509('0x77')](_0x35656c[_0xb509('0x7d')]);_0x3f7999[_0xb509('0x3e')](_0xf876ef(_0x35656c[_0xb509('0x7d')]['group']));}_0x394f4d=_0x3f7999['clone']();_0x3f7999[_0xb509('0x1f')](_0x36a6d9);_0x3f7999[_0xb509('0x1d')](0x0);logger['debug']('Limited\x20Query:',_0x3f7999['toString']());return dbH[_0xb509('0x7e')][_0xb509('0x34')](_0x3f7999[_0xb509('0x7f')](),{'type':dbH[_0xb509('0x7e')][_0xb509('0x80')]['SELECT']});}})[_0xb509('0x24')](respondWithResult(_0x3aa0d1,null))[_0xb509('0x49')](handleError(_0x3aa0d1,null));};function runReport(_0x13fac9,_0x3f27c4,_0x3bac85){var _0x6f6f63=_0x3f27c4[_0xb509('0x2b')];var _0x388f3a=0xa;var _0x1c374f=['join','left_join','right_join',_0xb509('0x54')];var _0x507dee={'SUM':_0xb509('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb509('0x57'),'MAX':_0xb509('0x81'),'MIN':_0xb509('0x58'),'AVG':_0xb509('0x82'),'GROUP_CONCAT':_0xb509('0x59'),'GROUP_CONCAT ASC':_0xb509('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x41e317={'SEC_TO_TIME':_0xb509('0x5b'),'DATE':'DATE(%s)','HOUR':_0xb509('0x83'),'ROUND':_0xb509('0x5d'),'UNIX_TIMESTAMP':_0xb509('0x5e')};var _0x4415f1=function(_0x4934ec){return!_[_0xb509('0x78')]([_0xb509('0x5f'),_0xb509('0x60'),_0xb509('0x61'),_0xb509('0x84')],_0x4934ec);};var _0x5707fd=function(_0x124462){if(!_0x124462||!_0x124462[_0xb509('0x62')][_0xb509('0x3a')]){return'';}for(var _0x3fe6b6='(',_0x5cd389=0x0;_0x5cd389<_0x124462['rules'][_0xb509('0x3a')];_0x5cd389+=0x1){_0x5cd389>0x0&&(_0x3fe6b6+='\x20'+_0x124462[_0xb509('0x63')]+'\x20');_0x3fe6b6+=_0x124462['rules'][_0x5cd389][_0xb509('0x64')]?_0x5707fd(_0x124462[_0xb509('0x62')][_0x5cd389][_0xb509('0x64')]):_0x124462[_0xb509('0x62')][_0x5cd389][_0xb509('0x65')]+'\x20'+_0x124462[_0xb509('0x62')][_0x5cd389]['condition']+(_0x4415f1(_0x124462[_0xb509('0x62')][_0x5cd389]['condition'])?'\x20'+_0x124462[_0xb509('0x62')][_0x5cd389][_0xb509('0x67')]:'');}return _0x3fe6b6+')';};var _0x5c7c43={'where':{'id':_0x13fac9['id']}},_0x4bcade,_0x4980fa,_0x352933,_0x7e2e22,_0x375886;_0x5c7c43=_[_0xb509('0x3f')]({},_0x5c7c43,_0x3bac85);return db[_0xb509('0x2e')][_0xb509('0x48')](_0x5c7c43)[_0xb509('0x24')](function(_0x411e9b){if(_0x411e9b){_0x4bcade=_0x411e9b;return _0x411e9b['getFields']();}return null;})[_0xb509('0x24')](function(_0x2f8553){if(_0x2f8553){if(!_0x2f8553[_0xb509('0x3a')]){throw new db[(_0xb509('0x68'))]['ValidationErrorItem'](_0xb509('0x85'),0x193);}_0x4980fa=_0x2f8553;return db[_0xb509('0x6a')][_0xb509('0x44')]({'raw':!![]});}return null;})[_0xb509('0x24')](function(_0x172797){if(_0x172797){_0x352933=_[_0xb509('0x86')](_0x172797,'id');var _0x374a69;var _0xa0156f=squel[_0xb509('0x87')]();_0xa0156f['from'](_0x4bcade[_0xb509('0x6c')]);for(var _0xbe31a5=0x0;_0xbe31a5<_0x4980fa['length'];_0xbe31a5+=0x1){_0x374a69=_0x4980fa[_0xbe31a5][_0xb509('0x6d')]?_0x352933[_0x4980fa[_0xbe31a5][_0xb509('0x6d')]][_0xb509('0x6e')]:_0x4980fa[_0xbe31a5][_0xb509('0x65')];_0x374a69=_0x4980fa[_0xbe31a5]['function']?_[_0xb509('0x70')](_0x507dee[_0x4980fa[_0xbe31a5][_0xb509('0x6f')]],'%s',_0x374a69):_0x374a69;_0x374a69=_0x4980fa[_0xbe31a5][_0xb509('0x71')]?_[_0xb509('0x70')](_0x41e317[_0x4980fa[_0xbe31a5][_0xb509('0x71')]],'%s',_0x374a69):_0x374a69;if(_0x4980fa[_0xbe31a5][_0xb509('0x72')]){_0xa0156f[_0xb509('0x64')](_0x374a69);}_0x4980fa[_0xbe31a5][_0xb509('0x73')]&&_0xa0156f['order'](_0x374a69,_0x4980fa[_0xbe31a5][_0xb509('0x73')]===_0xb509('0x88')?![]:!![]);_0xa0156f[_0xb509('0x65')](_0x374a69,_0x4980fa[_0xbe31a5]['alias']||_0x374a69);}if(_0x4bcade[_0xb509('0x76')]){_0x4bcade['joins']=JSON['parse'](_0x4bcade[_0xb509('0x76')]);for(var _0x34b8a1=0x0;_0x34b8a1<_0x4bcade[_0xb509('0x76')][_0xb509('0x3a')];_0x34b8a1+=0x1){if(_0x4bcade[_0xb509('0x76')][_0x34b8a1]['type']&&_['includes'](_0x1c374f,_0x4bcade[_0xb509('0x76')][_0x34b8a1]['type'])&&_0x4bcade[_0xb509('0x76')][_0x34b8a1][_0xb509('0x79')]&&_0x4bcade[_0xb509('0x76')][_0x34b8a1][_0xb509('0x7a')]&&_0x4bcade[_0xb509('0x76')][_0x34b8a1][_0xb509('0x7b')]){_0xa0156f[_0x4bcade[_0xb509('0x76')][_0x34b8a1][_0xb509('0x31')]](_0x4bcade[_0xb509('0x76')][_0x34b8a1]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4bcade[_0xb509('0x6c')],_0x4bcade[_0xb509('0x76')][_0x34b8a1][_0xb509('0x79')],_0x4bcade['joins'][_0x34b8a1][_0xb509('0x7a')],_0x4bcade[_0xb509('0x76')][_0x34b8a1][_0xb509('0x7b')]));}}}if(_0x4bcade[_0xb509('0x7d')]){_0x4bcade['conditions']=JSON[_0xb509('0x77')](_0x4bcade[_0xb509('0x7d')]);_0xa0156f[_0xb509('0x3e')](_0x5707fd(_0x4bcade[_0xb509('0x7d')]['group']));}_0x375886=_0xa0156f[_0xb509('0x89')]();_0xa0156f[_0xb509('0x1f')](_0x388f3a);_0xa0156f['offset'](0x0);return;}})['then'](function(){if(_0x3f27c4['output']===_0xb509('0x8a')){return null;}var _0x4c3155=_[_0xb509('0x3f')](_0x3f27c4,{'name':_0x3f27c4[_0xb509('0x8b')]||_0x3f27c4[_0xb509('0x2b')]||_0x4bcade[_0xb509('0x2b')],'basename':_0x6f6f63,'savename':util[_0xb509('0x71')](_0xb509('0x8c'),_0x3f27c4['name']||_0x4bcade[_0xb509('0x2b')],require(_0xb509('0x8d'))[_0xb509('0x8e')](0x4),_0x3f27c4[_0xb509('0x8f')]||_0xb509('0x90')),'reportId':_0x4bcade['id'],'reportType':_0xb509('0x91')});return db['AnalyticExtractedReport']['create'](_0x4c3155,{'raw':!![]});})['then'](function(_0x2d7fcd){if(_0x4bcade[_0xb509('0x6c')]===_0xb509('0x92')){_0x375886[_0xb509('0x3e')](_0x4bcade[_0xb509('0x6c')]+_0xb509('0x93'),_0x3f27c4[_0xb509('0x94')],_0x3f27c4[_0xb509('0x95')]);}else{_0x375886[_0xb509('0x3e')](_0x4bcade[_0xb509('0x6c')]+_0xb509('0x96'),_0x3f27c4[_0xb509('0x94')],_0x3f27c4['endDate']);}if(_0x2d7fcd){logger[_0xb509('0x97')](_0xb509('0x98'),_0x375886[_0xb509('0x7f')]());require(_0xb509('0x99'))[_0xb509('0x9a')](path[_0xb509('0x51')](__dirname,_0xb509('0x9b'),_0x2d7fcd[_0xb509('0x8f')]),[_0x2d7fcd['id'],_0x375886[_0xb509('0x7f')](),path[_0xb509('0x51')](__dirname,_0xb509('0x9c'),_0x2d7fcd[_0xb509('0x9d')]),_0x6f6f63]);return _0x2d7fcd;}else{var _0x39366b=squel['select']();_0x39366b['from']('('+_0x375886['toString']()+')',_0xb509('0x9e'));_0x39366b[_0xb509('0x65')](_0xb509('0x9f'),_0xb509('0x41'));_0x375886[_0xb509('0x1f')](_0x3f27c4['limit']||_0x388f3a);_0x375886[_0xb509('0x1d')](_0x3f27c4[_0xb509('0x1d')]||0x0);return dbH[_0xb509('0x7e')][_0xb509('0x34')](_0x39366b[_0xb509('0x7f')](),{'type':dbH['sequelize'][_0xb509('0x80')][_0xb509('0xa0')]})[_0xb509('0x24')](function(_0x115a89){if(!_0x115a89[_0xb509('0x3a')]){_0x7e2e22=0x0;}else{_0x7e2e22=_0x115a89[0x0][_0xb509('0x41')]||0x0;}return dbH[_0xb509('0x7e')][_0xb509('0x34')](_0x375886['toString'](),{'type':dbH[_0xb509('0x7e')][_0xb509('0x80')][_0xb509('0xa0')]});})[_0xb509('0x24')](function(_0x1f70c3){return{'rows':_0x1f70c3||[],'count':_0x7e2e22};});}});}exports[_0xb509('0xa1')]=function(_0x1418cf,_0x5bbace){return runReport(_0x1418cf['params'],_0x1418cf['query'],_0x1418cf[_0xb509('0x47')])[_0xb509('0x24')](respondWithResult(_0x5bbace,null))[_0xb509('0x49')](handleError(_0x5bbace,null));};exports[_0xb509('0xa2')]=runReport;exports[_0xb509('0x34')]=function(_0x581a2d,_0x243624){var _0x438006=0xa;var _0x23e154=[_0xb509('0x51'),'left_join',_0xb509('0x53'),_0xb509('0x54')];var _0x11db3b={'SUM':'SUM(%s)','COUNT':_0xb509('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb509('0x81'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xb509('0x59'),'GROUP_CONCAT ASC':_0xb509('0x5a'),'GROUP_CONCAT DESC':_0xb509('0xa3')};var _0x110a96={'SEC_TO_TIME':_0xb509('0x5b'),'DATE':_0xb509('0x5c'),'HOUR':_0xb509('0x83'),'ROUND':_0xb509('0x5d'),'UNIX_TIMESTAMP':_0xb509('0x5e')};var _0x3106ea=function(_0x16b523){return!_[_0xb509('0x78')]([_0xb509('0x5f'),'IS\x20NOT\x20NULL',_0xb509('0x61'),_0xb509('0x84')],_0x16b523);};var _0x14fccb=function(_0x5b20b1){if(!_0x5b20b1||!_0x5b20b1[_0xb509('0x62')][_0xb509('0x3a')]){return'';}for(var _0x3aedc6='(',_0x2d418f=0x0;_0x2d418f<_0x5b20b1[_0xb509('0x62')]['length'];_0x2d418f+=0x1){_0x2d418f>0x0&&(_0x3aedc6+='\x20'+_0x5b20b1[_0xb509('0x63')]+'\x20');_0x3aedc6+=_0x5b20b1[_0xb509('0x62')][_0x2d418f]['group']?_0x14fccb(_0x5b20b1[_0xb509('0x62')][_0x2d418f][_0xb509('0x64')]):_0x5b20b1['rules'][_0x2d418f]['field']+'\x20'+_0x5b20b1[_0xb509('0x62')][_0x2d418f][_0xb509('0x66')]+(_0x3106ea(_0x5b20b1['rules'][_0x2d418f][_0xb509('0x66')])?'\x20'+_0x5b20b1[_0xb509('0x62')][_0x2d418f][_0xb509('0x67')]:'');}return _0x3aedc6+')';};var _0x1b7185={'where':{'id':_0x581a2d[_0xb509('0x46')]['id']}},_0xdbcbd4,_0x25aede,_0x4a7b4d,_0x46f64a,_0x362cae;_0x1b7185=_['merge']({},_0x1b7185,_0x581a2d[_0xb509('0x47')]);return db[_0xb509('0x2e')]['find'](_0x1b7185)[_0xb509('0x24')](function(_0x13f199){if(_0x13f199){_0xdbcbd4=_0x13f199;return _0x13f199[_0xb509('0xa4')]();}return null;})[_0xb509('0x24')](function(_0x4ad302){if(_0x4ad302){if(!_0x4ad302['length']){throw new db[(_0xb509('0x68'))]['ValidationErrorItem'](_0xb509('0x85'),0x193);}_0x25aede=_0x4ad302;return db[_0xb509('0x6a')][_0xb509('0x44')]({'raw':!![]});}return null;})[_0xb509('0x24')](function(_0x286c91){if(_0x286c91){_0x4a7b4d=_[_0xb509('0x86')](_0x286c91,'id');var _0x10bc10;var _0x44b86a=squel[_0xb509('0x87')]();_0x44b86a[_0xb509('0x6b')](_0xdbcbd4[_0xb509('0x6c')]);for(var _0x2115be=0x0;_0x2115be<_0x25aede['length'];_0x2115be+=0x1){_0x10bc10=_0x25aede[_0x2115be][_0xb509('0x6d')]?_0x4a7b4d[_0x25aede[_0x2115be]['MetricId']][_0xb509('0x6e')]:_0x25aede[_0x2115be][_0xb509('0x65')];_0x10bc10=_0x25aede[_0x2115be]['function']?_[_0xb509('0x70')](_0x11db3b[_0x25aede[_0x2115be][_0xb509('0x6f')]],'%s',_0x10bc10):_0x10bc10;_0x10bc10=_0x25aede[_0x2115be][_0xb509('0x71')]?_[_0xb509('0x70')](_0x110a96[_0x25aede[_0x2115be][_0xb509('0x71')]],'%s',_0x10bc10):_0x10bc10;if(_0x25aede[_0x2115be][_0xb509('0x72')]){_0x44b86a[_0xb509('0x64')](_0x10bc10);}_0x25aede[_0x2115be][_0xb509('0x73')]&&_0x44b86a[_0xb509('0x74')](_0x10bc10,_0x25aede[_0x2115be][_0xb509('0x73')]==='DESC'?![]:!![]);_0x44b86a[_0xb509('0x65')](_0x10bc10,_0x25aede[_0x2115be]['alias']||_0x10bc10);}if(_0xdbcbd4['joins']){_0xdbcbd4[_0xb509('0x76')]=JSON[_0xb509('0x77')](_0xdbcbd4['joins']);for(var _0x22a3e2=0x0;_0x22a3e2<_0xdbcbd4[_0xb509('0x76')]['length'];_0x22a3e2+=0x1){if(_0xdbcbd4[_0xb509('0x76')][_0x22a3e2][_0xb509('0x31')]&&_[_0xb509('0x78')](_0x23e154,_0xdbcbd4[_0xb509('0x76')][_0x22a3e2][_0xb509('0x31')])&&_0xdbcbd4[_0xb509('0x76')][_0x22a3e2][_0xb509('0x79')]&&_0xdbcbd4[_0xb509('0x76')][_0x22a3e2][_0xb509('0x7a')]&&_0xdbcbd4[_0xb509('0x76')][_0x22a3e2][_0xb509('0x7b')]){_0x44b86a[_0xdbcbd4[_0xb509('0x76')][_0x22a3e2][_0xb509('0x31')]](_0xdbcbd4[_0xb509('0x76')][_0x22a3e2]['foreignTable'],null,util['format'](_0xb509('0x7c'),_0xdbcbd4[_0xb509('0x6c')],_0xdbcbd4[_0xb509('0x76')][_0x22a3e2][_0xb509('0x79')],_0xdbcbd4[_0xb509('0x76')][_0x22a3e2][_0xb509('0x7a')],_0xdbcbd4['joins'][_0x22a3e2][_0xb509('0x7b')]));}}}if(_0xdbcbd4[_0xb509('0x7d')]){_0xdbcbd4['conditions']=JSON[_0xb509('0x77')](_0xdbcbd4[_0xb509('0x7d')]);_0x44b86a[_0xb509('0x3e')](_0x14fccb(_0xdbcbd4[_0xb509('0x7d')][_0xb509('0x64')]));}_0x362cae=_0x44b86a['clone']();_0x44b86a['limit'](_0x438006);_0x44b86a[_0xb509('0x1d')](0x0);logger[_0xb509('0xa5')](_0xb509('0xa6'),_0x44b86a[_0xb509('0x7f')]());return dbH[_0xb509('0x7e')][_0xb509('0x34')](_0x44b86a[_0xb509('0x7f')](),{'type':dbH[_0xb509('0x7e')][_0xb509('0x80')][_0xb509('0xa0')]});}})[_0xb509('0x24')](function(){return{'sql':_0x362cae[_0xb509('0x7f')]()};})[_0xb509('0x24')](respondWithResult(_0x243624,null))[_0xb509('0x49')](handleError(_0x243624,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 800f45b..01574b6 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 _0x24d5=['util','../../config/logger','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash'];(function(_0x11e4f3,_0x28f89e){var _0x541e85=function(_0x2999e6){while(--_0x2999e6){_0x11e4f3['push'](_0x11e4f3['shift']());}};_0x541e85(++_0x28f89e);}(_0x24d5,0x1b7));var _0x524d=function(_0xb2dbb2,_0x2a311e){_0xb2dbb2=_0xb2dbb2-0x0;var _0x123734=_0x24d5[_0xb2dbb2];return _0x123734;};'use strict';var _=require(_0x524d('0x0'));var util=require(_0x524d('0x1'));var logger=require(_0x524d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x524d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x524d('0x4'));var config=require(_0x524d('0x5'));var attributes=require(_0x524d('0x6'));module[_0x524d('0x7')]=function(_0x51ada8,_0x5354e8){return _0x51ada8[_0x524d('0x8')](_0x524d('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x96cf=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x524994,_0x1a97c4){var _0x2a4a25=function(_0x3a7e16){while(--_0x3a7e16){_0x524994['push'](_0x524994['shift']());}};_0x2a4a25(++_0x1a97c4);}(_0x96cf,0xb7));var _0xf96c=function(_0x40fd56,_0x4ae7d0){_0x40fd56=_0x40fd56-0x0;var _0x5078e3=_0x96cf[_0x40fd56];return _0x5078e3;};'use strict';var _=require(_0xf96c('0x0'));var util=require(_0xf96c('0x1'));var logger=require('../../config/logger')(_0xf96c('0x2'));var moment=require(_0xf96c('0x3'));var BPromise=require(_0xf96c('0x4'));var rp=require(_0xf96c('0x5'));var fs=require('fs');var path=require(_0xf96c('0x6'));var rimraf=require(_0xf96c('0x7'));var config=require(_0xf96c('0x8'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x810d4a,_0x50ce79){return _0x810d4a[_0xf96c('0x9')](_0xf96c('0xa'),attributes,{'tableName':_0xf96c('0xb'),'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 74fc08c..bf85c64 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 _0x0c2f=['jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x4d3aa6,_0x972c6a){var _0x4014b6=function(_0x48bb6e){while(--_0x48bb6e){_0x4d3aa6['push'](_0x4d3aa6['shift']());}};_0x4014b6(++_0x972c6a);}(_0x0c2f,0x99));var _0xf0c2=function(_0x314397,_0x550526){_0x314397=_0x314397-0x0;var _0x1ec45e=_0x0c2f[_0x314397];return _0x1ec45e;};'use strict';var _=require(_0xf0c2('0x0'));var util=require(_0xf0c2('0x1'));var moment=require(_0xf0c2('0x2'));var BPromise=require(_0xf0c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0c2('0x4'));var db=require(_0xf0c2('0x5'))['db'];var utils=require(_0xf0c2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0c2('0x7'));var jayson=require(_0xf0c2('0x8'));var client=jayson[_0xf0c2('0x9')][_0xf0c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bb522,_0x56c279,_0x136ddf){return new BPromise(function(_0x3c1cc4,_0x28225e){return client[_0xf0c2('0xb')](_0x4bb522,_0x136ddf)[_0xf0c2('0xc')](function(_0x442d3e){logger['info'](_0xf0c2('0xd'),_0x56c279,_0xf0c2('0xe'));logger[_0xf0c2('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x56c279,_0xf0c2('0xe'),JSON[_0xf0c2('0x10')](_0x442d3e));if(_0x442d3e[_0xf0c2('0x11')]){if(_0x442d3e['error'][_0xf0c2('0x12')]===0x1f4){logger[_0xf0c2('0x11')](_0xf0c2('0xd'),_0x56c279,_0x442d3e[_0xf0c2('0x11')][_0xf0c2('0x13')]);return _0x28225e(_0x442d3e[_0xf0c2('0x11')][_0xf0c2('0x13')]);}logger[_0xf0c2('0x11')](_0xf0c2('0xd'),_0x56c279,_0x442d3e[_0xf0c2('0x11')]['message']);return _0x3c1cc4(_0x442d3e[_0xf0c2('0x11')][_0xf0c2('0x13')]);}else{logger[_0xf0c2('0x14')](_0xf0c2('0xd'),_0x56c279,'request\x20sent');_0x3c1cc4(_0x442d3e[_0xf0c2('0x15')][_0xf0c2('0x13')]);}})[_0xf0c2('0x16')](function(_0xfbde41){logger[_0xf0c2('0x11')](_0xf0c2('0xd'),_0x56c279,_0xfbde41);_0x28225e(_0xfbde41);});});}
\ No newline at end of file
+var _0x7caa=['then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x7caa,0x95));var _0xa7ca=function(_0x3cd2bb,_0x352bf5){_0x3cd2bb=_0x3cd2bb-0x0;var _0x14f4d5=_0x7caa[_0x3cd2bb];return _0x14f4d5;};'use strict';var _=require('lodash');var util=require(_0xa7ca('0x0'));var moment=require('moment');var BPromise=require(_0xa7ca('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa7ca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7ca('0x3'));var logger=require(_0xa7ca('0x4'))(_0xa7ca('0x5'));var config=require(_0xa7ca('0x6'));var jayson=require(_0xa7ca('0x7'));var client=jayson[_0xa7ca('0x8')][_0xa7ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18b0b3,_0x428307,_0x1c6b56){return new BPromise(function(_0x48f57c,_0x5d2b34){return client[_0xa7ca('0xa')](_0x18b0b3,_0x1c6b56)[_0xa7ca('0xb')](function(_0x9f1c6c){logger[_0xa7ca('0xc')](_0xa7ca('0xd'),_0x428307,_0xa7ca('0xe'));logger[_0xa7ca('0xf')](_0xa7ca('0x10'),_0x428307,_0xa7ca('0xe'),JSON['stringify'](_0x9f1c6c));if(_0x9f1c6c[_0xa7ca('0x11')]){if(_0x9f1c6c['error']['code']===0x1f4){logger[_0xa7ca('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x428307,_0x9f1c6c[_0xa7ca('0x11')][_0xa7ca('0x12')]);return _0x5d2b34(_0x9f1c6c[_0xa7ca('0x11')]['message']);}logger[_0xa7ca('0x11')](_0xa7ca('0xd'),_0x428307,_0x9f1c6c['error']['message']);return _0x48f57c(_0x9f1c6c[_0xa7ca('0x11')][_0xa7ca('0x12')]);}else{logger[_0xa7ca('0xc')](_0xa7ca('0xd'),_0x428307,_0xa7ca('0xe'));_0x48f57c(_0x9f1c6c[_0xa7ca('0x13')]['message']);}})['catch'](function(_0xe16b92){logger[_0xa7ca('0x11')](_0xa7ca('0xd'),_0x428307,_0xe16b92);_0x5d2b34(_0xe16b92);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index c8f5f13..c86dff3 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 _0xefd2=['express','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xefd2,0x1d7));var _0x2efd=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xefd2[_0x26f702];return _0x11417d;};'use strict';var multer=require(_0x2efd('0x0'));var util=require(_0x2efd('0x1'));var path=require(_0x2efd('0x2'));var timeout=require(_0x2efd('0x3'));var express=require(_0x2efd('0x4'));var router=express['Router']();var fs_extra=require(_0x2efd('0x5'));var auth=require(_0x2efd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2efd('0x7'));router[_0x2efd('0x8')]('/',auth[_0x2efd('0x9')](),controller[_0x2efd('0xa')]);router[_0x2efd('0x8')](_0x2efd('0xb'),auth[_0x2efd('0x9')](),controller['show']);router['get'](_0x2efd('0xc'),auth[_0x2efd('0x9')](),controller[_0x2efd('0xd')]);router[_0x2efd('0x8')](_0x2efd('0xe'),auth['isAuthenticated'](),controller[_0x2efd('0xf')]);router[_0x2efd('0x8')](_0x2efd('0x10'),auth[_0x2efd('0x9')](),controller[_0x2efd('0x11')]);router[_0x2efd('0x12')]('/',auth[_0x2efd('0x9')](),controller[_0x2efd('0x13')]);router[_0x2efd('0x14')](_0x2efd('0xb'),auth[_0x2efd('0x9')](),controller[_0x2efd('0x15')]);router[_0x2efd('0x16')](_0x2efd('0xb'),auth[_0x2efd('0x9')](),controller[_0x2efd('0x17')]);module[_0x2efd('0x18')]=router;
\ No newline at end of file
+var _0x14dd=['../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','query','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x268b12,_0x26c1eb){var _0x496df5=function(_0x663d5c){while(--_0x663d5c){_0x268b12['push'](_0x268b12['shift']());}};_0x496df5(++_0x26c1eb);}(_0x14dd,0x76));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd14d('0x0'));var util=require(_0xd14d('0x1'));var path=require(_0xd14d('0x2'));var timeout=require(_0xd14d('0x3'));var express=require(_0xd14d('0x4'));var router=express[_0xd14d('0x5')]();var fs_extra=require(_0xd14d('0x6'));var auth=require(_0xd14d('0x7'));var interaction=require(_0xd14d('0x8'));var config=require('../../config/environment');var controller=require(_0xd14d('0x9'));router[_0xd14d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd14d('0xa')](_0xd14d('0xb'),auth[_0xd14d('0xc')](),controller[_0xd14d('0xd')]);router['get'](_0xd14d('0xe'),auth['isAuthenticated'](),controller[_0xd14d('0xf')]);router[_0xd14d('0xa')](_0xd14d('0x10'),auth[_0xd14d('0xc')](),controller[_0xd14d('0x11')]);router[_0xd14d('0xa')]('/:id/query',auth['isAuthenticated'](),controller[_0xd14d('0x12')]);router[_0xd14d('0x13')]('/',auth[_0xd14d('0xc')](),controller[_0xd14d('0x14')]);router[_0xd14d('0x15')](_0xd14d('0xb'),auth[_0xd14d('0xc')](),controller['update']);router[_0xd14d('0x16')](_0xd14d('0xb'),auth[_0xd14d('0xc')](),controller[_0xd14d('0x17')]);module[_0xd14d('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index b61dfe8..60185fa 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x46ed,0x168));var _0xd46e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x46ed[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0x5d58=['TEXT','STRING'];(function(_0x1c22ea,_0x1adef1){var _0x326677=function(_0x5dbddb){while(--_0x5dbddb){_0x1c22ea['push'](_0x1c22ea['shift']());}};_0x326677(++_0x1adef1);}(_0x5d58,0x187));var _0x85d5=function(_0x3bc907,_0x641105){_0x3bc907=_0x3bc907-0x0;var _0x4a4b29=_0x5d58[_0x3bc907];return _0x4a4b29;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 5b79871..53ab559 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 _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(_0x5ea60d,_0xf1b6f3){_0x5ea60d=_0x5ea60d-0x0;var _0x1d14eb=_0x687b[_0x5ea60d];return _0x1d14eb;};'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
+var _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0xd05ee1,_0x21a5e7){var _0x123a98=function(_0xf076ae){while(--_0xf076ae){_0xd05ee1['push'](_0xd05ee1['shift']());}};_0x123a98(++_0x21a5e7);}(_0x46ed,0x168));var _0xd46e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x46ed[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5869774..47184c8 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 _0xaafa=['../../config/environment','exports','define','lodash','../../config/logger','api','moment','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaafa,0x12b));var _0xaaaf=function(_0x1443bb,_0x4453bb){_0x1443bb=_0x1443bb-0x0;var _0x5e3690=_0xaafa[_0x1443bb];return _0x5e3690;};'use strict';var _=require(_0xaaaf('0x0'));var util=require('util');var logger=require(_0xaaaf('0x1'))(_0xaaaf('0x2'));var moment=require(_0xaaaf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaaaf('0x4'));var config=require(_0xaaaf('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0xaaaf('0x6')]=function(_0x127f03,_0x3e49bc){return _0x127f03[_0xaaaf('0x7')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x17a6=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define'];(function(_0xf0ecb7,_0x1b712e){var _0x36667f=function(_0x5ad880){while(--_0x5ad880){_0xf0ecb7['push'](_0xf0ecb7['shift']());}};_0x36667f(++_0x1b712e);}(_0x17a6,0xc8));var _0x617a=function(_0x3f7249,_0x559dd3){_0x3f7249=_0x3f7249-0x0;var _0x422cbb=_0x17a6[_0x3f7249];return _0x422cbb;};'use strict';var _=require(_0x617a('0x0'));var util=require(_0x617a('0x1'));var logger=require(_0x617a('0x2'))(_0x617a('0x3'));var moment=require(_0x617a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x617a('0x5'));var rimraf=require(_0x617a('0x6'));var config=require(_0x617a('0x7'));var attributes=require(_0x617a('0x8'));module['exports']=function(_0x205a3d,_0x2b37f1){return _0x205a3d[_0x617a('0x9')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 74dbbe5..ad2066d 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 _0x3c59=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x3c59,0x8c));var _0x93c5=function(_0x56f722,_0x1c137a){_0x56f722=_0x56f722-0x0;var _0x4b2f67=_0x3c59[_0x56f722];return _0x4b2f67;};'use strict';var _=require(_0x93c5('0x0'));var util=require(_0x93c5('0x1'));var moment=require('moment');var BPromise=require(_0x93c5('0x2'));var rs=require(_0x93c5('0x3'));var fs=require('fs');var Redis=require(_0x93c5('0x4'));var db=require(_0x93c5('0x5'))['db'];var utils=require(_0x93c5('0x6'));var logger=require('../../config/logger')(_0x93c5('0x7'));var config=require('../../config/environment');var jayson=require(_0x93c5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c401d,_0x41627d,_0x2deb94){return new BPromise(function(_0x1aaa12,_0x4098c8){return client[_0x93c5('0x9')](_0x3c401d,_0x2deb94)['then'](function(_0x150241){logger[_0x93c5('0xa')](_0x93c5('0xb'),_0x41627d,_0x93c5('0xc'));logger['debug'](_0x93c5('0xd'),_0x41627d,_0x93c5('0xc'),JSON[_0x93c5('0xe')](_0x150241));if(_0x150241[_0x93c5('0xf')]){if(_0x150241[_0x93c5('0xf')]['code']===0x1f4){logger[_0x93c5('0xf')](_0x93c5('0xb'),_0x41627d,_0x150241[_0x93c5('0xf')][_0x93c5('0x10')]);return _0x4098c8(_0x150241['error'][_0x93c5('0x10')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x41627d,_0x150241[_0x93c5('0xf')]['message']);return _0x1aaa12(_0x150241[_0x93c5('0xf')][_0x93c5('0x10')]);}else{logger[_0x93c5('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x41627d,_0x93c5('0xc'));_0x1aaa12(_0x150241[_0x93c5('0x11')]['message']);}})[_0x93c5('0x12')](function(_0x36f343){logger[_0x93c5('0xf')](_0x93c5('0xb'),_0x41627d,_0x36f343);_0x4098c8(_0x36f343);});});}
\ No newline at end of file
+var _0x49c8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x5490b6,_0x518350){var _0x3a9f0b=function(_0x4d0e0f){while(--_0x4d0e0f){_0x5490b6['push'](_0x5490b6['shift']());}};_0x3a9f0b(++_0x518350);}(_0x49c8,0x72));var _0x849c=function(_0x470b0d,_0x503a3c){_0x470b0d=_0x470b0d-0x0;var _0x3d5309=_0x49c8[_0x470b0d];return _0x3d5309;};'use strict';var _=require(_0x849c('0x0'));var util=require(_0x849c('0x1'));var moment=require(_0x849c('0x2'));var BPromise=require(_0x849c('0x3'));var rs=require(_0x849c('0x4'));var fs=require('fs');var Redis=require(_0x849c('0x5'));var db=require(_0x849c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x849c('0x7'));var config=require(_0x849c('0x8'));var jayson=require(_0x849c('0x9'));var client=jayson[_0x849c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c4ea1,_0x488743,_0x541809){return new BPromise(function(_0x5e4d94,_0x20a86c){return client[_0x849c('0xb')](_0x1c4ea1,_0x541809)[_0x849c('0xc')](function(_0x57c831){logger[_0x849c('0xd')](_0x849c('0xe'),_0x488743,_0x849c('0xf'));logger[_0x849c('0x10')](_0x849c('0x11'),_0x488743,'request\x20sent',JSON[_0x849c('0x12')](_0x57c831));if(_0x57c831[_0x849c('0x13')]){if(_0x57c831[_0x849c('0x13')][_0x849c('0x14')]===0x1f4){logger[_0x849c('0x13')](_0x849c('0xe'),_0x488743,_0x57c831[_0x849c('0x13')][_0x849c('0x15')]);return _0x20a86c(_0x57c831[_0x849c('0x13')][_0x849c('0x15')]);}logger[_0x849c('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x488743,_0x57c831[_0x849c('0x13')][_0x849c('0x15')]);return _0x5e4d94(_0x57c831[_0x849c('0x13')][_0x849c('0x15')]);}else{logger['info'](_0x849c('0xe'),_0x488743,'request\x20sent');_0x5e4d94(_0x57c831['result'][_0x849c('0x15')]);}})[_0x849c('0x16')](function(_0x5c54bd){logger[_0x849c('0x13')](_0x849c('0xe'),_0x488743,_0x5c54bd);_0x20a86c(_0x5c54bd);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 271749a..0f16f98 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 _0x2f1c=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','create','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2f1c,0x68));var _0xc2f1=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x2f1c[_0x4bd06e];return _0x85ebb;};'use strict';var multer=require(_0xc2f1('0x0'));var util=require(_0xc2f1('0x1'));var path=require(_0xc2f1('0x2'));var timeout=require(_0xc2f1('0x3'));var express=require(_0xc2f1('0x4'));var router=express[_0xc2f1('0x5')]();var fs_extra=require(_0xc2f1('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc2f1('0x7'));var controller=require(_0xc2f1('0x8'));router[_0xc2f1('0x9')]('/',auth['isAuthenticated'](),controller[_0xc2f1('0xa')]);router['get'](_0xc2f1('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc2f1('0xc'),auth[_0xc2f1('0xd')](),controller[_0xc2f1('0xe')]);router[_0xc2f1('0x9')](_0xc2f1('0xf'),auth[_0xc2f1('0xd')](),controller[_0xc2f1('0x10')]);router[_0xc2f1('0x9')](_0xc2f1('0x11'),auth[_0xc2f1('0xd')](),controller[_0xc2f1('0x12')]);router['post']('/',auth[_0xc2f1('0xd')](),controller[_0xc2f1('0x13')]);router[_0xc2f1('0x14')]('/:id',auth[_0xc2f1('0xd')](),controller[_0xc2f1('0x15')]);router[_0xc2f1('0x16')](_0xc2f1('0xb'),auth[_0xc2f1('0xd')](),controller[_0xc2f1('0x17')]);module[_0xc2f1('0x18')]=router;
\ No newline at end of file
+var _0x0278=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete','exports'];(function(_0x587cb3,_0x5cddc1){var _0x444931=function(_0x31db46){while(--_0x31db46){_0x587cb3['push'](_0x587cb3['shift']());}};_0x444931(++_0x5cddc1);}(_0x0278,0x18c));var _0x8027=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x0278[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8027('0x0'));var timeout=require(_0x8027('0x1'));var express=require(_0x8027('0x2'));var router=express[_0x8027('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8027('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8027('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0x8027('0x6')]('/',auth[_0x8027('0x7')](),controller[_0x8027('0x8')]);router['get'](_0x8027('0x9'),auth['isAuthenticated'](),controller[_0x8027('0xa')]);router[_0x8027('0x6')](_0x8027('0xb'),auth['isAuthenticated'](),controller[_0x8027('0xc')]);router[_0x8027('0x6')]('/:id/run',auth[_0x8027('0x7')](),controller[_0x8027('0xd')]);router['get'](_0x8027('0xe'),auth[_0x8027('0x7')](),controller[_0x8027('0xf')]);router[_0x8027('0x10')]('/',auth[_0x8027('0x7')](),controller[_0x8027('0x11')]);router[_0x8027('0x12')](_0x8027('0x9'),auth[_0x8027('0x7')](),controller[_0x8027('0x13')]);router[_0x8027('0x14')](_0x8027('0x9'),auth[_0x8027('0x7')](),controller['destroy']);module[_0x8027('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 0602a52..419207a 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 _0xeace=['STRING','csv','pdf','xlsx','DATE','Loading','ENUM','manual','scheduled','UNSIGNED','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xeace,0x15f));var _0xeeac=function(_0x551a6d,_0x3c731d){_0x551a6d=_0x551a6d-0x0;var _0x566129=_0xeace[_0x551a6d];return _0x566129;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xeeac('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xeeac('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xeeac('0x2'),_0xeeac('0x3'),_0xeeac('0x4')),'allowNull':![],'defaultValue':_0xeeac('0x2')},'savename':{'type':Sequelize[_0xeeac('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xeeac('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xeeac('0x1')],'defaultValue':_0xeeac('0x6')},'type':{'type':Sequelize[_0xeeac('0x7')](_0xeeac('0x8'),_0xeeac('0x9')),'allowNull':![],'defaultValue':_0xeeac('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xeeac('0xa')]},'reportType':{'type':Sequelize[_0xeeac('0x1')]}};
\ No newline at end of file
+var _0x29d7=['manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x276dfc,_0x1cc347){var _0x285cd9=function(_0x4a652b){while(--_0x4a652b){_0x276dfc['push'](_0x276dfc['shift']());}};_0x285cd9(++_0x1cc347);}(_0x29d7,0x197));var _0x729d=function(_0x2c068e,_0x1fb4b6){_0x2c068e=_0x2c068e-0x0;var _0x47cbed=_0x29d7[_0x2c068e];return _0x47cbed;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x729d('0x0'));module[_0x729d('0x1')]={'name':{'type':Sequelize[_0x729d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x729d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x729d('0x3')](_0x729d('0x4'),_0x729d('0x5'),_0x729d('0x6')),'allowNull':![],'defaultValue':_0x729d('0x4')},'savename':{'type':Sequelize[_0x729d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x729d('0x7')]},'status':{'type':Sequelize[_0x729d('0x2')],'defaultValue':_0x729d('0x8')},'type':{'type':Sequelize[_0x729d('0x3')](_0x729d('0x9'),_0x729d('0xa')),'allowNull':![],'defaultValue':_0x729d('0x9')},'reportId':{'type':Sequelize[_0x729d('0xb')](0xb)[_0x729d('0xc')]},'reportType':{'type':Sequelize[_0x729d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index f98166d..3d7d3e3 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 _0xd41e=['fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','ExtractedReports','UserProfileResource','then','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','rows','catch','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','exists','format','toLowerCase','eml-format','rimraf'];(function(_0xef6b2f,_0x215ee6){var _0x44b6fb=function(_0x33ff6b){while(--_0x33ff6b){_0xef6b2f['push'](_0xef6b2f['shift']());}};_0x44b6fb(++_0x215ee6);}(_0xd41e,0x115));var _0xed41=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xd41e[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0xed41('0x0'));var rimraf=require(_0xed41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed41('0x2'));var rp=require(_0xed41('0x3'));var moment=require('moment');var BPromise=require(_0xed41('0x4'));var Mustache=require('mustache');var util=require(_0xed41('0x5'));var path=require('path');var sox=require(_0xed41('0x6'));var csv=require(_0xed41('0x7'));var ejs=require(_0xed41('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed41('0x9'));var squel=require(_0xed41('0xa'));var crypto=require('crypto');var jsforce=require(_0xed41('0xb'));var deskjs=require(_0xed41('0xc'));var toCsv=require(_0xed41('0x7'));var querystring=require(_0xed41('0xd'));var Papa=require(_0xed41('0xe'));var Redis=require(_0xed41('0xf'));var authService=require(_0xed41('0x10'));var qs=require(_0xed41('0x11'));var as=require(_0xed41('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed41('0x13'))(_0xed41('0x14'));var utils=require('../../config/utils');var config=require(_0xed41('0x15'));var licenseUtil=require(_0xed41('0x16'));var db=require(_0xed41('0x17'))['db'];function respondWithStatusCode(_0x3731df,_0x112771){_0x112771=_0x112771||0xcc;return function(_0x3f4f41){if(_0x3f4f41){return _0x3731df[_0xed41('0x18')](_0x112771);}return _0x3731df[_0xed41('0x19')](_0x112771)[_0xed41('0x1a')]();};}function respondWithResult(_0x38a7f8,_0x15092e){_0x15092e=_0x15092e||0xc8;return function(_0x1c97fa){if(_0x1c97fa){return _0x38a7f8[_0xed41('0x19')](_0x15092e)[_0xed41('0x1b')](_0x1c97fa);}};}function respondWithFilteredResult(_0x249b1c,_0x49843c){return function(_0x4017c2){if(_0x4017c2){var _0x24917b=typeof _0x49843c[_0xed41('0x1c')]==='undefined'&&typeof _0x49843c[_0xed41('0x1d')]===_0xed41('0x1e');var _0x2d1d55=_0x4017c2[_0xed41('0x1f')];var _0x388b33=_0x24917b?0x0:_0x49843c[_0xed41('0x1c')];var _0x4fe58b=_0x24917b?_0x4017c2[_0xed41('0x1f')]:_0x49843c[_0xed41('0x1c')]+_0x49843c[_0xed41('0x1d')];var _0x486d2c;if(_0x4fe58b>=_0x2d1d55){_0x4fe58b=_0x2d1d55;_0x486d2c=0xc8;}else{_0x486d2c=0xce;}_0x249b1c[_0xed41('0x19')](_0x486d2c);return _0x249b1c[_0xed41('0x20')](_0xed41('0x21'),_0x388b33+'-'+_0x4fe58b+'/'+_0x2d1d55)['json'](_0x4017c2);}return null;};}function patchUpdates(_0x272455){return function(_0x4522dd){try{jsonpatch[_0xed41('0x22')](_0x4522dd,_0x272455,!![]);}catch(_0x585721){return BPromise[_0xed41('0x23')](_0x585721);}return _0x4522dd[_0xed41('0x24')]();};}function saveUpdates(_0x2f4013,_0x4a04f8){return function(_0x586c07){if(_0x586c07){return _0x586c07['update'](_0x2f4013)['then'](function(_0x2df4a4){return _0x2df4a4;});}return null;};}function removeEntity(_0x22abb4,_0xdf5953){return function(_0x30c3b8){if(_0x30c3b8){return _0x30c3b8[_0xed41('0x25')]()['then'](function(){var _0x32ae88=_0x30c3b8[_0xed41('0x26')]({'plain':!![]});var _0x3f2b13=_0xed41('0x27');return db[_0xed41('0x28')][_0xed41('0x25')]({'where':{'type':_0x3f2b13,'resourceId':_0x32ae88['id']}})[_0xed41('0x29')](function(){return _0x30c3b8;});})['then'](function(){_0x22abb4[_0xed41('0x19')](0xcc)[_0xed41('0x1a')]();});}};}function handleEntityNotFound(_0x449cb9,_0x43dcd0){return function(_0x192ecb){if(!_0x192ecb){_0x449cb9['sendStatus'](0x194);}return _0x192ecb;};}function handleError(_0x56467a,_0x4e5eff){_0x4e5eff=_0x4e5eff||0x1f4;return function(_0x3f562c){logger[_0xed41('0x2a')](_0x3f562c[_0xed41('0x2b')]);if(_0x3f562c[_0xed41('0x2c')]){delete _0x3f562c['name'];}_0x56467a[_0xed41('0x19')](_0x4e5eff)[_0xed41('0x2d')](_0x3f562c);};}exports[_0xed41('0x2e')]=function(_0x20f6ea,_0x2e0b90){var _0x14680f={},_0x1fefa3={},_0x156123={'count':0x0,'rows':[]};var _0x209813=_[_0xed41('0x2f')](db[_0xed41('0x30')][_0xed41('0x31')],function(_0x5dc907){return{'name':_0x5dc907[_0xed41('0x32')],'type':_0x5dc907[_0xed41('0x33')][_0xed41('0x34')]};});_0x1fefa3[_0xed41('0x35')]=_[_0xed41('0x2f')](_0x209813,_0xed41('0x2c'));_0x1fefa3[_0xed41('0x36')]=_[_0xed41('0x37')](_0x20f6ea['query']);_0x1fefa3[_0xed41('0x38')]=_[_0xed41('0x39')](_0x1fefa3[_0xed41('0x35')],_0x1fefa3[_0xed41('0x36')]);_0x14680f[_0xed41('0x3a')]=_[_0xed41('0x39')](_0x1fefa3[_0xed41('0x35')],qs[_0xed41('0x3b')](_0x20f6ea['query'][_0xed41('0x3b')]));_0x14680f['attributes']=_0x14680f[_0xed41('0x3a')]['length']?_0x14680f[_0xed41('0x3a')]:_0x1fefa3[_0xed41('0x35')];if(!_0x20f6ea[_0xed41('0x36')][_0xed41('0x3c')]('nolimit')){_0x14680f['limit']=qs[_0xed41('0x1d')](_0x20f6ea[_0xed41('0x36')][_0xed41('0x1d')]);_0x14680f[_0xed41('0x1c')]=qs['offset'](_0x20f6ea[_0xed41('0x36')][_0xed41('0x1c')]);}_0x14680f[_0xed41('0x3d')]=qs[_0xed41('0x3e')](_0x20f6ea[_0xed41('0x36')][_0xed41('0x3e')]);_0x14680f[_0xed41('0x3f')]=qs[_0xed41('0x38')](_[_0xed41('0x40')](_0x20f6ea[_0xed41('0x36')],_0x1fefa3[_0xed41('0x38')]),_0x209813);if(_0x20f6ea[_0xed41('0x36')][_0xed41('0x41')]){_0x14680f[_0xed41('0x3f')]=_[_0xed41('0x42')](_0x14680f[_0xed41('0x3f')],{'$or':_[_0xed41('0x2f')](_0x209813,function(_0x2f34c3){if(_0x2f34c3['type']!=='VIRTUAL'){var _0x3574c0={};_0x3574c0[_0x2f34c3[_0xed41('0x2c')]]={'$like':'%'+_0x20f6ea['query'][_0xed41('0x41')]+'%'};return _0x3574c0;}})});}_0x14680f=_['merge']({},_0x14680f,_0x20f6ea[_0xed41('0x43')]);var _0x2765d5={'where':_0x14680f[_0xed41('0x3f')]};return db[_0xed41('0x30')]['count'](_0x2765d5)['then'](function(_0x5e6bcc){_0x156123[_0xed41('0x1f')]=_0x5e6bcc;if(_0x20f6ea[_0xed41('0x36')]['includeAll']){_0x14680f[_0xed41('0x44')]=[{'all':!![]}];}return db[_0xed41('0x30')]['findAll'](_0x14680f);})['then'](function(_0x31b0d9){_0x156123[_0xed41('0x45')]=_0x31b0d9;return _0x156123;})[_0xed41('0x29')](respondWithFilteredResult(_0x2e0b90,_0x14680f))[_0xed41('0x46')](handleError(_0x2e0b90,null));};exports['show']=function(_0x104942,_0x27f1fc){var _0x559080={'raw':!![],'where':{'id':_0x104942[_0xed41('0x47')]['id']}},_0x870ed1={};_0x870ed1[_0xed41('0x35')]=_[_0xed41('0x37')](db[_0xed41('0x30')][_0xed41('0x31')]);_0x870ed1[_0xed41('0x36')]=_['keys'](_0x104942['query']);_0x870ed1['filters']=_[_0xed41('0x39')](_0x870ed1['model'],_0x870ed1[_0xed41('0x36')]);_0x559080['attributes']=_[_0xed41('0x39')](_0x870ed1[_0xed41('0x35')],qs[_0xed41('0x3b')](_0x104942['query'][_0xed41('0x3b')]));_0x559080[_0xed41('0x3a')]=_0x559080[_0xed41('0x3a')][_0xed41('0x48')]?_0x559080['attributes']:_0x870ed1[_0xed41('0x35')];if(_0x104942['query']['includeAll']){_0x559080['include']=[{'all':!![]}];}_0x559080=_['merge']({},_0x559080,_0x104942[_0xed41('0x43')]);return db[_0xed41('0x30')][_0xed41('0x49')](_0x559080)[_0xed41('0x29')](handleEntityNotFound(_0x27f1fc,null))[_0xed41('0x29')](respondWithResult(_0x27f1fc,null))[_0xed41('0x46')](handleError(_0x27f1fc,null));};exports['create']=function(_0x358eff,_0xacc20d){return db[_0xed41('0x30')]['create'](_0x358eff[_0xed41('0x4a')],{})[_0xed41('0x29')](function(_0x27f38b){var _0x42643e=_0x358eff[_0xed41('0x4b')][_0xed41('0x26')]({'plain':!![]});if(!_0x42643e)throw new Error(_0xed41('0x4c'));if(_0x42643e[_0xed41('0x4d')]===_0xed41('0x4b')){var _0x128311=_0x27f38b['get']({'plain':!![]});var _0xa96186=_0xed41('0x27');return db[_0xed41('0x4e')]['find']({'where':{'name':_0xa96186,'userProfileId':_0x42643e[_0xed41('0x4f')]},'raw':!![]})[_0xed41('0x29')](function(_0x54249b){if(_0x54249b&&_0x54249b[_0xed41('0x50')]===0x0){return db[_0xed41('0x28')][_0xed41('0x51')]({'name':_0x128311[_0xed41('0x2c')],'resourceId':_0x128311['id'],'type':_0x54249b[_0xed41('0x2c')],'sectionId':_0x54249b['id']},{})[_0xed41('0x29')](function(){return _0x27f38b;});}else{return _0x27f38b;}})[_0xed41('0x46')](function(_0x430c7e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x430c7e);throw _0x430c7e;});}return _0x27f38b;})[_0xed41('0x29')](respondWithResult(_0xacc20d,0xc9))[_0xed41('0x46')](handleError(_0xacc20d,null));};exports['update']=function(_0x3f3560,_0x146c70){if(_0x3f3560[_0xed41('0x4a')]['id']){delete _0x3f3560[_0xed41('0x4a')]['id'];}return db[_0xed41('0x30')][_0xed41('0x49')]({'where':{'id':_0x3f3560[_0xed41('0x47')]['id']}})[_0xed41('0x29')](handleEntityNotFound(_0x146c70,null))[_0xed41('0x29')](saveUpdates(_0x3f3560[_0xed41('0x4a')],null))[_0xed41('0x29')](respondWithResult(_0x146c70,null))[_0xed41('0x46')](handleError(_0x146c70,null));};exports[_0xed41('0x25')]=function(_0x457855,_0x3a898e){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x457855[_0xed41('0x47')]['id']}})[_0xed41('0x29')](handleEntityNotFound(_0x3a898e,null))[_0xed41('0x29')](removeEntity(_0x3a898e,null))['catch'](handleError(_0x3a898e,null));};exports['download']=function(_0x293482,_0x12630e,_0x5d2cc6){return db['AnalyticExtractedReport'][_0xed41('0x49')]({'where':{'id':_0x293482[_0xed41('0x47')]['id']},'attributes':[_0xed41('0x2c'),_0xed41('0x52'),'savename',_0xed41('0x53')],'raw':!![]})[_0xed41('0x29')](handleEntityNotFound(_0x12630e,null))[_0xed41('0x29')](function(_0x45b28a){if(_0x45b28a){if(!fs[_0xed41('0x54')](path[_0xed41('0x55')](config[_0xed41('0x56')],_0xed41('0x57'),_0x45b28a[_0xed41('0x58')]))){throw new db['Sequelize'][(_0xed41('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x293482[_0xed41('0x36')][_0xed41('0x5a')]){return _0x12630e[_0xed41('0x18')](0xc8);}return _0x12630e['download'](path['join'](config[_0xed41('0x56')],_0xed41('0x57'),_0x45b28a[_0xed41('0x58')]),util[_0xed41('0x5b')]('%s.%s',_0x45b28a[_0xed41('0x52')]||_0x45b28a['name'],_0x45b28a[_0xed41('0x53')][_0xed41('0x5c')]()));}})['catch'](handleError(_0x12630e,null));};
\ No newline at end of file
+var _0xd706=['sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x588791,_0x35a42e){var _0x28937a=function(_0x8ca701){while(--_0x8ca701){_0x588791['push'](_0x588791['shift']());}};_0x28937a(++_0x35a42e);}(_0xd706,0xbc));var _0x6d70=function(_0x1dcb2a,_0x32768f){_0x1dcb2a=_0x1dcb2a-0x0;var _0x320475=_0xd706[_0x1dcb2a];return _0x320475;};'use strict';var emlformat=require(_0x6d70('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d70('0x1'));var jsonpatch=require(_0x6d70('0x2'));var rp=require(_0x6d70('0x3'));var moment=require(_0x6d70('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6d70('0x5'));var util=require(_0x6d70('0x6'));var path=require(_0x6d70('0x7'));var sox=require(_0x6d70('0x8'));var csv=require(_0x6d70('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d70('0xa'));var _=require(_0x6d70('0xb'));var squel=require('squel');var crypto=require(_0x6d70('0xc'));var jsforce=require(_0x6d70('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6d70('0x9'));var querystring=require(_0x6d70('0xe'));var Papa=require(_0x6d70('0xf'));var Redis=require(_0x6d70('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6d70('0x11'));var as=require(_0x6d70('0x12'));var hardwareService=require(_0x6d70('0x13'));var logger=require(_0x6d70('0x14'))(_0x6d70('0x15'));var utils=require('../../config/utils');var config=require(_0x6d70('0x16'));var licenseUtil=require(_0x6d70('0x17'));var db=require(_0x6d70('0x18'))['db'];function respondWithStatusCode(_0x3eb800,_0x13ec35){_0x13ec35=_0x13ec35||0xcc;return function(_0x32a2d5){if(_0x32a2d5){return _0x3eb800[_0x6d70('0x19')](_0x13ec35);}return _0x3eb800[_0x6d70('0x1a')](_0x13ec35)[_0x6d70('0x1b')]();};}function respondWithResult(_0x5e4389,_0x1a2347){_0x1a2347=_0x1a2347||0xc8;return function(_0x50308d){if(_0x50308d){return _0x5e4389['status'](_0x1a2347)[_0x6d70('0x1c')](_0x50308d);}};}function respondWithFilteredResult(_0x2cf1f1,_0x366ca7){return function(_0x309b61){if(_0x309b61){var _0x1fb4c9=typeof _0x366ca7[_0x6d70('0x1d')]===_0x6d70('0x1e')&&typeof _0x366ca7[_0x6d70('0x1f')]==='undefined';var _0x5ead6e=_0x309b61['count'];var _0x5608d3=_0x1fb4c9?0x0:_0x366ca7['offset'];var _0x48828d=_0x1fb4c9?_0x309b61[_0x6d70('0x20')]:_0x366ca7[_0x6d70('0x1d')]+_0x366ca7[_0x6d70('0x1f')];var _0x219c34;if(_0x48828d>=_0x5ead6e){_0x48828d=_0x5ead6e;_0x219c34=0xc8;}else{_0x219c34=0xce;}_0x2cf1f1[_0x6d70('0x1a')](_0x219c34);return _0x2cf1f1['set'](_0x6d70('0x21'),_0x5608d3+'-'+_0x48828d+'/'+_0x5ead6e)[_0x6d70('0x1c')](_0x309b61);}return null;};}function patchUpdates(_0x1f4ac8){return function(_0x865bd7){try{jsonpatch[_0x6d70('0x22')](_0x865bd7,_0x1f4ac8,!![]);}catch(_0x2a56f0){return BPromise[_0x6d70('0x23')](_0x2a56f0);}return _0x865bd7[_0x6d70('0x24')]();};}function saveUpdates(_0x3b55a0,_0xdeb4e4){return function(_0x206664){if(_0x206664){return _0x206664[_0x6d70('0x25')](_0x3b55a0)[_0x6d70('0x26')](function(_0x39514a){return _0x39514a;});}return null;};}function removeEntity(_0x39d634,_0x146835){return function(_0x1869ea){if(_0x1869ea){return _0x1869ea[_0x6d70('0x27')]()[_0x6d70('0x26')](function(){var _0x29edb3=_0x1869ea['get']({'plain':!![]});var _0x28b91d=_0x6d70('0x28');return db[_0x6d70('0x29')][_0x6d70('0x27')]({'where':{'type':_0x28b91d,'resourceId':_0x29edb3['id']}})[_0x6d70('0x26')](function(){return _0x1869ea;});})[_0x6d70('0x26')](function(){_0x39d634[_0x6d70('0x1a')](0xcc)[_0x6d70('0x1b')]();});}};}function handleEntityNotFound(_0x560469,_0x43672d){return function(_0x4397ae){if(!_0x4397ae){_0x560469[_0x6d70('0x19')](0x194);}return _0x4397ae;};}function handleError(_0x23ccae,_0x2cab84){_0x2cab84=_0x2cab84||0x1f4;return function(_0x3998c2){logger[_0x6d70('0x2a')](_0x3998c2['stack']);if(_0x3998c2[_0x6d70('0x2b')]){delete _0x3998c2[_0x6d70('0x2b')];}_0x23ccae[_0x6d70('0x1a')](_0x2cab84)[_0x6d70('0x2c')](_0x3998c2);};}exports[_0x6d70('0x2d')]=function(_0x3596a9,_0x189914){var _0x4833bb={},_0x597e4b={},_0x5e5436={'count':0x0,'rows':[]};var _0x157b1c=_[_0x6d70('0x2e')](db[_0x6d70('0x2f')][_0x6d70('0x30')],function(_0x2a6bd2){return{'name':_0x2a6bd2[_0x6d70('0x31')],'type':_0x2a6bd2[_0x6d70('0x32')][_0x6d70('0x33')]};});_0x597e4b[_0x6d70('0x34')]=_[_0x6d70('0x2e')](_0x157b1c,'name');_0x597e4b[_0x6d70('0x35')]=_['keys'](_0x3596a9['query']);_0x597e4b[_0x6d70('0x36')]=_[_0x6d70('0x37')](_0x597e4b[_0x6d70('0x34')],_0x597e4b['query']);_0x4833bb[_0x6d70('0x38')]=_[_0x6d70('0x37')](_0x597e4b[_0x6d70('0x34')],qs['fields'](_0x3596a9['query'][_0x6d70('0x39')]));_0x4833bb['attributes']=_0x4833bb['attributes']['length']?_0x4833bb[_0x6d70('0x38')]:_0x597e4b[_0x6d70('0x34')];if(!_0x3596a9['query'][_0x6d70('0x3a')]('nolimit')){_0x4833bb[_0x6d70('0x1f')]=qs['limit'](_0x3596a9[_0x6d70('0x35')][_0x6d70('0x1f')]);_0x4833bb[_0x6d70('0x1d')]=qs[_0x6d70('0x1d')](_0x3596a9[_0x6d70('0x35')]['offset']);}_0x4833bb['order']=qs[_0x6d70('0x3b')](_0x3596a9['query'][_0x6d70('0x3b')]);_0x4833bb['where']=qs['filters'](_[_0x6d70('0x3c')](_0x3596a9[_0x6d70('0x35')],_0x597e4b[_0x6d70('0x36')]),_0x157b1c);if(_0x3596a9[_0x6d70('0x35')][_0x6d70('0x3d')]){_0x4833bb[_0x6d70('0x3e')]=_[_0x6d70('0x3f')](_0x4833bb[_0x6d70('0x3e')],{'$or':_['map'](_0x157b1c,function(_0x46d6ae){if(_0x46d6ae[_0x6d70('0x32')]!==_0x6d70('0x40')){var _0x4d94b5={};_0x4d94b5[_0x46d6ae['name']]={'$like':'%'+_0x3596a9[_0x6d70('0x35')]['filter']+'%'};return _0x4d94b5;}})});}_0x4833bb=_[_0x6d70('0x3f')]({},_0x4833bb,_0x3596a9[_0x6d70('0x41')]);var _0x3446e8={'where':_0x4833bb['where']};return db[_0x6d70('0x2f')][_0x6d70('0x20')](_0x3446e8)['then'](function(_0x969bf6){_0x5e5436[_0x6d70('0x20')]=_0x969bf6;if(_0x3596a9['query']['includeAll']){_0x4833bb[_0x6d70('0x42')]=[{'all':!![]}];}return db[_0x6d70('0x2f')][_0x6d70('0x43')](_0x4833bb);})['then'](function(_0x2783b3){_0x5e5436[_0x6d70('0x44')]=_0x2783b3;return _0x5e5436;})[_0x6d70('0x26')](respondWithFilteredResult(_0x189914,_0x4833bb))[_0x6d70('0x45')](handleError(_0x189914,null));};exports[_0x6d70('0x46')]=function(_0x14d483,_0x2464b9){var _0x396c10={'raw':!![],'where':{'id':_0x14d483[_0x6d70('0x47')]['id']}},_0x50948e={};_0x50948e['model']=_[_0x6d70('0x48')](db[_0x6d70('0x2f')][_0x6d70('0x30')]);_0x50948e['query']=_['keys'](_0x14d483[_0x6d70('0x35')]);_0x50948e[_0x6d70('0x36')]=_[_0x6d70('0x37')](_0x50948e['model'],_0x50948e[_0x6d70('0x35')]);_0x396c10['attributes']=_[_0x6d70('0x37')](_0x50948e[_0x6d70('0x34')],qs[_0x6d70('0x39')](_0x14d483[_0x6d70('0x35')][_0x6d70('0x39')]));_0x396c10[_0x6d70('0x38')]=_0x396c10[_0x6d70('0x38')][_0x6d70('0x49')]?_0x396c10[_0x6d70('0x38')]:_0x50948e[_0x6d70('0x34')];if(_0x14d483[_0x6d70('0x35')][_0x6d70('0x4a')]){_0x396c10['include']=[{'all':!![]}];}_0x396c10=_[_0x6d70('0x3f')]({},_0x396c10,_0x14d483[_0x6d70('0x41')]);return db[_0x6d70('0x2f')][_0x6d70('0x4b')](_0x396c10)[_0x6d70('0x26')](handleEntityNotFound(_0x2464b9,null))[_0x6d70('0x26')](respondWithResult(_0x2464b9,null))['catch'](handleError(_0x2464b9,null));};exports[_0x6d70('0x4c')]=function(_0x345909,_0x9a68f5){return db[_0x6d70('0x2f')][_0x6d70('0x4c')](_0x345909[_0x6d70('0x4d')],{})[_0x6d70('0x26')](function(_0x54a080){var _0x2c30aa=_0x345909[_0x6d70('0x4e')]['get']({'plain':!![]});if(!_0x2c30aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c30aa[_0x6d70('0x4f')]===_0x6d70('0x4e')){var _0x50712a=_0x54a080[_0x6d70('0x50')]({'plain':!![]});var _0x1e443c=_0x6d70('0x28');return db[_0x6d70('0x51')][_0x6d70('0x4b')]({'where':{'name':_0x1e443c,'userProfileId':_0x2c30aa[_0x6d70('0x52')]},'raw':!![]})['then'](function(_0x4c262f){if(_0x4c262f&&_0x4c262f['autoAssociation']===0x0){return db[_0x6d70('0x29')][_0x6d70('0x4c')]({'name':_0x50712a[_0x6d70('0x2b')],'resourceId':_0x50712a['id'],'type':_0x4c262f[_0x6d70('0x2b')],'sectionId':_0x4c262f['id']},{})['then'](function(){return _0x54a080;});}else{return _0x54a080;}})[_0x6d70('0x45')](function(_0x222b0a){logger[_0x6d70('0x2a')](_0x6d70('0x53'),_0x222b0a);throw _0x222b0a;});}return _0x54a080;})[_0x6d70('0x26')](respondWithResult(_0x9a68f5,0xc9))[_0x6d70('0x45')](handleError(_0x9a68f5,null));};exports[_0x6d70('0x25')]=function(_0x3621ba,_0x54a3e3){if(_0x3621ba[_0x6d70('0x4d')]['id']){delete _0x3621ba['body']['id'];}return db[_0x6d70('0x2f')][_0x6d70('0x4b')]({'where':{'id':_0x3621ba[_0x6d70('0x47')]['id']}})[_0x6d70('0x26')](handleEntityNotFound(_0x54a3e3,null))[_0x6d70('0x26')](saveUpdates(_0x3621ba['body'],null))[_0x6d70('0x26')](respondWithResult(_0x54a3e3,null))[_0x6d70('0x45')](handleError(_0x54a3e3,null));};exports[_0x6d70('0x27')]=function(_0x5d9108,_0x3ae9ff){return db[_0x6d70('0x2f')][_0x6d70('0x4b')]({'where':{'id':_0x5d9108[_0x6d70('0x47')]['id']}})[_0x6d70('0x26')](handleEntityNotFound(_0x3ae9ff,null))[_0x6d70('0x26')](removeEntity(_0x3ae9ff,null))['catch'](handleError(_0x3ae9ff,null));};exports[_0x6d70('0x54')]=function(_0x4a61c3,_0x41ecdd,_0x4a735e){return db[_0x6d70('0x2f')]['find']({'where':{'id':_0x4a61c3['params']['id']},'attributes':[_0x6d70('0x2b'),_0x6d70('0x55'),'savename',_0x6d70('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x41ecdd,null))[_0x6d70('0x26')](function(_0x47b65c){if(_0x47b65c){if(!fs['existsSync'](path[_0x6d70('0x57')](config[_0x6d70('0x58')],_0x6d70('0x59'),_0x47b65c[_0x6d70('0x5a')]))){throw new db[(_0x6d70('0x5b'))][(_0x6d70('0x5c'))](_0x6d70('0x5d'));}if(_0x4a61c3[_0x6d70('0x35')][_0x6d70('0x5e')]){return _0x41ecdd[_0x6d70('0x19')](0xc8);}return _0x41ecdd[_0x6d70('0x54')](path[_0x6d70('0x57')](config[_0x6d70('0x58')],_0x6d70('0x59'),_0x47b65c[_0x6d70('0x5a')]),util[_0x6d70('0x5f')](_0x6d70('0x60'),_0x47b65c[_0x6d70('0x55')]||_0x47b65c[_0x6d70('0x2b')],_0x47b65c['output'][_0x6d70('0x61')]()));}})[_0x6d70('0x45')](handleError(_0x41ecdd,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index a7f5179..1263404 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 _0xf0a1=['../../config/environment','exports','define','analytics_extracted_reports','util','../../config/logger','api','moment','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf0a1,0x176));var _0x1f0a=function(_0x51e9e4,_0x143651){_0x51e9e4=_0x51e9e4-0x0;var _0x454cd7=_0xf0a1[_0x51e9e4];return _0x454cd7;};'use strict';var _=require('lodash');var util=require(_0x1f0a('0x0'));var logger=require(_0x1f0a('0x1'))(_0x1f0a('0x2'));var moment=require(_0x1f0a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f0a('0x4'));var rimraf=require(_0x1f0a('0x5'));var config=require(_0x1f0a('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x1f0a('0x7')]=function(_0x55a86e,_0x210b24){return _0x55a86e[_0x1f0a('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x1f0a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f88=['rimraf','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xfb0744,_0x3890fa){var _0x4fe877=function(_0x2cd665){while(--_0x2cd665){_0xfb0744['push'](_0xfb0744['shift']());}};_0x4fe877(++_0x3890fa);}(_0x4f88,0x1d2));var _0x84f8=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0x4f88[_0x40f9a0];return _0x3e3144;};'use strict';var _=require('lodash');var util=require(_0x84f8('0x0'));var logger=require(_0x84f8('0x1'))(_0x84f8('0x2'));var moment=require(_0x84f8('0x3'));var BPromise=require(_0x84f8('0x4'));var rp=require(_0x84f8('0x5'));var fs=require('fs');var path=require(_0x84f8('0x6'));var rimraf=require(_0x84f8('0x7'));var config=require('../../config/environment');var attributes=require(_0x84f8('0x8'));module['exports']=function(_0xef4ac6,_0x312a3f){return _0xef4ac6['define'](_0x84f8('0x9'),attributes,{'tableName':_0x84f8('0xa'),'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 5d2e021..ab7782f 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 _0xe85b=['request\x20sent','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x33ef9f,_0xd7e50e){var _0x2cf757=function(_0x4a7d1a){while(--_0x4a7d1a){_0x33ef9f['push'](_0x33ef9f['shift']());}};_0x2cf757(++_0xd7e50e);}(_0xe85b,0x6f));var _0xbe85=function(_0xa8a57e,_0x27295c){_0xa8a57e=_0xa8a57e-0x0;var _0x53244c=_0xe85b[_0xa8a57e];return _0x53244c;};'use strict';var _=require(_0xbe85('0x0'));var util=require(_0xbe85('0x1'));var moment=require(_0xbe85('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe85('0x3'));var fs=require('fs');var Redis=require(_0xbe85('0x4'));var db=require(_0xbe85('0x5'))['db'];var utils=require(_0xbe85('0x6'));var logger=require(_0xbe85('0x7'))(_0xbe85('0x8'));var config=require(_0xbe85('0x9'));var jayson=require(_0xbe85('0xa'));var client=jayson['client'][_0xbe85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23d7ec,_0x37846f,_0x424508){return new BPromise(function(_0x298d83,_0x5247ac){return client['request'](_0x23d7ec,_0x424508)['then'](function(_0x18ab9b){logger['info'](_0xbe85('0xc'),_0x37846f,'request\x20sent');logger[_0xbe85('0xd')](_0xbe85('0xe'),_0x37846f,_0xbe85('0xf'),JSON['stringify'](_0x18ab9b));if(_0x18ab9b[_0xbe85('0x10')]){if(_0x18ab9b[_0xbe85('0x10')][_0xbe85('0x11')]===0x1f4){logger['error'](_0xbe85('0xc'),_0x37846f,_0x18ab9b['error']['message']);return _0x5247ac(_0x18ab9b[_0xbe85('0x10')]['message']);}logger['error'](_0xbe85('0xc'),_0x37846f,_0x18ab9b[_0xbe85('0x10')][_0xbe85('0x12')]);return _0x298d83(_0x18ab9b['error'][_0xbe85('0x12')]);}else{logger[_0xbe85('0x13')](_0xbe85('0xc'),_0x37846f,_0xbe85('0xf'));_0x298d83(_0x18ab9b['result'][_0xbe85('0x12')]);}})[_0xbe85('0x14')](function(_0x355c65){logger['error'](_0xbe85('0xc'),_0x37846f,_0x355c65);_0x5247ac(_0x355c65);});});}
\ No newline at end of file
+var _0x565e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0xe833b2,_0x1bddfb){var _0x569b40=function(_0x4b8ed1){while(--_0x4b8ed1){_0xe833b2['push'](_0xe833b2['shift']());}};_0x569b40(++_0x1bddfb);}(_0x565e,0xb7));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe565('0x0'));var util=require(_0xe565('0x1'));var moment=require('moment');var BPromise=require(_0xe565('0x2'));var rs=require(_0xe565('0x3'));var fs=require('fs');var Redis=require(_0xe565('0x4'));var db=require(_0xe565('0x5'))['db'];var utils=require(_0xe565('0x6'));var logger=require(_0xe565('0x7'))(_0xe565('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe565('0x9')][_0xe565('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48f5bd,_0xc6a69c,_0x49903c){return new BPromise(function(_0x4a70c8,_0x4ca582){return client[_0xe565('0xb')](_0x48f5bd,_0x49903c)[_0xe565('0xc')](function(_0x1599d0){logger[_0xe565('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xc6a69c,_0xe565('0xe'));logger[_0xe565('0xf')](_0xe565('0x10'),_0xc6a69c,_0xe565('0xe'),JSON['stringify'](_0x1599d0));if(_0x1599d0['error']){if(_0x1599d0[_0xe565('0x11')][_0xe565('0x12')]===0x1f4){logger[_0xe565('0x11')](_0xe565('0x13'),_0xc6a69c,_0x1599d0[_0xe565('0x11')][_0xe565('0x14')]);return _0x4ca582(_0x1599d0[_0xe565('0x11')]['message']);}logger[_0xe565('0x11')](_0xe565('0x13'),_0xc6a69c,_0x1599d0['error'][_0xe565('0x14')]);return _0x4a70c8(_0x1599d0[_0xe565('0x11')]['message']);}else{logger[_0xe565('0xd')](_0xe565('0x13'),_0xc6a69c,_0xe565('0xe'));_0x4a70c8(_0x1599d0[_0xe565('0x15')][_0xe565('0x14')]);}})[_0xe565('0x16')](function(_0x380538){logger[_0xe565('0x11')](_0xe565('0x13'),_0xc6a69c,_0x380538);_0x4ca582(_0x380538);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 7c04502..bced82b 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 _0xbd74=['download','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show'];(function(_0x1cc6c9,_0x1be68d){var _0x22c4e2=function(_0x55f99b){while(--_0x55f99b){_0x1cc6c9['push'](_0x1cc6c9['shift']());}};_0x22c4e2(++_0x1be68d);}(_0xbd74,0x1c0));var _0x4bd7=function(_0x4935f7,_0x3c2772){_0x4935f7=_0x4935f7-0x0;var _0x2831de=_0xbd74[_0x4935f7];return _0x2831de;};'use strict';var multer=require('multer');var util=require(_0x4bd7('0x0'));var path=require(_0x4bd7('0x1'));var timeout=require(_0x4bd7('0x2'));var express=require(_0x4bd7('0x3'));var router=express[_0x4bd7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4bd7('0x5'));var interaction=require(_0x4bd7('0x6'));var config=require(_0x4bd7('0x7'));var controller=require(_0x4bd7('0x8'));router[_0x4bd7('0x9')]('/',auth['isAuthenticated'](),controller[_0x4bd7('0xa')]);router['get'](_0x4bd7('0xb'),auth[_0x4bd7('0xc')](),controller[_0x4bd7('0xd')]);router[_0x4bd7('0x9')]('/:id/download',auth[_0x4bd7('0xc')](),controller[_0x4bd7('0xe')]);router['post']('/',auth[_0x4bd7('0xc')](),controller[_0x4bd7('0xf')]);router[_0x4bd7('0x10')](_0x4bd7('0xb'),auth[_0x4bd7('0xc')](),controller[_0x4bd7('0x11')]);router[_0x4bd7('0x12')]('/:id',auth[_0x4bd7('0xc')](),controller[_0x4bd7('0x13')]);module[_0x4bd7('0x14')]=router;
\ No newline at end of file
+var _0x02d9=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create'];(function(_0x5b5ddb,_0x523183){var _0x13bf56=function(_0x590919){while(--_0x590919){_0x5b5ddb['push'](_0x5b5ddb['shift']());}};_0x13bf56(++_0x523183);}(_0x02d9,0x169));var _0x902d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02d9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x902d('0x0'));var util=require(_0x902d('0x1'));var path=require(_0x902d('0x2'));var timeout=require(_0x902d('0x3'));var express=require(_0x902d('0x4'));var router=express[_0x902d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x902d('0x6'));var interaction=require(_0x902d('0x7'));var config=require('../../config/environment');var controller=require(_0x902d('0x8'));router[_0x902d('0x9')]('/',auth[_0x902d('0xa')](),controller[_0x902d('0xb')]);router[_0x902d('0x9')](_0x902d('0xc'),auth[_0x902d('0xa')](),controller['show']);router['get'](_0x902d('0xd'),auth[_0x902d('0xa')](),controller[_0x902d('0xe')]);router[_0x902d('0xf')]('/',auth[_0x902d('0xa')](),controller[_0x902d('0x10')]);router[_0x902d('0x11')](_0x902d('0xc'),auth[_0x902d('0xa')](),controller['update']);router[_0x902d('0x12')](_0x902d('0xc'),auth[_0x902d('0xa')](),controller[_0x902d('0x13')]);module[_0x902d('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 768f3bf..d21f6a6 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 _0x9e82=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0x9e82,0xe5));var _0x29e8=function(_0x5bf8e8,_0x1797e3){_0x5bf8e8=_0x5bf8e8-0x0;var _0x397b1e=_0x9e82[_0x5bf8e8];return _0x397b1e;};'use strict';var Sequelize=require(_0x29e8('0x0'));module['exports']={'field':{'type':Sequelize[_0x29e8('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x29e8('0x2')]},'format':{'type':Sequelize[_0x29e8('0x2')]},'groupBy':{'type':Sequelize[_0x29e8('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x29e8('0x2')]},'custom':{'type':Sequelize[_0x29e8('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x913e=['exports','TEXT','STRING','BOOLEAN'];(function(_0x54d05b,_0x3c0d6c){var _0x29a1a1=function(_0x4ffddd){while(--_0x4ffddd){_0x54d05b['push'](_0x54d05b['shift']());}};_0x29a1a1(++_0x3c0d6c);}(_0x913e,0x150));var _0xe913=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0x913e[_0x72a33d];return _0x2621d5;};'use strict';var Sequelize=require('sequelize');module[_0xe913('0x0')]={'field':{'type':Sequelize[_0xe913('0x1')]},'alias':{'type':Sequelize[_0xe913('0x2')]},'function':{'type':Sequelize[_0xe913('0x2')]},'format':{'type':Sequelize[_0xe913('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe913('0x2')]},'custom':{'type':Sequelize[_0xe913('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 36d397c..7b57936 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 _0xa386=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','AnalyticFieldReport','findAll','rows','catch','show','params','length','find','create','body','update','ids','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5a2d95,_0xb362e5){var _0x2c3986=function(_0x5cce7c){while(--_0x5cce7c){_0x5a2d95['push'](_0x5a2d95['shift']());}};_0x2c3986(++_0xb362e5);}(_0xa386,0x1dd));var _0x6a38=function(_0x4309d9,_0x5b0b57){_0x4309d9=_0x4309d9-0x0;var _0x1af166=_0xa386[_0x4309d9];return _0x1af166;};'use strict';var emlformat=require(_0x6a38('0x0'));var rimraf=require(_0x6a38('0x1'));var zipdir=require(_0x6a38('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a38('0x3'));var moment=require(_0x6a38('0x4'));var BPromise=require(_0x6a38('0x5'));var Mustache=require(_0x6a38('0x6'));var util=require('util');var path=require(_0x6a38('0x7'));var sox=require(_0x6a38('0x8'));var csv=require(_0x6a38('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a38('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6a38('0xb'));var jsforce=require(_0x6a38('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a38('0x9'));var querystring=require(_0x6a38('0xd'));var Papa=require('papaparse');var Redis=require(_0x6a38('0xe'));var authService=require(_0x6a38('0xf'));var qs=require(_0x6a38('0x10'));var as=require(_0x6a38('0x11'));var hardwareService=require(_0x6a38('0x12'));var logger=require(_0x6a38('0x13'))(_0x6a38('0x14'));var utils=require(_0x6a38('0x15'));var config=require(_0x6a38('0x16'));var licenseUtil=require(_0x6a38('0x17'));var db=require(_0x6a38('0x18'))['db'];function respondWithStatusCode(_0x2d1ca0,_0x428a45){_0x428a45=_0x428a45||0xcc;return function(_0x109612){if(_0x109612){return _0x2d1ca0['sendStatus'](_0x428a45);}return _0x2d1ca0['status'](_0x428a45)[_0x6a38('0x19')]();};}function respondWithResult(_0x1b7af6,_0x4470e2){_0x4470e2=_0x4470e2||0xc8;return function(_0x49c6f7){if(_0x49c6f7){return _0x1b7af6[_0x6a38('0x1a')](_0x4470e2)['json'](_0x49c6f7);}};}function respondWithFilteredResult(_0x3feb58,_0xdfff10){return function(_0x20377d){if(_0x20377d){var _0x3e1661=typeof _0xdfff10[_0x6a38('0x1b')]===_0x6a38('0x1c')&&typeof _0xdfff10['limit']==='undefined';var _0x510f71=_0x20377d[_0x6a38('0x1d')];var _0x21c000=_0x3e1661?0x0:_0xdfff10[_0x6a38('0x1b')];var _0x473c63=_0x3e1661?_0x20377d[_0x6a38('0x1d')]:_0xdfff10[_0x6a38('0x1b')]+_0xdfff10[_0x6a38('0x1e')];var _0x8e6e8f;if(_0x473c63>=_0x510f71){_0x473c63=_0x510f71;_0x8e6e8f=0xc8;}else{_0x8e6e8f=0xce;}_0x3feb58[_0x6a38('0x1a')](_0x8e6e8f);return _0x3feb58[_0x6a38('0x1f')](_0x6a38('0x20'),_0x21c000+'-'+_0x473c63+'/'+_0x510f71)['json'](_0x20377d);}return null;};}function patchUpdates(_0x53a6e9){return function(_0xe7e39e){try{jsonpatch[_0x6a38('0x21')](_0xe7e39e,_0x53a6e9,!![]);}catch(_0x2dca50){return BPromise[_0x6a38('0x22')](_0x2dca50);}return _0xe7e39e[_0x6a38('0x23')]();};}function saveUpdates(_0x28b7c1,_0x3da6f8){return function(_0x1bf10d){if(_0x1bf10d){return _0x1bf10d['update'](_0x28b7c1)[_0x6a38('0x24')](function(_0x2350de){return _0x2350de;});}return null;};}function removeEntity(_0x15f023,_0x4afa8f){return function(_0x3272a3){if(_0x3272a3){return _0x3272a3[_0x6a38('0x25')]()['then'](function(){_0x15f023[_0x6a38('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14b478,_0x3c58b3){return function(_0x40f31e){if(!_0x40f31e){_0x14b478[_0x6a38('0x26')](0x194);}return _0x40f31e;};}function handleError(_0x248f3c,_0x24566b){_0x24566b=_0x24566b||0x1f4;return function(_0xfe890c){logger[_0x6a38('0x27')](_0xfe890c[_0x6a38('0x28')]);if(_0xfe890c[_0x6a38('0x29')]){delete _0xfe890c['name'];}_0x248f3c[_0x6a38('0x1a')](_0x24566b)[_0x6a38('0x2a')](_0xfe890c);};}exports[_0x6a38('0x2b')]=function(_0x2cf69c,_0x3244c3){var _0x50cdbb={},_0x5d3227={},_0x1e4407={'count':0x0,'rows':[]};var _0x5695ab=_[_0x6a38('0x2c')](db['AnalyticFieldReport'][_0x6a38('0x2d')],function(_0x36ab77){return{'name':_0x36ab77['fieldName'],'type':_0x36ab77[_0x6a38('0x2e')][_0x6a38('0x2f')]};});_0x5d3227[_0x6a38('0x30')]=_[_0x6a38('0x2c')](_0x5695ab,_0x6a38('0x29'));_0x5d3227[_0x6a38('0x31')]=_[_0x6a38('0x32')](_0x2cf69c[_0x6a38('0x31')]);_0x5d3227[_0x6a38('0x33')]=_['intersection'](_0x5d3227[_0x6a38('0x30')],_0x5d3227[_0x6a38('0x31')]);_0x50cdbb[_0x6a38('0x34')]=_[_0x6a38('0x35')](_0x5d3227[_0x6a38('0x30')],qs[_0x6a38('0x36')](_0x2cf69c[_0x6a38('0x31')][_0x6a38('0x36')]));_0x50cdbb[_0x6a38('0x34')]=_0x50cdbb[_0x6a38('0x34')]['length']?_0x50cdbb[_0x6a38('0x34')]:_0x5d3227[_0x6a38('0x30')];if(!_0x2cf69c[_0x6a38('0x31')][_0x6a38('0x37')](_0x6a38('0x38'))){_0x50cdbb[_0x6a38('0x1e')]=qs[_0x6a38('0x1e')](_0x2cf69c['query'][_0x6a38('0x1e')]);_0x50cdbb[_0x6a38('0x1b')]=qs['offset'](_0x2cf69c[_0x6a38('0x31')][_0x6a38('0x1b')]);}_0x50cdbb[_0x6a38('0x39')]=qs[_0x6a38('0x3a')](_0x2cf69c['query'][_0x6a38('0x3a')]);_0x50cdbb[_0x6a38('0x3b')]=qs['filters'](_[_0x6a38('0x3c')](_0x2cf69c[_0x6a38('0x31')],_0x5d3227[_0x6a38('0x33')]),_0x5695ab);if(_0x2cf69c['query']['filter']){_0x50cdbb[_0x6a38('0x3b')]=_[_0x6a38('0x3d')](_0x50cdbb[_0x6a38('0x3b')],{'$or':_[_0x6a38('0x2c')](_0x5695ab,function(_0x1c7d49){if(_0x1c7d49[_0x6a38('0x2e')]!==_0x6a38('0x3e')){var _0x13bf6c={};_0x13bf6c[_0x1c7d49[_0x6a38('0x29')]]={'$like':'%'+_0x2cf69c[_0x6a38('0x31')][_0x6a38('0x3f')]+'%'};return _0x13bf6c;}})});}_0x50cdbb=_[_0x6a38('0x3d')]({},_0x50cdbb,_0x2cf69c[_0x6a38('0x40')]);var _0x19b3eb={'where':_0x50cdbb['where']};return db['AnalyticFieldReport'][_0x6a38('0x1d')](_0x19b3eb)[_0x6a38('0x24')](function(_0x29dbc6){_0x1e4407[_0x6a38('0x1d')]=_0x29dbc6;if(_0x2cf69c[_0x6a38('0x31')][_0x6a38('0x41')]){_0x50cdbb[_0x6a38('0x42')]=[{'all':!![]}];}return db[_0x6a38('0x43')][_0x6a38('0x44')](_0x50cdbb);})[_0x6a38('0x24')](function(_0x34fdb9){_0x1e4407[_0x6a38('0x45')]=_0x34fdb9;return _0x1e4407;})[_0x6a38('0x24')](respondWithFilteredResult(_0x3244c3,_0x50cdbb))[_0x6a38('0x46')](handleError(_0x3244c3,null));};exports[_0x6a38('0x47')]=function(_0xdcf0a,_0x3aecfd){var _0x11ae5a={'raw':![],'where':{'id':_0xdcf0a[_0x6a38('0x48')]['id']}},_0x5c2ddf={};_0x5c2ddf[_0x6a38('0x30')]=_['keys'](db[_0x6a38('0x43')][_0x6a38('0x2d')]);_0x5c2ddf[_0x6a38('0x31')]=_[_0x6a38('0x32')](_0xdcf0a['query']);_0x5c2ddf[_0x6a38('0x33')]=_['intersection'](_0x5c2ddf[_0x6a38('0x30')],_0x5c2ddf['query']);_0x11ae5a['attributes']=_[_0x6a38('0x35')](_0x5c2ddf['model'],qs[_0x6a38('0x36')](_0xdcf0a[_0x6a38('0x31')]['fields']));_0x11ae5a['attributes']=_0x11ae5a[_0x6a38('0x34')][_0x6a38('0x49')]?_0x11ae5a[_0x6a38('0x34')]:_0x5c2ddf[_0x6a38('0x30')];if(_0xdcf0a[_0x6a38('0x31')][_0x6a38('0x41')]){_0x11ae5a['include']=[{'all':!![]}];}_0x11ae5a=_[_0x6a38('0x3d')]({},_0x11ae5a,_0xdcf0a[_0x6a38('0x40')]);return db[_0x6a38('0x43')][_0x6a38('0x4a')](_0x11ae5a)[_0x6a38('0x24')](handleEntityNotFound(_0x3aecfd,null))[_0x6a38('0x24')](respondWithResult(_0x3aecfd,null))[_0x6a38('0x46')](handleError(_0x3aecfd,null));};exports['create']=function(_0x310552,_0x30442d){return db['AnalyticFieldReport'][_0x6a38('0x4b')](_0x310552[_0x6a38('0x4c')],{})[_0x6a38('0x24')](respondWithResult(_0x30442d,0xc9))['catch'](handleError(_0x30442d,null));};exports['bulkCreate']=function(_0x5b33a3,_0x430c08){return db[_0x6a38('0x43')]['bulkCreate'](_0x5b33a3[_0x6a38('0x4c')],{'raw':![],'individualHooks':!![]})[_0x6a38('0x24')](respondWithResult(_0x430c08,0xc9))[_0x6a38('0x46')](handleError(_0x430c08,null));};exports[_0x6a38('0x4d')]=function(_0x3aca5c,_0x579121){if(_0x3aca5c[_0x6a38('0x4c')]['id']){delete _0x3aca5c[_0x6a38('0x4c')]['id'];}return db[_0x6a38('0x43')][_0x6a38('0x4a')]({'where':{'id':_0x3aca5c[_0x6a38('0x48')]['id']}})[_0x6a38('0x24')](handleEntityNotFound(_0x579121,null))[_0x6a38('0x24')](saveUpdates(_0x3aca5c['body'],null))['then'](respondWithResult(_0x579121,null))[_0x6a38('0x46')](handleError(_0x579121,null));};exports['destroy']=function(_0x18f131,_0x191f6e){return db['AnalyticFieldReport'][_0x6a38('0x4a')]({'where':{'id':_0x18f131[_0x6a38('0x48')]['id']}})['then'](handleEntityNotFound(_0x191f6e,null))[_0x6a38('0x24')](removeEntity(_0x191f6e,null))['catch'](handleError(_0x191f6e,null));};exports['bulkDestroy']=function(_0x2abb91,_0x53a392){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x2abb91[_0x6a38('0x31')][_0x6a38('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x6a38('0x24')](respondWithResult(_0x53a392,0xcc))[_0x6a38('0x46')](handleError(_0x53a392,null));};exports['addFields']=function(_0x490397,_0x428b6a,_0x5978a0){return db['AnalyticCustomReport'][_0x6a38('0x4f')]({'where':{'id':_0x490397['params']['id']}})['then'](handleEntityNotFound(_0x428b6a,null))[_0x6a38('0x24')](function(_0x1c4670){if(_0x1c4670){return db[_0x6a38('0x50')][_0x6a38('0x51')](function(_0x352a03){return db[_0x6a38('0x43')][_0x6a38('0x25')]({'where':{'CustomReportId':_0x490397['params']['id']},'transaction':_0x352a03})[_0x6a38('0x24')](function(_0xac9aaa){var _0x5c8555=_['map'](_0x490397[_0x6a38('0x4c')],function(_0x449aa5){delete _0x449aa5['id'];_0x449aa5['CustomReportId']=_0x490397['params']['id'];return _0x449aa5;});return db[_0x6a38('0x43')][_0x6a38('0x52')](_0x5c8555,{'transaction':_0x352a03});});})[_0x6a38('0x24')](function(){return db[_0x6a38('0x43')][_0x6a38('0x44')]({'where':{'CustomReportId':_0x490397[_0x6a38('0x48')]['id']}});});}})['then'](respondWithResult(_0x428b6a,null))[_0x6a38('0x46')](handleError(_0x428b6a,null));};
\ No newline at end of file
+var _0xc9ac=['AnalyticFieldReport','findAll','rows','catch','show','params','includeAll','include','find','create','bulkCreate','body','bulkDestroy','ids','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0x4ae082,_0x5c3fcc){var _0x166f2e=function(_0x3e37be){while(--_0x3e37be){_0x4ae082['push'](_0x4ae082['shift']());}};_0x166f2e(++_0x5c3fcc);}(_0xc9ac,0xaa));var _0xcc9a=function(_0x5a3135,_0x2612ae){_0x5a3135=_0x5a3135-0x0;var _0x52de79=_0xc9ac[_0x5a3135];return _0x52de79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc9a('0x0'));var zipdir=require(_0xcc9a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcc9a('0x2'));var util=require('util');var path=require('path');var sox=require(_0xcc9a('0x3'));var csv=require(_0xcc9a('0x4'));var ejs=require(_0xcc9a('0x5'));var fs=require('fs');var fs_extra=require(_0xcc9a('0x6'));var _=require(_0xcc9a('0x7'));var squel=require('squel');var crypto=require(_0xcc9a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xcc9a('0x9'));var toCsv=require(_0xcc9a('0x4'));var querystring=require('querystring');var Papa=require(_0xcc9a('0xa'));var Redis=require(_0xcc9a('0xb'));var authService=require(_0xcc9a('0xc'));var qs=require(_0xcc9a('0xd'));var as=require(_0xcc9a('0xe'));var hardwareService=require(_0xcc9a('0xf'));var logger=require(_0xcc9a('0x10'))(_0xcc9a('0x11'));var utils=require(_0xcc9a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcc9a('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39ce6b,_0x1415d6){_0x1415d6=_0x1415d6||0xcc;return function(_0x3e164f){if(_0x3e164f){return _0x39ce6b['sendStatus'](_0x1415d6);}return _0x39ce6b[_0xcc9a('0x14')](_0x1415d6)[_0xcc9a('0x15')]();};}function respondWithResult(_0x944247,_0x572bb6){_0x572bb6=_0x572bb6||0xc8;return function(_0x20bf55){if(_0x20bf55){return _0x944247[_0xcc9a('0x14')](_0x572bb6)[_0xcc9a('0x16')](_0x20bf55);}};}function respondWithFilteredResult(_0x5a7407,_0x2e000a){return function(_0x1c61f1){if(_0x1c61f1){var _0x266a7f=typeof _0x2e000a['offset']===_0xcc9a('0x17')&&typeof _0x2e000a[_0xcc9a('0x18')]===_0xcc9a('0x17');var _0x2bdaa1=_0x1c61f1[_0xcc9a('0x19')];var _0xf9b8a8=_0x266a7f?0x0:_0x2e000a['offset'];var _0x41df76=_0x266a7f?_0x1c61f1[_0xcc9a('0x19')]:_0x2e000a[_0xcc9a('0x1a')]+_0x2e000a[_0xcc9a('0x18')];var _0x3d8f77;if(_0x41df76>=_0x2bdaa1){_0x41df76=_0x2bdaa1;_0x3d8f77=0xc8;}else{_0x3d8f77=0xce;}_0x5a7407[_0xcc9a('0x14')](_0x3d8f77);return _0x5a7407[_0xcc9a('0x1b')](_0xcc9a('0x1c'),_0xf9b8a8+'-'+_0x41df76+'/'+_0x2bdaa1)[_0xcc9a('0x16')](_0x1c61f1);}return null;};}function patchUpdates(_0x253f0b){return function(_0x597a28){try{jsonpatch[_0xcc9a('0x1d')](_0x597a28,_0x253f0b,!![]);}catch(_0x55a216){return BPromise['reject'](_0x55a216);}return _0x597a28['save']();};}function saveUpdates(_0x20be1b,_0x1b3292){return function(_0x5342a6){if(_0x5342a6){return _0x5342a6[_0xcc9a('0x1e')](_0x20be1b)['then'](function(_0x355e19){return _0x355e19;});}return null;};}function removeEntity(_0x480bdd,_0x2fe1ba){return function(_0x5e43a0){if(_0x5e43a0){return _0x5e43a0[_0xcc9a('0x1f')]()[_0xcc9a('0x20')](function(){_0x480bdd[_0xcc9a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b78ab,_0x4c6cc2){return function(_0x54094c){if(!_0x54094c){_0x3b78ab['sendStatus'](0x194);}return _0x54094c;};}function handleError(_0x1e9e8f,_0xff1a10){_0xff1a10=_0xff1a10||0x1f4;return function(_0x19c4b7){logger['error'](_0x19c4b7[_0xcc9a('0x21')]);if(_0x19c4b7['name']){delete _0x19c4b7[_0xcc9a('0x22')];}_0x1e9e8f[_0xcc9a('0x14')](_0xff1a10)[_0xcc9a('0x23')](_0x19c4b7);};}exports[_0xcc9a('0x24')]=function(_0x3234dc,_0x38bd5e){var _0x1cd4f1={},_0x5a289b={},_0x48cbd9={'count':0x0,'rows':[]};var _0x4ec132=_[_0xcc9a('0x25')](db['AnalyticFieldReport'][_0xcc9a('0x26')],function(_0x156586){return{'name':_0x156586[_0xcc9a('0x27')],'type':_0x156586['type'][_0xcc9a('0x28')]};});_0x5a289b['model']=_[_0xcc9a('0x25')](_0x4ec132,_0xcc9a('0x22'));_0x5a289b['query']=_[_0xcc9a('0x29')](_0x3234dc[_0xcc9a('0x2a')]);_0x5a289b[_0xcc9a('0x2b')]=_['intersection'](_0x5a289b[_0xcc9a('0x2c')],_0x5a289b[_0xcc9a('0x2a')]);_0x1cd4f1['attributes']=_[_0xcc9a('0x2d')](_0x5a289b['model'],qs[_0xcc9a('0x2e')](_0x3234dc[_0xcc9a('0x2a')][_0xcc9a('0x2e')]));_0x1cd4f1[_0xcc9a('0x2f')]=_0x1cd4f1['attributes']['length']?_0x1cd4f1[_0xcc9a('0x2f')]:_0x5a289b[_0xcc9a('0x2c')];if(!_0x3234dc['query'][_0xcc9a('0x30')](_0xcc9a('0x31'))){_0x1cd4f1[_0xcc9a('0x18')]=qs['limit'](_0x3234dc[_0xcc9a('0x2a')][_0xcc9a('0x18')]);_0x1cd4f1[_0xcc9a('0x1a')]=qs[_0xcc9a('0x1a')](_0x3234dc[_0xcc9a('0x2a')][_0xcc9a('0x1a')]);}_0x1cd4f1[_0xcc9a('0x32')]=qs[_0xcc9a('0x33')](_0x3234dc['query'][_0xcc9a('0x33')]);_0x1cd4f1[_0xcc9a('0x34')]=qs[_0xcc9a('0x2b')](_['pick'](_0x3234dc[_0xcc9a('0x2a')],_0x5a289b['filters']),_0x4ec132);if(_0x3234dc[_0xcc9a('0x2a')][_0xcc9a('0x35')]){_0x1cd4f1[_0xcc9a('0x34')]=_[_0xcc9a('0x36')](_0x1cd4f1[_0xcc9a('0x34')],{'$or':_[_0xcc9a('0x25')](_0x4ec132,function(_0x4a6367){if(_0x4a6367[_0xcc9a('0x37')]!==_0xcc9a('0x38')){var _0x523f04={};_0x523f04[_0x4a6367['name']]={'$like':'%'+_0x3234dc[_0xcc9a('0x2a')]['filter']+'%'};return _0x523f04;}})});}_0x1cd4f1=_[_0xcc9a('0x36')]({},_0x1cd4f1,_0x3234dc[_0xcc9a('0x39')]);var _0x300e83={'where':_0x1cd4f1['where']};return db[_0xcc9a('0x3a')][_0xcc9a('0x19')](_0x300e83)[_0xcc9a('0x20')](function(_0x46eb71){_0x48cbd9['count']=_0x46eb71;if(_0x3234dc[_0xcc9a('0x2a')]['includeAll']){_0x1cd4f1['include']=[{'all':!![]}];}return db[_0xcc9a('0x3a')][_0xcc9a('0x3b')](_0x1cd4f1);})[_0xcc9a('0x20')](function(_0x1f2168){_0x48cbd9[_0xcc9a('0x3c')]=_0x1f2168;return _0x48cbd9;})[_0xcc9a('0x20')](respondWithFilteredResult(_0x38bd5e,_0x1cd4f1))[_0xcc9a('0x3d')](handleError(_0x38bd5e,null));};exports[_0xcc9a('0x3e')]=function(_0x59e6c2,_0x264dbf){var _0x5790e2={'raw':![],'where':{'id':_0x59e6c2[_0xcc9a('0x3f')]['id']}},_0x39fa8d={};_0x39fa8d[_0xcc9a('0x2c')]=_['keys'](db[_0xcc9a('0x3a')]['rawAttributes']);_0x39fa8d[_0xcc9a('0x2a')]=_[_0xcc9a('0x29')](_0x59e6c2[_0xcc9a('0x2a')]);_0x39fa8d[_0xcc9a('0x2b')]=_['intersection'](_0x39fa8d[_0xcc9a('0x2c')],_0x39fa8d['query']);_0x5790e2[_0xcc9a('0x2f')]=_[_0xcc9a('0x2d')](_0x39fa8d[_0xcc9a('0x2c')],qs[_0xcc9a('0x2e')](_0x59e6c2[_0xcc9a('0x2a')][_0xcc9a('0x2e')]));_0x5790e2['attributes']=_0x5790e2[_0xcc9a('0x2f')]['length']?_0x5790e2[_0xcc9a('0x2f')]:_0x39fa8d[_0xcc9a('0x2c')];if(_0x59e6c2[_0xcc9a('0x2a')][_0xcc9a('0x40')]){_0x5790e2[_0xcc9a('0x41')]=[{'all':!![]}];}_0x5790e2=_['merge']({},_0x5790e2,_0x59e6c2[_0xcc9a('0x39')]);return db[_0xcc9a('0x3a')][_0xcc9a('0x42')](_0x5790e2)[_0xcc9a('0x20')](handleEntityNotFound(_0x264dbf,null))[_0xcc9a('0x20')](respondWithResult(_0x264dbf,null))[_0xcc9a('0x3d')](handleError(_0x264dbf,null));};exports[_0xcc9a('0x43')]=function(_0x2ad3e9,_0x5a7840){return db['AnalyticFieldReport'][_0xcc9a('0x43')](_0x2ad3e9['body'],{})[_0xcc9a('0x20')](respondWithResult(_0x5a7840,0xc9))[_0xcc9a('0x3d')](handleError(_0x5a7840,null));};exports['bulkCreate']=function(_0x2612c2,_0x537b01){return db[_0xcc9a('0x3a')][_0xcc9a('0x44')](_0x2612c2[_0xcc9a('0x45')],{'raw':![],'individualHooks':!![]})[_0xcc9a('0x20')](respondWithResult(_0x537b01,0xc9))[_0xcc9a('0x3d')](handleError(_0x537b01,null));};exports[_0xcc9a('0x1e')]=function(_0x2677ef,_0x4808f2){if(_0x2677ef[_0xcc9a('0x45')]['id']){delete _0x2677ef[_0xcc9a('0x45')]['id'];}return db[_0xcc9a('0x3a')][_0xcc9a('0x42')]({'where':{'id':_0x2677ef['params']['id']}})['then'](handleEntityNotFound(_0x4808f2,null))[_0xcc9a('0x20')](saveUpdates(_0x2677ef[_0xcc9a('0x45')],null))[_0xcc9a('0x20')](respondWithResult(_0x4808f2,null))[_0xcc9a('0x3d')](handleError(_0x4808f2,null));};exports[_0xcc9a('0x1f')]=function(_0x465d97,_0x1532ae){return db[_0xcc9a('0x3a')][_0xcc9a('0x42')]({'where':{'id':_0x465d97[_0xcc9a('0x3f')]['id']}})[_0xcc9a('0x20')](handleEntityNotFound(_0x1532ae,null))['then'](removeEntity(_0x1532ae,null))[_0xcc9a('0x3d')](handleError(_0x1532ae,null));};exports[_0xcc9a('0x46')]=function(_0x313927,_0x379b74){return db[_0xcc9a('0x3a')]['destroy']({'where':{'id':_0x313927['query'][_0xcc9a('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0xcc9a('0x20')](respondWithResult(_0x379b74,0xcc))['catch'](handleError(_0x379b74,null));};exports['addFields']=function(_0x4c78d4,_0x5850aa,_0x4268be){return db['AnalyticCustomReport'][_0xcc9a('0x48')]({'where':{'id':_0x4c78d4[_0xcc9a('0x3f')]['id']}})[_0xcc9a('0x20')](handleEntityNotFound(_0x5850aa,null))[_0xcc9a('0x20')](function(_0x219bf0){if(_0x219bf0){return db[_0xcc9a('0x49')][_0xcc9a('0x4a')](function(_0x1b43de){return db[_0xcc9a('0x3a')][_0xcc9a('0x1f')]({'where':{'CustomReportId':_0x4c78d4[_0xcc9a('0x3f')]['id']},'transaction':_0x1b43de})[_0xcc9a('0x20')](function(_0xbe6a39){var _0x24a8ea=_[_0xcc9a('0x25')](_0x4c78d4[_0xcc9a('0x45')],function(_0x2753bd){delete _0x2753bd['id'];_0x2753bd[_0xcc9a('0x4b')]=_0x4c78d4[_0xcc9a('0x3f')]['id'];return _0x2753bd;});return db[_0xcc9a('0x3a')]['bulkCreate'](_0x24a8ea,{'transaction':_0x1b43de});});})['then'](function(){return db[_0xcc9a('0x3a')][_0xcc9a('0x3b')]({'where':{'CustomReportId':_0x4c78d4[_0xcc9a('0x3f')]['id']}});});}})[_0xcc9a('0x20')](respondWithResult(_0x5850aa,null))[_0xcc9a('0x3d')](handleError(_0x5850aa,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 6843033..8b80f71 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 _0x73bf=['../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','path'];(function(_0x406c07,_0x188e1b){var _0x38722c=function(_0x2ab052){while(--_0x2ab052){_0x406c07['push'](_0x406c07['shift']());}};_0x38722c(++_0x188e1b);}(_0x73bf,0x181));var _0xf73b=function(_0x1833dc,_0x121d9d){_0x1833dc=_0x1833dc-0x0;var _0x77da96=_0x73bf[_0x1833dc];return _0x77da96;};'use strict';var _=require(_0xf73b('0x0'));var util=require(_0xf73b('0x1'));var logger=require(_0xf73b('0x2'))(_0xf73b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf73b('0x4'));var rimraf=require('rimraf');var config=require(_0xf73b('0x5'));var attributes=require(_0xf73b('0x6'));module['exports']=function(_0x29ce09,_0x29fbdc){return _0x29ce09[_0xf73b('0x7')](_0xf73b('0x8'),attributes,{'tableName':_0xf73b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab98=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','analytics_report_fields','lodash','util'];(function(_0x184409,_0x1dfc16){var _0x2ead15=function(_0xa3ff61){while(--_0xa3ff61){_0x184409['push'](_0x184409['shift']());}};_0x2ead15(++_0x1dfc16);}(_0xab98,0xce));var _0x8ab9=function(_0x19c066,_0x447857){_0x19c066=_0x19c066-0x0;var _0x5044e6=_0xab98[_0x19c066];return _0x5044e6;};'use strict';var _=require(_0x8ab9('0x0'));var util=require(_0x8ab9('0x1'));var logger=require(_0x8ab9('0x2'))(_0x8ab9('0x3'));var moment=require(_0x8ab9('0x4'));var BPromise=require(_0x8ab9('0x5'));var rp=require(_0x8ab9('0x6'));var fs=require('fs');var path=require(_0x8ab9('0x7'));var rimraf=require(_0x8ab9('0x8'));var config=require(_0x8ab9('0x9'));var attributes=require(_0x8ab9('0xa'));module[_0x8ab9('0xb')]=function(_0x15a92f,_0xfc9ece){return _0x15a92f['define']('AnalyticFieldReport',attributes,{'tableName':_0x8ab9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 787cbd5..3d83456 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 _0x4050=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x3b3489,_0x1da252){var _0x2a70a3=function(_0x144433){while(--_0x144433){_0x3b3489['push'](_0x3b3489['shift']());}};_0x2a70a3(++_0x1da252);}(_0x4050,0x1a1));var _0x0405=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x4050[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x0405('0x0'));var util=require(_0x0405('0x1'));var moment=require('moment');var BPromise=require(_0x0405('0x2'));var rs=require(_0x0405('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0405('0x4'));var logger=require(_0x0405('0x5'))(_0x0405('0x6'));var config=require('../../config/environment');var jayson=require(_0x0405('0x7'));var client=jayson[_0x0405('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e7ed1,_0x312bfb,_0x59e59c){return new BPromise(function(_0x18f71c,_0x5e36c6){return client[_0x0405('0x9')](_0x2e7ed1,_0x59e59c)[_0x0405('0xa')](function(_0x1b0d0d){logger[_0x0405('0xb')](_0x0405('0xc'),_0x312bfb,_0x0405('0xd'));logger[_0x0405('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x312bfb,_0x0405('0xd'),JSON[_0x0405('0xf')](_0x1b0d0d));if(_0x1b0d0d[_0x0405('0x10')]){if(_0x1b0d0d['error']['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x312bfb,_0x1b0d0d['error'][_0x0405('0x11')]);return _0x5e36c6(_0x1b0d0d[_0x0405('0x10')]['message']);}logger[_0x0405('0x10')](_0x0405('0xc'),_0x312bfb,_0x1b0d0d[_0x0405('0x10')][_0x0405('0x11')]);return _0x18f71c(_0x1b0d0d[_0x0405('0x10')][_0x0405('0x11')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x312bfb,_0x0405('0xd'));_0x18f71c(_0x1b0d0d[_0x0405('0x12')]['message']);}})[_0x0405('0x13')](function(_0x547b91){logger[_0x0405('0x10')](_0x0405('0xc'),_0x312bfb,_0x547b91);_0x5e36c6(_0x547b91);});});}
\ No newline at end of file
+var _0xe27d=['../../config/environment','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xe27d,0xa8));var _0xde27=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0xe27d[_0x10852d];return _0x13a8d6;};'use strict';var _=require(_0xde27('0x0'));var util=require(_0xde27('0x1'));var moment=require(_0xde27('0x2'));var BPromise=require('bluebird');var rs=require(_0xde27('0x3'));var fs=require('fs');var Redis=require(_0xde27('0x4'));var db=require(_0xde27('0x5'))['db'];var utils=require(_0xde27('0x6'));var logger=require(_0xde27('0x7'))('rpc');var config=require(_0xde27('0x8'));var jayson=require(_0xde27('0x9'));var client=jayson[_0xde27('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x195af9,_0x4f218c,_0x27462f){return new BPromise(function(_0x23be43,_0x38befa){return client[_0xde27('0xb')](_0x195af9,_0x27462f)[_0xde27('0xc')](function(_0x33b680){logger['info'](_0xde27('0xd'),_0x4f218c,_0xde27('0xe'));logger[_0xde27('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4f218c,_0xde27('0xe'),JSON[_0xde27('0x10')](_0x33b680));if(_0x33b680[_0xde27('0x11')]){if(_0x33b680[_0xde27('0x11')][_0xde27('0x12')]===0x1f4){logger['error'](_0xde27('0xd'),_0x4f218c,_0x33b680['error']['message']);return _0x38befa(_0x33b680[_0xde27('0x11')][_0xde27('0x13')]);}logger[_0xde27('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4f218c,_0x33b680[_0xde27('0x11')][_0xde27('0x13')]);return _0x23be43(_0x33b680[_0xde27('0x11')][_0xde27('0x13')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4f218c,'request\x20sent');_0x23be43(_0x33b680[_0xde27('0x14')][_0xde27('0x13')]);}})[_0xde27('0x15')](function(_0x197de3){logger['error'](_0xde27('0xd'),_0x4f218c,_0x197de3);_0x38befa(_0x197de3);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 51e01f4..be64a1d 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(_0xfa531c,_0x98e69e){var _0x2eef5a=function(_0x59114b){while(--_0x59114b){_0xfa531c['push'](_0xfa531c['shift']());}};_0x2eef5a(++_0x98e69e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x12b096,_0x3f6cba){var _0x58f1d6=function(_0xaf1070){while(--_0xaf1070){_0x12b096['push'](_0x12b096['shift']());}};_0x58f1d6(++_0x3f6cba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 1db5f86..e2b690f 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 _0x9bb4=['STRING','name','TEXT','sequelize','exports'];(function(_0x18ce30,_0x437d06){var _0x4471a3=function(_0x403a4a){while(--_0x403a4a){_0x18ce30['push'](_0x18ce30['shift']());}};_0x4471a3(++_0x437d06);}(_0x9bb4,0xd5));var _0x49bb=function(_0x1b06c8,_0x189e88){_0x1b06c8=_0x1b06c8-0x0;var _0x3977c1=_0x9bb4[_0x1b06c8];return _0x3977c1;};'use strict';var Sequelize=require(_0x49bb('0x0'));module[_0x49bb('0x1')]={'name':{'type':Sequelize[_0x49bb('0x2')],'allowNull':![],'unique':_0x49bb('0x3')},'table':{'type':Sequelize[_0x49bb('0x2')]},'metric':{'type':Sequelize[_0x49bb('0x4')]},'description':{'type':Sequelize[_0x49bb('0x2')]}};
\ No newline at end of file
+var _0xd5b6=['sequelize','exports','STRING','name','TEXT'];(function(_0x1036db,_0x984f05){var _0x4fdbee=function(_0x5d8d7f){while(--_0x5d8d7f){_0x1036db['push'](_0x1036db['shift']());}};_0x4fdbee(++_0x984f05);}(_0xd5b6,0x73));var _0x6d5b=function(_0x2a827b,_0x227ff1){_0x2a827b=_0x2a827b-0x0;var _0x18b0cb=_0xd5b6[_0x2a827b];return _0x18b0cb;};'use strict';var Sequelize=require(_0x6d5b('0x0'));module[_0x6d5b('0x1')]={'name':{'type':Sequelize[_0x6d5b('0x2')],'allowNull':![],'unique':_0x6d5b('0x3')},'table':{'type':Sequelize[_0x6d5b('0x2')]},'metric':{'type':Sequelize[_0x6d5b('0x4')]},'description':{'type':Sequelize[_0x6d5b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 7890c02..f4ac71e 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 _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x84ab,0x12f));var _0xb84a=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x84ab[_0x234ae1];return _0x227ba0;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));};
\ No newline at end of file
+var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x383c5d,_0x5594ee){var _0x3fe9a5=function(_0x29547c){while(--_0x29547c){_0x383c5d['push'](_0x383c5d['shift']());}};_0x3fe9a5(++_0x5594ee);}(_0xdc97,0x13b));var _0x7dc9=function(_0x35fa77,_0x41f359){_0x35fa77=_0x35fa77-0x0;var _0x381411=_0xdc97[_0x35fa77];return _0x381411;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 035f562..082559a 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 _0x236d=['lodash','util','api','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var logger=require('../../config/logger')(_0xd236('0x2'));var moment=require('moment');var BPromise=require(_0xd236('0x3'));var rp=require(_0xd236('0x4'));var fs=require('fs');var path=require(_0xd236('0x5'));var rimraf=require(_0xd236('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xd236('0x7')]=function(_0x29a67c,_0x75d84c){return _0x29a67c[_0xd236('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x187d=['define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes'];(function(_0x1011ce,_0x56be41){var _0x30ff98=function(_0x3c743c){while(--_0x3c743c){_0x1011ce['push'](_0x1011ce['shift']());}};_0x30ff98(++_0x56be41);}(_0x187d,0x93));var _0xd187=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x187d[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'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 854e90b..d5d989a 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 _0x471b=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request\x20sent'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x471b,0x1d1));var _0xb471=function(_0x98f837,_0x4468f2){_0x98f837=_0x98f837-0x0;var _0xee1d27=_0x471b[_0x98f837];return _0xee1d27;};'use strict';var _=require('lodash');var util=require(_0xb471('0x0'));var moment=require(_0xb471('0x1'));var BPromise=require('bluebird');var rs=require(_0xb471('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb471('0x3'))['db'];var utils=require(_0xb471('0x4'));var logger=require('../../config/logger')(_0xb471('0x5'));var config=require('../../config/environment');var jayson=require(_0xb471('0x6'));var client=jayson[_0xb471('0x7')][_0xb471('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2019a1,_0x4db57d,_0xd306e7){return new BPromise(function(_0x1b4b1a,_0x2007c5){return client['request'](_0x2019a1,_0xd306e7)['then'](function(_0x4fce70){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x4db57d,_0xb471('0x9'));logger['debug'](_0xb471('0xa'),_0x4db57d,'request\x20sent',JSON[_0xb471('0xb')](_0x4fce70));if(_0x4fce70[_0xb471('0xc')]){if(_0x4fce70[_0xb471('0xc')][_0xb471('0xd')]===0x1f4){logger[_0xb471('0xc')](_0xb471('0xe'),_0x4db57d,_0x4fce70['error'][_0xb471('0xf')]);return _0x2007c5(_0x4fce70[_0xb471('0xc')]['message']);}logger['error'](_0xb471('0xe'),_0x4db57d,_0x4fce70[_0xb471('0xc')]['message']);return _0x1b4b1a(_0x4fce70[_0xb471('0xc')][_0xb471('0xf')]);}else{logger[_0xb471('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x4db57d,_0xb471('0x9'));_0x1b4b1a(_0x4fce70[_0xb471('0x11')]['message']);}})[_0xb471('0x12')](function(_0x13a03a){logger[_0xb471('0xc')](_0xb471('0xe'),_0x4db57d,_0x13a03a);_0x2007c5(_0x13a03a);});});}
\ No newline at end of file
+var _0x9960=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3ae3b9,_0x51d5ca){var _0x50a3c7=function(_0x28ddf7){while(--_0x28ddf7){_0x3ae3b9['push'](_0x3ae3b9['shift']());}};_0x50a3c7(++_0x51d5ca);}(_0x9960,0xc8));var _0x0996=function(_0xe49c16,_0x29aa2f){_0xe49c16=_0xe49c16-0x0;var _0x331054=_0x9960[_0xe49c16];return _0x331054;};'use strict';var _=require(_0x0996('0x0'));var util=require(_0x0996('0x1'));var moment=require(_0x0996('0x2'));var BPromise=require(_0x0996('0x3'));var rs=require(_0x0996('0x4'));var fs=require('fs');var Redis=require(_0x0996('0x5'));var db=require(_0x0996('0x6'))['db'];var utils=require(_0x0996('0x7'));var logger=require(_0x0996('0x8'))(_0x0996('0x9'));var config=require(_0x0996('0xa'));var jayson=require(_0x0996('0xb'));var client=jayson[_0x0996('0xc')][_0x0996('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x265fd5,_0x40d833,_0x4034fb){return new BPromise(function(_0x499524,_0x2de586){return client[_0x0996('0xe')](_0x265fd5,_0x4034fb)[_0x0996('0xf')](function(_0x5e319a){logger[_0x0996('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x40d833,_0x0996('0x11'));logger[_0x0996('0x12')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x40d833,_0x0996('0x11'),JSON[_0x0996('0x13')](_0x5e319a));if(_0x5e319a[_0x0996('0x14')]){if(_0x5e319a[_0x0996('0x14')][_0x0996('0x15')]===0x1f4){logger[_0x0996('0x14')](_0x0996('0x16'),_0x40d833,_0x5e319a[_0x0996('0x14')][_0x0996('0x17')]);return _0x2de586(_0x5e319a['error'][_0x0996('0x17')]);}logger[_0x0996('0x14')](_0x0996('0x16'),_0x40d833,_0x5e319a[_0x0996('0x14')][_0x0996('0x17')]);return _0x499524(_0x5e319a[_0x0996('0x14')]['message']);}else{logger['info'](_0x0996('0x16'),_0x40d833,_0x0996('0x11'));_0x499524(_0x5e319a[_0x0996('0x18')][_0x0996('0x17')]);}})[_0x0996('0x19')](function(_0x1c7f20){logger[_0x0996('0x14')](_0x0996('0x16'),_0x40d833,_0x1c7f20);_0x2de586(_0x1c7f20);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 39e16d6..11a9efd 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 _0x5a63=['put','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','show','isAuthenticated','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a63,0xe3));var _0x35a6=function(_0x1baee9,_0x1792ca){_0x1baee9=_0x1baee9-0x0;var _0xb25557=_0x5a63[_0x1baee9];return _0xb25557;};'use strict';var multer=require(_0x35a6('0x0'));var util=require(_0x35a6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x35a6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x35a6('0x3'));var interaction=require(_0x35a6('0x4'));var config=require(_0x35a6('0x5'));var controller=require(_0x35a6('0x6'));router[_0x35a6('0x7')]('/',auth['isAuthenticated'](),controller[_0x35a6('0x8')]);router['get'](_0x35a6('0x9'),auth['isAuthenticated'](),controller[_0x35a6('0xa')]);router['post']('/',auth[_0x35a6('0xb')](),controller[_0x35a6('0xc')]);router[_0x35a6('0xd')](_0x35a6('0x9'),auth[_0x35a6('0xb')](),controller['update']);router[_0x35a6('0xe')](_0x35a6('0x9'),auth[_0x35a6('0xb')](),controller['destroy']);module[_0x35a6('0xf')]=router;
\ No newline at end of file
+var _0x6753=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x239a4e,_0x26c07e){var _0x35a78f=function(_0x4270cb){while(--_0x4270cb){_0x239a4e['push'](_0x239a4e['shift']());}};_0x35a78f(++_0x26c07e);}(_0x6753,0xa1));var _0x3675=function(_0x375575,_0x1b4979){_0x375575=_0x375575-0x0;var _0x46ff54=_0x6753[_0x375575];return _0x46ff54;};'use strict';var multer=require(_0x3675('0x0'));var util=require(_0x3675('0x1'));var path=require(_0x3675('0x2'));var timeout=require(_0x3675('0x3'));var express=require('express');var router=express[_0x3675('0x4')]();var fs_extra=require(_0x3675('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3675('0x6'));var config=require(_0x3675('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3675('0x8')]);router[_0x3675('0x9')](_0x3675('0xa'),auth[_0x3675('0xb')](),controller[_0x3675('0xc')]);router[_0x3675('0xd')]('/',auth[_0x3675('0xb')](),controller[_0x3675('0xe')]);router[_0x3675('0xf')](_0x3675('0xa'),auth[_0x3675('0xb')](),controller[_0x3675('0x10')]);router[_0x3675('0x11')](_0x3675('0xa'),auth['isAuthenticated'](),controller[_0x3675('0x12')]);module[_0x3675('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 a7085a3..4277bdf 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 _0x9eb4=['exports','TEXT'];(function(_0x1dcd8b,_0x40f175){var _0x61bebf=function(_0x251850){while(--_0x251850){_0x1dcd8b['push'](_0x1dcd8b['shift']());}};_0x61bebf(++_0x40f175);}(_0x9eb4,0x126));var _0x49eb=function(_0x22f53f,_0x14ef66){_0x22f53f=_0x22f53f-0x0;var _0x57bc67=_0x9eb4[_0x22f53f];return _0x57bc67;};'use strict';var Sequelize=require('sequelize');module[_0x49eb('0x0')]={'tree':{'type':Sequelize[_0x49eb('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x9b0c=['exports'];(function(_0x473e75,_0x56d103){var _0x540705=function(_0x577666){while(--_0x577666){_0x473e75['push'](_0x473e75['shift']());}};_0x540705(++_0x56d103);}(_0x9b0c,0x1ce));var _0xc9b0=function(_0x21cf6c,_0x44d671){_0x21cf6c=_0x21cf6c-0x0;var _0x5e1a6f=_0x9b0c[_0x21cf6c];return _0x5e1a6f;};'use strict';var Sequelize=require('sequelize');module[_0xc9b0('0x0')]={'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 313e1c1..f38dad4 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 _0x6414=['stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','count','findAll','catch','show','params','include','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','squel','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','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','then','error'];(function(_0x4d6f3b,_0x169895){var _0x2c3010=function(_0x2cad24){while(--_0x2cad24){_0x4d6f3b['push'](_0x4d6f3b['shift']());}};_0x2c3010(++_0x169895);}(_0x6414,0x6c));var _0x4641=function(_0x52fcc0,_0x537733){_0x52fcc0=_0x52fcc0-0x0;var _0x5e2b3c=_0x6414[_0x52fcc0];return _0x5e2b3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4641('0x0'));var zipdir=require(_0x4641('0x1'));var jsonpatch=require(_0x4641('0x2'));var rp=require(_0x4641('0x3'));var moment=require(_0x4641('0x4'));var BPromise=require(_0x4641('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4641('0x6'));var ejs=require(_0x4641('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4641('0x8'));var crypto=require(_0x4641('0x9'));var jsforce=require(_0x4641('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4641('0x6'));var querystring=require(_0x4641('0xb'));var Papa=require(_0x4641('0xc'));var Redis=require(_0x4641('0xd'));var authService=require(_0x4641('0xe'));var qs=require(_0x4641('0xf'));var as=require(_0x4641('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4641('0x11'))(_0x4641('0x12'));var utils=require(_0x4641('0x13'));var config=require(_0x4641('0x14'));var licenseUtil=require(_0x4641('0x15'));var db=require(_0x4641('0x16'))['db'];function respondWithStatusCode(_0x54f441,_0x21d6d6){_0x21d6d6=_0x21d6d6||0xcc;return function(_0x566e24){if(_0x566e24){return _0x54f441[_0x4641('0x17')](_0x21d6d6);}return _0x54f441[_0x4641('0x18')](_0x21d6d6)[_0x4641('0x19')]();};}function respondWithResult(_0x19ff24,_0x424452){_0x424452=_0x424452||0xc8;return function(_0x557352){if(_0x557352){return _0x19ff24[_0x4641('0x18')](_0x424452)[_0x4641('0x1a')](_0x557352);}};}function respondWithFilteredResult(_0xbb428c,_0x3fb452){return function(_0xa463a0){if(_0xa463a0){var _0x5f4e48=typeof _0x3fb452[_0x4641('0x1b')]===_0x4641('0x1c')&&typeof _0x3fb452[_0x4641('0x1d')]==='undefined';var _0x3a490e=_0xa463a0['count'];var _0x27b8f5=_0x5f4e48?0x0:_0x3fb452['offset'];var _0x2ac169=_0x5f4e48?_0xa463a0['count']:_0x3fb452[_0x4641('0x1b')]+_0x3fb452[_0x4641('0x1d')];var _0x4d68cd;if(_0x2ac169>=_0x3a490e){_0x2ac169=_0x3a490e;_0x4d68cd=0xc8;}else{_0x4d68cd=0xce;}_0xbb428c[_0x4641('0x18')](_0x4d68cd);return _0xbb428c[_0x4641('0x1e')](_0x4641('0x1f'),_0x27b8f5+'-'+_0x2ac169+'/'+_0x3a490e)[_0x4641('0x1a')](_0xa463a0);}return null;};}function patchUpdates(_0x1eda1c){return function(_0x44b778){try{jsonpatch[_0x4641('0x20')](_0x44b778,_0x1eda1c,!![]);}catch(_0x12ec8e){return BPromise[_0x4641('0x21')](_0x12ec8e);}return _0x44b778['save']();};}function saveUpdates(_0x3e7d72,_0x278962){return function(_0xd46390){if(_0xd46390){return _0xd46390[_0x4641('0x22')](_0x3e7d72)['then'](function(_0x374d1f){return _0x374d1f;});}return null;};}function removeEntity(_0xdba891,_0x11502e){return function(_0x3be486){if(_0x3be486){return _0x3be486[_0x4641('0x23')]()[_0x4641('0x24')](function(){_0xdba891[_0x4641('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd69b5d,_0x4b8183){return function(_0x509b8c){if(!_0x509b8c){_0xd69b5d['sendStatus'](0x194);}return _0x509b8c;};}function handleError(_0x293f20,_0x38cd88){_0x38cd88=_0x38cd88||0x1f4;return function(_0x5e1a7d){logger[_0x4641('0x25')](_0x5e1a7d[_0x4641('0x26')]);if(_0x5e1a7d[_0x4641('0x27')]){delete _0x5e1a7d[_0x4641('0x27')];}_0x293f20[_0x4641('0x18')](_0x38cd88)[_0x4641('0x28')](_0x5e1a7d);};}exports[_0x4641('0x29')]=function(_0x3402e3,_0x124b54){var _0x56771e={},_0x27fafe={},_0x11554c={'count':0x0,'rows':[]};var _0x2feb20=_[_0x4641('0x2a')](db[_0x4641('0x2b')][_0x4641('0x2c')],function(_0x39f192){return{'name':_0x39f192[_0x4641('0x2d')],'type':_0x39f192[_0x4641('0x2e')][_0x4641('0x2f')]};});_0x27fafe[_0x4641('0x30')]=_['map'](_0x2feb20,_0x4641('0x27'));_0x27fafe['query']=_[_0x4641('0x31')](_0x3402e3[_0x4641('0x32')]);_0x27fafe[_0x4641('0x33')]=_[_0x4641('0x34')](_0x27fafe['model'],_0x27fafe[_0x4641('0x32')]);_0x56771e[_0x4641('0x35')]=_[_0x4641('0x34')](_0x27fafe[_0x4641('0x30')],qs[_0x4641('0x36')](_0x3402e3['query']['fields']));_0x56771e[_0x4641('0x35')]=_0x56771e['attributes'][_0x4641('0x37')]?_0x56771e[_0x4641('0x35')]:_0x27fafe['model'];if(!_0x3402e3['query']['hasOwnProperty'](_0x4641('0x38'))){_0x56771e[_0x4641('0x1d')]=qs[_0x4641('0x1d')](_0x3402e3['query'][_0x4641('0x1d')]);_0x56771e[_0x4641('0x1b')]=qs[_0x4641('0x1b')](_0x3402e3[_0x4641('0x32')]['offset']);}_0x56771e[_0x4641('0x39')]=qs[_0x4641('0x3a')](_0x3402e3[_0x4641('0x32')][_0x4641('0x3a')]);_0x56771e['where']=qs[_0x4641('0x33')](_[_0x4641('0x3b')](_0x3402e3[_0x4641('0x32')],_0x27fafe[_0x4641('0x33')]),_0x2feb20);if(_0x3402e3[_0x4641('0x32')][_0x4641('0x3c')]){_0x56771e['where']=_[_0x4641('0x3d')](_0x56771e['where'],{'$or':_[_0x4641('0x2a')](_0x2feb20,function(_0x3c0af3){if(_0x3c0af3[_0x4641('0x2e')]!==_0x4641('0x3e')){var _0x336ede={};_0x336ede[_0x3c0af3[_0x4641('0x27')]]={'$like':'%'+_0x3402e3[_0x4641('0x32')][_0x4641('0x3c')]+'%'};return _0x336ede;}})});}_0x56771e=_['merge']({},_0x56771e,_0x3402e3[_0x4641('0x3f')]);var _0x55787b={'where':_0x56771e['where']};return db[_0x4641('0x2b')][_0x4641('0x40')](_0x55787b)[_0x4641('0x24')](function(_0x301ba4){_0x11554c[_0x4641('0x40')]=_0x301ba4;if(_0x3402e3[_0x4641('0x32')]['includeAll']){_0x56771e['include']=[{'all':!![]}];}return db[_0x4641('0x2b')][_0x4641('0x41')](_0x56771e);})[_0x4641('0x24')](function(_0xfd5b84){_0x11554c['rows']=_0xfd5b84;return _0x11554c;})[_0x4641('0x24')](respondWithFilteredResult(_0x124b54,_0x56771e))[_0x4641('0x42')](handleError(_0x124b54,null));};exports[_0x4641('0x43')]=function(_0x290bdd,_0x18ccdc){var _0x4c0bb7={'raw':!![],'where':{'id':_0x290bdd[_0x4641('0x44')]['id']}},_0x490431={};_0x490431[_0x4641('0x30')]=_[_0x4641('0x31')](db['AnalyticTreeReport']['rawAttributes']);_0x490431[_0x4641('0x32')]=_['keys'](_0x290bdd[_0x4641('0x32')]);_0x490431[_0x4641('0x33')]=_[_0x4641('0x34')](_0x490431[_0x4641('0x30')],_0x490431[_0x4641('0x32')]);_0x4c0bb7[_0x4641('0x35')]=_[_0x4641('0x34')](_0x490431[_0x4641('0x30')],qs[_0x4641('0x36')](_0x290bdd[_0x4641('0x32')][_0x4641('0x36')]));_0x4c0bb7[_0x4641('0x35')]=_0x4c0bb7[_0x4641('0x35')][_0x4641('0x37')]?_0x4c0bb7[_0x4641('0x35')]:_0x490431[_0x4641('0x30')];if(_0x290bdd[_0x4641('0x32')]['includeAll']){_0x4c0bb7[_0x4641('0x45')]=[{'all':!![]}];}_0x4c0bb7=_[_0x4641('0x3d')]({},_0x4c0bb7,_0x290bdd[_0x4641('0x3f')]);return db[_0x4641('0x2b')]['find'](_0x4c0bb7)['then'](handleEntityNotFound(_0x18ccdc,null))[_0x4641('0x24')](respondWithResult(_0x18ccdc,null))[_0x4641('0x42')](handleError(_0x18ccdc,null));};exports[_0x4641('0x46')]=function(_0x47043c,_0xc5ba49){return db[_0x4641('0x2b')]['create'](_0x47043c[_0x4641('0x47')],{})[_0x4641('0x24')](respondWithResult(_0xc5ba49,0xc9))[_0x4641('0x42')](handleError(_0xc5ba49,null));};exports['update']=function(_0x2e4027,_0x452d93){if(_0x2e4027['body']['id']){delete _0x2e4027['body']['id'];}return db[_0x4641('0x2b')][_0x4641('0x48')]({'where':{'id':_0x2e4027[_0x4641('0x44')]['id']}})[_0x4641('0x24')](handleEntityNotFound(_0x452d93,null))[_0x4641('0x24')](saveUpdates(_0x2e4027[_0x4641('0x47')],null))[_0x4641('0x24')](respondWithResult(_0x452d93,null))[_0x4641('0x42')](handleError(_0x452d93,null));};exports[_0x4641('0x23')]=function(_0x332b4e,_0x103276){return db['AnalyticTreeReport']['find']({'where':{'id':_0x332b4e[_0x4641('0x44')]['id']}})[_0x4641('0x24')](handleEntityNotFound(_0x103276,null))['then'](removeEntity(_0x103276,null))['catch'](handleError(_0x103276,null));};
\ No newline at end of file
+var _0xe56f=['stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','include','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error'];(function(_0x3489dc,_0x5c9f11){var _0x53b272=function(_0x465420){while(--_0x465420){_0x3489dc['push'](_0x3489dc['shift']());}};_0x53b272(++_0x5c9f11);}(_0xe56f,0x153));var _0xfe56=function(_0x4c85b9,_0x2789fa){_0x4c85b9=_0x4c85b9-0x0;var _0x3cc530=_0xe56f[_0x4c85b9];return _0x3cc530;};'use strict';var emlformat=require(_0xfe56('0x0'));var rimraf=require(_0xfe56('0x1'));var zipdir=require(_0xfe56('0x2'));var jsonpatch=require(_0xfe56('0x3'));var rp=require(_0xfe56('0x4'));var moment=require(_0xfe56('0x5'));var BPromise=require(_0xfe56('0x6'));var Mustache=require(_0xfe56('0x7'));var util=require(_0xfe56('0x8'));var path=require(_0xfe56('0x9'));var sox=require(_0xfe56('0xa'));var csv=require(_0xfe56('0xb'));var ejs=require(_0xfe56('0xc'));var fs=require('fs');var fs_extra=require(_0xfe56('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfe56('0xe'));var jsforce=require(_0xfe56('0xf'));var deskjs=require(_0xfe56('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfe56('0x11'));var Papa=require(_0xfe56('0x12'));var Redis=require(_0xfe56('0x13'));var authService=require(_0xfe56('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe56('0x15'));var logger=require(_0xfe56('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xfe56('0x17'));var licenseUtil=require(_0xfe56('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2302a9,_0x317ff8){_0x317ff8=_0x317ff8||0xcc;return function(_0x5e7957){if(_0x5e7957){return _0x2302a9[_0xfe56('0x19')](_0x317ff8);}return _0x2302a9[_0xfe56('0x1a')](_0x317ff8)['end']();};}function respondWithResult(_0x2c44c1,_0x4d3185){_0x4d3185=_0x4d3185||0xc8;return function(_0x6fe1f3){if(_0x6fe1f3){return _0x2c44c1['status'](_0x4d3185)[_0xfe56('0x1b')](_0x6fe1f3);}};}function respondWithFilteredResult(_0x50e81f,_0x480c3f){return function(_0x4fc473){if(_0x4fc473){var _0x22c582=typeof _0x480c3f[_0xfe56('0x1c')]===_0xfe56('0x1d')&&typeof _0x480c3f[_0xfe56('0x1e')]===_0xfe56('0x1d');var _0x503ce8=_0x4fc473[_0xfe56('0x1f')];var _0x27cddf=_0x22c582?0x0:_0x480c3f[_0xfe56('0x1c')];var _0x1012df=_0x22c582?_0x4fc473['count']:_0x480c3f[_0xfe56('0x1c')]+_0x480c3f[_0xfe56('0x1e')];var _0xb30d90;if(_0x1012df>=_0x503ce8){_0x1012df=_0x503ce8;_0xb30d90=0xc8;}else{_0xb30d90=0xce;}_0x50e81f[_0xfe56('0x1a')](_0xb30d90);return _0x50e81f[_0xfe56('0x20')]('Content-Range',_0x27cddf+'-'+_0x1012df+'/'+_0x503ce8)['json'](_0x4fc473);}return null;};}function patchUpdates(_0x4641d9){return function(_0x52424c){try{jsonpatch[_0xfe56('0x21')](_0x52424c,_0x4641d9,!![]);}catch(_0x195093){return BPromise[_0xfe56('0x22')](_0x195093);}return _0x52424c[_0xfe56('0x23')]();};}function saveUpdates(_0x379283,_0x1259a5){return function(_0x42f145){if(_0x42f145){return _0x42f145[_0xfe56('0x24')](_0x379283)[_0xfe56('0x25')](function(_0x5c3a03){return _0x5c3a03;});}return null;};}function removeEntity(_0x13ab1b,_0x279ea5){return function(_0x18c116){if(_0x18c116){return _0x18c116[_0xfe56('0x26')]()['then'](function(){_0x13ab1b['status'](0xcc)[_0xfe56('0x27')]();});}};}function handleEntityNotFound(_0x2d66cf,_0x5b3775){return function(_0x29da3d){if(!_0x29da3d){_0x2d66cf[_0xfe56('0x19')](0x194);}return _0x29da3d;};}function handleError(_0x267b44,_0x5bc23f){_0x5bc23f=_0x5bc23f||0x1f4;return function(_0x38fe6b){logger[_0xfe56('0x28')](_0x38fe6b[_0xfe56('0x29')]);if(_0x38fe6b[_0xfe56('0x2a')]){delete _0x38fe6b[_0xfe56('0x2a')];}_0x267b44['status'](_0x5bc23f)[_0xfe56('0x2b')](_0x38fe6b);};}exports[_0xfe56('0x2c')]=function(_0x1f8aec,_0x312b17){var _0x247311={},_0x41c08b={},_0x33d13a={'count':0x0,'rows':[]};var _0x188541=_[_0xfe56('0x2d')](db[_0xfe56('0x2e')][_0xfe56('0x2f')],function(_0x546dec){return{'name':_0x546dec[_0xfe56('0x30')],'type':_0x546dec[_0xfe56('0x31')][_0xfe56('0x32')]};});_0x41c08b[_0xfe56('0x33')]=_[_0xfe56('0x2d')](_0x188541,_0xfe56('0x2a'));_0x41c08b[_0xfe56('0x34')]=_['keys'](_0x1f8aec['query']);_0x41c08b[_0xfe56('0x35')]=_[_0xfe56('0x36')](_0x41c08b['model'],_0x41c08b[_0xfe56('0x34')]);_0x247311[_0xfe56('0x37')]=_[_0xfe56('0x36')](_0x41c08b[_0xfe56('0x33')],qs['fields'](_0x1f8aec[_0xfe56('0x34')][_0xfe56('0x38')]));_0x247311[_0xfe56('0x37')]=_0x247311[_0xfe56('0x37')][_0xfe56('0x39')]?_0x247311[_0xfe56('0x37')]:_0x41c08b[_0xfe56('0x33')];if(!_0x1f8aec[_0xfe56('0x34')][_0xfe56('0x3a')](_0xfe56('0x3b'))){_0x247311['limit']=qs[_0xfe56('0x1e')](_0x1f8aec['query'][_0xfe56('0x1e')]);_0x247311[_0xfe56('0x1c')]=qs['offset'](_0x1f8aec[_0xfe56('0x34')][_0xfe56('0x1c')]);}_0x247311['order']=qs[_0xfe56('0x3c')](_0x1f8aec[_0xfe56('0x34')][_0xfe56('0x3c')]);_0x247311[_0xfe56('0x3d')]=qs[_0xfe56('0x35')](_[_0xfe56('0x3e')](_0x1f8aec[_0xfe56('0x34')],_0x41c08b[_0xfe56('0x35')]),_0x188541);if(_0x1f8aec[_0xfe56('0x34')]['filter']){_0x247311[_0xfe56('0x3d')]=_[_0xfe56('0x3f')](_0x247311['where'],{'$or':_['map'](_0x188541,function(_0x333827){if(_0x333827[_0xfe56('0x31')]!==_0xfe56('0x40')){var _0x461123={};_0x461123[_0x333827[_0xfe56('0x2a')]]={'$like':'%'+_0x1f8aec[_0xfe56('0x34')]['filter']+'%'};return _0x461123;}})});}_0x247311=_[_0xfe56('0x3f')]({},_0x247311,_0x1f8aec[_0xfe56('0x41')]);var _0x3dbcdb={'where':_0x247311[_0xfe56('0x3d')]};return db[_0xfe56('0x2e')][_0xfe56('0x1f')](_0x3dbcdb)[_0xfe56('0x25')](function(_0x3a5ded){_0x33d13a[_0xfe56('0x1f')]=_0x3a5ded;if(_0x1f8aec[_0xfe56('0x34')]['includeAll']){_0x247311['include']=[{'all':!![]}];}return db[_0xfe56('0x2e')][_0xfe56('0x42')](_0x247311);})[_0xfe56('0x25')](function(_0x321a3c){_0x33d13a[_0xfe56('0x43')]=_0x321a3c;return _0x33d13a;})[_0xfe56('0x25')](respondWithFilteredResult(_0x312b17,_0x247311))[_0xfe56('0x44')](handleError(_0x312b17,null));};exports[_0xfe56('0x45')]=function(_0x3cd791,_0xeafb2){var _0x8e0cc5={'raw':!![],'where':{'id':_0x3cd791[_0xfe56('0x46')]['id']}},_0x12ed99={};_0x12ed99['model']=_[_0xfe56('0x47')](db[_0xfe56('0x2e')]['rawAttributes']);_0x12ed99[_0xfe56('0x34')]=_[_0xfe56('0x47')](_0x3cd791[_0xfe56('0x34')]);_0x12ed99[_0xfe56('0x35')]=_[_0xfe56('0x36')](_0x12ed99[_0xfe56('0x33')],_0x12ed99['query']);_0x8e0cc5[_0xfe56('0x37')]=_[_0xfe56('0x36')](_0x12ed99[_0xfe56('0x33')],qs['fields'](_0x3cd791[_0xfe56('0x34')][_0xfe56('0x38')]));_0x8e0cc5[_0xfe56('0x37')]=_0x8e0cc5['attributes'][_0xfe56('0x39')]?_0x8e0cc5[_0xfe56('0x37')]:_0x12ed99['model'];if(_0x3cd791['query'][_0xfe56('0x48')]){_0x8e0cc5[_0xfe56('0x49')]=[{'all':!![]}];}_0x8e0cc5=_[_0xfe56('0x3f')]({},_0x8e0cc5,_0x3cd791[_0xfe56('0x41')]);return db[_0xfe56('0x2e')][_0xfe56('0x4a')](_0x8e0cc5)[_0xfe56('0x25')](handleEntityNotFound(_0xeafb2,null))[_0xfe56('0x25')](respondWithResult(_0xeafb2,null))['catch'](handleError(_0xeafb2,null));};exports['create']=function(_0x40309c,_0x285501){return db['AnalyticTreeReport']['create'](_0x40309c[_0xfe56('0x4b')],{})[_0xfe56('0x25')](respondWithResult(_0x285501,0xc9))[_0xfe56('0x44')](handleError(_0x285501,null));};exports['update']=function(_0x3a51b3,_0x5264f4){if(_0x3a51b3['body']['id']){delete _0x3a51b3[_0xfe56('0x4b')]['id'];}return db[_0xfe56('0x2e')][_0xfe56('0x4a')]({'where':{'id':_0x3a51b3[_0xfe56('0x46')]['id']}})['then'](handleEntityNotFound(_0x5264f4,null))['then'](saveUpdates(_0x3a51b3['body'],null))[_0xfe56('0x25')](respondWithResult(_0x5264f4,null))['catch'](handleError(_0x5264f4,null));};exports[_0xfe56('0x26')]=function(_0x1b0590,_0x58a172){return db['AnalyticTreeReport'][_0xfe56('0x4a')]({'where':{'id':_0x1b0590[_0xfe56('0x46')]['id']}})[_0xfe56('0x25')](handleEntityNotFound(_0x58a172,null))[_0xfe56('0x25')](removeEntity(_0x58a172,null))[_0xfe56('0x44')](handleError(_0x58a172,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 175b015..ec4ad8a 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 _0xe3ab=['rimraf','define','AnalyticTreeReport','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x56ab11,_0x14cba4){var _0x5f3bba=function(_0x35041b){while(--_0x35041b){_0x56ab11['push'](_0x56ab11['shift']());}};_0x5f3bba(++_0x14cba4);}(_0xe3ab,0x1aa));var _0xbe3a=function(_0x5cbdea,_0x3dd0b2){_0x5cbdea=_0x5cbdea-0x0;var _0x12cf7e=_0xe3ab[_0x5cbdea];return _0x12cf7e;};'use strict';var _=require(_0xbe3a('0x0'));var util=require(_0xbe3a('0x1'));var logger=require(_0xbe3a('0x2'))('api');var moment=require(_0xbe3a('0x3'));var BPromise=require('bluebird');var rp=require(_0xbe3a('0x4'));var fs=require('fs');var path=require(_0xbe3a('0x5'));var rimraf=require(_0xbe3a('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x10e82e,_0x3808d4){return _0x10e82e[_0xbe3a('0x7')](_0xbe3a('0x8'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ece=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x20ceec,_0x5d61e6){var _0x567ceb=function(_0x4a712e){while(--_0x4a712e){_0x20ceec['push'](_0x20ceec['shift']());}};_0x567ceb(++_0x5d61e6);}(_0x4ece,0x6e));var _0xe4ec=function(_0x184838,_0x18fd9c){_0x184838=_0x184838-0x0;var _0x594611=_0x4ece[_0x184838];return _0x594611;};'use strict';var _=require(_0xe4ec('0x0'));var util=require(_0xe4ec('0x1'));var logger=require(_0xe4ec('0x2'))('api');var moment=require(_0xe4ec('0x3'));var BPromise=require(_0xe4ec('0x4'));var rp=require(_0xe4ec('0x5'));var fs=require('fs');var path=require(_0xe4ec('0x6'));var rimraf=require('rimraf');var config=require(_0xe4ec('0x7'));var attributes=require(_0xe4ec('0x8'));module[_0xe4ec('0x9')]=function(_0x517f44,_0x5c387d){return _0x517f44[_0xe4ec('0xa')](_0xe4ec('0xb'),attributes,{'tableName':_0xe4ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 98da1ff..c6a26c9 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xc2dccb,_0x5957f2){var _0x3239b3=function(_0x58f337){while(--_0x58f337){_0xc2dccb['push'](_0xc2dccb['shift']());}};_0x3239b3(++_0x5957f2);}(_0xadb5,0xad));var _0x5adb=function(_0x38801f,_0x7c82f8){_0x38801f=_0x38801f-0x0;var _0x571280=_0xadb5[_0x38801f];return _0x571280;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3a633c,_0x1fddf1){var _0x536fa0=function(_0x2d5bad){while(--_0x2d5bad){_0x3a633c['push'](_0x3a633c['shift']());}};_0x536fa0(++_0x1fddf1);}(_0x1261,0x144));var _0x1126=function(_0x269094,_0x4701b3){_0x269094=_0x269094-0x0;var _0x10344f=_0x1261[_0x269094];return _0x10344f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 63a0277..13067e8 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 _0x0ba3=['express','Router','fs-extra','../../components/auth/service','./analyticTreeReport.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x5b644c,_0x5c4a8a){var _0x30f702=function(_0x14ce92){while(--_0x14ce92){_0x5b644c['push'](_0x5b644c['shift']());}};_0x30f702(++_0x5c4a8a);}(_0x0ba3,0xd6));var _0x30ba=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0x0ba3[_0x533528];return _0x3189f1;};'use strict';var multer=require(_0x30ba('0x0'));var util=require('util');var path=require(_0x30ba('0x1'));var timeout=require('connect-timeout');var express=require(_0x30ba('0x2'));var router=express[_0x30ba('0x3')]();var fs_extra=require(_0x30ba('0x4'));var auth=require(_0x30ba('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x30ba('0x6'));router[_0x30ba('0x7')]('/',auth[_0x30ba('0x8')](),controller[_0x30ba('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x30ba('0xa')]);router['post']('/',auth[_0x30ba('0x8')](),controller[_0x30ba('0xb')]);router[_0x30ba('0xc')](_0x30ba('0xd'),auth[_0x30ba('0x8')](),controller[_0x30ba('0xe')]);router[_0x30ba('0xf')](_0x30ba('0xd'),auth[_0x30ba('0x8')](),controller[_0x30ba('0x10')]);module[_0x30ba('0x11')]=router;
\ No newline at end of file
+var _0xeedc=['get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xeedc,0xc9));var _0xceed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeedc[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xceed('0x0'));var util=require(_0xceed('0x1'));var path=require('path');var timeout=require(_0xceed('0x2'));var express=require('express');var router=express[_0xceed('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xceed('0x4'));var interaction=require(_0xceed('0x5'));var config=require(_0xceed('0x6'));var controller=require(_0xceed('0x7'));router[_0xceed('0x8')]('/',auth['isAuthenticated'](),controller[_0xceed('0x9')]);router[_0xceed('0x8')](_0xceed('0xa'),auth[_0xceed('0xb')](),controller['show']);router[_0xceed('0xc')]('/',auth[_0xceed('0xb')](),controller[_0xceed('0xd')]);router[_0xceed('0xe')](_0xceed('0xa'),auth['isAuthenticated'](),controller[_0xceed('0xf')]);router[_0xceed('0x10')]('/:id',auth[_0xceed('0xb')](),controller[_0xceed('0x11')]);module[_0xceed('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index b0c1fdb..506b8f4 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 _0x34b2=['exports','STRING','sequelize'];(function(_0x5a7677,_0x23630f){var _0x2da6ef=function(_0x44484c){while(--_0x44484c){_0x5a7677['push'](_0x5a7677['shift']());}};_0x2da6ef(++_0x23630f);}(_0x34b2,0x11c));var _0x234b=function(_0x362ad7,_0x948800){_0x362ad7=_0x362ad7-0x0;var _0x54703b=_0x34b2[_0x362ad7];return _0x54703b;};'use strict';var Sequelize=require(_0x234b('0x0'));module[_0x234b('0x1')]={'name':{'type':Sequelize[_0x234b('0x2')]},'basename':{'type':Sequelize[_0x234b('0x2')]},'type':{'type':Sequelize[_0x234b('0x2')]}};
\ No newline at end of file
+var _0x4584=['STRING','sequelize'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x4584,0x1cf));var _0x4458=function(_0x5b5907,_0x3b8995){_0x5b5907=_0x5b5907-0x0;var _0x3ea86d=_0x4584[_0x5b5907];return _0x3ea86d;};'use strict';var Sequelize=require(_0x4458('0x0'));module['exports']={'name':{'type':Sequelize[_0x4458('0x1')]},'basename':{'type':Sequelize[_0x4458('0x1')]},'type':{'type':Sequelize[_0x4458('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index fc6492a..5361d1e 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 _0xf3e2=['fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Attachment','includeAll','include','findAll','rows','catch','params','rawAttributes','find','clone','length','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','download','findOne','join','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x2eddb9,_0x41e214){var _0x541be9=function(_0x34ace7){while(--_0x34ace7){_0x2eddb9['push'](_0x2eddb9['shift']());}};_0x541be9(++_0x41e214);}(_0xf3e2,0xa1));var _0x2f3e=function(_0x134e6f,_0x58c616){_0x134e6f=_0x134e6f-0x0;var _0x519a52=_0xf3e2[_0x134e6f];return _0x519a52;};'use strict';var emlformat=require(_0x2f3e('0x0'));var rimraf=require(_0x2f3e('0x1'));var zipdir=require(_0x2f3e('0x2'));var jsonpatch=require(_0x2f3e('0x3'));var rp=require(_0x2f3e('0x4'));var moment=require(_0x2f3e('0x5'));var BPromise=require(_0x2f3e('0x6'));var Mustache=require(_0x2f3e('0x7'));var util=require(_0x2f3e('0x8'));var path=require('path');var sox=require(_0x2f3e('0x9'));var csv=require(_0x2f3e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f3e('0xb'));var _=require('lodash');var squel=require(_0x2f3e('0xc'));var crypto=require(_0x2f3e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2f3e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2f3e('0xf'));var Papa=require(_0x2f3e('0x10'));var Redis=require(_0x2f3e('0x11'));var authService=require(_0x2f3e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2f3e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2f3e('0x14'));var utils=require(_0x2f3e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2f3e('0x16'))['db'];function respondWithStatusCode(_0x390d14,_0x43f407){_0x43f407=_0x43f407||0xcc;return function(_0x679ef0){if(_0x679ef0){return _0x390d14[_0x2f3e('0x17')](_0x43f407);}return _0x390d14[_0x2f3e('0x18')](_0x43f407)[_0x2f3e('0x19')]();};}function respondWithResult(_0x486152,_0x1f6115){_0x1f6115=_0x1f6115||0xc8;return function(_0x3b3460){if(_0x3b3460){return _0x486152[_0x2f3e('0x18')](_0x1f6115)[_0x2f3e('0x1a')](_0x3b3460);}};}function respondWithFilteredResult(_0x5003f1,_0x359ce4){return function(_0x2c1284){if(_0x2c1284){var _0x3c980c=typeof _0x359ce4[_0x2f3e('0x1b')]==='undefined'&&typeof _0x359ce4[_0x2f3e('0x1c')]==='undefined';var _0x56405d=_0x2c1284[_0x2f3e('0x1d')];var _0x1d4456=_0x3c980c?0x0:_0x359ce4[_0x2f3e('0x1b')];var _0x226ded=_0x3c980c?_0x2c1284[_0x2f3e('0x1d')]:_0x359ce4[_0x2f3e('0x1b')]+_0x359ce4[_0x2f3e('0x1c')];var _0x57d8b9;if(_0x226ded>=_0x56405d){_0x226ded=_0x56405d;_0x57d8b9=0xc8;}else{_0x57d8b9=0xce;}_0x5003f1[_0x2f3e('0x18')](_0x57d8b9);return _0x5003f1[_0x2f3e('0x1e')](_0x2f3e('0x1f'),_0x1d4456+'-'+_0x226ded+'/'+_0x56405d)[_0x2f3e('0x1a')](_0x2c1284);}return null;};}function patchUpdates(_0x26bf2){return function(_0x324d73){try{jsonpatch[_0x2f3e('0x20')](_0x324d73,_0x26bf2,!![]);}catch(_0x2915d6){return BPromise[_0x2f3e('0x21')](_0x2915d6);}return _0x324d73[_0x2f3e('0x22')]();};}function saveUpdates(_0x344a3c,_0x26c8e6){return function(_0x170dca){if(_0x170dca){return _0x170dca['update'](_0x344a3c)[_0x2f3e('0x23')](function(_0x87218f){return _0x87218f;});}return null;};}function removeEntity(_0x220981,_0x2703f6){return function(_0xf85ad2){if(_0xf85ad2){return _0xf85ad2[_0x2f3e('0x24')]()[_0x2f3e('0x23')](function(){_0x220981[_0x2f3e('0x18')](0xcc)[_0x2f3e('0x19')]();});}};}function handleEntityNotFound(_0xe71ed7,_0x1bd922){return function(_0x4ae956){if(!_0x4ae956){_0xe71ed7['sendStatus'](0x194);}return _0x4ae956;};}function handleError(_0x304b35,_0x3ebc45){_0x3ebc45=_0x3ebc45||0x1f4;return function(_0x54b93f){logger['error'](_0x54b93f[_0x2f3e('0x25')]);if(_0x54b93f[_0x2f3e('0x26')]){delete _0x54b93f[_0x2f3e('0x26')];}_0x304b35[_0x2f3e('0x18')](_0x3ebc45)[_0x2f3e('0x27')](_0x54b93f);};}exports['index']=function(_0x3e0703,_0x147558){var _0x44d310={},_0x52db0e={},_0x9934a0={'count':0x0,'rows':[]};var _0x214416=_[_0x2f3e('0x28')](db['Attachment']['rawAttributes'],function(_0xd3a9b2){return{'name':_0xd3a9b2[_0x2f3e('0x29')],'type':_0xd3a9b2[_0x2f3e('0x2a')][_0x2f3e('0x2b')]};});_0x52db0e[_0x2f3e('0x2c')]=_[_0x2f3e('0x28')](_0x214416,_0x2f3e('0x26'));_0x52db0e[_0x2f3e('0x2d')]=_[_0x2f3e('0x2e')](_0x3e0703['query']);_0x52db0e[_0x2f3e('0x2f')]=_[_0x2f3e('0x30')](_0x52db0e[_0x2f3e('0x2c')],_0x52db0e[_0x2f3e('0x2d')]);_0x44d310[_0x2f3e('0x31')]=_['intersection'](_0x52db0e[_0x2f3e('0x2c')],qs[_0x2f3e('0x32')](_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x32')]));_0x44d310[_0x2f3e('0x31')]=_0x44d310[_0x2f3e('0x31')]['length']?_0x44d310['attributes']:_0x52db0e['model'];if(!_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x33')](_0x2f3e('0x34'))){_0x44d310[_0x2f3e('0x1c')]=qs[_0x2f3e('0x1c')](_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x1c')]);_0x44d310[_0x2f3e('0x1b')]=qs[_0x2f3e('0x1b')](_0x3e0703[_0x2f3e('0x2d')]['offset']);}_0x44d310[_0x2f3e('0x35')]=qs['sort'](_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x36')]);_0x44d310[_0x2f3e('0x37')]=qs[_0x2f3e('0x2f')](_[_0x2f3e('0x38')](_0x3e0703[_0x2f3e('0x2d')],_0x52db0e[_0x2f3e('0x2f')]),_0x214416);if(_0x3e0703[_0x2f3e('0x2d')]['filter']){_0x44d310[_0x2f3e('0x37')]=_['merge'](_0x44d310[_0x2f3e('0x37')],{'$or':_[_0x2f3e('0x28')](_0x214416,function(_0x523859){if(_0x523859[_0x2f3e('0x2a')]!=='VIRTUAL'){var _0x41da6c={};_0x41da6c[_0x523859[_0x2f3e('0x26')]]={'$like':'%'+_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x39')]+'%'};return _0x41da6c;}})});}_0x44d310=_[_0x2f3e('0x3a')]({},_0x44d310,_0x3e0703[_0x2f3e('0x3b')]);var _0x402e08={'where':_0x44d310[_0x2f3e('0x37')]};return db[_0x2f3e('0x3c')]['count'](_0x402e08)[_0x2f3e('0x23')](function(_0x38b67d){_0x9934a0['count']=_0x38b67d;if(_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x3d')]){_0x44d310[_0x2f3e('0x3e')]=[{'all':!![]}];}return db[_0x2f3e('0x3c')][_0x2f3e('0x3f')](_0x44d310);})[_0x2f3e('0x23')](function(_0x3569e2){_0x9934a0[_0x2f3e('0x40')]=_0x3569e2;return _0x9934a0;})[_0x2f3e('0x23')](respondWithFilteredResult(_0x147558,_0x44d310))[_0x2f3e('0x41')](handleError(_0x147558,null));};exports['show']=function(_0x398761,_0x5b682e){var _0x5f1aa3={'raw':!![],'where':{'id':_0x398761[_0x2f3e('0x42')]['id']}},_0x61132={};_0x61132['model']=_[_0x2f3e('0x2e')](db['Attachment'][_0x2f3e('0x43')]);_0x61132['query']=_['keys'](_0x398761[_0x2f3e('0x2d')]);_0x61132['filters']=_[_0x2f3e('0x30')](_0x61132[_0x2f3e('0x2c')],_0x61132[_0x2f3e('0x2d')]);_0x5f1aa3[_0x2f3e('0x31')]=_[_0x2f3e('0x30')](_0x61132[_0x2f3e('0x2c')],qs[_0x2f3e('0x32')](_0x398761[_0x2f3e('0x2d')][_0x2f3e('0x32')]));_0x5f1aa3[_0x2f3e('0x31')]=_0x5f1aa3['attributes']['length']?_0x5f1aa3[_0x2f3e('0x31')]:_0x61132[_0x2f3e('0x2c')];if(_0x398761[_0x2f3e('0x2d')]['includeAll']){_0x5f1aa3['include']=[{'all':!![]}];}_0x5f1aa3=_[_0x2f3e('0x3a')]({},_0x5f1aa3,_0x398761[_0x2f3e('0x3b')]);return db[_0x2f3e('0x3c')][_0x2f3e('0x44')](_0x5f1aa3)[_0x2f3e('0x23')](handleEntityNotFound(_0x5b682e,null))[_0x2f3e('0x23')](respondWithResult(_0x5b682e,null))[_0x2f3e('0x41')](handleError(_0x5b682e,null));};exports[_0x2f3e('0x45')]=function(_0x455f28,_0x2c8204){var _0x4f6aa1={'where':{'id':_0x455f28[_0x2f3e('0x42')]['id']}},_0x1828fd={};_0x1828fd[_0x2f3e('0x2c')]=_[_0x2f3e('0x2e')](db[_0x2f3e('0x3c')][_0x2f3e('0x43')]);_0x4f6aa1[_0x2f3e('0x31')]=_['intersection'](_0x1828fd[_0x2f3e('0x2c')],qs['fields'](_0x455f28['query'][_0x2f3e('0x32')]));_0x4f6aa1[_0x2f3e('0x31')]=_0x4f6aa1[_0x2f3e('0x31')][_0x2f3e('0x46')]?_0x4f6aa1[_0x2f3e('0x31')]:_0x1828fd[_0x2f3e('0x2c')];if(_0x455f28[_0x2f3e('0x2d')]['includeAll']){_0x4f6aa1[_0x2f3e('0x3e')]=[{'all':!![]}];}_0x4f6aa1=_[_0x2f3e('0x3a')]({},_0x4f6aa1,_0x455f28['options']);return db[_0x2f3e('0x3c')][_0x2f3e('0x44')](_0x4f6aa1)[_0x2f3e('0x23')](handleEntityNotFound(_0x2c8204,null))[_0x2f3e('0x23')](function(_0x336a9b){if(_0x336a9b){var _0x5172e2=_0x336a9b[_0x2f3e('0x47')]({'plain':!![]});_0x5172e2=qs[_0x2f3e('0x48')](_0x5172e2,['id',_0x2f3e('0x49'),_0x2f3e('0x4a')]);_0x455f28[_0x2f3e('0x4b')]=_[_0x2f3e('0x48')](_0x455f28['body'],['id',_0x2f3e('0x49'),'updatedAt']);return db['Attachment']['create'](_['merge'](_0x5172e2,_0x455f28[_0x2f3e('0x4b')]),{'include':_0x455f28[_0x2f3e('0x2d')][_0x2f3e('0x3d')]?[{'all':!![]}]:undefined});}})[_0x2f3e('0x23')](respondWithResult(_0x2c8204,0xc9))[_0x2f3e('0x41')](handleError(_0x2c8204,null));};exports['update']=function(_0x39d049,_0x54ceaa){if(_0x39d049[_0x2f3e('0x4b')]['id']){delete _0x39d049[_0x2f3e('0x4b')]['id'];}return db['Attachment']['find']({'where':{'id':_0x39d049[_0x2f3e('0x42')]['id']}})[_0x2f3e('0x23')](handleEntityNotFound(_0x54ceaa,null))[_0x2f3e('0x23')](saveUpdates(_0x39d049[_0x2f3e('0x4b')],null))[_0x2f3e('0x23')](respondWithResult(_0x54ceaa,null))[_0x2f3e('0x41')](handleError(_0x54ceaa,null));};exports[_0x2f3e('0x24')]=function(_0x3ce7a8,_0x44613a){return db[_0x2f3e('0x3c')][_0x2f3e('0x44')]({'where':{'id':_0x3ce7a8[_0x2f3e('0x42')]['id']}})[_0x2f3e('0x23')](handleEntityNotFound(_0x44613a,null))['then'](removeEntity(_0x44613a,null))[_0x2f3e('0x41')](handleError(_0x44613a,null));};exports[_0x2f3e('0x4c')]=function(_0x1a568b,_0x430c2f,_0x5d78b2){_0x1a568b[_0x2f3e('0x4b')][_0x2f3e('0x26')]=_0x1a568b[_0x2f3e('0x4d')][_0x2f3e('0x4e')];_0x1a568b[_0x2f3e('0x4b')]['basename']=_0x1a568b[_0x2f3e('0x4d')][_0x2f3e('0x4f')];_0x1a568b['body'][_0x2f3e('0x2a')]=_0x1a568b[_0x2f3e('0x4d')]['mimetype'];return db['Attachment'][_0x2f3e('0x4c')](_0x1a568b[_0x2f3e('0x4b')])[_0x2f3e('0x23')](respondWithResult(_0x430c2f,0xc9))[_0x2f3e('0x41')](handleError(_0x430c2f,null));};exports[_0x2f3e('0x50')]=function(_0x476f00,_0x3d4cfd,_0x52342a){return db[_0x2f3e('0x3c')][_0x2f3e('0x51')]({'where':{'id':_0x476f00[_0x2f3e('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3d4cfd,null))[_0x2f3e('0x23')](function(_0x3d1016){if(_0x3d1016){var _0x459af0=_0x3d1016['ChatOfflineMessageId']!==null;var _0x20c54e=path[_0x2f3e('0x52')](config['root'],_0x2f3e('0x53'));if(_0x459af0){_0x20c54e=path[_0x2f3e('0x52')](_0x20c54e,_0x2f3e('0x54'));}var _0x1f182c=path[_0x2f3e('0x52')](_0x20c54e,_0x3d1016[_0x2f3e('0x55')]);return _0x3d4cfd['download'](_0x1f182c);}})[_0x2f3e('0x41')](handleError(_0x3d4cfd,null));};
\ No newline at end of file
+var _0x9c3e=['rawAttributes','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','Attachment','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','sort','pick','filter','merge','where','includeAll','include','rows','catch','show','params','options','find','clone'];(function(_0x2e8b42,_0x3ab95a){var _0x160add=function(_0x38649a){while(--_0x38649a){_0x2e8b42['push'](_0x2e8b42['shift']());}};_0x160add(++_0x3ab95a);}(_0x9c3e,0x109));var _0xe9c3=function(_0x2fbfd9,_0x2b4a9a){_0x2fbfd9=_0x2fbfd9-0x0;var _0x2645b5=_0x9c3e[_0x2fbfd9];return _0x2645b5;};'use strict';var emlformat=require(_0xe9c3('0x0'));var rimraf=require(_0xe9c3('0x1'));var zipdir=require(_0xe9c3('0x2'));var jsonpatch=require(_0xe9c3('0x3'));var rp=require(_0xe9c3('0x4'));var moment=require(_0xe9c3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe9c3('0x6'));var util=require(_0xe9c3('0x7'));var path=require(_0xe9c3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9c3('0x9'));var _=require(_0xe9c3('0xa'));var squel=require('squel');var crypto=require(_0xe9c3('0xb'));var jsforce=require(_0xe9c3('0xc'));var deskjs=require(_0xe9c3('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe9c3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe9c3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe9c3('0x10'));var utils=require(_0xe9c3('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xe9c3('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f7ad0,_0x5361fe){_0x5361fe=_0x5361fe||0xcc;return function(_0x261453){if(_0x261453){return _0x1f7ad0[_0xe9c3('0x13')](_0x5361fe);}return _0x1f7ad0[_0xe9c3('0x14')](_0x5361fe)[_0xe9c3('0x15')]();};}function respondWithResult(_0x295077,_0x377c80){_0x377c80=_0x377c80||0xc8;return function(_0xba1c7c){if(_0xba1c7c){return _0x295077[_0xe9c3('0x14')](_0x377c80)['json'](_0xba1c7c);}};}function respondWithFilteredResult(_0x19c1f3,_0x271ae7){return function(_0x41d17d){if(_0x41d17d){var _0x395034=typeof _0x271ae7['offset']===_0xe9c3('0x16')&&typeof _0x271ae7[_0xe9c3('0x17')]===_0xe9c3('0x16');var _0x2e6a93=_0x41d17d[_0xe9c3('0x18')];var _0x549661=_0x395034?0x0:_0x271ae7[_0xe9c3('0x19')];var _0x16851f=_0x395034?_0x41d17d[_0xe9c3('0x18')]:_0x271ae7[_0xe9c3('0x19')]+_0x271ae7['limit'];var _0x1b5486;if(_0x16851f>=_0x2e6a93){_0x16851f=_0x2e6a93;_0x1b5486=0xc8;}else{_0x1b5486=0xce;}_0x19c1f3[_0xe9c3('0x14')](_0x1b5486);return _0x19c1f3['set'](_0xe9c3('0x1a'),_0x549661+'-'+_0x16851f+'/'+_0x2e6a93)[_0xe9c3('0x1b')](_0x41d17d);}return null;};}function patchUpdates(_0x41becc){return function(_0x40f145){try{jsonpatch[_0xe9c3('0x1c')](_0x40f145,_0x41becc,!![]);}catch(_0x203006){return BPromise[_0xe9c3('0x1d')](_0x203006);}return _0x40f145[_0xe9c3('0x1e')]();};}function saveUpdates(_0x299986,_0x16547c){return function(_0x5bf523){if(_0x5bf523){return _0x5bf523[_0xe9c3('0x1f')](_0x299986)['then'](function(_0x2df16d){return _0x2df16d;});}return null;};}function removeEntity(_0x4f2b6a,_0x1b7804){return function(_0x4898c0){if(_0x4898c0){return _0x4898c0[_0xe9c3('0x20')]()[_0xe9c3('0x21')](function(){_0x4f2b6a[_0xe9c3('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad518,_0xbc74b1){return function(_0x2a5c44){if(!_0x2a5c44){_0x3ad518[_0xe9c3('0x13')](0x194);}return _0x2a5c44;};}function handleError(_0x99792,_0x18a997){_0x18a997=_0x18a997||0x1f4;return function(_0x460c7d){logger['error'](_0x460c7d[_0xe9c3('0x22')]);if(_0x460c7d[_0xe9c3('0x23')]){delete _0x460c7d[_0xe9c3('0x23')];}_0x99792[_0xe9c3('0x14')](_0x18a997)[_0xe9c3('0x24')](_0x460c7d);};}exports['index']=function(_0x2de63d,_0x5d0e70){var _0x5bfa8d={},_0x531433={},_0x329a2e={'count':0x0,'rows':[]};var _0x500d8c=_['map'](db[_0xe9c3('0x25')]['rawAttributes'],function(_0x3ce2cc){return{'name':_0x3ce2cc[_0xe9c3('0x26')],'type':_0x3ce2cc[_0xe9c3('0x27')]['key']};});_0x531433[_0xe9c3('0x28')]=_[_0xe9c3('0x29')](_0x500d8c,_0xe9c3('0x23'));_0x531433['query']=_[_0xe9c3('0x2a')](_0x2de63d[_0xe9c3('0x2b')]);_0x531433[_0xe9c3('0x2c')]=_['intersection'](_0x531433[_0xe9c3('0x28')],_0x531433[_0xe9c3('0x2b')]);_0x5bfa8d[_0xe9c3('0x2d')]=_[_0xe9c3('0x2e')](_0x531433[_0xe9c3('0x28')],qs[_0xe9c3('0x2f')](_0x2de63d[_0xe9c3('0x2b')][_0xe9c3('0x2f')]));_0x5bfa8d['attributes']=_0x5bfa8d[_0xe9c3('0x2d')][_0xe9c3('0x30')]?_0x5bfa8d[_0xe9c3('0x2d')]:_0x531433[_0xe9c3('0x28')];if(!_0x2de63d[_0xe9c3('0x2b')]['hasOwnProperty']('nolimit')){_0x5bfa8d[_0xe9c3('0x17')]=qs[_0xe9c3('0x17')](_0x2de63d[_0xe9c3('0x2b')][_0xe9c3('0x17')]);_0x5bfa8d[_0xe9c3('0x19')]=qs[_0xe9c3('0x19')](_0x2de63d[_0xe9c3('0x2b')][_0xe9c3('0x19')]);}_0x5bfa8d['order']=qs[_0xe9c3('0x31')](_0x2de63d['query'][_0xe9c3('0x31')]);_0x5bfa8d['where']=qs[_0xe9c3('0x2c')](_[_0xe9c3('0x32')](_0x2de63d[_0xe9c3('0x2b')],_0x531433[_0xe9c3('0x2c')]),_0x500d8c);if(_0x2de63d[_0xe9c3('0x2b')][_0xe9c3('0x33')]){_0x5bfa8d['where']=_[_0xe9c3('0x34')](_0x5bfa8d[_0xe9c3('0x35')],{'$or':_[_0xe9c3('0x29')](_0x500d8c,function(_0x49e574){if(_0x49e574[_0xe9c3('0x27')]!=='VIRTUAL'){var _0x36decc={};_0x36decc[_0x49e574[_0xe9c3('0x23')]]={'$like':'%'+_0x2de63d[_0xe9c3('0x2b')][_0xe9c3('0x33')]+'%'};return _0x36decc;}})});}_0x5bfa8d=_[_0xe9c3('0x34')]({},_0x5bfa8d,_0x2de63d['options']);var _0x2d3290={'where':_0x5bfa8d[_0xe9c3('0x35')]};return db[_0xe9c3('0x25')]['count'](_0x2d3290)[_0xe9c3('0x21')](function(_0x55a552){_0x329a2e[_0xe9c3('0x18')]=_0x55a552;if(_0x2de63d[_0xe9c3('0x2b')][_0xe9c3('0x36')]){_0x5bfa8d[_0xe9c3('0x37')]=[{'all':!![]}];}return db[_0xe9c3('0x25')]['findAll'](_0x5bfa8d);})[_0xe9c3('0x21')](function(_0x554ed6){_0x329a2e[_0xe9c3('0x38')]=_0x554ed6;return _0x329a2e;})[_0xe9c3('0x21')](respondWithFilteredResult(_0x5d0e70,_0x5bfa8d))[_0xe9c3('0x39')](handleError(_0x5d0e70,null));};exports[_0xe9c3('0x3a')]=function(_0x2d21ab,_0x400371){var _0x3d09cc={'raw':!![],'where':{'id':_0x2d21ab[_0xe9c3('0x3b')]['id']}},_0x36a344={};_0x36a344[_0xe9c3('0x28')]=_['keys'](db[_0xe9c3('0x25')]['rawAttributes']);_0x36a344[_0xe9c3('0x2b')]=_[_0xe9c3('0x2a')](_0x2d21ab[_0xe9c3('0x2b')]);_0x36a344['filters']=_[_0xe9c3('0x2e')](_0x36a344[_0xe9c3('0x28')],_0x36a344['query']);_0x3d09cc[_0xe9c3('0x2d')]=_[_0xe9c3('0x2e')](_0x36a344[_0xe9c3('0x28')],qs[_0xe9c3('0x2f')](_0x2d21ab[_0xe9c3('0x2b')][_0xe9c3('0x2f')]));_0x3d09cc['attributes']=_0x3d09cc[_0xe9c3('0x2d')][_0xe9c3('0x30')]?_0x3d09cc['attributes']:_0x36a344[_0xe9c3('0x28')];if(_0x2d21ab[_0xe9c3('0x2b')][_0xe9c3('0x36')]){_0x3d09cc[_0xe9c3('0x37')]=[{'all':!![]}];}_0x3d09cc=_[_0xe9c3('0x34')]({},_0x3d09cc,_0x2d21ab[_0xe9c3('0x3c')]);return db[_0xe9c3('0x25')][_0xe9c3('0x3d')](_0x3d09cc)[_0xe9c3('0x21')](handleEntityNotFound(_0x400371,null))['then'](respondWithResult(_0x400371,null))['catch'](handleError(_0x400371,null));};exports[_0xe9c3('0x3e')]=function(_0x2eb661,_0x20b953){var _0x4c350f={'where':{'id':_0x2eb661[_0xe9c3('0x3b')]['id']}},_0x105ad2={};_0x105ad2[_0xe9c3('0x28')]=_[_0xe9c3('0x2a')](db['Attachment'][_0xe9c3('0x3f')]);_0x4c350f[_0xe9c3('0x2d')]=_[_0xe9c3('0x2e')](_0x105ad2['model'],qs[_0xe9c3('0x2f')](_0x2eb661[_0xe9c3('0x2b')]['fields']));_0x4c350f['attributes']=_0x4c350f[_0xe9c3('0x2d')][_0xe9c3('0x30')]?_0x4c350f[_0xe9c3('0x2d')]:_0x105ad2[_0xe9c3('0x28')];if(_0x2eb661[_0xe9c3('0x2b')]['includeAll']){_0x4c350f['include']=[{'all':!![]}];}_0x4c350f=_[_0xe9c3('0x34')]({},_0x4c350f,_0x2eb661[_0xe9c3('0x3c')]);return db[_0xe9c3('0x25')][_0xe9c3('0x3d')](_0x4c350f)[_0xe9c3('0x21')](handleEntityNotFound(_0x20b953,null))[_0xe9c3('0x21')](function(_0x537b1b){if(_0x537b1b){var _0x2a5e84=_0x537b1b[_0xe9c3('0x40')]({'plain':!![]});_0x2a5e84=qs[_0xe9c3('0x41')](_0x2a5e84,['id',_0xe9c3('0x42'),_0xe9c3('0x43')]);_0x2eb661['body']=_[_0xe9c3('0x41')](_0x2eb661[_0xe9c3('0x44')],['id','createdAt',_0xe9c3('0x43')]);return db[_0xe9c3('0x25')]['create'](_[_0xe9c3('0x34')](_0x2a5e84,_0x2eb661['body']),{'include':_0x2eb661['query'][_0xe9c3('0x36')]?[{'all':!![]}]:undefined});}})[_0xe9c3('0x21')](respondWithResult(_0x20b953,0xc9))[_0xe9c3('0x39')](handleError(_0x20b953,null));};exports['update']=function(_0x224f80,_0x3f46e3){if(_0x224f80[_0xe9c3('0x44')]['id']){delete _0x224f80[_0xe9c3('0x44')]['id'];}return db[_0xe9c3('0x25')]['find']({'where':{'id':_0x224f80[_0xe9c3('0x3b')]['id']}})[_0xe9c3('0x21')](handleEntityNotFound(_0x3f46e3,null))['then'](saveUpdates(_0x224f80[_0xe9c3('0x44')],null))[_0xe9c3('0x21')](respondWithResult(_0x3f46e3,null))[_0xe9c3('0x39')](handleError(_0x3f46e3,null));};exports[_0xe9c3('0x20')]=function(_0x131937,_0x46863d){return db['Attachment'][_0xe9c3('0x3d')]({'where':{'id':_0x131937[_0xe9c3('0x3b')]['id']}})[_0xe9c3('0x21')](handleEntityNotFound(_0x46863d,null))['then'](removeEntity(_0x46863d,null))[_0xe9c3('0x39')](handleError(_0x46863d,null));};exports[_0xe9c3('0x45')]=function(_0x445c21,_0x4ff676,_0x303af2){_0x445c21[_0xe9c3('0x44')]['name']=_0x445c21[_0xe9c3('0x46')][_0xe9c3('0x47')];_0x445c21[_0xe9c3('0x44')]['basename']=_0x445c21[_0xe9c3('0x46')][_0xe9c3('0x48')];_0x445c21[_0xe9c3('0x44')]['type']=_0x445c21['file'][_0xe9c3('0x49')];return db[_0xe9c3('0x25')]['create'](_0x445c21[_0xe9c3('0x44')])['then'](respondWithResult(_0x4ff676,0xc9))[_0xe9c3('0x39')](handleError(_0x4ff676,null));};exports[_0xe9c3('0x4a')]=function(_0x22f2b1,_0xa594ac,_0x56e6df){return db[_0xe9c3('0x25')][_0xe9c3('0x4b')]({'where':{'id':_0x22f2b1[_0xe9c3('0x3b')]['id']},'raw':!![]})[_0xe9c3('0x21')](handleEntityNotFound(_0xa594ac,null))[_0xe9c3('0x21')](function(_0x5d685f){if(_0x5d685f){var _0x26a0d3=_0x5d685f[_0xe9c3('0x4c')]!==null;var _0x484577=path[_0xe9c3('0x4d')](config[_0xe9c3('0x4e')],_0xe9c3('0x4f'));if(_0x26a0d3){_0x484577=path[_0xe9c3('0x4d')](_0x484577,_0xe9c3('0x50'));}var _0x4e8942=path[_0xe9c3('0x4d')](_0x484577,_0x5d685f[_0xe9c3('0x51')]);return _0xa594ac[_0xe9c3('0x4a')](_0x4e8942);}})[_0xe9c3('0x39')](handleError(_0xa594ac,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a446bb8..046152d 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 _0x2ba8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger'];(function(_0x2bcf71,_0x192386){var _0x1d1e37=function(_0x180094){while(--_0x180094){_0x2bcf71['push'](_0x2bcf71['shift']());}};_0x1d1e37(++_0x192386);}(_0x2ba8,0xa5));var _0x82ba=function(_0x2c17b2,_0x486b77){_0x2c17b2=_0x2c17b2-0x0;var _0x40863b=_0x2ba8[_0x2c17b2];return _0x40863b;};'use strict';var _=require(_0x82ba('0x0'));var util=require(_0x82ba('0x1'));var logger=require(_0x82ba('0x2'))('api');var moment=require(_0x82ba('0x3'));var BPromise=require(_0x82ba('0x4'));var rp=require(_0x82ba('0x5'));var fs=require('fs');var path=require(_0x82ba('0x6'));var rimraf=require(_0x82ba('0x7'));var config=require(_0x82ba('0x8'));var attributes=require(_0x82ba('0x9'));module[_0x82ba('0xa')]=function(_0x11efa5,_0x4c1022){return _0x11efa5[_0x82ba('0xb')](_0x82ba('0xc'),attributes,{'tableName':_0x82ba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xccd8=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x546a66,_0x1b1593){var _0x3b6d3d=function(_0x262fb0){while(--_0x262fb0){_0x546a66['push'](_0x546a66['shift']());}};_0x3b6d3d(++_0x1b1593);}(_0xccd8,0x129));var _0x8ccd=function(_0x44d9b9,_0x409a69){_0x44d9b9=_0x44d9b9-0x0;var _0x47493f=_0xccd8[_0x44d9b9];return _0x47493f;};'use strict';var _=require('lodash');var util=require(_0x8ccd('0x0'));var logger=require(_0x8ccd('0x1'))('api');var moment=require(_0x8ccd('0x2'));var BPromise=require(_0x8ccd('0x3'));var rp=require(_0x8ccd('0x4'));var fs=require('fs');var path=require(_0x8ccd('0x5'));var rimraf=require('rimraf');var config=require(_0x8ccd('0x6'));var attributes=require(_0x8ccd('0x7'));module[_0x8ccd('0x8')]=function(_0x2353c3,_0x2e7240){return _0x2353c3[_0x8ccd('0x9')](_0x8ccd('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index f43e1e5..4c1680b 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 _0x89e8=['then','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','options'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x89e8,0x74));var _0x889e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x89e8[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var moment=require(_0x889e('0x2'));var BPromise=require(_0x889e('0x3'));var rs=require(_0x889e('0x4'));var fs=require('fs');var Redis=require(_0x889e('0x5'));var db=require(_0x889e('0x6'))['db'];var utils=require(_0x889e('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x889e('0x8'));var client=jayson[_0x889e('0x9')][_0x889e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed85f,_0x38eeae,_0x54f734){return new BPromise(function(_0x2bfae4,_0x42be62){return client[_0x889e('0xb')](_0x5ed85f,_0x54f734)['then'](function(_0x21c1d9){logger[_0x889e('0xc')](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));logger['debug'](_0x889e('0xf'),_0x38eeae,_0x889e('0xe'),JSON['stringify'](_0x21c1d9));if(_0x21c1d9[_0x889e('0x10')]){if(_0x21c1d9[_0x889e('0x10')][_0x889e('0x11')]===0x1f4){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x42be62(_0x21c1d9[_0x889e('0x10')]['message']);}logger[_0x889e('0x10')](_0x889e('0xd'),_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x2bfae4(_0x21c1d9[_0x889e('0x10')]['message']);}else{logger['info'](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));_0x2bfae4(_0x21c1d9[_0x889e('0x13')][_0x889e('0x12')]);}})['catch'](function(_0x22fbf6){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x22fbf6);_0x42be62(_0x22fbf6);});});}exports[_0x889e('0x14')]=function(_0x4f9b2c){var _0x75e219=this;return new Promise(function(_0x168fed,_0x232452){return db[_0x889e('0x15')][_0x889e('0x16')](_0x4f9b2c['body'],{'raw':_0x4f9b2c[_0x889e('0x17')]?_0x4f9b2c[_0x889e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x889e('0x18')](function(_0x11abba){logger[_0x889e('0xc')]('CreateAttachment',_0x4f9b2c);logger[_0x889e('0x19')](_0x889e('0x14'),_0x4f9b2c,JSON[_0x889e('0x1a')](_0x11abba));_0x168fed(_0x11abba);})[_0x889e('0x1b')](function(_0x590b6f){logger['error'](_0x889e('0x14'),_0x590b6f[_0x889e('0x12')],_0x4f9b2c);_0x232452(_0x75e219[_0x889e('0x10')](0x1f4,_0x590b6f['message']));});});};
\ No newline at end of file
+var _0xa25c=['message','Attachment,\x20%s,\x20%s','result','catch','CreateAttachment','Attachment','create','body','options','then','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1c7ad1,_0x1765b5){var _0x162c65=function(_0x544712){while(--_0x544712){_0x1c7ad1['push'](_0x1c7ad1['shift']());}};_0x162c65(++_0x1765b5);}(_0xa25c,0x13f));var _0xca25=function(_0x1127bf,_0x542714){_0x1127bf=_0x1127bf-0x0;var _0x5bdfce=_0xa25c[_0x1127bf];return _0x5bdfce;};'use strict';var _=require('lodash');var util=require(_0xca25('0x0'));var moment=require(_0xca25('0x1'));var BPromise=require(_0xca25('0x2'));var rs=require(_0xca25('0x3'));var fs=require('fs');var Redis=require(_0xca25('0x4'));var db=require(_0xca25('0x5'))['db'];var utils=require(_0xca25('0x6'));var logger=require(_0xca25('0x7'))('rpc');var config=require(_0xca25('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xca25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e9352,_0xb2fc94,_0x3cee89){return new BPromise(function(_0x2c0b8c,_0x42a97a){return client[_0xca25('0xa')](_0x4e9352,_0x3cee89)['then'](function(_0x5d820c){logger[_0xca25('0xb')]('Attachment,\x20%s,\x20%s',_0xb2fc94,_0xca25('0xc'));logger[_0xca25('0xd')](_0xca25('0xe'),_0xb2fc94,'request\x20sent',JSON['stringify'](_0x5d820c));if(_0x5d820c['error']){if(_0x5d820c[_0xca25('0xf')][_0xca25('0x10')]===0x1f4){logger[_0xca25('0xf')]('Attachment,\x20%s,\x20%s',_0xb2fc94,_0x5d820c['error'][_0xca25('0x11')]);return _0x42a97a(_0x5d820c['error'][_0xca25('0x11')]);}logger[_0xca25('0xf')](_0xca25('0x12'),_0xb2fc94,_0x5d820c[_0xca25('0xf')][_0xca25('0x11')]);return _0x2c0b8c(_0x5d820c[_0xca25('0xf')][_0xca25('0x11')]);}else{logger[_0xca25('0xb')](_0xca25('0x12'),_0xb2fc94,_0xca25('0xc'));_0x2c0b8c(_0x5d820c[_0xca25('0x13')]['message']);}})[_0xca25('0x14')](function(_0x340c9b){logger['error'](_0xca25('0x12'),_0xb2fc94,_0x340c9b);_0x42a97a(_0x340c9b);});});}exports[_0xca25('0x15')]=function(_0x3705a0){var _0x18ec6f=this;return new Promise(function(_0x155cf2,_0x59997b){return db[_0xca25('0x16')][_0xca25('0x17')](_0x3705a0[_0xca25('0x18')],{'raw':_0x3705a0[_0xca25('0x19')]?_0x3705a0[_0xca25('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xca25('0x1a')](function(_0x3598c7){logger[_0xca25('0xb')](_0xca25('0x15'),_0x3705a0);logger[_0xca25('0xd')](_0xca25('0x15'),_0x3705a0,JSON[_0xca25('0x1b')](_0x3598c7));_0x155cf2(_0x3598c7);})['catch'](function(_0x48fdf5){logger[_0xca25('0xf')](_0xca25('0x15'),_0x48fdf5[_0xca25('0x11')],_0x3705a0);_0x59997b(_0x18ec6f[_0xca25('0xf')](0x1f4,_0x48fdf5[_0xca25('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 8f25c41..7537256 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 _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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x404f6b,_0x21484d){_0x404f6b=_0x404f6b-0x0;var _0x472790=_0xdb28[_0x404f6b];return _0x472790;};'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
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x30b2a5,_0x1560f9){var _0x448419=function(_0x1e56a0){while(--_0x1e56a0){_0x30b2a5['push'](_0x30b2a5['shift']());}};_0x448419(++_0x1560f9);}(_0xadb5,0xad));var _0x5adb=function(_0x2ee2e7,_0x32c49f){_0x2ee2e7=_0x2ee2e7-0x0;var _0x44c367=_0xadb5[_0x2ee2e7];return _0x44c367;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 1e59c60..0d98cdd 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 _0xf5ac=['authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','add','minutes','clearBlockUser','getLicense','catch','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xf5ac,0x162));var _0xcf5a=function(_0x415ecc,_0x592ba9){_0x415ecc=_0x415ecc-0x0;var _0x475f35=_0xf5ac[_0x415ecc];return _0x475f35;};'use strict';var passport=require(_0xcf5a('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xcf5a('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xcf5a('0x2'));var util=require(_0xcf5a('0x3'));var db=require(_0xcf5a('0x4'))['db'];var authService=require(_0xcf5a('0x5'));var utils=require('../../config/utils');var config=require(_0xcf5a('0x6'));var logger=require(_0xcf5a('0x7'))(_0xcf5a('0x8'));function isActiveDirectoryConfigured(_0x5e9b29){var _0x22fc54=![];if(typeof _0x5e9b29[_0xcf5a('0x9')]!==_0xcf5a('0xa')){_0x22fc54=_0x5e9b29[_0xcf5a('0x9')][_0xcf5a('0xb')]&&_0x5e9b29[_0xcf5a('0x9')][_0xcf5a('0xc')]&&_0x5e9b29['activedirectory'][_0xcf5a('0xd')];}return _0x22fc54;}function adAuthenticate(_0x22a867,_0x1dc0be,_0xdc80d4){return new BPromise(function(_0x398a5a,_0x151372){try{var _0x253b11=new ActiveDirectory(_0x22a867);_0x253b11[_0xcf5a('0xe')](_0x1dc0be,_0xdc80d4,function(_0x224598,_0x38cbf1){if(_0x224598){logger[_0xcf5a('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x1dc0be,util['inspect'](_0x224598,{'showHidden':![],'depth':null}));_0x151372(_0xcf5a('0x10'));}else if(!_0x38cbf1){logger[_0xcf5a('0xf')](_0xcf5a('0x11'),_0x1dc0be);_0x151372(_0xcf5a('0x10'));}else{_0x398a5a(_0x38cbf1);}});}catch(_0x1b2857){_0x151372(_0x1b2857);}});}function ActiveDirectoryAuthenticate(_0xc8e4f1,_0x47705d,_0x1746e0,_0x4f8227){var _0x3372c3,_0x2997d6;if(!isActiveDirectoryConfigured(config)){logger[_0xcf5a('0xf')](_0xcf5a('0x12'),_0x47705d);return _0x4f8227(null,![],{'message':_0xcf5a('0x10')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xcf5a('0x13'),_0xcf5a('0x14')],'raw':!![]})[_0xcf5a('0x15')](function(_0x7f179c){_0x3372c3=_0x7f179c;if(!_0x3372c3[_0xcf5a('0x13')]){logger['error'](_0xcf5a('0x16'),_0x47705d);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0xc8e4f1['findOne']({'attributes':['id',_0xcf5a('0x17'),_0xcf5a('0x18'),_0xcf5a('0x19'),_0xcf5a('0x1a'),_0xcf5a('0x1b'),_0xcf5a('0x1c'),_0xcf5a('0x1d'),_0xcf5a('0x1e')],'where':{'name':_0x47705d,'role':{'$or':[_0xcf5a('0x1f'),'user',_0xcf5a('0x20')]},'adSsoEnabled':!![]}});})[_0xcf5a('0x15')](function(_0x5b5886){if(!_0x5b5886||_0x5b5886&&_0x5b5886['name']!==_0x47705d){throw new Error(_0xcf5a('0x10'));}_0x2997d6=_0x5b5886;var _0x42b65a=_0x2997d6[_0xcf5a('0x17')]+'@'+config[_0xcf5a('0x9')][_0xcf5a('0xd')];return adAuthenticate(config[_0xcf5a('0x9')],_0x42b65a,_0x1746e0);})['then'](function(_0x139aaa){if(_0x2997d6[_0xcf5a('0x1b')]){throw new Error(_0xcf5a('0x10'));}if(_0x3372c3['blockDuration']>0x0){if(_0x2997d6['blocked']){if(moment(_0x2997d6[_0xcf5a('0x1d')])[_0xcf5a('0x21')](_0x3372c3['blockDuration'],_0xcf5a('0x22'))>moment()){throw new Error(_0xcf5a('0x10'));}return utils[_0xcf5a('0x23')](_0x2997d6,0x0,![],null)[_0xcf5a('0x15')](function(){return utils[_0xcf5a('0x24')](_0x2997d6);})[_0xcf5a('0x15')](function(){return _0x4f8227(null,_0x2997d6);});}else{return utils['getLicense'](_0x2997d6)[_0xcf5a('0x15')](function(){return _0x4f8227(null,_0x2997d6);});}}else{return utils['getLicense'](_0x2997d6)[_0xcf5a('0x15')](function(){return _0x4f8227(null,_0x2997d6);});}})[_0xcf5a('0x25')](function(_0x4ea9f6){return _0x4f8227(null,![],_0x4ea9f6);});}function handleError(_0x45eaa3,_0x94f43b,_0x4cdcc2){return _0x45eaa3['status'](_0x94f43b||0x1f4)['send']({'message':_0x4cdcc2?_0x4cdcc2[_0xcf5a('0x26')]||_0x4cdcc2:''});}exports[_0xcf5a('0x27')]=function(_0x560efc,_0x40a3d4,_0x12a05f){passport[_0xcf5a('0xe')](_0xcf5a('0x28'),function(_0x12bce7,_0x1edf3a,_0x39fe49){var _0xcb59f5=_0x12bce7||_0x39fe49;if(_0xcb59f5){return handleError(_0x40a3d4,0x191,_0xcb59f5);}if(!_0x1edf3a){return handleError(_0x40a3d4,0x194,{'message':_0xcf5a('0x29')});}else{var _0x4f9070={'payload':{'id':_0x1edf3a['id'],'role':_0x1edf3a[_0xcf5a('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0xcf5a('0x2a')](_0x4f9070)[_0xcf5a('0x15')](function(_0x2e4942){_0x40a3d4[_0xcf5a('0x2b')]({'id':_0x1edf3a['id'],'token':_0x2e4942,'statusCall':'','isAlreadyLogged':_0x1edf3a[_0xcf5a('0x1e')]});});}})(_0x560efc,_0x40a3d4,_0x12a05f);};passport[_0xcf5a('0x2c')](_0xcf5a('0x28'),new LocalStrategy({'usernameField':_0xcf5a('0x17'),'passwordField':_0xcf5a('0x18')},function(_0x29bd15,_0x406e0b,_0x1554b0){return ActiveDirectoryAuthenticate(db[_0xcf5a('0x2d')],_0x29bd15,_0x406e0b,_0x1554b0);}));
\ No newline at end of file
+var _0x6522=['minutes','clearBlockUser','getLicense','catch','status','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','name','password','salt','blocked','user','agent','disabled','add'];(function(_0x277dff,_0x34e1ae){var _0x1f4770=function(_0x2bffd3){while(--_0x2bffd3){_0x277dff['push'](_0x277dff['shift']());}};_0x1f4770(++_0x34e1ae);}(_0x6522,0x1f0));var _0x2652=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6522[_0x20a584];return _0x4b41a8;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0x2652('0x0')];var moment=require(_0x2652('0x1'));var ActiveDirectory=require(_0x2652('0x2'));var BPromise=require(_0x2652('0x3'));var util=require(_0x2652('0x4'));var db=require(_0x2652('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x2652('0x6'));var config=require(_0x2652('0x7'));var logger=require(_0x2652('0x8'))('api');function isActiveDirectoryConfigured(_0x45492e){var _0x4323d1=![];if(typeof _0x45492e[_0x2652('0x9')]!=='undefined'){_0x4323d1=_0x45492e[_0x2652('0x9')][_0x2652('0xa')]&&_0x45492e[_0x2652('0x9')][_0x2652('0xb')]&&_0x45492e['activedirectory'][_0x2652('0xc')];}return _0x4323d1;}function adAuthenticate(_0x3633eb,_0x260612,_0x186512){return new BPromise(function(_0x16c0a3,_0x3ccfc3){try{var _0x5caa05=new ActiveDirectory(_0x3633eb);_0x5caa05['authenticate'](_0x260612,_0x186512,function(_0x20aefd,_0x4c7c99){if(_0x20aefd){logger[_0x2652('0xd')](_0x2652('0xe'),_0x260612,util[_0x2652('0xf')](_0x20aefd,{'showHidden':![],'depth':null}));_0x3ccfc3(_0x2652('0x10'));}else if(!_0x4c7c99){logger[_0x2652('0xd')](_0x2652('0x11'),_0x260612);_0x3ccfc3(_0x2652('0x10'));}else{_0x16c0a3(_0x4c7c99);}});}catch(_0xfc5649){_0x3ccfc3(_0xfc5649);}});}function ActiveDirectoryAuthenticate(_0x4294f3,_0x344a39,_0x388822,_0x4e788d){var _0xfdfd99,_0x14519b;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x2652('0x12'),_0x344a39);return _0x4e788d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x2652('0x13')][_0x2652('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x2652('0x15')],'raw':!![]})[_0x2652('0x16')](function(_0x372410){_0xfdfd99=_0x372410;if(!_0xfdfd99[_0x2652('0x17')]){logger[_0x2652('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x344a39);throw new Error(_0x2652('0x10'));}return _0x4294f3[_0x2652('0x14')]({'attributes':['id',_0x2652('0x18'),_0x2652('0x19'),_0x2652('0x1a'),'role','disabled',_0x2652('0x1b'),'blockedAt','online'],'where':{'name':_0x344a39,'role':{'$or':['admin',_0x2652('0x1c'),_0x2652('0x1d')]},'adSsoEnabled':!![]}});})[_0x2652('0x16')](function(_0x115bc6){if(!_0x115bc6||_0x115bc6&&_0x115bc6[_0x2652('0x18')]!==_0x344a39){throw new Error(_0x2652('0x10'));}_0x14519b=_0x115bc6;var _0x24746b=_0x14519b[_0x2652('0x18')]+'@'+config['activedirectory'][_0x2652('0xc')];return adAuthenticate(config[_0x2652('0x9')],_0x24746b,_0x388822);})[_0x2652('0x16')](function(_0x5b3703){if(_0x14519b[_0x2652('0x1e')]){throw new Error(_0x2652('0x10'));}if(_0xfdfd99[_0x2652('0x15')]>0x0){if(_0x14519b[_0x2652('0x1b')]){if(moment(_0x14519b['blockedAt'])[_0x2652('0x1f')](_0xfdfd99[_0x2652('0x15')],_0x2652('0x20'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x2652('0x21')](_0x14519b,0x0,![],null)['then'](function(){return utils['getLicense'](_0x14519b);})[_0x2652('0x16')](function(){return _0x4e788d(null,_0x14519b);});}else{return utils[_0x2652('0x22')](_0x14519b)[_0x2652('0x16')](function(){return _0x4e788d(null,_0x14519b);});}}else{return utils[_0x2652('0x22')](_0x14519b)['then'](function(){return _0x4e788d(null,_0x14519b);});}})[_0x2652('0x23')](function(_0x3ee910){return _0x4e788d(null,![],_0x3ee910);});}function handleError(_0x221ec6,_0x2d65e1,_0x22f2e6){return _0x221ec6[_0x2652('0x24')](_0x2d65e1||0x1f4)[_0x2652('0x25')]({'message':_0x22f2e6?_0x22f2e6['message']||_0x22f2e6:''});}exports['login']=function(_0x5b409f,_0x290bd5,_0x1907bf){passport[_0x2652('0x26')]('ad-login',function(_0x3cac18,_0x2e4353,_0x5c7a7e){var _0x14fd33=_0x3cac18||_0x5c7a7e;if(_0x14fd33){return handleError(_0x290bd5,0x191,_0x14fd33);}if(!_0x2e4353){return handleError(_0x290bd5,0x194,{'message':_0x2652('0x27')});}else{var _0x1e4d1b={'payload':{'id':_0x2e4353['id'],'role':_0x2e4353[_0x2652('0x28')]},'options':{'expiresIn':0x15180}};return authService[_0x2652('0x29')](_0x1e4d1b)[_0x2652('0x16')](function(_0x4025d5){_0x290bd5[_0x2652('0x2a')]({'id':_0x2e4353['id'],'token':_0x4025d5,'statusCall':'','isAlreadyLogged':_0x2e4353[_0x2652('0x2b')]});});}})(_0x5b409f,_0x290bd5,_0x1907bf);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0x2652('0x18'),'passwordField':_0x2652('0x19')},function(_0x2a3e74,_0x14b790,_0x11d64e){return ActiveDirectoryAuthenticate(db['User'],_0x2a3e74,_0x14b790,_0x11d64e);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index b5ddbcb..b5ad87c 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 _0xcd73=['login','exports','Router','./authActiveDirectory.controller','post'];(function(_0x53ba99,_0x31d724){var _0xab94e4=function(_0x242935){while(--_0x242935){_0x53ba99['push'](_0x53ba99['shift']());}};_0xab94e4(++_0x31d724);}(_0xcd73,0xa7));var _0x3cd7=function(_0x1c6b54,_0x57304c){_0x1c6b54=_0x1c6b54-0x0;var _0x144008=_0xcd73[_0x1c6b54];return _0x144008;};'use strict';var express=require('express');var router=express[_0x3cd7('0x0')]();var controller=require(_0x3cd7('0x1'));router[_0x3cd7('0x2')]('/',controller[_0x3cd7('0x3')]);module[_0x3cd7('0x4')]=router;
\ No newline at end of file
+var _0x8604=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x405e93,_0x2aa32d){var _0xfce049=function(_0x3e2d77){while(--_0x3e2d77){_0x405e93['push'](_0x405e93['shift']());}};_0xfce049(++_0x2aa32d);}(_0x8604,0x18a));var _0x4860=function(_0x2775b4,_0x22b5e8){_0x2775b4=_0x2775b4-0x0;var _0x2025dd=_0x8604[_0x2775b4];return _0x2025dd;};'use strict';var express=require(_0x4860('0x0'));var router=express[_0x4860('0x1')]();var controller=require(_0x4860('0x2'));router[_0x4860('0x3')]('/',controller[_0x4860('0x4')]);module[_0x4860('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 63517e0..eaaef47 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x17f65a,_0x24ec2e){var _0x523b7c=function(_0x7b2ce7){while(--_0x7b2ce7){_0x17f65a['push'](_0x17f65a['shift']());}};_0x523b7c(++_0x24ec2e);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4536b9,_0x31aa20){var _0x2af712=function(_0x2dd96d){while(--_0x2dd96d){_0x4536b9['push'](_0x4536b9['shift']());}};_0x2af712(++_0x31aa20);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index fd3270d..e1343c3 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 _0x4133=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x4bc4f7,_0x32986a){var _0x4aa0c5=function(_0x174914){while(--_0x174914){_0x4bc4f7['push'](_0x4bc4f7['shift']());}};_0x4aa0c5(++_0x32986a);}(_0x4133,0x14a));var _0x3413=function(_0x1214d3,_0x2a3519){_0x1214d3=_0x1214d3-0x0;var _0x3ff802=_0x4133[_0x1214d3];return _0x3ff802;};'use strict';var express=require(_0x3413('0x0'));var passport=require(_0x3413('0x1'));var router=express[_0x3413('0x2')]();var controller=require(_0x3413('0x3'));var userController=require(_0x3413('0x4'));var authService=require(_0x3413('0x5'));router[_0x3413('0x6')]('/',controller[_0x3413('0x7')]);router[_0x3413('0x6')](_0x3413('0x8'),controller[_0x3413('0x9')],authService[_0x3413('0xa')],userController[_0x3413('0x7')],authService[_0x3413('0xb')]);module[_0x3413('0xc')]=router;
\ No newline at end of file
+var _0x1e86=['login','get','/callback','callback','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x56d1ed,_0x237e84){var _0x1b282b=function(_0x56648c){while(--_0x56648c){_0x56d1ed['push'](_0x56d1ed['shift']());}};_0x1b282b(++_0x237e84);}(_0x1e86,0x13b));var _0x61e8=function(_0x54e194,_0x359df8){_0x54e194=_0x54e194-0x0;var _0x5b02a1=_0x1e86[_0x54e194];return _0x5b02a1;};'use strict';var express=require(_0x61e8('0x0'));var passport=require(_0x61e8('0x1'));var router=express[_0x61e8('0x2')]();var controller=require(_0x61e8('0x3'));var userController=require(_0x61e8('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x61e8('0x5')]);router[_0x61e8('0x6')](_0x61e8('0x7'),controller[_0x61e8('0x8')],authService['isMiddleware'],userController[_0x61e8('0x5')],authService['setTokenCookie']);module[_0x61e8('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 55a3a94..7904ae1 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 _0x8708=['previousPasswords','passwordHistoryLimit','resetPasswordToken','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blocked','blockedAt','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','error','message','stringify','status','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','password'];(function(_0x8dd6d3,_0x140e5f){var _0x54d89a=function(_0x552e34){while(--_0x552e34){_0x8dd6d3['push'](_0x8dd6d3['shift']());}};_0x54d89a(++_0x140e5f);}(_0x8708,0xa5));var _0x8870=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8708[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x8870('0x0'));var passport=require('passport');var LocalStrategy=require(_0x8870('0x1'))[_0x8870('0x2')];var jayson=require(_0x8870('0x3'));var _=require(_0x8870('0x4'));var rs=require(_0x8870('0x5'));var moment=require(_0x8870('0x6'));var db=require(_0x8870('0x7'))['db'];var authService=require(_0x8870('0x8'));var utils=require(_0x8870('0x9'));var client=jayson[_0x8870('0xa')][_0x8870('0xb')]({'port':0x232b});function localAuthenticate(_0x55a17b,_0x5a2d06,_0x28db38,_0x3bd5d4){var _0x1eb5ed,_0x2cd5f3;return db['Setting'][_0x8870('0xc')]({'where':{'id':0x1},'attributes':[_0x8870('0xd'),_0x8870('0xe')],'raw':!![]})[_0x8870('0xf')](function(_0x2893a5){_0x1eb5ed=_0x2893a5;return _0x55a17b['findOne']({'attributes':['id',_0x8870('0x10'),'password',_0x8870('0x11'),_0x8870('0x12'),'disabled',_0x8870('0x13'),_0x8870('0x14'),'loginAttempts'],'where':{'name':_0x5a2d06,'role':{'$or':['admin',_0x8870('0x15'),_0x8870('0x16')]}}});})[_0x8870('0xf')](function(_0x164bf8){if(!_0x164bf8||_0x164bf8&&_0x164bf8[_0x8870('0x10')]!==_0x5a2d06){throw new Error(_0x8870('0x17'));}else{_0x2cd5f3=_0x164bf8;return _0x2cd5f3;}})[_0x8870('0xf')](function(){_0x2cd5f3[_0x8870('0x18')](_0x28db38,function(_0x3459f0,_0x15829e){var _0x33b0be=_0x2cd5f3[_0x8870('0x19')]+0x1;if(_0x3459f0){return _0x3bd5d4(_0x3459f0);}else if(!_0x15829e){if(_0x2cd5f3[_0x8870('0x1a')]){return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});}else if(_0x1eb5ed[_0x8870('0xd')]>0x0){if(_0x2cd5f3[_0x8870('0x13')]){if(_0x1eb5ed['blockDuration']>0x0){if(moment(_0x2cd5f3[_0x8870('0x14')])[_0x8870('0x1b')](_0x1eb5ed['blockDuration'],_0x8870('0x1c'))>moment()){return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});}else{return utils[_0x8870('0x1d')](_0x2cd5f3,_0x33b0be,![],null)[_0x8870('0xf')](function(){return _0x3bd5d4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3bd5d4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x33b0be>=_0x1eb5ed[_0x8870('0xd')]){return utils['clearBlockUser'](_0x2cd5f3,0x0,!![],moment())['then'](function(){return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});});}else{return utils[_0x8870('0x1d')](_0x2cd5f3,_0x33b0be,![],null)[_0x8870('0xf')](function(){return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});});}}}else{return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});}}else{if(_0x2cd5f3[_0x8870('0x1a')]){return _0x3bd5d4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1eb5ed[_0x8870('0xd')]>0x0){if(_0x2cd5f3[_0x8870('0x13')]){if(_0x1eb5ed[_0x8870('0xe')]>0x0){if(moment(_0x2cd5f3['blockedAt'])[_0x8870('0x1b')](_0x1eb5ed[_0x8870('0xe')],'minutes')>moment()){return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});}else{return utils[_0x8870('0x1d')](_0x2cd5f3,0x0,![],null)['then'](function(){return utils['getLicense'](_0x2cd5f3);})[_0x8870('0xf')](function(){return _0x3bd5d4(null,_0x2cd5f3);});}}else{return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});}}else{return utils[_0x8870('0x1d')](_0x2cd5f3,0x0,![],null)['then'](function(){return utils[_0x8870('0x1e')](_0x2cd5f3);})['then'](function(){return _0x3bd5d4(null,_0x2cd5f3);})[_0x8870('0x1f')](function(_0x18f66b){return _0x3bd5d4(null,![],_0x18f66b);});}}else{if(_0x2cd5f3[_0x8870('0x13')]){return _0x3bd5d4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8870('0x1e')](_0x2cd5f3)[_0x8870('0xf')](function(){return _0x3bd5d4(null,_0x2cd5f3);});}}}});})[_0x8870('0x1f')](function(_0xaf98cd){return _0x3bd5d4(null,![],_0xaf98cd);});}function sendServiceMail(_0x329271){return db['MailAccount'][_0x8870('0x20')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x8870('0x21')],'as':_0x8870('0x22'),'include':[{'model':db['CloudProvider'],'as':_0x8870('0x23')}]}]})[_0x8870('0xf')](function(_0x130497){if(!_0x130497){throw new Error(_0x8870('0x24'));}var _0x2468bd=_0x130497[_0x8870('0x25')]();var _0x57856e={'account':_0x2468bd,'message':_['merge']({'from':util[_0x8870('0x26')](_0x8870('0x27'),_0x130497['name'],_0x130497[_0x8870('0x28')]||_0x130497['Smtp'][_0x8870('0x15')])},_0x329271)};return client['request']('SendMail',_0x57856e);})[_0x8870('0xf')](function(_0x1971a2){if(_0x1971a2[_0x8870('0x29')]){throw new Error(util[_0x8870('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1971a2['error'][_0x8870('0x2a')]||JSON[_0x8870('0x2b')](_0x1971a2[_0x8870('0x29')])));}return!![];});}function handleError(_0x3874b1,_0x5d2a50,_0x258121){return _0x3874b1[_0x8870('0x2c')](_0x5d2a50||0x1f4)['send']({'message':_0x258121?_0x258121[_0x8870('0x2a')]||_0x258121:''});}exports[_0x8870('0x2d')]=function(_0x4a560b,_0x50f45b,_0x3f8693){passport[_0x8870('0x18')]('local-login',function(_0xd743eb,_0x3fde51,_0x12eec8){var _0x5f020a=_0xd743eb||_0x12eec8;if(_0x5f020a){return handleError(_0x50f45b,0x191,_0x5f020a);}if(!_0x3fde51){return handleError(_0x50f45b,0x194,{'message':_0x8870('0x2e')});}else{var _0x45a005={'payload':{'id':_0x3fde51['id'],'role':_0x3fde51['role']},'options':{'expiresIn':0x15180}};return authService[_0x8870('0x2f')](_0x45a005)['then'](function(_0x36292f){_0x50f45b[_0x8870('0x30')]({'id':_0x3fde51['id'],'token':_0x36292f,'statusCall':'','isAlreadyLogged':_0x3fde51[_0x8870('0x31')]});});}})(_0x4a560b,_0x50f45b,_0x3f8693);};exports[_0x8870('0x32')]=function(_0x1ae723,_0x3169e6){if(!_0x1ae723['body']['email']){return handleError(_0x3169e6,0x1f4,{'message':_0x8870('0x33')});}var _0x1413e2=rs[_0x8870('0x34')]();_0x1ae723[_0x8870('0x35')][_0x8870('0x28')]=_0x1ae723[_0x8870('0x35')][_0x8870('0x28')][_0x8870('0x36')]()[_0x8870('0x37')]();var _0x85f67;return db[_0x8870('0x38')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x8870('0xe')],'raw':!![]})[_0x8870('0xf')](function(_0x21caf3){_0x85f67=_0x21caf3;return db['User']['find']({'where':{'email':_0x1ae723[_0x8870('0x35')][_0x8870('0x28')]}});})[_0x8870('0xf')](function(_0x24b2d3){if(!_0x24b2d3){throw new Error(_0x8870('0x39'));}if(_0x24b2d3[_0x8870('0x1a')]){throw new Error(_0x8870('0x3a'));}if(_0x24b2d3[_0x8870('0x13')]){if(moment(_0x24b2d3[_0x8870('0x14')])[_0x8870('0x1b')](_0x85f67['blockDuration'],_0x8870('0x1c'))>moment()){throw new Error(_0x8870('0x3b'));}else{_0x24b2d3[_0x8870('0x13')]=![];_0x24b2d3[_0x8870('0x14')]=null;}}_0x24b2d3['resetPasswordToken']=_0x1413e2;_0x24b2d3[_0x8870('0x3c')]=Date['now']()+0x36ee80;return _0x24b2d3[_0x8870('0x3d')]();})[_0x8870('0xf')](function(){return sendServiceMail({'to':_0x1ae723[_0x8870('0x35')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x8870('0x3e')+_0x8870('0x3f')+_0x1ae723['headers'][_0x8870('0x40')]+_0x8870('0x41')+_0x1413e2+'\x0a\x0a'+_0x8870('0x42')});})[_0x8870('0xf')](function(){_0x3169e6[_0x8870('0x2c')](0xc8)[_0x8870('0x43')]({'message':_0x8870('0x44')});})[_0x8870('0x1f')](function(_0x2cd12b){return handleError(_0x3169e6,0x1f4,_0x2cd12b);});};exports['reset']=function(_0x57a18d,_0x32d48b){return db[_0x8870('0x45')][_0x8870('0x20')]({'where':{'resetPasswordToken':_0x57a18d['params'][_0x8870('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x8870('0xf')](function(_0x27b592){if(!_0x27b592){throw new Error(_0x8870('0x47'));}return db['Setting']['findOne']({'attributes':['id',_0x8870('0x48'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x8870('0xf')](function(_0x5c5d76){if(_0x5c5d76[_0x8870('0x48')])authService[_0x8870('0x49')](_0x57a18d['body'][_0x8870('0x4a')]);if(!_0x5c5d76['enforcePasswordHistory']||!_0x27b592[_0x8870('0x4b')])return _0x27b592;authService['validatePasswordHistory'](_0x57a18d[_0x8870('0x35')]['password'],_0x27b592[_0x8870('0x4b')],_0x5c5d76[_0x8870('0x4c')]);return _0x27b592;})[_0x8870('0xf')](function(){_0x27b592['password']=_0x57a18d[_0x8870('0x35')][_0x8870('0x4a')];_0x27b592[_0x8870('0x4d')]=null;_0x27b592['resetPasswordExpires']=null;return _0x27b592[_0x8870('0x3d')]();});})[_0x8870('0xf')](function(){_0x32d48b[_0x8870('0x2c')](0xc8)[_0x8870('0x43')]({'message':_0x8870('0x4e')});})[_0x8870('0x1f')](function(_0x15ec20){return handleError(_0x32d48b,0x1f4,_0x15ec20);});};passport[_0x8870('0x4f')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x8870('0x4a')},function(_0x57da6f,_0x1d5f50,_0xb2087d){return localAuthenticate(db[_0x8870('0x45')],_0x57da6f,_0x1d5f50,_0xb2087d);}));
\ No newline at end of file
+var _0x2067=['loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','signToken','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','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','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','find','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','local-login','util','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','then','name','password','role','disabled','blocked','blockedAt'];(function(_0x456f70,_0x66f4e5){var _0x12c9e8=function(_0x55e0dd){while(--_0x55e0dd){_0x456f70['push'](_0x456f70['shift']());}};_0x12c9e8(++_0x66f4e5);}(_0x2067,0x161));var _0x7206=function(_0x3ee91e,_0x466a5a){_0x3ee91e=_0x3ee91e-0x0;var _0x239405=_0x2067[_0x3ee91e];return _0x239405;};'use strict';var util=require(_0x7206('0x0'));var passport=require('passport');var LocalStrategy=require(_0x7206('0x1'))[_0x7206('0x2')];var jayson=require('jayson/promise');var _=require(_0x7206('0x3'));var rs=require('randomstring');var moment=require(_0x7206('0x4'));var db=require(_0x7206('0x5'))['db'];var authService=require(_0x7206('0x6'));var utils=require(_0x7206('0x7'));var client=jayson[_0x7206('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x4ad8d7,_0x15c0c5,_0x3685f9,_0x559939){var _0x2cf8da,_0x1ef65c;return db['Setting'][_0x7206('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x7206('0xa')](function(_0x164c54){_0x2cf8da=_0x164c54;return _0x4ad8d7[_0x7206('0x9')]({'attributes':['id',_0x7206('0xb'),_0x7206('0xc'),'salt',_0x7206('0xd'),_0x7206('0xe'),_0x7206('0xf'),_0x7206('0x10'),_0x7206('0x11')],'where':{'name':_0x15c0c5,'role':{'$or':[_0x7206('0x12'),_0x7206('0x13'),_0x7206('0x14')]}}});})['then'](function(_0x2baee1){if(!_0x2baee1||_0x2baee1&&_0x2baee1[_0x7206('0xb')]!==_0x15c0c5){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1ef65c=_0x2baee1;return _0x1ef65c;}})[_0x7206('0xa')](function(){_0x1ef65c[_0x7206('0x15')](_0x3685f9,function(_0x28d643,_0x74aba2){var _0x33baa1=_0x1ef65c[_0x7206('0x11')]+0x1;if(_0x28d643){return _0x559939(_0x28d643);}else if(!_0x74aba2){if(_0x1ef65c[_0x7206('0xe')]){return _0x559939(null,![],{'message':_0x7206('0x16')});}else if(_0x2cf8da[_0x7206('0x17')]>0x0){if(_0x1ef65c['blocked']){if(_0x2cf8da[_0x7206('0x18')]>0x0){if(moment(_0x1ef65c[_0x7206('0x10')])[_0x7206('0x19')](_0x2cf8da[_0x7206('0x18')],_0x7206('0x1a'))>moment()){return _0x559939(null,![],{'message':_0x7206('0x16')});}else{return utils[_0x7206('0x1b')](_0x1ef65c,_0x33baa1,![],null)[_0x7206('0xa')](function(){return _0x559939(null,![],{'message':_0x7206('0x16')});});}}else{return _0x559939(null,![],{'message':_0x7206('0x16')});}}else{if(_0x33baa1>=_0x2cf8da[_0x7206('0x17')]){return utils[_0x7206('0x1b')](_0x1ef65c,0x0,!![],moment())['then'](function(){return _0x559939(null,![],{'message':_0x7206('0x16')});});}else{return utils['clearBlockUser'](_0x1ef65c,_0x33baa1,![],null)[_0x7206('0xa')](function(){return _0x559939(null,![],{'message':_0x7206('0x16')});});}}}else{return _0x559939(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1ef65c[_0x7206('0xe')]){return _0x559939(null,![],{'message':_0x7206('0x16')});}else if(_0x2cf8da[_0x7206('0x17')]>0x0){if(_0x1ef65c['blocked']){if(_0x2cf8da[_0x7206('0x18')]>0x0){if(moment(_0x1ef65c['blockedAt'])[_0x7206('0x19')](_0x2cf8da['blockDuration'],_0x7206('0x1a'))>moment()){return _0x559939(null,![],{'message':_0x7206('0x16')});}else{return utils[_0x7206('0x1b')](_0x1ef65c,0x0,![],null)[_0x7206('0xa')](function(){return utils[_0x7206('0x1c')](_0x1ef65c);})[_0x7206('0xa')](function(){return _0x559939(null,_0x1ef65c);});}}else{return _0x559939(null,![],{'message':_0x7206('0x16')});}}else{return utils[_0x7206('0x1b')](_0x1ef65c,0x0,![],null)[_0x7206('0xa')](function(){return utils[_0x7206('0x1c')](_0x1ef65c);})[_0x7206('0xa')](function(){return _0x559939(null,_0x1ef65c);})[_0x7206('0x1d')](function(_0x2cc5b2){return _0x559939(null,![],_0x2cc5b2);});}}else{if(_0x1ef65c[_0x7206('0xf')]){return _0x559939(null,![],{'message':_0x7206('0x16')});}else{return utils[_0x7206('0x1c')](_0x1ef65c)[_0x7206('0xa')](function(){return _0x559939(null,_0x1ef65c);});}}}});})[_0x7206('0x1d')](function(_0x57c59){return _0x559939(null,![],_0x57c59);});}function sendServiceMail(_0x564952){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x7206('0xb'),_0x7206('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x7206('0x1f'),'include':[{'model':db[_0x7206('0x20')],'as':'CloudProvider'}]}]})[_0x7206('0xa')](function(_0x18c190){if(!_0x18c190){throw new Error(_0x7206('0x21'));}var _0x12a8ac=_0x18c190[_0x7206('0x22')]();var _0x5c5b4b={'account':_0x12a8ac,'message':_[_0x7206('0x23')]({'from':util[_0x7206('0x24')](_0x7206('0x25'),_0x18c190[_0x7206('0xb')],_0x18c190[_0x7206('0x1e')]||_0x18c190[_0x7206('0x1f')][_0x7206('0x13')])},_0x564952)};return client['request']('SendMail',_0x5c5b4b);})[_0x7206('0xa')](function(_0x487300){if(_0x487300['error']){throw new Error(util[_0x7206('0x24')](_0x7206('0x26'),_0x487300[_0x7206('0x27')][_0x7206('0x28')]||JSON['stringify'](_0x487300[_0x7206('0x27')])));}return!![];});}function handleError(_0x10a94d,_0x2a32cc,_0xac5af4){return _0x10a94d[_0x7206('0x29')](_0x2a32cc||0x1f4)['send']({'message':_0xac5af4?_0xac5af4[_0x7206('0x28')]||_0xac5af4:''});}exports['login']=function(_0x256ef6,_0x1af0b5,_0x619c13){passport[_0x7206('0x15')]('local-login',function(_0x1d26fa,_0x81b656,_0xe0f30){var _0x3d00f2=_0x1d26fa||_0xe0f30;if(_0x3d00f2){return handleError(_0x1af0b5,0x191,_0x3d00f2);}if(!_0x81b656){return handleError(_0x1af0b5,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x10c32f={'payload':{'id':_0x81b656['id'],'role':_0x81b656[_0x7206('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x7206('0x2a')](_0x10c32f)[_0x7206('0xa')](function(_0x71e839){_0x1af0b5['json']({'id':_0x81b656['id'],'token':_0x71e839,'statusCall':'','isAlreadyLogged':_0x81b656['online']});});}})(_0x256ef6,_0x1af0b5,_0x619c13);};exports['forgot']=function(_0x1f3698,_0x550b45){if(!_0x1f3698[_0x7206('0x2b')]['email']){return handleError(_0x550b45,0x1f4,{'message':_0x7206('0x2c')});}var _0x547c58=rs[_0x7206('0x2d')]();_0x1f3698[_0x7206('0x2b')][_0x7206('0x1e')]=_0x1f3698['body'][_0x7206('0x1e')][_0x7206('0x2e')]()[_0x7206('0x2f')]();var _0x5d54a7;return db[_0x7206('0x30')][_0x7206('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7206('0x18')],'raw':!![]})[_0x7206('0xa')](function(_0x18e5e7){_0x5d54a7=_0x18e5e7;return db[_0x7206('0x31')]['find']({'where':{'email':_0x1f3698[_0x7206('0x2b')][_0x7206('0x1e')]}});})[_0x7206('0xa')](function(_0x1def41){if(!_0x1def41){throw new Error(_0x7206('0x32'));}if(_0x1def41[_0x7206('0xe')]){throw new Error(_0x7206('0x33'));}if(_0x1def41[_0x7206('0xf')]){if(moment(_0x1def41['blockedAt'])[_0x7206('0x19')](_0x5d54a7['blockDuration'],_0x7206('0x1a'))>moment()){throw new Error(_0x7206('0x34'));}else{_0x1def41[_0x7206('0xf')]=![];_0x1def41[_0x7206('0x10')]=null;}}_0x1def41[_0x7206('0x35')]=_0x547c58;_0x1def41[_0x7206('0x36')]=Date[_0x7206('0x37')]()+0x36ee80;return _0x1def41[_0x7206('0x38')]();})[_0x7206('0xa')](function(){return sendServiceMail({'to':_0x1f3698['body'][_0x7206('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x7206('0x39')+_0x7206('0x3a')+'https://'+_0x1f3698[_0x7206('0x3b')]['host']+_0x7206('0x3c')+_0x547c58+'\x0a\x0a'+_0x7206('0x3d')});})['then'](function(){_0x550b45[_0x7206('0x29')](0xc8)['send']({'message':_0x7206('0x3e')});})['catch'](function(_0x1378ad){return handleError(_0x550b45,0x1f4,_0x1378ad);});};exports['reset']=function(_0x4ac41f,_0x56b9d4){return db[_0x7206('0x31')][_0x7206('0x3f')]({'where':{'resetPasswordToken':_0x4ac41f[_0x7206('0x40')][_0x7206('0x41')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x7206('0xa')](function(_0x322bcd){if(!_0x322bcd){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x7206('0x30')]['findOne']({'attributes':['id',_0x7206('0x42'),_0x7206('0x43'),_0x7206('0x44')]})[_0x7206('0xa')](function(_0x5b18ce){if(_0x5b18ce[_0x7206('0x42')])authService['validatePasswordPattern'](_0x4ac41f['body'][_0x7206('0xc')]);if(!_0x5b18ce[_0x7206('0x43')]||!_0x322bcd[_0x7206('0x45')])return _0x322bcd;authService[_0x7206('0x46')](_0x4ac41f['body'][_0x7206('0xc')],_0x322bcd[_0x7206('0x45')],_0x5b18ce[_0x7206('0x44')]);return _0x322bcd;})['then'](function(){_0x322bcd['password']=_0x4ac41f[_0x7206('0x2b')]['password'];_0x322bcd[_0x7206('0x35')]=null;_0x322bcd['resetPasswordExpires']=null;return _0x322bcd['save']();});})[_0x7206('0xa')](function(){_0x56b9d4[_0x7206('0x29')](0xc8)['send']({'message':_0x7206('0x47')});})[_0x7206('0x1d')](function(_0x2e4765){return handleError(_0x56b9d4,0x1f4,_0x2e4765);});};passport[_0x7206('0x48')](_0x7206('0x49'),new LocalStrategy({'usernameField':_0x7206('0xb'),'passwordField':_0x7206('0xc')},function(_0x37609c,_0x2404a0,_0x20d141){return localAuthenticate(db[_0x7206('0x31')],_0x37609c,_0x2404a0,_0x20d141);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 6fcbb7d..4798bbe 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 _0x7720=['express','./authLocal.controller','login','post','/forgot','forgot','reset','exports'];(function(_0x16de3b,_0x34f93e){var _0x20c869=function(_0x566f2f){while(--_0x566f2f){_0x16de3b['push'](_0x16de3b['shift']());}};_0x20c869(++_0x34f93e);}(_0x7720,0xc0));var _0x0772=function(_0xbefb7d,_0x2688cf){_0xbefb7d=_0xbefb7d-0x0;var _0x36b430=_0x7720[_0xbefb7d];return _0x36b430;};'use strict';var express=require(_0x0772('0x0'));var router=express['Router']();var controller=require(_0x0772('0x1'));router['post']('/',controller[_0x0772('0x2')]);router[_0x0772('0x3')](_0x0772('0x4'),controller[_0x0772('0x5')]);router['post']('/reset/:token',controller[_0x0772('0x6')]);module[_0x0772('0x7')]=router;
\ No newline at end of file
+var _0xb3cb=['express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xb3cb,0x90));var _0xbb3c=function(_0x3c4752,_0x1725bf){_0x3c4752=_0x3c4752-0x0;var _0x49b68a=_0xb3cb[_0x3c4752];return _0x49b68a;};'use strict';var express=require(_0xbb3c('0x0'));var router=express[_0xbb3c('0x1')]();var controller=require(_0xbb3c('0x2'));router[_0xbb3c('0x3')]('/',controller['login']);router[_0xbb3c('0x3')](_0xbb3c('0x4'),controller[_0xbb3c('0x5')]);router[_0xbb3c('0x3')](_0xbb3c('0x6'),controller[_0xbb3c('0x7')]);module[_0xbb3c('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 2ba02b5..31e8bc5 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 _0x2095=['sequelize','exports','STRING'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x2095,0x12f));var _0x5209=function(_0x3498ac,_0x20d2a0){_0x3498ac=_0x3498ac-0x0;var _0x263832=_0x2095[_0x3498ac];return _0x263832;};'use strict';var Sequelize=require(_0x5209('0x0'));module[_0x5209('0x1')]={'name':{'type':Sequelize[_0x5209('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5209('0x2')]},'description':{'type':Sequelize[_0x5209('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3083=['STRING','BOOLEAN','sequelize'];(function(_0x167f9e,_0x21839b){var _0xe55352=function(_0x370dc5){while(--_0x370dc5){_0x167f9e['push'](_0x167f9e['shift']());}};_0xe55352(++_0x21839b);}(_0x3083,0x1c4));var _0x3308=function(_0x158e3b,_0x4534b){_0x158e3b=_0x158e3b-0x0;var _0x551a1d=_0x3083[_0x158e3b];return _0x551a1d;};'use strict';var Sequelize=require(_0x3308('0x0'));module['exports']={'name':{'type':Sequelize[_0x3308('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x3308('0x1')]},'description':{'type':Sequelize[_0x3308('0x1')]},'status':{'type':Sequelize[_0x3308('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index bb4413e..713147f 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 _0x63b7=['filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','rows','show','keys','includeAll','include','catch','create','body','params','find','addConditions','ids','omit','findOne','nolimit','addActions','Action','getActions','eml-format','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','name','send','index','map','Automation','rawAttributes','type','model','query'];(function(_0x25d9fe,_0x54b634){var _0x9da108=function(_0x4f81f6){while(--_0x4f81f6){_0x25d9fe['push'](_0x25d9fe['shift']());}};_0x9da108(++_0x54b634);}(_0x63b7,0x1e8));var _0x763b=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0x63b7[_0x4207f4];return _0x29a621;};'use strict';var emlformat=require(_0x763b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x763b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x763b('0x2'));var moment=require('moment');var BPromise=require(_0x763b('0x3'));var Mustache=require(_0x763b('0x4'));var util=require('util');var path=require('path');var sox=require(_0x763b('0x5'));var csv=require(_0x763b('0x6'));var ejs=require(_0x763b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x763b('0x8'));var crypto=require(_0x763b('0x9'));var jsforce=require(_0x763b('0xa'));var deskjs=require(_0x763b('0xb'));var toCsv=require(_0x763b('0x6'));var querystring=require(_0x763b('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x763b('0xd'));var as=require(_0x763b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x763b('0xf'))(_0x763b('0x10'));var utils=require('../../config/utils');var config=require(_0x763b('0x11'));var licenseUtil=require(_0x763b('0x12'));var db=require(_0x763b('0x13'))['db'];function respondWithStatusCode(_0xc0f8f6,_0x1fb02b){_0x1fb02b=_0x1fb02b||0xcc;return function(_0x1f85e8){if(_0x1f85e8){return _0xc0f8f6['sendStatus'](_0x1fb02b);}return _0xc0f8f6[_0x763b('0x14')](_0x1fb02b)[_0x763b('0x15')]();};}function respondWithResult(_0x9ec53,_0x458088){_0x458088=_0x458088||0xc8;return function(_0x30dd93){if(_0x30dd93){return _0x9ec53[_0x763b('0x14')](_0x458088)[_0x763b('0x16')](_0x30dd93);}};}function respondWithFilteredResult(_0x5ee599,_0xb04c57){return function(_0x1febae){if(_0x1febae){var _0x4bc739=typeof _0xb04c57['offset']===_0x763b('0x17')&&typeof _0xb04c57[_0x763b('0x18')]===_0x763b('0x17');var _0x402083=_0x1febae[_0x763b('0x19')];var _0x3abdfb=_0x4bc739?0x0:_0xb04c57[_0x763b('0x1a')];var _0x1c9394=_0x4bc739?_0x1febae['count']:_0xb04c57[_0x763b('0x1a')]+_0xb04c57[_0x763b('0x18')];var _0x49757d;if(_0x1c9394>=_0x402083){_0x1c9394=_0x402083;_0x49757d=0xc8;}else{_0x49757d=0xce;}_0x5ee599[_0x763b('0x14')](_0x49757d);return _0x5ee599['set'](_0x763b('0x1b'),_0x3abdfb+'-'+_0x1c9394+'/'+_0x402083)[_0x763b('0x16')](_0x1febae);}return null;};}function patchUpdates(_0x14f4aa){return function(_0x58651d){try{jsonpatch[_0x763b('0x1c')](_0x58651d,_0x14f4aa,!![]);}catch(_0x32f742){return BPromise[_0x763b('0x1d')](_0x32f742);}return _0x58651d['save']();};}function saveUpdates(_0x2d081b,_0x205763){return function(_0x25e97b){if(_0x25e97b){return _0x25e97b[_0x763b('0x1e')](_0x2d081b)['then'](function(_0x428fc1){return _0x428fc1;});}return null;};}function removeEntity(_0xc8cbbf,_0x3413d0){return function(_0x25a039){if(_0x25a039){return _0x25a039[_0x763b('0x1f')]()[_0x763b('0x20')](function(){_0xc8cbbf[_0x763b('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f36f2,_0x2951a9){return function(_0x42c60e){if(!_0x42c60e){_0x1f36f2[_0x763b('0x21')](0x194);}return _0x42c60e;};}function handleError(_0x1f67c1,_0x1903e2){_0x1903e2=_0x1903e2||0x1f4;return function(_0x5acecb){logger['error'](_0x5acecb[_0x763b('0x22')]);if(_0x5acecb[_0x763b('0x23')]){delete _0x5acecb[_0x763b('0x23')];}_0x1f67c1[_0x763b('0x14')](_0x1903e2)[_0x763b('0x24')](_0x5acecb);};}exports[_0x763b('0x25')]=function(_0x10fa31,_0x4b33b6){var _0x4c9800={},_0x2e40aa={},_0x4f3886={'count':0x0,'rows':[]};var _0x51b8f1=_[_0x763b('0x26')](db[_0x763b('0x27')][_0x763b('0x28')],function(_0x4b7afe){return{'name':_0x4b7afe['fieldName'],'type':_0x4b7afe[_0x763b('0x29')]['key']};});_0x2e40aa[_0x763b('0x2a')]=_[_0x763b('0x26')](_0x51b8f1,_0x763b('0x23'));_0x2e40aa[_0x763b('0x2b')]=_['keys'](_0x10fa31[_0x763b('0x2b')]);_0x2e40aa[_0x763b('0x2c')]=_['intersection'](_0x2e40aa[_0x763b('0x2a')],_0x2e40aa[_0x763b('0x2b')]);_0x4c9800[_0x763b('0x2d')]=_[_0x763b('0x2e')](_0x2e40aa[_0x763b('0x2a')],qs[_0x763b('0x2f')](_0x10fa31['query']['fields']));_0x4c9800[_0x763b('0x2d')]=_0x4c9800[_0x763b('0x2d')][_0x763b('0x30')]?_0x4c9800[_0x763b('0x2d')]:_0x2e40aa[_0x763b('0x2a')];if(!_0x10fa31['query'][_0x763b('0x31')]('nolimit')){_0x4c9800[_0x763b('0x18')]=qs[_0x763b('0x18')](_0x10fa31[_0x763b('0x2b')][_0x763b('0x18')]);_0x4c9800[_0x763b('0x1a')]=qs[_0x763b('0x1a')](_0x10fa31[_0x763b('0x2b')][_0x763b('0x1a')]);}_0x4c9800[_0x763b('0x32')]=qs['sort'](_0x10fa31['query'][_0x763b('0x33')]);_0x4c9800[_0x763b('0x34')]=qs[_0x763b('0x2c')](_[_0x763b('0x35')](_0x10fa31[_0x763b('0x2b')],_0x2e40aa[_0x763b('0x2c')]),_0x51b8f1);if(_0x10fa31[_0x763b('0x2b')]['filter']){_0x4c9800[_0x763b('0x34')]=_[_0x763b('0x36')](_0x4c9800[_0x763b('0x34')],{'$or':_[_0x763b('0x26')](_0x51b8f1,function(_0x3f8d1d){if(_0x3f8d1d[_0x763b('0x29')]!==_0x763b('0x37')){var _0x1f5898={};_0x1f5898[_0x3f8d1d[_0x763b('0x23')]]={'$like':'%'+_0x10fa31[_0x763b('0x2b')][_0x763b('0x38')]+'%'};return _0x1f5898;}})});}_0x4c9800=_[_0x763b('0x36')]({},_0x4c9800,_0x10fa31[_0x763b('0x39')]);var _0x31ef7e={'where':_0x4c9800[_0x763b('0x34')]};return db[_0x763b('0x27')][_0x763b('0x19')](_0x31ef7e)[_0x763b('0x20')](function(_0xe31129){_0x4f3886[_0x763b('0x19')]=_0xe31129;if(_0x10fa31[_0x763b('0x2b')]['includeAll']){_0x4c9800['include']=[{'all':!![]}];}return db[_0x763b('0x27')]['findAll'](_0x4c9800);})[_0x763b('0x20')](function(_0x4ffb5b){_0x4f3886[_0x763b('0x3a')]=_0x4ffb5b;return _0x4f3886;})['then'](respondWithFilteredResult(_0x4b33b6,_0x4c9800))['catch'](handleError(_0x4b33b6,null));};exports[_0x763b('0x3b')]=function(_0x410259,_0x34b6ab){var _0x5f3424={'raw':![],'where':{'id':_0x410259['params']['id']}},_0x5d1409={};_0x5d1409[_0x763b('0x2a')]=_['keys'](db['Automation'][_0x763b('0x28')]);_0x5d1409[_0x763b('0x2b')]=_[_0x763b('0x3c')](_0x410259[_0x763b('0x2b')]);_0x5d1409['filters']=_['intersection'](_0x5d1409[_0x763b('0x2a')],_0x5d1409[_0x763b('0x2b')]);_0x5f3424[_0x763b('0x2d')]=_[_0x763b('0x2e')](_0x5d1409[_0x763b('0x2a')],qs[_0x763b('0x2f')](_0x410259[_0x763b('0x2b')][_0x763b('0x2f')]));_0x5f3424[_0x763b('0x2d')]=_0x5f3424['attributes'][_0x763b('0x30')]?_0x5f3424[_0x763b('0x2d')]:_0x5d1409[_0x763b('0x2a')];if(_0x410259[_0x763b('0x2b')][_0x763b('0x3d')]){_0x5f3424[_0x763b('0x3e')]=[{'all':!![]}];}_0x5f3424=_[_0x763b('0x36')]({},_0x5f3424,_0x410259['options']);return db[_0x763b('0x27')]['find'](_0x5f3424)[_0x763b('0x20')](handleEntityNotFound(_0x34b6ab,null))['then'](respondWithResult(_0x34b6ab,null))[_0x763b('0x3f')](handleError(_0x34b6ab,null));};exports[_0x763b('0x40')]=function(_0x583027,_0x2b2cc2){return db[_0x763b('0x27')][_0x763b('0x40')](_0x583027['body'],{})['then'](respondWithResult(_0x2b2cc2,0xc9))['catch'](handleError(_0x2b2cc2,null));};exports['update']=function(_0xa5f195,_0x75c925){if(_0xa5f195[_0x763b('0x41')]['id']){delete _0xa5f195['body']['id'];}return db[_0x763b('0x27')]['find']({'where':{'id':_0xa5f195[_0x763b('0x42')]['id']}})[_0x763b('0x20')](handleEntityNotFound(_0x75c925,null))[_0x763b('0x20')](saveUpdates(_0xa5f195[_0x763b('0x41')],null))[_0x763b('0x20')](respondWithResult(_0x75c925,null))[_0x763b('0x3f')](handleError(_0x75c925,null));};exports[_0x763b('0x1f')]=function(_0x12c0b0,_0xad67b9){return db[_0x763b('0x27')][_0x763b('0x43')]({'where':{'id':_0x12c0b0[_0x763b('0x42')]['id']}})[_0x763b('0x20')](handleEntityNotFound(_0xad67b9,null))[_0x763b('0x20')](removeEntity(_0xad67b9,null))['catch'](handleError(_0xad67b9,null));};exports['addConditions']=function(_0x509f58,_0x29d1ff,_0x385fe9){return db['Condition'][_0x763b('0x43')]({'where':{'id':_0x509f58[_0x763b('0x42')]['id']}})[_0x763b('0x20')](handleEntityNotFound(_0x29d1ff,null))[_0x763b('0x20')](function(_0x4e5a3b){if(_0x4e5a3b){return _0x4e5a3b[_0x763b('0x44')](_0x509f58[_0x763b('0x41')][_0x763b('0x45')],_[_0x763b('0x46')](_0x509f58[_0x763b('0x41')],[_0x763b('0x45'),'id'])||{});}})['then'](respondWithResult(_0x29d1ff,null))[_0x763b('0x3f')](handleError(_0x29d1ff,null));};exports['getConditions']=function(_0x59e7c1,_0x19e0a6,_0x9eeb30){var _0x293faa={};var _0x30d643={};var _0x129371;var _0xa29af1;return db[_0x763b('0x27')][_0x763b('0x47')]({'where':{'id':_0x59e7c1[_0x763b('0x42')]['id']}})[_0x763b('0x20')](handleEntityNotFound(_0x19e0a6,null))[_0x763b('0x20')](function(_0x93e619){if(_0x93e619){_0x129371=_0x93e619;_0x30d643[_0x763b('0x2a')]=_[_0x763b('0x3c')](db['Condition'][_0x763b('0x28')]);_0x30d643[_0x763b('0x2b')]=_[_0x763b('0x3c')](_0x59e7c1['query']);_0x30d643[_0x763b('0x2c')]=_['intersection'](_0x30d643[_0x763b('0x2a')],_0x30d643[_0x763b('0x2b')]);_0x293faa['attributes']=_[_0x763b('0x2e')](_0x30d643[_0x763b('0x2a')],qs[_0x763b('0x2f')](_0x59e7c1[_0x763b('0x2b')][_0x763b('0x2f')]));_0x293faa['attributes']=_0x293faa[_0x763b('0x2d')][_0x763b('0x30')]?_0x293faa['attributes']:_0x30d643[_0x763b('0x2a')];_0x293faa[_0x763b('0x32')]=qs[_0x763b('0x33')](_0x59e7c1[_0x763b('0x2b')]['sort']);_0x293faa[_0x763b('0x34')]=qs[_0x763b('0x2c')](_['pick'](_0x59e7c1['query'],_0x30d643[_0x763b('0x2c')]));if(_0x59e7c1[_0x763b('0x2b')][_0x763b('0x38')]){_0x293faa[_0x763b('0x34')]=_[_0x763b('0x36')](_0x293faa[_0x763b('0x34')],{'$or':_['map'](_0x293faa[_0x763b('0x2d')],function(_0x4477c5){var _0x5ae04f={};_0x5ae04f[_0x4477c5]={'$like':'%'+_0x59e7c1[_0x763b('0x2b')][_0x763b('0x38')]+'%'};return _0x5ae04f;})});}_0x293faa=_['merge']({},_0x293faa,_0x59e7c1[_0x763b('0x39')]);return _0x129371['getConditions'](_0x293faa);}})[_0x763b('0x20')](function(_0x502789){if(_0x502789){_0xa29af1=_0x502789[_0x763b('0x30')];if(!_0x59e7c1[_0x763b('0x2b')][_0x763b('0x31')](_0x763b('0x48'))){_0x293faa['limit']=qs[_0x763b('0x18')](_0x59e7c1[_0x763b('0x2b')][_0x763b('0x18')]);_0x293faa['offset']=qs['offset'](_0x59e7c1[_0x763b('0x2b')][_0x763b('0x1a')]);}return _0x129371['getConditions'](_0x293faa);}})[_0x763b('0x20')](function(_0x245722){if(_0x245722){return _0x245722?{'count':_0xa29af1,'rows':_0x245722}:null;}})[_0x763b('0x20')](respondWithResult(_0x19e0a6,null))[_0x763b('0x3f')](handleError(_0x19e0a6,null));};exports[_0x763b('0x49')]=function(_0xced089,_0x3a57f9,_0x5cc0f1){return db[_0x763b('0x4a')][_0x763b('0x43')]({'where':{'id':_0xced089['params']['id']}})[_0x763b('0x20')](handleEntityNotFound(_0x3a57f9,null))[_0x763b('0x20')](function(_0x29ba30){if(_0x29ba30){return _0x29ba30[_0x763b('0x49')](_0xced089[_0x763b('0x41')][_0x763b('0x45')],_[_0x763b('0x46')](_0xced089[_0x763b('0x41')],['ids','id'])||{});}})[_0x763b('0x20')](respondWithResult(_0x3a57f9,null))[_0x763b('0x3f')](handleError(_0x3a57f9,null));};exports[_0x763b('0x4b')]=function(_0x337b67,_0x5cddec,_0x217d80){var _0x3b2194={};var _0x5a5159={};var _0x34c2e1;var _0x14676a;return db['Automation'][_0x763b('0x47')]({'where':{'id':_0x337b67[_0x763b('0x42')]['id']}})['then'](handleEntityNotFound(_0x5cddec,null))['then'](function(_0x52c376){if(_0x52c376){_0x34c2e1=_0x52c376;_0x5a5159[_0x763b('0x2a')]=_[_0x763b('0x3c')](db[_0x763b('0x4a')][_0x763b('0x28')]);_0x5a5159[_0x763b('0x2b')]=_[_0x763b('0x3c')](_0x337b67[_0x763b('0x2b')]);_0x5a5159[_0x763b('0x2c')]=_[_0x763b('0x2e')](_0x5a5159[_0x763b('0x2a')],_0x5a5159[_0x763b('0x2b')]);_0x3b2194[_0x763b('0x2d')]=_[_0x763b('0x2e')](_0x5a5159['model'],qs[_0x763b('0x2f')](_0x337b67[_0x763b('0x2b')][_0x763b('0x2f')]));_0x3b2194[_0x763b('0x2d')]=_0x3b2194[_0x763b('0x2d')][_0x763b('0x30')]?_0x3b2194[_0x763b('0x2d')]:_0x5a5159[_0x763b('0x2a')];_0x3b2194[_0x763b('0x32')]=qs['sort'](_0x337b67[_0x763b('0x2b')]['sort']);_0x3b2194[_0x763b('0x34')]=qs['filters'](_['pick'](_0x337b67[_0x763b('0x2b')],_0x5a5159[_0x763b('0x2c')]));if(_0x337b67[_0x763b('0x2b')]['filter']){_0x3b2194['where']=_[_0x763b('0x36')](_0x3b2194['where'],{'$or':_[_0x763b('0x26')](_0x3b2194['attributes'],function(_0xa5e09){var _0x5a0d97={};_0x5a0d97[_0xa5e09]={'$like':'%'+_0x337b67[_0x763b('0x2b')][_0x763b('0x38')]+'%'};return _0x5a0d97;})});}_0x3b2194=_['merge']({},_0x3b2194,_0x337b67[_0x763b('0x39')]);return _0x34c2e1[_0x763b('0x4b')](_0x3b2194);}})[_0x763b('0x20')](function(_0x1b0ed4){if(_0x1b0ed4){_0x14676a=_0x1b0ed4[_0x763b('0x30')];if(!_0x337b67['query'][_0x763b('0x31')](_0x763b('0x48'))){_0x3b2194['limit']=qs[_0x763b('0x18')](_0x337b67[_0x763b('0x2b')][_0x763b('0x18')]);_0x3b2194[_0x763b('0x1a')]=qs[_0x763b('0x1a')](_0x337b67[_0x763b('0x2b')][_0x763b('0x1a')]);}return _0x34c2e1[_0x763b('0x4b')](_0x3b2194);}})[_0x763b('0x20')](function(_0x2f5837){if(_0x2f5837){return _0x2f5837?{'count':_0x14676a,'rows':_0x2f5837}:null;}})[_0x763b('0x20')](respondWithResult(_0x5cddec,null))[_0x763b('0x3f')](handleError(_0x5cddec,null));};
\ No newline at end of file
+var _0x2ee6=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','Automation','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','addConditions','Condition','ids','omit','findOne','length','getConditions','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x346107,_0x296b20){var _0x361e34=function(_0x20a924){while(--_0x20a924){_0x346107['push'](_0x346107['shift']());}};_0x361e34(++_0x296b20);}(_0x2ee6,0xfb));var _0x62ee=function(_0x3cb9f7,_0x12f280){_0x3cb9f7=_0x3cb9f7-0x0;var _0x172b2b=_0x2ee6[_0x3cb9f7];return _0x172b2b;};'use strict';var emlformat=require(_0x62ee('0x0'));var rimraf=require(_0x62ee('0x1'));var zipdir=require(_0x62ee('0x2'));var jsonpatch=require(_0x62ee('0x3'));var rp=require('request-promise');var moment=require(_0x62ee('0x4'));var BPromise=require(_0x62ee('0x5'));var Mustache=require(_0x62ee('0x6'));var util=require(_0x62ee('0x7'));var path=require(_0x62ee('0x8'));var sox=require(_0x62ee('0x9'));var csv=require(_0x62ee('0xa'));var ejs=require(_0x62ee('0xb'));var fs=require('fs');var fs_extra=require(_0x62ee('0xc'));var _=require(_0x62ee('0xd'));var squel=require(_0x62ee('0xe'));var crypto=require(_0x62ee('0xf'));var jsforce=require(_0x62ee('0x10'));var deskjs=require(_0x62ee('0x11'));var toCsv=require(_0x62ee('0xa'));var querystring=require(_0x62ee('0x12'));var Papa=require(_0x62ee('0x13'));var Redis=require('ioredis');var authService=require(_0x62ee('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x62ee('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62ee('0x16'))('api');var utils=require(_0x62ee('0x17'));var config=require(_0x62ee('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27d1ea,_0x50ab52){_0x50ab52=_0x50ab52||0xcc;return function(_0x28d00d){if(_0x28d00d){return _0x27d1ea[_0x62ee('0x19')](_0x50ab52);}return _0x27d1ea['status'](_0x50ab52)[_0x62ee('0x1a')]();};}function respondWithResult(_0x5ebf01,_0x2a473e){_0x2a473e=_0x2a473e||0xc8;return function(_0x1d3feb){if(_0x1d3feb){return _0x5ebf01[_0x62ee('0x1b')](_0x2a473e)[_0x62ee('0x1c')](_0x1d3feb);}};}function respondWithFilteredResult(_0x34ee85,_0x59a661){return function(_0xdb0a8c){if(_0xdb0a8c){var _0x5264ee=typeof _0x59a661[_0x62ee('0x1d')]===_0x62ee('0x1e')&&typeof _0x59a661[_0x62ee('0x1f')]===_0x62ee('0x1e');var _0x21c0b0=_0xdb0a8c['count'];var _0x24127f=_0x5264ee?0x0:_0x59a661['offset'];var _0x1d2130=_0x5264ee?_0xdb0a8c[_0x62ee('0x20')]:_0x59a661[_0x62ee('0x1d')]+_0x59a661['limit'];var _0x6410e3;if(_0x1d2130>=_0x21c0b0){_0x1d2130=_0x21c0b0;_0x6410e3=0xc8;}else{_0x6410e3=0xce;}_0x34ee85['status'](_0x6410e3);return _0x34ee85[_0x62ee('0x21')](_0x62ee('0x22'),_0x24127f+'-'+_0x1d2130+'/'+_0x21c0b0)[_0x62ee('0x1c')](_0xdb0a8c);}return null;};}function patchUpdates(_0xf19f98){return function(_0x28902f){try{jsonpatch[_0x62ee('0x23')](_0x28902f,_0xf19f98,!![]);}catch(_0x2045b0){return BPromise[_0x62ee('0x24')](_0x2045b0);}return _0x28902f[_0x62ee('0x25')]();};}function saveUpdates(_0x4c462c,_0x308f3f){return function(_0xcccf49){if(_0xcccf49){return _0xcccf49[_0x62ee('0x26')](_0x4c462c)['then'](function(_0x4b3f73){return _0x4b3f73;});}return null;};}function removeEntity(_0x4d0e50,_0x11073c){return function(_0x173b80){if(_0x173b80){return _0x173b80[_0x62ee('0x27')]()[_0x62ee('0x28')](function(){_0x4d0e50[_0x62ee('0x1b')](0xcc)[_0x62ee('0x1a')]();});}};}function handleEntityNotFound(_0x37756a,_0x535d81){return function(_0x17c142){if(!_0x17c142){_0x37756a[_0x62ee('0x19')](0x194);}return _0x17c142;};}function handleError(_0x11fa0a,_0x45a629){_0x45a629=_0x45a629||0x1f4;return function(_0xfefaa0){logger[_0x62ee('0x29')](_0xfefaa0['stack']);if(_0xfefaa0[_0x62ee('0x2a')]){delete _0xfefaa0[_0x62ee('0x2a')];}_0x11fa0a['status'](_0x45a629)['send'](_0xfefaa0);};}exports[_0x62ee('0x2b')]=function(_0x187edb,_0x145955){var _0x1e712d={},_0x5481f5={},_0x55fb57={'count':0x0,'rows':[]};var _0x1b0150=_['map'](db[_0x62ee('0x2c')][_0x62ee('0x2d')],function(_0x4d6778){return{'name':_0x4d6778[_0x62ee('0x2e')],'type':_0x4d6778[_0x62ee('0x2f')]['key']};});_0x5481f5[_0x62ee('0x30')]=_[_0x62ee('0x31')](_0x1b0150,_0x62ee('0x2a'));_0x5481f5['query']=_[_0x62ee('0x32')](_0x187edb[_0x62ee('0x33')]);_0x5481f5[_0x62ee('0x34')]=_[_0x62ee('0x35')](_0x5481f5[_0x62ee('0x30')],_0x5481f5[_0x62ee('0x33')]);_0x1e712d[_0x62ee('0x36')]=_[_0x62ee('0x35')](_0x5481f5[_0x62ee('0x30')],qs[_0x62ee('0x37')](_0x187edb[_0x62ee('0x33')][_0x62ee('0x37')]));_0x1e712d['attributes']=_0x1e712d[_0x62ee('0x36')]['length']?_0x1e712d[_0x62ee('0x36')]:_0x5481f5['model'];if(!_0x187edb[_0x62ee('0x33')][_0x62ee('0x38')](_0x62ee('0x39'))){_0x1e712d[_0x62ee('0x1f')]=qs[_0x62ee('0x1f')](_0x187edb[_0x62ee('0x33')]['limit']);_0x1e712d[_0x62ee('0x1d')]=qs[_0x62ee('0x1d')](_0x187edb['query'][_0x62ee('0x1d')]);}_0x1e712d[_0x62ee('0x3a')]=qs[_0x62ee('0x3b')](_0x187edb[_0x62ee('0x33')]['sort']);_0x1e712d[_0x62ee('0x3c')]=qs[_0x62ee('0x34')](_[_0x62ee('0x3d')](_0x187edb['query'],_0x5481f5[_0x62ee('0x34')]),_0x1b0150);if(_0x187edb[_0x62ee('0x33')][_0x62ee('0x3e')]){_0x1e712d['where']=_[_0x62ee('0x3f')](_0x1e712d[_0x62ee('0x3c')],{'$or':_[_0x62ee('0x31')](_0x1b0150,function(_0x55fff4){if(_0x55fff4['type']!==_0x62ee('0x40')){var _0x41bf49={};_0x41bf49[_0x55fff4[_0x62ee('0x2a')]]={'$like':'%'+_0x187edb[_0x62ee('0x33')][_0x62ee('0x3e')]+'%'};return _0x41bf49;}})});}_0x1e712d=_[_0x62ee('0x3f')]({},_0x1e712d,_0x187edb[_0x62ee('0x41')]);var _0x282ab6={'where':_0x1e712d[_0x62ee('0x3c')]};return db[_0x62ee('0x2c')][_0x62ee('0x20')](_0x282ab6)[_0x62ee('0x28')](function(_0x2db7e6){_0x55fb57['count']=_0x2db7e6;if(_0x187edb[_0x62ee('0x33')][_0x62ee('0x42')]){_0x1e712d[_0x62ee('0x43')]=[{'all':!![]}];}return db[_0x62ee('0x2c')][_0x62ee('0x44')](_0x1e712d);})[_0x62ee('0x28')](function(_0x666bc4){_0x55fb57[_0x62ee('0x45')]=_0x666bc4;return _0x55fb57;})['then'](respondWithFilteredResult(_0x145955,_0x1e712d))[_0x62ee('0x46')](handleError(_0x145955,null));};exports[_0x62ee('0x47')]=function(_0x35f4f2,_0x322368){var _0x2b1977={'raw':![],'where':{'id':_0x35f4f2['params']['id']}},_0x4c1c6d={};_0x4c1c6d[_0x62ee('0x30')]=_[_0x62ee('0x32')](db[_0x62ee('0x2c')]['rawAttributes']);_0x4c1c6d[_0x62ee('0x33')]=_[_0x62ee('0x32')](_0x35f4f2['query']);_0x4c1c6d['filters']=_[_0x62ee('0x35')](_0x4c1c6d[_0x62ee('0x30')],_0x4c1c6d['query']);_0x2b1977[_0x62ee('0x36')]=_[_0x62ee('0x35')](_0x4c1c6d['model'],qs[_0x62ee('0x37')](_0x35f4f2[_0x62ee('0x33')][_0x62ee('0x37')]));_0x2b1977[_0x62ee('0x36')]=_0x2b1977[_0x62ee('0x36')]['length']?_0x2b1977[_0x62ee('0x36')]:_0x4c1c6d['model'];if(_0x35f4f2['query'][_0x62ee('0x42')]){_0x2b1977[_0x62ee('0x43')]=[{'all':!![]}];}_0x2b1977=_[_0x62ee('0x3f')]({},_0x2b1977,_0x35f4f2[_0x62ee('0x41')]);return db[_0x62ee('0x2c')][_0x62ee('0x48')](_0x2b1977)[_0x62ee('0x28')](handleEntityNotFound(_0x322368,null))[_0x62ee('0x28')](respondWithResult(_0x322368,null))[_0x62ee('0x46')](handleError(_0x322368,null));};exports[_0x62ee('0x49')]=function(_0x325a41,_0x4a7bdd){return db[_0x62ee('0x2c')][_0x62ee('0x49')](_0x325a41[_0x62ee('0x4a')],{})[_0x62ee('0x28')](respondWithResult(_0x4a7bdd,0xc9))['catch'](handleError(_0x4a7bdd,null));};exports['update']=function(_0x38589b,_0x832615){if(_0x38589b['body']['id']){delete _0x38589b[_0x62ee('0x4a')]['id'];}return db[_0x62ee('0x2c')]['find']({'where':{'id':_0x38589b[_0x62ee('0x4b')]['id']}})[_0x62ee('0x28')](handleEntityNotFound(_0x832615,null))[_0x62ee('0x28')](saveUpdates(_0x38589b[_0x62ee('0x4a')],null))['then'](respondWithResult(_0x832615,null))[_0x62ee('0x46')](handleError(_0x832615,null));};exports['destroy']=function(_0x4eea11,_0x35cc47){return db['Automation'][_0x62ee('0x48')]({'where':{'id':_0x4eea11[_0x62ee('0x4b')]['id']}})[_0x62ee('0x28')](handleEntityNotFound(_0x35cc47,null))[_0x62ee('0x28')](removeEntity(_0x35cc47,null))[_0x62ee('0x46')](handleError(_0x35cc47,null));};exports[_0x62ee('0x4c')]=function(_0x599960,_0x26a841,_0x2e5a05){return db[_0x62ee('0x4d')][_0x62ee('0x48')]({'where':{'id':_0x599960[_0x62ee('0x4b')]['id']}})['then'](handleEntityNotFound(_0x26a841,null))[_0x62ee('0x28')](function(_0x29062d){if(_0x29062d){return _0x29062d[_0x62ee('0x4c')](_0x599960['body'][_0x62ee('0x4e')],_[_0x62ee('0x4f')](_0x599960[_0x62ee('0x4a')],[_0x62ee('0x4e'),'id'])||{});}})[_0x62ee('0x28')](respondWithResult(_0x26a841,null))['catch'](handleError(_0x26a841,null));};exports['getConditions']=function(_0x49423a,_0x8a8656,_0x5ecc0d){var _0x36d1f2={};var _0x2a1050={};var _0x13807c;var _0x55cc85;return db[_0x62ee('0x2c')][_0x62ee('0x50')]({'where':{'id':_0x49423a['params']['id']}})[_0x62ee('0x28')](handleEntityNotFound(_0x8a8656,null))['then'](function(_0x538a7b){if(_0x538a7b){_0x13807c=_0x538a7b;_0x2a1050['model']=_[_0x62ee('0x32')](db['Condition']['rawAttributes']);_0x2a1050[_0x62ee('0x33')]=_[_0x62ee('0x32')](_0x49423a[_0x62ee('0x33')]);_0x2a1050['filters']=_[_0x62ee('0x35')](_0x2a1050['model'],_0x2a1050[_0x62ee('0x33')]);_0x36d1f2[_0x62ee('0x36')]=_[_0x62ee('0x35')](_0x2a1050['model'],qs[_0x62ee('0x37')](_0x49423a[_0x62ee('0x33')][_0x62ee('0x37')]));_0x36d1f2['attributes']=_0x36d1f2[_0x62ee('0x36')][_0x62ee('0x51')]?_0x36d1f2[_0x62ee('0x36')]:_0x2a1050[_0x62ee('0x30')];_0x36d1f2[_0x62ee('0x3a')]=qs[_0x62ee('0x3b')](_0x49423a['query'][_0x62ee('0x3b')]);_0x36d1f2[_0x62ee('0x3c')]=qs[_0x62ee('0x34')](_[_0x62ee('0x3d')](_0x49423a[_0x62ee('0x33')],_0x2a1050[_0x62ee('0x34')]));if(_0x49423a['query'][_0x62ee('0x3e')]){_0x36d1f2['where']=_[_0x62ee('0x3f')](_0x36d1f2[_0x62ee('0x3c')],{'$or':_['map'](_0x36d1f2[_0x62ee('0x36')],function(_0x252da6){var _0xe7422f={};_0xe7422f[_0x252da6]={'$like':'%'+_0x49423a['query']['filter']+'%'};return _0xe7422f;})});}_0x36d1f2=_[_0x62ee('0x3f')]({},_0x36d1f2,_0x49423a['options']);return _0x13807c[_0x62ee('0x52')](_0x36d1f2);}})[_0x62ee('0x28')](function(_0x4dd096){if(_0x4dd096){_0x55cc85=_0x4dd096[_0x62ee('0x51')];if(!_0x49423a[_0x62ee('0x33')][_0x62ee('0x38')](_0x62ee('0x39'))){_0x36d1f2[_0x62ee('0x1f')]=qs[_0x62ee('0x1f')](_0x49423a[_0x62ee('0x33')][_0x62ee('0x1f')]);_0x36d1f2[_0x62ee('0x1d')]=qs[_0x62ee('0x1d')](_0x49423a[_0x62ee('0x33')][_0x62ee('0x1d')]);}return _0x13807c[_0x62ee('0x52')](_0x36d1f2);}})[_0x62ee('0x28')](function(_0x317094){if(_0x317094){return _0x317094?{'count':_0x55cc85,'rows':_0x317094}:null;}})['then'](respondWithResult(_0x8a8656,null))['catch'](handleError(_0x8a8656,null));};exports[_0x62ee('0x53')]=function(_0x362fc7,_0x3a2f46,_0xecfa33){return db[_0x62ee('0x54')][_0x62ee('0x48')]({'where':{'id':_0x362fc7[_0x62ee('0x4b')]['id']}})[_0x62ee('0x28')](handleEntityNotFound(_0x3a2f46,null))[_0x62ee('0x28')](function(_0x70eb7){if(_0x70eb7){return _0x70eb7[_0x62ee('0x53')](_0x362fc7[_0x62ee('0x4a')]['ids'],_[_0x62ee('0x4f')](_0x362fc7['body'],[_0x62ee('0x4e'),'id'])||{});}})[_0x62ee('0x28')](respondWithResult(_0x3a2f46,null))[_0x62ee('0x46')](handleError(_0x3a2f46,null));};exports[_0x62ee('0x55')]=function(_0x221b9b,_0x4cc702,_0xb75fed){var _0x2f33f2={};var _0xb70c0b={};var _0x4bfa0b;var _0x3c0fe4;return db['Automation'][_0x62ee('0x50')]({'where':{'id':_0x221b9b[_0x62ee('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4cc702,null))[_0x62ee('0x28')](function(_0x4a1475){if(_0x4a1475){_0x4bfa0b=_0x4a1475;_0xb70c0b[_0x62ee('0x30')]=_[_0x62ee('0x32')](db[_0x62ee('0x54')][_0x62ee('0x2d')]);_0xb70c0b[_0x62ee('0x33')]=_['keys'](_0x221b9b[_0x62ee('0x33')]);_0xb70c0b[_0x62ee('0x34')]=_[_0x62ee('0x35')](_0xb70c0b['model'],_0xb70c0b['query']);_0x2f33f2[_0x62ee('0x36')]=_[_0x62ee('0x35')](_0xb70c0b[_0x62ee('0x30')],qs[_0x62ee('0x37')](_0x221b9b[_0x62ee('0x33')][_0x62ee('0x37')]));_0x2f33f2['attributes']=_0x2f33f2[_0x62ee('0x36')][_0x62ee('0x51')]?_0x2f33f2[_0x62ee('0x36')]:_0xb70c0b['model'];_0x2f33f2[_0x62ee('0x3a')]=qs[_0x62ee('0x3b')](_0x221b9b[_0x62ee('0x33')][_0x62ee('0x3b')]);_0x2f33f2[_0x62ee('0x3c')]=qs['filters'](_[_0x62ee('0x3d')](_0x221b9b[_0x62ee('0x33')],_0xb70c0b[_0x62ee('0x34')]));if(_0x221b9b[_0x62ee('0x33')][_0x62ee('0x3e')]){_0x2f33f2[_0x62ee('0x3c')]=_[_0x62ee('0x3f')](_0x2f33f2[_0x62ee('0x3c')],{'$or':_['map'](_0x2f33f2['attributes'],function(_0x11edb6){var _0x4e9c15={};_0x4e9c15[_0x11edb6]={'$like':'%'+_0x221b9b[_0x62ee('0x33')][_0x62ee('0x3e')]+'%'};return _0x4e9c15;})});}_0x2f33f2=_['merge']({},_0x2f33f2,_0x221b9b[_0x62ee('0x41')]);return _0x4bfa0b['getActions'](_0x2f33f2);}})[_0x62ee('0x28')](function(_0x5056dd){if(_0x5056dd){_0x3c0fe4=_0x5056dd[_0x62ee('0x51')];if(!_0x221b9b[_0x62ee('0x33')][_0x62ee('0x38')](_0x62ee('0x39'))){_0x2f33f2[_0x62ee('0x1f')]=qs[_0x62ee('0x1f')](_0x221b9b[_0x62ee('0x33')][_0x62ee('0x1f')]);_0x2f33f2[_0x62ee('0x1d')]=qs[_0x62ee('0x1d')](_0x221b9b[_0x62ee('0x33')][_0x62ee('0x1d')]);}return _0x4bfa0b['getActions'](_0x2f33f2);}})['then'](function(_0x47bd08){if(_0x47bd08){return _0x47bd08?{'count':_0x3c0fe4,'rows':_0x47bd08}:null;}})[_0x62ee('0x28')](respondWithResult(_0x4cc702,null))[_0x62ee('0x46')](handleError(_0x4cc702,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 4419194..2280803 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 _0x2e7c=['api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x116363,_0x2b5ae4){var _0x21b28d=function(_0x229eec){while(--_0x229eec){_0x116363['push'](_0x116363['shift']());}};_0x21b28d(++_0x2b5ae4);}(_0x2e7c,0xcc));var _0xc2e7=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x2e7c[_0x42bc91];return _0x3f5507;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc2e7('0x0'));var moment=require(_0xc2e7('0x1'));var BPromise=require(_0xc2e7('0x2'));var rp=require(_0xc2e7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc2e7('0x4'));var attributes=require('./automation.attributes');module[_0xc2e7('0x5')]=function(_0x2bb219,_0x42a9f7){return _0x2bb219['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9667=['lodash','util','api','moment','request-promise','rimraf','./automation.attributes','exports','define','tools_automations'];(function(_0x1ed76f,_0x56e8da){var _0x3274b3=function(_0x4c9966){while(--_0x4c9966){_0x1ed76f['push'](_0x1ed76f['shift']());}};_0x3274b3(++_0x56e8da);}(_0x9667,0x96));var _0x7966=function(_0xdbd7fb,_0x1dee5f){_0xdbd7fb=_0xdbd7fb-0x0;var _0x2fe439=_0x9667[_0xdbd7fb];return _0x2fe439;};'use strict';var _=require(_0x7966('0x0'));var util=require(_0x7966('0x1'));var logger=require('../../config/logger')(_0x7966('0x2'));var moment=require(_0x7966('0x3'));var BPromise=require('bluebird');var rp=require(_0x7966('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7966('0x5'));var config=require('../../config/environment');var attributes=require(_0x7966('0x6'));module[_0x7966('0x7')]=function(_0x274326,_0xec8058){return _0x274326[_0x7966('0x8')]('Automation',attributes,{'tableName':_0x7966('0x9'),'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 1e3a596..3e7ac1e 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 _0x19cb=['message','result','catch','util','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31f5af,_0x9712a5){var _0x1525e4=function(_0x57f7ca){while(--_0x57f7ca){_0x31f5af['push'](_0x31f5af['shift']());}};_0x1525e4(++_0x9712a5);}(_0x19cb,0x146));var _0xb19c=function(_0x2827ef,_0x459de4){_0x2827ef=_0x2827ef-0x0;var _0x4a68b5=_0x19cb[_0x2827ef];return _0x4a68b5;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var moment=require(_0xb19c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb19c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb19c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb19c('0x4'));var jayson=require(_0xb19c('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d6a30,_0x477ac1,_0x35c200){return new BPromise(function(_0x262354,_0x5d50d4){return client['request'](_0x2d6a30,_0x35c200)[_0xb19c('0x6')](function(_0x3ffb45){logger[_0xb19c('0x7')](_0xb19c('0x8'),_0x477ac1,_0xb19c('0x9'));logger['debug'](_0xb19c('0xa'),_0x477ac1,_0xb19c('0x9'),JSON[_0xb19c('0xb')](_0x3ffb45));if(_0x3ffb45[_0xb19c('0xc')]){if(_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xd')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x477ac1,_0x3ffb45['error'][_0xb19c('0xe')]);return _0x5d50d4(_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xe')]);}logger['error'](_0xb19c('0x8'),_0x477ac1,_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xe')]);return _0x262354(_0x3ffb45['error'][_0xb19c('0xe')]);}else{logger['info'](_0xb19c('0x8'),_0x477ac1,_0xb19c('0x9'));_0x262354(_0x3ffb45[_0xb19c('0xf')][_0xb19c('0xe')]);}})[_0xb19c('0x10')](function(_0x5bae0a){logger[_0xb19c('0xc')](_0xb19c('0x8'),_0x477ac1,_0x5bae0a);_0x5d50d4(_0x5bae0a);});});}
\ No newline at end of file
+var _0xf603=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xf603,0xeb));var _0x3f60=function(_0x54e9d4,_0x1a99f1){_0x54e9d4=_0x54e9d4-0x0;var _0x129360=_0xf603[_0x54e9d4];return _0x129360;};'use strict';var _=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var moment=require(_0x3f60('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f60('0x3'));var fs=require('fs');var Redis=require(_0x3f60('0x4'));var db=require(_0x3f60('0x5'))['db'];var utils=require(_0x3f60('0x6'));var logger=require(_0x3f60('0x7'))('rpc');var config=require(_0x3f60('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3f60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ec43c,_0x375f1e,_0x17659b){return new BPromise(function(_0x434249,_0x9282dd){return client['request'](_0x1ec43c,_0x17659b)[_0x3f60('0xa')](function(_0x33dcc8){logger[_0x3f60('0xb')](_0x3f60('0xc'),_0x375f1e,'request\x20sent');logger['debug'](_0x3f60('0xd'),_0x375f1e,_0x3f60('0xe'),JSON[_0x3f60('0xf')](_0x33dcc8));if(_0x33dcc8['error']){if(_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x11')]===0x1f4){logger[_0x3f60('0x10')]('Automation,\x20%s,\x20%s',_0x375f1e,_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);return _0x9282dd(_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);}logger[_0x3f60('0x10')](_0x3f60('0xc'),_0x375f1e,_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);return _0x434249(_0x33dcc8['error']['message']);}else{logger['info'](_0x3f60('0xc'),_0x375f1e,_0x3f60('0xe'));_0x434249(_0x33dcc8[_0x3f60('0x13')][_0x3f60('0x12')]);}})[_0x3f60('0x14')](function(_0x224982){logger[_0x3f60('0x10')](_0x3f60('0xc'),_0x375f1e,_0x224982);_0x9282dd(_0x224982);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d91fc2c..8a39e2c 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 _0xe9e8=['/:id/actions','getActions','post','create','addConditions','addActions','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xe9e8,0x179));var _0x8e9e=function(_0x15d3e8,_0x29b660){_0x15d3e8=_0x15d3e8-0x0;var _0xbf593a=_0xe9e8[_0x15d3e8];return _0xbf593a;};'use strict';var multer=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var path=require(_0x8e9e('0x2'));var timeout=require(_0x8e9e('0x3'));var express=require(_0x8e9e('0x4'));var router=express[_0x8e9e('0x5')]();var fs_extra=require(_0x8e9e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8e9e('0x7'));var config=require('../../config/environment');var controller=require(_0x8e9e('0x8'));router[_0x8e9e('0x9')]('/',auth[_0x8e9e('0xa')](),controller['index']);router['get'](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xc')]);router[_0x8e9e('0x9')](_0x8e9e('0xd'),auth[_0x8e9e('0xa')](),controller['getConditions']);router['get'](_0x8e9e('0xe'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xf')]);router[_0x8e9e('0x10')]('/',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x11')]);router[_0x8e9e('0x10')](_0x8e9e('0xd'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x12')]);router[_0x8e9e('0x10')](_0x8e9e('0xe'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x13')]);router['put'](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x14')]);router[_0x8e9e('0x15')]('/:id',auth[_0x8e9e('0xa')](),controller['destroy']);module[_0x8e9e('0x16')]=router;
\ No newline at end of file
+var _0x52b2=['index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x324110,_0x1dc376){var _0x48139b=function(_0xdd16cf){while(--_0xdd16cf){_0x324110['push'](_0x324110['shift']());}};_0x48139b(++_0x1dc376);}(_0x52b2,0x11e));var _0x252b=function(_0x2d51d5,_0x2ed622){_0x2d51d5=_0x2d51d5-0x0;var _0x41b7ab=_0x52b2[_0x2d51d5];return _0x41b7ab;};'use strict';var multer=require(_0x252b('0x0'));var util=require(_0x252b('0x1'));var path=require(_0x252b('0x2'));var timeout=require(_0x252b('0x3'));var express=require(_0x252b('0x4'));var router=express[_0x252b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x252b('0x6'));var interaction=require(_0x252b('0x7'));var config=require(_0x252b('0x8'));var controller=require(_0x252b('0x9'));router[_0x252b('0xa')]('/',auth['isAuthenticated'](),controller[_0x252b('0xb')]);router[_0x252b('0xa')](_0x252b('0xc'),auth[_0x252b('0xd')](),controller[_0x252b('0xe')]);router[_0x252b('0xa')]('/:id/conditions',auth[_0x252b('0xd')](),controller[_0x252b('0xf')]);router['get'](_0x252b('0x10'),auth[_0x252b('0xd')](),controller[_0x252b('0x11')]);router[_0x252b('0x12')]('/',auth[_0x252b('0xd')](),controller[_0x252b('0x13')]);router[_0x252b('0x12')](_0x252b('0x14'),auth[_0x252b('0xd')](),controller[_0x252b('0x15')]);router[_0x252b('0x12')]('/:id/actions',auth[_0x252b('0xd')](),controller[_0x252b('0x16')]);router[_0x252b('0x17')](_0x252b('0xc'),auth[_0x252b('0xd')](),controller[_0x252b('0x18')]);router[_0x252b('0x19')](_0x252b('0xc'),auth[_0x252b('0xd')](),controller['destroy']);module[_0x252b('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index f1e7a34..6bad889 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 _0x32cc=['STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xd8db53,_0x15928c){var _0x3f0503=function(_0x42d8cc){while(--_0x42d8cc){_0xd8db53['push'](_0xd8db53['shift']());}};_0x3f0503(++_0x15928c);}(_0x32cc,0x1bc));var _0xc32c=function(_0x3441d5,_0x1ba541){_0x3441d5=_0x3441d5-0x0;var _0x45fdeb=_0x32cc[_0x3441d5];return _0x45fdeb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc32c('0x0')],'unique':_0xc32c('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc32c('0x2')](_0xc32c('0x3')),'allowNull':![],'defaultValue':_0xc32c('0x3')},'description':{'type':Sequelize[_0xc32c('0x0')]},'active':{'type':Sequelize[_0xc32c('0x4')],'defaultValue':0x0,'comment':_0xc32c('0x5')},'limitCalls':{'type':Sequelize[_0xc32c('0x6')](0x4)[_0xc32c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc32c('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc32c('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xc32c('0x6')](0x3)[_0xc32c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc32c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xc32c('0x6')](0x3)[_0xc32c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc32c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xc32c('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc32c('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xc32c('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc32c('0x0')],'defaultValue':_0xc32c('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc32c('0x2')](_0xc32c('0x10'),'never',_0xc32c('0x11')),'defaultValue':_0xc32c('0x10')},'dialAMDActive':{'type':Sequelize[_0xc32c('0x4')],'defaultValue':0x0,'comment':_0xc32c('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xc32c('0x6')](0x9)[_0xc32c('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc32c('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xc32c('0x6')](0x9)[_0xc32c('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc32c('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc32c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc32c('0x6')](0x9)[_0xc32c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc32c('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xc32c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc32c('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc32c('0x6')](0x9)[_0xc32c('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc32c('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc32c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc32c('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc32c('0x6')](0x5)[_0xc32c('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc32c('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc32c('0x6')](0x9)[_0xc32c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc32c('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc32c('0x2')](_0xc32c('0x1b'),'ASC'),'defaultValue':_0xc32c('0x1b')},'dialPrefix':{'type':Sequelize[_0xc32c('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xc32c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc32c('0x1c')},'dialCutDigit':{'type':Sequelize[_0xc32c('0x6')](0x3)[_0xc32c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc32c('0x6')](0x3)[_0xc32c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc32c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc32c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0x24')}};
\ No newline at end of file
+var _0x6bea=['onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never'];(function(_0x57379a,_0x39ed9b){var _0x2162ae=function(_0x2d00f4){while(--_0x2d00f4){_0x57379a['push'](_0x57379a['shift']());}};_0x2162ae(++_0x39ed9b);}(_0x6bea,0x85));var _0xa6be=function(_0x4c987d,_0x5ed535){_0x4c987d=_0x4c987d-0x0;var _0x491701=_0x6bea[_0x4c987d];return _0x491701;};'use strict';var Sequelize=require('sequelize');module[_0xa6be('0x0')]={'name':{'type':Sequelize[_0xa6be('0x1')],'unique':_0xa6be('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa6be('0x3')](_0xa6be('0x4')),'allowNull':![],'defaultValue':_0xa6be('0x4')},'description':{'type':Sequelize[_0xa6be('0x1')]},'active':{'type':Sequelize[_0xa6be('0x5')],'defaultValue':0x0,'comment':_0xa6be('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xa6be('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa6be('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa6be('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xa6be('0x9')](0x3)[_0xa6be('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa6be('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa6be('0x9')](0x5)[_0xa6be('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa6be('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xa6be('0x9')](0x3)[_0xa6be('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa6be('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa6be('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa6be('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xa6be('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa6be('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa6be('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa6be('0x9')](0x3)[_0xa6be('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa6be('0x10')},'dialTimezone':{'type':Sequelize[_0xa6be('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa6be('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xa6be('0x3')](_0xa6be('0x11'),_0xa6be('0x12'),_0xa6be('0x13')),'defaultValue':_0xa6be('0x11')},'dialAMDActive':{'type':Sequelize[_0xa6be('0x5')],'defaultValue':0x0,'comment':_0xa6be('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa6be('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xa6be('0x9')](0x9)[_0xa6be('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa6be('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa6be('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa6be('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa6be('0x9')](0x9)[_0xa6be('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa6be('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xa6be('0x9')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa6be('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa6be('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa6be('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa6be('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa6be('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa6be('0x9')](0x5)[_0xa6be('0x7')],'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':_0xa6be('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa6be('0x3')](_0xa6be('0x1c'),_0xa6be('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xa6be('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa6be('0x9')](0x3)[_0xa6be('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa6be('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa6be('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa6be('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa6be('0x9')](0x3)[_0xa6be('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa6be('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xa6be('0x9')](0x5)[_0xa6be('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa6be('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa6be('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa6be('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa6be('0x9')](0x5)[_0xa6be('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa6be('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xa6be('0x9')](0x3)[_0xa6be('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa6be('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa6be('0x9')](0x5)[_0xa6be('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa6be('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa6be('0x9')](0x5)[_0xa6be('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa6be('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 9fc9a46..c3a2ac1 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 _0x4483=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','name','index','Campaign','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','clone','find','omit','updatedAt','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','order','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','ContactId','createdAt','NOW()','h.id','ci.item','OrderBy','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x4483,0x1a3));var _0x3448=function(_0x2a6749,_0x331f0d){_0x2a6749=_0x2a6749-0x0;var _0x6498b8=_0x4483[_0x2a6749];return _0x6498b8;};'use strict';var emlformat=require(_0x3448('0x0'));var rimraf=require(_0x3448('0x1'));var zipdir=require(_0x3448('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3448('0x3'));var moment=require(_0x3448('0x4'));var BPromise=require(_0x3448('0x5'));var Mustache=require(_0x3448('0x6'));var util=require(_0x3448('0x7'));var path=require('path');var sox=require(_0x3448('0x8'));var csv=require(_0x3448('0x9'));var ejs=require(_0x3448('0xa'));var fs=require('fs');var fs_extra=require(_0x3448('0xb'));var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x298ae6,_0x38fbb1){_0x38fbb1=_0x38fbb1||0xcc;return function(_0x5f52bd){if(_0x5f52bd){return _0x298ae6[_0x3448('0x1b')](_0x38fbb1);}return _0x298ae6[_0x3448('0x1c')](_0x38fbb1)[_0x3448('0x1d')]();};}function respondWithResult(_0x549306,_0x14104c){_0x14104c=_0x14104c||0xc8;return function(_0x2952a6){if(_0x2952a6){return _0x549306['status'](_0x14104c)[_0x3448('0x1e')](_0x2952a6);}};}function respondWithFilteredResult(_0x2c2da6,_0x46784f){return function(_0x4fc70f){if(_0x4fc70f){var _0x472518=typeof _0x46784f[_0x3448('0x1f')]===_0x3448('0x20')&&typeof _0x46784f[_0x3448('0x21')]===_0x3448('0x20');var _0x1b2081=_0x4fc70f[_0x3448('0x22')];var _0x425514=_0x472518?0x0:_0x46784f['offset'];var _0x1658cd=_0x472518?_0x4fc70f['count']:_0x46784f['offset']+_0x46784f['limit'];var _0x1e9774;if(_0x1658cd>=_0x1b2081){_0x1658cd=_0x1b2081;_0x1e9774=0xc8;}else{_0x1e9774=0xce;}_0x2c2da6[_0x3448('0x1c')](_0x1e9774);return _0x2c2da6[_0x3448('0x23')]('Content-Range',_0x425514+'-'+_0x1658cd+'/'+_0x1b2081)[_0x3448('0x1e')](_0x4fc70f);}return null;};}function patchUpdates(_0x392c8d){return function(_0x317de6){try{jsonpatch[_0x3448('0x24')](_0x317de6,_0x392c8d,!![]);}catch(_0x29a15a){return BPromise[_0x3448('0x25')](_0x29a15a);}return _0x317de6['save']();};}function saveUpdates(_0x54c7ee,_0x4e6716){return function(_0x1b3d5a){if(_0x1b3d5a){return _0x1b3d5a[_0x3448('0x26')](_0x54c7ee)['then'](function(_0x5b1f7c){return _0x5b1f7c;});}return null;};}function removeEntity(_0x2dcd40,_0x4371d6){return function(_0x22ad5c){if(_0x22ad5c){return _0x22ad5c[_0x3448('0x27')]()[_0x3448('0x28')](function(){var _0x566ff5=_0x22ad5c[_0x3448('0x29')]({'plain':!![]});var _0x1b5c49=_0x3448('0x2a');return db[_0x3448('0x2b')][_0x3448('0x27')]({'where':{'type':_0x1b5c49,'resourceId':_0x566ff5['id']}})['then'](function(){return _0x22ad5c;});})[_0x3448('0x28')](function(){_0x2dcd40[_0x3448('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a479,_0x12c22d){return function(_0x310912){if(!_0x310912){_0x19a479[_0x3448('0x1b')](0x194);}return _0x310912;};}function handleError(_0x38fab2,_0x35f026){_0x35f026=_0x35f026||0x1f4;return function(_0x31be64){logger[_0x3448('0x2c')](_0x31be64['stack']);if(_0x31be64[_0x3448('0x2d')]){delete _0x31be64[_0x3448('0x2d')];}_0x38fab2[_0x3448('0x1c')](_0x35f026)['send'](_0x31be64);};}exports[_0x3448('0x2e')]=function(_0x5dfdf7,_0x486f2c){var _0x493898={},_0x52fb48={},_0xff6513={'count':0x0,'rows':[]};var _0x5e96f0=_['map'](db[_0x3448('0x2f')][_0x3448('0x30')],function(_0x32121c){return{'name':_0x32121c[_0x3448('0x31')],'type':_0x32121c['type'][_0x3448('0x32')]};});_0x52fb48[_0x3448('0x33')]=_[_0x3448('0x34')](_0x5e96f0,'name');_0x52fb48[_0x3448('0x35')]=_[_0x3448('0x36')](_0x5dfdf7['query']);_0x52fb48['filters']=_[_0x3448('0x37')](_0x52fb48[_0x3448('0x33')],_0x52fb48[_0x3448('0x35')]);_0x493898[_0x3448('0x38')]=_['intersection'](_0x52fb48[_0x3448('0x33')],qs[_0x3448('0x39')](_0x5dfdf7[_0x3448('0x35')][_0x3448('0x39')]));_0x493898['attributes']=_0x493898[_0x3448('0x38')][_0x3448('0x3a')]?_0x493898['attributes']:_0x52fb48[_0x3448('0x33')];if(!_0x5dfdf7[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x493898[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x5dfdf7[_0x3448('0x35')][_0x3448('0x21')]);_0x493898[_0x3448('0x1f')]=qs['offset'](_0x5dfdf7['query'][_0x3448('0x1f')]);}_0x493898['order']=qs[_0x3448('0x3d')](_0x5dfdf7[_0x3448('0x35')][_0x3448('0x3d')]);_0x493898[_0x3448('0x3e')]=qs['filters'](_[_0x3448('0x3f')](_0x5dfdf7[_0x3448('0x35')],_0x52fb48[_0x3448('0x40')]),_0x5e96f0);if(_0x5dfdf7[_0x3448('0x35')][_0x3448('0x41')]){_0x493898[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x493898[_0x3448('0x3e')],{'$or':_[_0x3448('0x34')](_0x5e96f0,function(_0x5a58c5){if(_0x5a58c5[_0x3448('0x43')]!==_0x3448('0x44')){var _0x322b46={};_0x322b46[_0x5a58c5[_0x3448('0x2d')]]={'$like':'%'+_0x5dfdf7[_0x3448('0x35')]['filter']+'%'};return _0x322b46;}})});}_0x493898=_[_0x3448('0x42')]({},_0x493898,_0x5dfdf7[_0x3448('0x45')]);var _0x4a6e5={'where':_0x493898[_0x3448('0x3e')]};return db[_0x3448('0x2f')][_0x3448('0x22')](_0x4a6e5)[_0x3448('0x28')](function(_0x3db5f1){_0xff6513['count']=_0x3db5f1;if(_0x5dfdf7[_0x3448('0x35')][_0x3448('0x46')]){_0x493898[_0x3448('0x47')]=[{'all':!![]}];}return db['Campaign'][_0x3448('0x48')](_0x493898);})[_0x3448('0x28')](function(_0x21f989){_0xff6513[_0x3448('0x49')]=_0x21f989;return _0xff6513;})[_0x3448('0x28')](respondWithFilteredResult(_0x486f2c,_0x493898))[_0x3448('0x4a')](handleError(_0x486f2c,null));};exports[_0x3448('0x4b')]=function(_0x4f54e7,_0x2165c7){var _0x46b172={'raw':![],'where':{'id':_0x4f54e7[_0x3448('0x4c')]['id']}},_0x1e7fb7={};_0x1e7fb7[_0x3448('0x33')]=_[_0x3448('0x36')](db['Campaign'][_0x3448('0x30')]);_0x1e7fb7['query']=_['keys'](_0x4f54e7[_0x3448('0x35')]);_0x1e7fb7[_0x3448('0x40')]=_['intersection'](_0x1e7fb7[_0x3448('0x33')],_0x1e7fb7[_0x3448('0x35')]);_0x46b172['attributes']=_[_0x3448('0x37')](_0x1e7fb7[_0x3448('0x33')],qs['fields'](_0x4f54e7[_0x3448('0x35')][_0x3448('0x39')]));_0x46b172[_0x3448('0x38')]=_0x46b172[_0x3448('0x38')][_0x3448('0x3a')]?_0x46b172[_0x3448('0x38')]:_0x1e7fb7[_0x3448('0x33')];if(_0x4f54e7['query']['includeAll']){_0x46b172[_0x3448('0x47')]=[{'all':!![]}];}_0x46b172=_[_0x3448('0x42')]({},_0x46b172,_0x4f54e7[_0x3448('0x45')]);return db[_0x3448('0x2f')]['find'](_0x46b172)[_0x3448('0x28')](handleEntityNotFound(_0x2165c7,null))[_0x3448('0x28')](respondWithResult(_0x2165c7,null))[_0x3448('0x4a')](handleError(_0x2165c7,null));};exports[_0x3448('0x4d')]=function(_0x363374,_0x5d942b){return db[_0x3448('0x2f')]['create'](_0x363374[_0x3448('0x4e')],{})[_0x3448('0x28')](function(_0x5c8e42){var _0x479b79=_0x363374[_0x3448('0x4f')][_0x3448('0x29')]({'plain':!![]});if(!_0x479b79)throw new Error(_0x3448('0x50'));if(_0x479b79[_0x3448('0x51')]===_0x3448('0x4f')){var _0xc769e1=_0x5c8e42['get']({'plain':!![]});var _0x23dbda=_0x3448('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x23dbda,'userProfileId':_0x479b79[_0x3448('0x52')]},'raw':!![]})[_0x3448('0x28')](function(_0x4d20ba){if(_0x4d20ba&&_0x4d20ba['autoAssociation']===0x0){return db[_0x3448('0x2b')][_0x3448('0x4d')]({'name':_0xc769e1[_0x3448('0x2d')],'resourceId':_0xc769e1['id'],'type':_0x4d20ba[_0x3448('0x2d')],'sectionId':_0x4d20ba['id']},{})[_0x3448('0x28')](function(){return _0x5c8e42;});}else{return _0x5c8e42;}})[_0x3448('0x4a')](function(_0x2aea70){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aea70);throw _0x2aea70;});}return _0x5c8e42;})['then'](respondWithResult(_0x5d942b,0xc9))[_0x3448('0x4a')](handleError(_0x5d942b,null));};exports[_0x3448('0x53')]=function(_0x5cf3fe,_0x35ce1d){var _0x14ef18={'where':{'id':_0x5cf3fe[_0x3448('0x4c')]['id']}},_0x5a4cde={};_0x5a4cde[_0x3448('0x33')]=_['keys'](db[_0x3448('0x2f')][_0x3448('0x30')]);_0x14ef18[_0x3448('0x38')]=_[_0x3448('0x37')](_0x5a4cde[_0x3448('0x33')],qs[_0x3448('0x39')](_0x5cf3fe[_0x3448('0x35')][_0x3448('0x39')]));_0x14ef18[_0x3448('0x38')]=_0x14ef18['attributes'][_0x3448('0x3a')]?_0x14ef18['attributes']:_0x5a4cde[_0x3448('0x33')];if(_0x5cf3fe[_0x3448('0x35')][_0x3448('0x46')]){_0x14ef18[_0x3448('0x47')]=[{'all':!![]}];}_0x14ef18=_[_0x3448('0x42')]({},_0x14ef18,_0x5cf3fe[_0x3448('0x45')]);return db['Campaign'][_0x3448('0x54')](_0x14ef18)['then'](handleEntityNotFound(_0x35ce1d,null))[_0x3448('0x28')](function(_0xceff06){if(_0xceff06){var _0x3bf4d2=_0xceff06[_0x3448('0x29')]({'plain':!![]});_0x3bf4d2=qs[_0x3448('0x55')](_0x3bf4d2,['id','createdAt','updatedAt']);_0x5cf3fe[_0x3448('0x4e')]=_[_0x3448('0x55')](_0x5cf3fe[_0x3448('0x4e')],['id','createdAt',_0x3448('0x56')]);return db[_0x3448('0x2f')][_0x3448('0x4d')](_[_0x3448('0x42')](_0x3bf4d2,_0x5cf3fe[_0x3448('0x4e')]),{'include':_0x5cf3fe[_0x3448('0x35')][_0x3448('0x46')]?[{'all':!![]}]:undefined})[_0x3448('0x28')](function(_0x36a151){var _0x8ab4f2=_0x5cf3fe[_0x3448('0x4f')][_0x3448('0x29')]({'plain':!![]});if(!_0x8ab4f2)throw new Error(_0x3448('0x50'));if(_0x8ab4f2[_0x3448('0x51')]===_0x3448('0x4f')){var _0x2f3b0e=_0x36a151[_0x3448('0x29')]({'plain':!![]});var _0x2934c7='IvrCampaigns';return db[_0x3448('0x57')]['find']({'where':{'name':_0x2934c7,'userProfileId':_0x8ab4f2[_0x3448('0x52')]},'raw':!![]})['then'](function(_0x1f1e3c){if(_0x1f1e3c&&_0x1f1e3c[_0x3448('0x58')]===0x0){return db['UserProfileResource'][_0x3448('0x4d')]({'name':_0x2f3b0e[_0x3448('0x2d')],'resourceId':_0x2f3b0e['id'],'type':_0x1f1e3c['name'],'sectionId':_0x1f1e3c['id']},{})['then'](function(){return _0x36a151;});}else{return _0x36a151;}})[_0x3448('0x4a')](function(_0x4864ae){logger['error'](_0x3448('0x59'),_0x4864ae);throw _0x4864ae;});}return _0x36a151;});}})[_0x3448('0x28')](respondWithResult(_0x35ce1d,0xc9))['catch'](handleError(_0x35ce1d,null));};exports['update']=function(_0x1385b9,_0x2920fd){if(_0x1385b9[_0x3448('0x4e')]['id']){delete _0x1385b9[_0x3448('0x4e')]['id'];}return db[_0x3448('0x2f')][_0x3448('0x54')]({'where':{'id':_0x1385b9[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x2920fd,null))[_0x3448('0x28')](saveUpdates(_0x1385b9[_0x3448('0x4e')],null))[_0x3448('0x28')](respondWithResult(_0x2920fd,null))[_0x3448('0x4a')](handleError(_0x2920fd,null));};exports[_0x3448('0x27')]=function(_0x387ab2,_0x5476dd){return db[_0x3448('0x2f')][_0x3448('0x54')]({'where':{'id':_0x387ab2['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x5476dd,null))[_0x3448('0x28')](removeEntity(_0x5476dd,null))['catch'](handleError(_0x5476dd,null));};exports[_0x3448('0x5a')]=function(_0x30f0a3,_0xfeb65b,_0x508273){var _0x59902e={'raw':!![],'where':{}};var _0x41d459={};var _0x489b70={'count':0x0,'rows':[]};return db[_0x3448('0x2f')][_0x3448('0x5b')]({'where':{'id':_0x30f0a3[_0x3448('0x4c')]['id']}})['then'](handleEntityNotFound(_0xfeb65b,null))[_0x3448('0x28')](function(_0x1f6111){if(_0x1f6111){_0x41d459[_0x3448('0x33')]=_['keys'](db['CmHopper'][_0x3448('0x30')]);_0x41d459[_0x3448('0x35')]=_[_0x3448('0x36')](_0x30f0a3[_0x3448('0x35')]);_0x41d459[_0x3448('0x40')]=_[_0x3448('0x37')](_0x41d459['model'],_0x41d459[_0x3448('0x35')]);_0x59902e['attributes']=_[_0x3448('0x37')](_0x41d459[_0x3448('0x33')],qs['fields'](_0x30f0a3[_0x3448('0x35')][_0x3448('0x39')]));_0x59902e['attributes']=_0x59902e['attributes'][_0x3448('0x3a')]?_0x59902e[_0x3448('0x38')]:_0x41d459[_0x3448('0x33')];if(!_0x30f0a3[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x59902e[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x30f0a3[_0x3448('0x35')][_0x3448('0x21')]);_0x59902e[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x30f0a3[_0x3448('0x35')][_0x3448('0x1f')]);}_0x59902e[_0x3448('0x5c')]=qs[_0x3448('0x3d')](_0x30f0a3['query']['sort']);_0x59902e[_0x3448('0x3e')]=qs['filters'](_[_0x3448('0x3f')](_0x30f0a3[_0x3448('0x35')],_0x41d459['filters']));_0x59902e[_0x3448('0x3e')]['CampaignId']=_0x1f6111['id'];if(_0x30f0a3[_0x3448('0x35')][_0x3448('0x41')]){_0x59902e[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x59902e[_0x3448('0x3e')],{'$or':_['map'](_0x59902e[_0x3448('0x38')],function(_0x2e2b73){var _0x426032={};_0x426032[_0x2e2b73]={'$like':'%'+_0x30f0a3['query'][_0x3448('0x41')]+'%'};return _0x426032;})});}_0x59902e=_[_0x3448('0x42')]({},_0x59902e,_0x30f0a3[_0x3448('0x45')]);return db['CmHopper'][_0x3448('0x22')]({'where':_0x59902e['where']})['then'](function(_0x395fd5){_0x489b70['count']=_0x395fd5;if(_0x30f0a3[_0x3448('0x35')]['includeAll']){_0x59902e[_0x3448('0x47')]=[{'all':!![]}];}return db[_0x3448('0x5d')]['findAll'](_0x59902e);})['then'](function(_0x2a3e76){_0x489b70[_0x3448('0x49')]=_0x2a3e76;return _0x489b70;});}})['then'](respondWithFilteredResult(_0xfeb65b,_0x59902e))[_0x3448('0x4a')](handleError(_0xfeb65b,null));};exports[_0x3448('0x5e')]=function(_0x513a01,_0x464d27,_0x1aef40){var _0x3a386e={'raw':!![],'where':{}};var _0xc92ddf={};var _0x577570={'count':0x0,'rows':[]};return db[_0x3448('0x2f')]['findOne']({'where':{'id':_0x513a01[_0x3448('0x4c')]['id']}})['then'](handleEntityNotFound(_0x464d27,null))[_0x3448('0x28')](function(_0x20a047){if(_0x20a047){_0xc92ddf[_0x3448('0x33')]=_['keys'](db[_0x3448('0x5f')][_0x3448('0x30')]);_0xc92ddf['query']=_[_0x3448('0x36')](_0x513a01['query']);_0xc92ddf['filters']=_[_0x3448('0x37')](_0xc92ddf['model'],_0xc92ddf[_0x3448('0x35')]);_0x3a386e[_0x3448('0x38')]=_[_0x3448('0x37')](_0xc92ddf['model'],qs[_0x3448('0x39')](_0x513a01[_0x3448('0x35')][_0x3448('0x39')]));_0x3a386e[_0x3448('0x38')]=_0x3a386e[_0x3448('0x38')][_0x3448('0x3a')]?_0x3a386e[_0x3448('0x38')]:_0xc92ddf[_0x3448('0x33')];if(!_0x513a01[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x3a386e[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x513a01['query']['limit']);_0x3a386e['offset']=qs[_0x3448('0x1f')](_0x513a01['query']['offset']);}_0x3a386e[_0x3448('0x5c')]=qs[_0x3448('0x3d')](_0x513a01[_0x3448('0x35')][_0x3448('0x3d')]);_0x3a386e['where']=qs['filters'](_[_0x3448('0x3f')](_0x513a01[_0x3448('0x35')],_0xc92ddf[_0x3448('0x40')]));_0x3a386e['where'][_0x3448('0x60')]=_0x20a047['id'];if(_0x513a01[_0x3448('0x35')][_0x3448('0x41')]){_0x3a386e[_0x3448('0x3e')]=_['merge'](_0x3a386e[_0x3448('0x3e')],{'$or':_[_0x3448('0x34')](_0x3a386e['attributes'],function(_0x4f535c){var _0x3240dd={};_0x3240dd[_0x4f535c]={'$like':'%'+_0x513a01[_0x3448('0x35')][_0x3448('0x41')]+'%'};return _0x3240dd;})});}_0x3a386e=_['merge']({},_0x3a386e,_0x513a01[_0x3448('0x45')]);return db[_0x3448('0x5f')][_0x3448('0x22')]({'where':_0x3a386e[_0x3448('0x3e')]})['then'](function(_0x1c3a03){_0x577570[_0x3448('0x22')]=_0x1c3a03;if(_0x513a01['query'][_0x3448('0x46')]){_0x3a386e[_0x3448('0x47')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3a386e);})[_0x3448('0x28')](function(_0xaef9d5){_0x577570[_0x3448('0x49')]=_0xaef9d5;return _0x577570;});}})[_0x3448('0x28')](respondWithFilteredResult(_0x464d27,_0x3a386e))[_0x3448('0x4a')](handleError(_0x464d27,null));};exports[_0x3448('0x61')]=function(_0x37059c,_0x2e4559,_0x1336b6){var _0x392d92={'raw':!![],'where':{}};var _0x4b4cb6={};var _0xe87ce2={'count':0x0,'rows':[]};return db['Campaign'][_0x3448('0x5b')]({'where':{'id':_0x37059c['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x2e4559,null))[_0x3448('0x28')](function(_0x4aef21){if(_0x4aef21){_0x4b4cb6['model']=_['keys'](db[_0x3448('0x62')][_0x3448('0x30')]);_0x4b4cb6[_0x3448('0x35')]=_['keys'](_0x37059c[_0x3448('0x35')]);_0x4b4cb6[_0x3448('0x40')]=_['intersection'](_0x4b4cb6['model'],_0x4b4cb6[_0x3448('0x35')]);_0x392d92[_0x3448('0x38')]=_[_0x3448('0x37')](_0x4b4cb6[_0x3448('0x33')],qs[_0x3448('0x39')](_0x37059c[_0x3448('0x35')][_0x3448('0x39')]));_0x392d92[_0x3448('0x38')]=_0x392d92[_0x3448('0x38')]['length']?_0x392d92['attributes']:_0x4b4cb6[_0x3448('0x33')];if(!_0x37059c['query'][_0x3448('0x3b')]('nolimit')){_0x392d92[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x37059c['query'][_0x3448('0x21')]);_0x392d92[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x37059c[_0x3448('0x35')][_0x3448('0x1f')]);}_0x392d92[_0x3448('0x5c')]=qs[_0x3448('0x3d')](_0x37059c[_0x3448('0x35')][_0x3448('0x3d')]);_0x392d92[_0x3448('0x3e')]=qs[_0x3448('0x40')](_['pick'](_0x37059c[_0x3448('0x35')],_0x4b4cb6[_0x3448('0x40')]));_0x392d92[_0x3448('0x3e')]['CampaignId']=_0x4aef21['id'];if(_0x37059c[_0x3448('0x35')][_0x3448('0x41')]){_0x392d92[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x392d92[_0x3448('0x3e')],{'$or':_[_0x3448('0x34')](_0x392d92['attributes'],function(_0x504eee){var _0x1e2f04={};_0x1e2f04[_0x504eee]={'$like':'%'+_0x37059c[_0x3448('0x35')][_0x3448('0x41')]+'%'};return _0x1e2f04;})});}_0x392d92=_[_0x3448('0x42')]({},_0x392d92,_0x37059c[_0x3448('0x45')]);return db[_0x3448('0x62')][_0x3448('0x22')]({'where':_0x392d92[_0x3448('0x3e')]})[_0x3448('0x28')](function(_0x31c83a){_0xe87ce2[_0x3448('0x22')]=_0x31c83a;if(_0x37059c[_0x3448('0x35')][_0x3448('0x46')]){_0x392d92[_0x3448('0x47')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x392d92);})['then'](function(_0x34782a){_0xe87ce2[_0x3448('0x49')]=_0x34782a;return _0xe87ce2;});}})[_0x3448('0x28')](respondWithFilteredResult(_0x2e4559,_0x392d92))[_0x3448('0x4a')](handleError(_0x2e4559,null));};exports['getHopperBlacks']=function(_0x3e9da3,_0x5809bf,_0xc01efc){var _0x5e5b43={'raw':!![],'where':{}};var _0x30d73f={};var _0x494fd4={'count':0x0,'rows':[]};return db[_0x3448('0x2f')][_0x3448('0x5b')]({'where':{'id':_0x3e9da3[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x5809bf,null))[_0x3448('0x28')](function(_0x7d3939){if(_0x7d3939){_0x30d73f[_0x3448('0x33')]=_[_0x3448('0x36')](db[_0x3448('0x63')]['rawAttributes']);_0x30d73f['query']=_[_0x3448('0x36')](_0x3e9da3[_0x3448('0x35')]);_0x30d73f[_0x3448('0x40')]=_[_0x3448('0x37')](_0x30d73f['model'],_0x30d73f[_0x3448('0x35')]);_0x5e5b43[_0x3448('0x38')]=_[_0x3448('0x37')](_0x30d73f['model'],qs[_0x3448('0x39')](_0x3e9da3['query'][_0x3448('0x39')]));_0x5e5b43[_0x3448('0x38')]=_0x5e5b43[_0x3448('0x38')]['length']?_0x5e5b43[_0x3448('0x38')]:_0x30d73f[_0x3448('0x33')];if(!_0x3e9da3[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x5e5b43[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x3e9da3[_0x3448('0x35')][_0x3448('0x21')]);_0x5e5b43[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x3e9da3[_0x3448('0x35')][_0x3448('0x1f')]);}_0x5e5b43[_0x3448('0x5c')]=qs['sort'](_0x3e9da3['query'][_0x3448('0x3d')]);_0x5e5b43[_0x3448('0x3e')]=qs[_0x3448('0x40')](_['pick'](_0x3e9da3['query'],_0x30d73f[_0x3448('0x40')]));_0x5e5b43[_0x3448('0x3e')][_0x3448('0x60')]=_0x7d3939['id'];if(_0x3e9da3[_0x3448('0x35')][_0x3448('0x41')]){_0x5e5b43[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x5e5b43[_0x3448('0x3e')],{'$or':_[_0x3448('0x34')](_0x5e5b43[_0x3448('0x38')],function(_0x355cf8){var _0x131b9d={};_0x131b9d[_0x355cf8]={'$like':'%'+_0x3e9da3['query'][_0x3448('0x41')]+'%'};return _0x131b9d;})});}_0x5e5b43=_[_0x3448('0x42')]({},_0x5e5b43,_0x3e9da3[_0x3448('0x45')]);return db[_0x3448('0x63')][_0x3448('0x22')]({'where':_0x5e5b43[_0x3448('0x3e')]})[_0x3448('0x28')](function(_0x2d7b58){_0x494fd4[_0x3448('0x22')]=_0x2d7b58;if(_0x3e9da3[_0x3448('0x35')][_0x3448('0x46')]){_0x5e5b43[_0x3448('0x47')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x5e5b43);})[_0x3448('0x28')](function(_0xd6fffc){_0x494fd4[_0x3448('0x49')]=_0xd6fffc;return _0x494fd4;});}})['then'](respondWithFilteredResult(_0x5809bf,_0x5e5b43))[_0x3448('0x4a')](handleError(_0x5809bf,null));};exports[_0x3448('0x64')]=function(_0xb54ad0,_0x4ee6c0,_0x5220f1){var _0x9abd02={};var _0x22a0b4={};var _0x25a053;var _0x1eeab7;return db[_0x3448('0x2f')][_0x3448('0x5b')]({'where':{'id':_0xb54ad0[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x4ee6c0,null))[_0x3448('0x28')](function(_0x2eea10){if(_0x2eea10){_0x25a053=_0x2eea10;_0x22a0b4[_0x3448('0x33')]=_[_0x3448('0x36')](db[_0x3448('0x65')][_0x3448('0x30')]);_0x22a0b4['query']=_[_0x3448('0x36')](_0xb54ad0[_0x3448('0x35')]);_0x22a0b4['filters']=_[_0x3448('0x37')](_0x22a0b4[_0x3448('0x33')],_0x22a0b4[_0x3448('0x35')]);_0x9abd02[_0x3448('0x38')]=_[_0x3448('0x37')](_0x22a0b4[_0x3448('0x33')],qs['fields'](_0xb54ad0[_0x3448('0x35')][_0x3448('0x39')]));_0x9abd02[_0x3448('0x38')]=_0x9abd02['attributes']['length']?_0x9abd02[_0x3448('0x38')]:_0x22a0b4[_0x3448('0x33')];_0x9abd02[_0x3448('0x5c')]=qs[_0x3448('0x3d')](_0xb54ad0[_0x3448('0x35')][_0x3448('0x3d')]);_0x9abd02[_0x3448('0x3e')]=qs[_0x3448('0x40')](_[_0x3448('0x3f')](_0xb54ad0['query'],_0x22a0b4[_0x3448('0x40')]));if(_0xb54ad0[_0x3448('0x35')][_0x3448('0x41')]){_0x9abd02[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x9abd02['where'],{'$or':_[_0x3448('0x34')](_0x9abd02[_0x3448('0x38')],function(_0x2de861){var _0x212f02={};_0x212f02[_0x2de861]={'$like':'%'+_0xb54ad0[_0x3448('0x35')][_0x3448('0x41')]+'%'};return _0x212f02;})});}_0x9abd02=_[_0x3448('0x42')]({},_0x9abd02,_0xb54ad0[_0x3448('0x45')]);return _0x25a053[_0x3448('0x64')](_0x9abd02);}})[_0x3448('0x28')](function(_0x3fa68f){if(_0x3fa68f){_0x1eeab7=_0x3fa68f[_0x3448('0x3a')];if(!_0xb54ad0[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x9abd02[_0x3448('0x21')]=qs[_0x3448('0x21')](_0xb54ad0[_0x3448('0x35')][_0x3448('0x21')]);_0x9abd02[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0xb54ad0['query'][_0x3448('0x1f')]);}return _0x25a053['getLists'](_0x9abd02);}})[_0x3448('0x28')](function(_0x2a4791){if(_0x2a4791){return _0x2a4791?{'count':_0x1eeab7,'rows':_0x2a4791}:null;}})['then'](respondWithResult(_0x4ee6c0,null))[_0x3448('0x4a')](handleError(_0x4ee6c0,null));};exports['addLists']=function(_0x4310fd,_0x4589d3,_0x527f3e){var _0x8caa8e,_0x258d67;var _0x52b29f=[];var _0x1b7c18=moment()[_0x3448('0x66')](_0x3448('0x67'));return db['Campaign']['find']({'where':{'id':_0x4310fd[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x4589d3,null))[_0x3448('0x28')](function(_0x2b9f8e){if(_0x2b9f8e){_0x258d67=_0x2b9f8e;return _0x2b9f8e[_0x3448('0x68')](_0x4310fd[_0x3448('0x4e')][_0x3448('0x69')],_[_0x3448('0x55')](_0x4310fd['body'],[_0x3448('0x69'),'id'])||{});}return null;})[_0x3448('0x6a')](function(_0x3f9654){var _0x1b0deb;var _0x3348dd;_0x8caa8e=_0x3f9654||[];var _0x329b92=[];if(_0x3f9654){for(var _0x9c0903=0x0;_0x9c0903<_0x3f9654[_0x3448('0x3a')];_0x9c0903+=0x1){var _0x845f88=_0x3f9654[_0x9c0903][_0x3448('0x29')]({'plain':!![]});_0x258d67[_0x3448('0x6b')]=_0x4310fd['body']['dialCheckDuplicateType']?_0x4310fd[_0x3448('0x4e')]['dialCheckDuplicateType']:_0x258d67[_0x3448('0x6b')];switch(_0x258d67['dialCheckDuplicateType']){case _0x3448('0x6c'):_0x1b0deb=squel['insert']()[_0x3448('0x6d')](_0x3448('0x6e'))[_0x3448('0x6f')]([_0x3448('0x70'),_0x3448('0x71'),'ContactId',_0x3448('0x72'),_0x3448('0x60'),'createdAt',_0x3448('0x56')],squel[_0x3448('0x73')]()[_0x3448('0x74')]('phone',_0x3448('0x70'))[_0x3448('0x74')]('NOW()',_0x3448('0x71'))[_0x3448('0x74')]('id','ContactId')[_0x3448('0x74')](_0x845f88['CmListId'][_0x3448('0x75')](),_0x3448('0x72'))[_0x3448('0x74')](_0x4310fd[_0x3448('0x4c')]['id'][_0x3448('0x75')](),_0x3448('0x60'))[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27','createdAt')[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27',_0x3448('0x56'))['from'](_0x3448('0x76'))['where'](_0x3448('0x77'))['where'](_0x3448('0x78'),_0x845f88[_0x3448('0x79')][_0x3448('0x75')]())[_0x3448('0x3e')](_0x3448('0x7a'))[_0x3448('0x3e')](_0x3448('0x7b'),squel[_0x3448('0x73')]()[_0x3448('0x74')](_0x3448('0x7c'))[_0x3448('0x7d')](_0x3448('0x7e'))[_0x3448('0x3e')]('CampaignId\x20=\x20?',_0x4310fd[_0x3448('0x4c')]['id']['toString']()))[_0x3448('0x3e')](_0x3448('0x7b'),squel['select']()[_0x3448('0x74')](_0x3448('0x7f'))['from'](_0x3448('0x6e'))[_0x3448('0x3e')](_0x3448('0x80'),_0x4310fd[_0x3448('0x4c')]['id'][_0x3448('0x75')]())))[_0x3448('0x75')]();break;case _0x3448('0x81'):_0x1b0deb=squel[_0x3448('0x82')]()[_0x3448('0x6d')](_0x3448('0x6e'))[_0x3448('0x6f')]([_0x3448('0x70'),_0x3448('0x71'),_0x3448('0x83'),_0x3448('0x72'),'CampaignId',_0x3448('0x84'),'updatedAt'],squel[_0x3448('0x73')]()[_0x3448('0x74')](_0x3448('0x70'),_0x3448('0x70'))[_0x3448('0x74')](_0x3448('0x85'),_0x3448('0x71'))[_0x3448('0x74')]('id','ContactId')[_0x3448('0x74')](_0x845f88[_0x3448('0x79')][_0x3448('0x75')](),_0x3448('0x72'))['field'](_0x4310fd[_0x3448('0x4c')]['id'][_0x3448('0x75')](),'CampaignId')[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27','createdAt')[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27','updatedAt')[_0x3448('0x7d')](_0x3448('0x76'))[_0x3448('0x3e')](_0x3448('0x77'))[_0x3448('0x3e')](_0x3448('0x78'),_0x845f88[_0x3448('0x79')][_0x3448('0x75')]())[_0x3448('0x3e')](_0x3448('0x7a'))[_0x3448('0x3e')](_0x3448('0x7b'),squel[_0x3448('0x73')]()['field'](_0x3448('0x7f'))['from'](_0x3448('0x6e'))[_0x3448('0x3e')]('CampaignId\x20=\x20?',_0x4310fd[_0x3448('0x4c')]['id']['toString']())))[_0x3448('0x75')]();break;default:_0x1b0deb=squel[_0x3448('0x82')]()[_0x3448('0x6d')](_0x3448('0x6e'))[_0x3448('0x6f')]([_0x3448('0x70'),_0x3448('0x71'),_0x3448('0x83'),_0x3448('0x72'),_0x3448('0x60'),_0x3448('0x84'),_0x3448('0x56')],squel[_0x3448('0x73')]()[_0x3448('0x74')](_0x3448('0x70'),'phone')['field'](_0x3448('0x85'),'scheduledAt')[_0x3448('0x74')]('id',_0x3448('0x83'))[_0x3448('0x74')](_0x845f88[_0x3448('0x79')][_0x3448('0x75')](),_0x3448('0x72'))[_0x3448('0x74')](_0x4310fd[_0x3448('0x4c')]['id'][_0x3448('0x75')](),_0x3448('0x60'))[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27',_0x3448('0x84'))['field']('\x27'+_0x1b7c18+'\x27','updatedAt')[_0x3448('0x7d')](_0x3448('0x76'))[_0x3448('0x3e')](_0x3448('0x77'))[_0x3448('0x3e')]('ListId\x20=\x20?',_0x845f88[_0x3448('0x79')][_0x3448('0x75')]())[_0x3448('0x3e')](_0x3448('0x7a')))['toString']();}_0x3348dd=squel['insert']()[_0x3448('0x6d')]('cm_hopper_additional_phones')[_0x3448('0x6f')](['cmHopperId',_0x3448('0x71'),_0x3448('0x70'),'OrderBy',_0x3448('0x84'),_0x3448('0x56')],squel[_0x3448('0x73')]()[_0x3448('0x74')](_0x3448('0x86'),'id')[_0x3448('0x74')](_0x3448('0x85'),_0x3448('0x71'))[_0x3448('0x74')](_0x3448('0x87'),_0x3448('0x70'))[_0x3448('0x74')]('ci.OrderBY',_0x3448('0x88'))[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27',_0x3448('0x84'))['field']('\x27'+_0x1b7c18+'\x27','updatedAt')[_0x3448('0x7d')](_0x3448('0x89'),'ci')['join']('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x3448('0x3e')](_0x3448('0x8a'),_0x845f88['CmListId'][_0x3448('0x75')]())['where'](_0x3448('0x8b'),_0x4310fd[_0x3448('0x4c')]['id']['toString']())[_0x3448('0x3e')]('h.createdAt\x20=\x20?',_0x1b7c18))['toString']();_0x329b92[_0x3448('0x8c')](db[_0x3448('0x8d')][_0x3448('0x35')](_0x1b0deb));_0x52b29f[_0x3448('0x8c')](db[_0x3448('0x8d')][_0x3448('0x35')](_0x3348dd));}return BPromise[_0x3448('0x8e')](_0x329b92);}})[_0x3448('0x28')](function(){return BPromise['all'](_0x52b29f);})[_0x3448('0x28')](function(){return _0x8caa8e;})[_0x3448('0x28')](respondWithResult(_0x4589d3,null))[_0x3448('0x4a')](handleError(_0x4589d3,null));};exports[_0x3448('0x8f')]=function(_0x3a90b5,_0xd01a38,_0x40793c){return db[_0x3448('0x2f')][_0x3448('0x54')]({'where':{'id':_0x3a90b5[_0x3448('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd01a38,null))[_0x3448('0x28')](function(_0x905854){if(_0x905854){return _0x905854[_0x3448('0x8f')](_0x3a90b5['query'][_0x3448('0x69')]);}})['then'](function(_0x592974){if(_0x592974){return db[_0x3448('0x5d')][_0x3448('0x27')]({'where':{'ListId':_0x3a90b5[_0x3448('0x35')][_0x3448('0x69')],'CampaignId':_0x3a90b5[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](function(){return _0x592974;});}})[_0x3448('0x28')](respondWithStatusCode(_0xd01a38,null))[_0x3448('0x4a')](handleError(_0xd01a38,null));};exports[_0x3448('0x90')]=function(_0x234134,_0x279fca,_0x5d3b42){var _0x44e4a5={};var _0x40c612={};var _0x818a4c;var _0x23e6cc;return db['Campaign'][_0x3448('0x5b')]({'where':{'id':_0x234134[_0x3448('0x4c')]['id']}})['then'](handleEntityNotFound(_0x279fca,null))['then'](function(_0x3c56d2){if(_0x3c56d2){_0x818a4c=_0x3c56d2;_0x40c612[_0x3448('0x33')]=_['keys'](db['CmList'][_0x3448('0x30')]);_0x40c612[_0x3448('0x35')]=_[_0x3448('0x36')](_0x234134[_0x3448('0x35')]);_0x40c612[_0x3448('0x40')]=_[_0x3448('0x37')](_0x40c612[_0x3448('0x33')],_0x40c612[_0x3448('0x35')]);_0x44e4a5['attributes']=_[_0x3448('0x37')](_0x40c612[_0x3448('0x33')],qs[_0x3448('0x39')](_0x234134['query']['fields']));_0x44e4a5[_0x3448('0x38')]=_0x44e4a5[_0x3448('0x38')][_0x3448('0x3a')]?_0x44e4a5[_0x3448('0x38')]:_0x40c612[_0x3448('0x33')];_0x44e4a5['order']=qs[_0x3448('0x3d')](_0x234134[_0x3448('0x35')][_0x3448('0x3d')]);_0x44e4a5[_0x3448('0x3e')]=qs[_0x3448('0x40')](_[_0x3448('0x3f')](_0x234134['query'],_0x40c612[_0x3448('0x40')]));if(_0x234134[_0x3448('0x35')][_0x3448('0x41')]){_0x44e4a5[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x44e4a5[_0x3448('0x3e')],{'$or':_['map'](_0x44e4a5[_0x3448('0x38')],function(_0x2420d1){var _0x320fdc={};_0x320fdc[_0x2420d1]={'$like':'%'+_0x234134['query'][_0x3448('0x41')]+'%'};return _0x320fdc;})});}_0x44e4a5=_[_0x3448('0x42')]({},_0x44e4a5,_0x234134[_0x3448('0x45')]);return _0x818a4c['getBlackLists'](_0x44e4a5);}})[_0x3448('0x28')](function(_0x1920d1){if(_0x1920d1){_0x23e6cc=_0x1920d1[_0x3448('0x3a')];if(!_0x234134[_0x3448('0x35')]['hasOwnProperty'](_0x3448('0x3c'))){_0x44e4a5[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x234134['query'][_0x3448('0x21')]);_0x44e4a5[_0x3448('0x1f')]=qs['offset'](_0x234134['query'][_0x3448('0x1f')]);}return _0x818a4c[_0x3448('0x90')](_0x44e4a5);}})['then'](function(_0x28bac0){if(_0x28bac0){return _0x28bac0?{'count':_0x23e6cc,'rows':_0x28bac0}:null;}})['then'](respondWithResult(_0x279fca,null))['catch'](handleError(_0x279fca,null));};exports['addBlackLists']=function(_0x242145,_0x13818d,_0x425089){var _0x542e01,_0x1a56a4;var _0x111f26=[];var _0x48b4ca=moment()['format'](_0x3448('0x67'));return db['Campaign'][_0x3448('0x54')]({'where':{'id':_0x242145[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x13818d,null))[_0x3448('0x28')](function(_0x1ab2d1){if(_0x1ab2d1){_0x1a56a4=_0x1ab2d1;return _0x1ab2d1['addBlackLists'](_0x242145[_0x3448('0x4e')][_0x3448('0x69')],_[_0x3448('0x55')](_0x242145[_0x3448('0x4e')],['ids','id'])||{});}return null;})['spread'](function(_0x19bae9){var _0x48b2b4;var _0x95204d;_0x542e01=_0x19bae9||[];var _0x7da7ea=[];if(_0x19bae9){for(var _0xd59b17=0x0;_0xd59b17<_0x19bae9[_0x3448('0x3a')];_0xd59b17+=0x1){var _0x283751=_0x19bae9[_0xd59b17][_0x3448('0x29')]({'plain':!![]});_0x48b2b4=squel['insert']()[_0x3448('0x6d')](_0x3448('0x91'))[_0x3448('0x6f')]([_0x3448('0x70'),_0x3448('0x83'),_0x3448('0x72'),_0x3448('0x60'),_0x3448('0x84'),_0x3448('0x56')],squel[_0x3448('0x73')]()[_0x3448('0x74')](_0x3448('0x70'),_0x3448('0x70'))['field']('id',_0x3448('0x83'))[_0x3448('0x74')](_0x283751['CmListId'][_0x3448('0x75')](),'ListId')['field'](_0x242145[_0x3448('0x4c')]['id'][_0x3448('0x75')](),_0x3448('0x60'))[_0x3448('0x74')](_0x3448('0x85'),'createdAt')[_0x3448('0x74')](_0x3448('0x85'),_0x3448('0x56'))[_0x3448('0x7d')](_0x3448('0x76'))['where'](_0x3448('0x77'))[_0x3448('0x3e')]('ListId\x20=\x20?',_0x283751[_0x3448('0x79')][_0x3448('0x75')]())['where'](_0x3448('0x7a')))[_0x3448('0x75')]();_0x7da7ea[_0x3448('0x8c')](db[_0x3448('0x8d')]['query'](_0x48b2b4));}return BPromise[_0x3448('0x8e')](_0x7da7ea);}})[_0x3448('0x28')](function(){return _0x542e01;})[_0x3448('0x28')](respondWithResult(_0x13818d,null))[_0x3448('0x4a')](handleError(_0x13818d,null));};exports['removeBlackLists']=function(_0x37c224,_0x177b9f,_0x412fef){return db['Campaign'][_0x3448('0x54')]({'where':{'id':_0x37c224['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x177b9f,null))[_0x3448('0x28')](function(_0x4e4c5d){if(_0x4e4c5d){return _0x4e4c5d[_0x3448('0x92')](_0x37c224['query']['ids']);}})[_0x3448('0x28')](function(_0x271899){if(_0x271899){return db[_0x3448('0x63')][_0x3448('0x27')]({'where':{'ListId':_0x37c224[_0x3448('0x35')][_0x3448('0x69')],'CampaignId':_0x37c224[_0x3448('0x4c')]['id']}})['then'](function(){return _0x271899;});}})[_0x3448('0x28')](respondWithStatusCode(_0x177b9f,null))[_0x3448('0x4a')](handleError(_0x177b9f,null));};
\ No newline at end of file
+var _0x8305=['insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','CmListId','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','NOW()','cm_contacts','cm_hopper_additional_phones','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','Campaign','includeAll','include','findAll','rows','params','options','find','catch','create','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','getHoppers','findOne','CmHopper','order','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always'];(function(_0x406b50,_0x514488){var _0x3844f7=function(_0x256690){while(--_0x256690){_0x406b50['push'](_0x406b50['shift']());}};_0x3844f7(++_0x514488);}(_0x8305,0x1d3));var _0x5830=function(_0x4c9992,_0xd79837){_0x4c9992=_0x4c9992-0x0;var _0x79957f=_0x8305[_0x4c9992];return _0x79957f;};'use strict';var emlformat=require(_0x5830('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5830('0x1'));var rp=require('request-promise');var moment=require(_0x5830('0x2'));var BPromise=require(_0x5830('0x3'));var Mustache=require(_0x5830('0x4'));var util=require(_0x5830('0x5'));var path=require(_0x5830('0x6'));var sox=require(_0x5830('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5830('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5830('0x9'));var jsforce=require(_0x5830('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5830('0xb'));var querystring=require(_0x5830('0xc'));var Papa=require(_0x5830('0xd'));var Redis=require('ioredis');var authService=require(_0x5830('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5830('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5830('0x10'));var config=require(_0x5830('0x11'));var licenseUtil=require(_0x5830('0x12'));var db=require(_0x5830('0x13'))['db'];function respondWithStatusCode(_0xa1bde,_0x1d7f6d){_0x1d7f6d=_0x1d7f6d||0xcc;return function(_0x16febb){if(_0x16febb){return _0xa1bde[_0x5830('0x14')](_0x1d7f6d);}return _0xa1bde[_0x5830('0x15')](_0x1d7f6d)[_0x5830('0x16')]();};}function respondWithResult(_0x25ed7b,_0x31a5b2){_0x31a5b2=_0x31a5b2||0xc8;return function(_0x30cd08){if(_0x30cd08){return _0x25ed7b[_0x5830('0x15')](_0x31a5b2)['json'](_0x30cd08);}};}function respondWithFilteredResult(_0x3b4242,_0x59ea04){return function(_0x3f5906){if(_0x3f5906){var _0x5a0852=typeof _0x59ea04[_0x5830('0x17')]===_0x5830('0x18')&&typeof _0x59ea04[_0x5830('0x19')]==='undefined';var _0x2d615d=_0x3f5906['count'];var _0x1d3450=_0x5a0852?0x0:_0x59ea04['offset'];var _0x3e5ae3=_0x5a0852?_0x3f5906[_0x5830('0x1a')]:_0x59ea04[_0x5830('0x17')]+_0x59ea04['limit'];var _0x24e074;if(_0x3e5ae3>=_0x2d615d){_0x3e5ae3=_0x2d615d;_0x24e074=0xc8;}else{_0x24e074=0xce;}_0x3b4242[_0x5830('0x15')](_0x24e074);return _0x3b4242[_0x5830('0x1b')](_0x5830('0x1c'),_0x1d3450+'-'+_0x3e5ae3+'/'+_0x2d615d)[_0x5830('0x1d')](_0x3f5906);}return null;};}function patchUpdates(_0x155c22){return function(_0xc3813e){try{jsonpatch[_0x5830('0x1e')](_0xc3813e,_0x155c22,!![]);}catch(_0x3d27af){return BPromise[_0x5830('0x1f')](_0x3d27af);}return _0xc3813e['save']();};}function saveUpdates(_0x4b5b51,_0x283c70){return function(_0x183029){if(_0x183029){return _0x183029[_0x5830('0x20')](_0x4b5b51)[_0x5830('0x21')](function(_0x13ed5d){return _0x13ed5d;});}return null;};}function removeEntity(_0x26e69b,_0x41c7ec){return function(_0x3d4197){if(_0x3d4197){return _0x3d4197[_0x5830('0x22')]()[_0x5830('0x21')](function(){var _0x1fcf2f=_0x3d4197[_0x5830('0x23')]({'plain':!![]});var _0xcc13ca=_0x5830('0x24');return db[_0x5830('0x25')][_0x5830('0x22')]({'where':{'type':_0xcc13ca,'resourceId':_0x1fcf2f['id']}})[_0x5830('0x21')](function(){return _0x3d4197;});})['then'](function(){_0x26e69b[_0x5830('0x15')](0xcc)[_0x5830('0x16')]();});}};}function handleEntityNotFound(_0x276ce5,_0x33fe9b){return function(_0x12041c){if(!_0x12041c){_0x276ce5[_0x5830('0x14')](0x194);}return _0x12041c;};}function handleError(_0x383e40,_0x38b381){_0x38b381=_0x38b381||0x1f4;return function(_0x5e3345){logger[_0x5830('0x26')](_0x5e3345[_0x5830('0x27')]);if(_0x5e3345[_0x5830('0x28')]){delete _0x5e3345['name'];}_0x383e40['status'](_0x38b381)[_0x5830('0x29')](_0x5e3345);};}exports['index']=function(_0x78a0ef,_0xb4dabd){var _0x1dc580={},_0x3b7f37={},_0x1e060d={'count':0x0,'rows':[]};var _0x841064=_[_0x5830('0x2a')](db['Campaign'][_0x5830('0x2b')],function(_0x3ab2bc){return{'name':_0x3ab2bc[_0x5830('0x2c')],'type':_0x3ab2bc[_0x5830('0x2d')][_0x5830('0x2e')]};});_0x3b7f37[_0x5830('0x2f')]=_[_0x5830('0x2a')](_0x841064,_0x5830('0x28'));_0x3b7f37[_0x5830('0x30')]=_[_0x5830('0x31')](_0x78a0ef[_0x5830('0x30')]);_0x3b7f37[_0x5830('0x32')]=_[_0x5830('0x33')](_0x3b7f37[_0x5830('0x2f')],_0x3b7f37['query']);_0x1dc580[_0x5830('0x34')]=_[_0x5830('0x33')](_0x3b7f37[_0x5830('0x2f')],qs[_0x5830('0x35')](_0x78a0ef[_0x5830('0x30')][_0x5830('0x35')]));_0x1dc580[_0x5830('0x34')]=_0x1dc580[_0x5830('0x34')][_0x5830('0x36')]?_0x1dc580[_0x5830('0x34')]:_0x3b7f37['model'];if(!_0x78a0ef['query'][_0x5830('0x37')](_0x5830('0x38'))){_0x1dc580[_0x5830('0x19')]=qs[_0x5830('0x19')](_0x78a0ef[_0x5830('0x30')][_0x5830('0x19')]);_0x1dc580[_0x5830('0x17')]=qs[_0x5830('0x17')](_0x78a0ef[_0x5830('0x30')][_0x5830('0x17')]);}_0x1dc580['order']=qs['sort'](_0x78a0ef['query'][_0x5830('0x39')]);_0x1dc580[_0x5830('0x3a')]=qs['filters'](_[_0x5830('0x3b')](_0x78a0ef[_0x5830('0x30')],_0x3b7f37[_0x5830('0x32')]),_0x841064);if(_0x78a0ef['query'][_0x5830('0x3c')]){_0x1dc580['where']=_['merge'](_0x1dc580[_0x5830('0x3a')],{'$or':_[_0x5830('0x2a')](_0x841064,function(_0x889058){if(_0x889058[_0x5830('0x2d')]!=='VIRTUAL'){var _0x1a1af7={};_0x1a1af7[_0x889058['name']]={'$like':'%'+_0x78a0ef['query'][_0x5830('0x3c')]+'%'};return _0x1a1af7;}})});}_0x1dc580=_[_0x5830('0x3d')]({},_0x1dc580,_0x78a0ef['options']);var _0xe70f36={'where':_0x1dc580[_0x5830('0x3a')]};return db[_0x5830('0x3e')][_0x5830('0x1a')](_0xe70f36)[_0x5830('0x21')](function(_0x52f3f4){_0x1e060d['count']=_0x52f3f4;if(_0x78a0ef['query'][_0x5830('0x3f')]){_0x1dc580[_0x5830('0x40')]=[{'all':!![]}];}return db[_0x5830('0x3e')][_0x5830('0x41')](_0x1dc580);})[_0x5830('0x21')](function(_0x56e53a){_0x1e060d[_0x5830('0x42')]=_0x56e53a;return _0x1e060d;})['then'](respondWithFilteredResult(_0xb4dabd,_0x1dc580))['catch'](handleError(_0xb4dabd,null));};exports['show']=function(_0x358157,_0x19229b){var _0x7d0e45={'raw':![],'where':{'id':_0x358157[_0x5830('0x43')]['id']}},_0x40cca1={};_0x40cca1['model']=_['keys'](db[_0x5830('0x3e')][_0x5830('0x2b')]);_0x40cca1[_0x5830('0x30')]=_[_0x5830('0x31')](_0x358157['query']);_0x40cca1[_0x5830('0x32')]=_['intersection'](_0x40cca1[_0x5830('0x2f')],_0x40cca1[_0x5830('0x30')]);_0x7d0e45['attributes']=_[_0x5830('0x33')](_0x40cca1[_0x5830('0x2f')],qs[_0x5830('0x35')](_0x358157[_0x5830('0x30')][_0x5830('0x35')]));_0x7d0e45[_0x5830('0x34')]=_0x7d0e45[_0x5830('0x34')][_0x5830('0x36')]?_0x7d0e45['attributes']:_0x40cca1[_0x5830('0x2f')];if(_0x358157['query'][_0x5830('0x3f')]){_0x7d0e45[_0x5830('0x40')]=[{'all':!![]}];}_0x7d0e45=_[_0x5830('0x3d')]({},_0x7d0e45,_0x358157[_0x5830('0x44')]);return db[_0x5830('0x3e')][_0x5830('0x45')](_0x7d0e45)[_0x5830('0x21')](handleEntityNotFound(_0x19229b,null))[_0x5830('0x21')](respondWithResult(_0x19229b,null))[_0x5830('0x46')](handleError(_0x19229b,null));};exports[_0x5830('0x47')]=function(_0x241b3e,_0x585909){return db[_0x5830('0x3e')][_0x5830('0x47')](_0x241b3e[_0x5830('0x48')],{})[_0x5830('0x21')](function(_0x4a6d19){var _0x4eb3ca=_0x241b3e[_0x5830('0x49')][_0x5830('0x23')]({'plain':!![]});if(!_0x4eb3ca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4eb3ca[_0x5830('0x4a')]===_0x5830('0x49')){var _0x4bf822=_0x4a6d19[_0x5830('0x23')]({'plain':!![]});var _0x432823=_0x5830('0x24');return db[_0x5830('0x4b')]['find']({'where':{'name':_0x432823,'userProfileId':_0x4eb3ca['userProfileId']},'raw':!![]})[_0x5830('0x21')](function(_0x2785d4){if(_0x2785d4&&_0x2785d4['autoAssociation']===0x0){return db[_0x5830('0x25')][_0x5830('0x47')]({'name':_0x4bf822[_0x5830('0x28')],'resourceId':_0x4bf822['id'],'type':_0x2785d4[_0x5830('0x28')],'sectionId':_0x2785d4['id']},{})[_0x5830('0x21')](function(){return _0x4a6d19;});}else{return _0x4a6d19;}})[_0x5830('0x46')](function(_0x49bd9e){logger['error'](_0x5830('0x4c'),_0x49bd9e);throw _0x49bd9e;});}return _0x4a6d19;})['then'](respondWithResult(_0x585909,0xc9))[_0x5830('0x46')](handleError(_0x585909,null));};exports['clone']=function(_0x516860,_0x5317c0){var _0x1f7321={'where':{'id':_0x516860[_0x5830('0x43')]['id']}},_0x53aab3={};_0x53aab3[_0x5830('0x2f')]=_[_0x5830('0x31')](db[_0x5830('0x3e')][_0x5830('0x2b')]);_0x1f7321[_0x5830('0x34')]=_['intersection'](_0x53aab3[_0x5830('0x2f')],qs[_0x5830('0x35')](_0x516860[_0x5830('0x30')][_0x5830('0x35')]));_0x1f7321[_0x5830('0x34')]=_0x1f7321[_0x5830('0x34')]['length']?_0x1f7321['attributes']:_0x53aab3[_0x5830('0x2f')];if(_0x516860[_0x5830('0x30')][_0x5830('0x3f')]){_0x1f7321[_0x5830('0x40')]=[{'all':!![]}];}_0x1f7321=_['merge']({},_0x1f7321,_0x516860[_0x5830('0x44')]);return db[_0x5830('0x3e')]['find'](_0x1f7321)[_0x5830('0x21')](handleEntityNotFound(_0x5317c0,null))[_0x5830('0x21')](function(_0x4b3212){if(_0x4b3212){var _0x374bd2=_0x4b3212['get']({'plain':!![]});_0x374bd2=qs[_0x5830('0x4d')](_0x374bd2,['id',_0x5830('0x4e'),_0x5830('0x4f')]);_0x516860[_0x5830('0x48')]=_[_0x5830('0x4d')](_0x516860[_0x5830('0x48')],['id','createdAt','updatedAt']);return db[_0x5830('0x3e')][_0x5830('0x47')](_['merge'](_0x374bd2,_0x516860[_0x5830('0x48')]),{'include':_0x516860['query'][_0x5830('0x3f')]?[{'all':!![]}]:undefined})[_0x5830('0x21')](function(_0x567b8a){var _0x6d8561=_0x516860[_0x5830('0x49')][_0x5830('0x23')]({'plain':!![]});if(!_0x6d8561)throw new Error(_0x5830('0x50'));if(_0x6d8561[_0x5830('0x4a')]===_0x5830('0x49')){var _0x1daa77=_0x567b8a[_0x5830('0x23')]({'plain':!![]});var _0x4646f4=_0x5830('0x24');return db[_0x5830('0x4b')]['find']({'where':{'name':_0x4646f4,'userProfileId':_0x6d8561[_0x5830('0x51')]},'raw':!![]})[_0x5830('0x21')](function(_0x19c70c){if(_0x19c70c&&_0x19c70c[_0x5830('0x52')]===0x0){return db[_0x5830('0x25')]['create']({'name':_0x1daa77[_0x5830('0x28')],'resourceId':_0x1daa77['id'],'type':_0x19c70c[_0x5830('0x28')],'sectionId':_0x19c70c['id']},{})[_0x5830('0x21')](function(){return _0x567b8a;});}else{return _0x567b8a;}})['catch'](function(_0x11e779){logger[_0x5830('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11e779);throw _0x11e779;});}return _0x567b8a;});}})[_0x5830('0x21')](respondWithResult(_0x5317c0,0xc9))[_0x5830('0x46')](handleError(_0x5317c0,null));};exports['update']=function(_0x14473d,_0x21f397){if(_0x14473d['body']['id']){delete _0x14473d[_0x5830('0x48')]['id'];}return db['Campaign'][_0x5830('0x45')]({'where':{'id':_0x14473d['params']['id']}})['then'](handleEntityNotFound(_0x21f397,null))[_0x5830('0x21')](saveUpdates(_0x14473d[_0x5830('0x48')],null))[_0x5830('0x21')](respondWithResult(_0x21f397,null))[_0x5830('0x46')](handleError(_0x21f397,null));};exports[_0x5830('0x22')]=function(_0x3696a8,_0x2a402f){return db[_0x5830('0x3e')][_0x5830('0x45')]({'where':{'id':_0x3696a8['params']['id']}})[_0x5830('0x21')](handleEntityNotFound(_0x2a402f,null))['then'](removeEntity(_0x2a402f,null))[_0x5830('0x46')](handleError(_0x2a402f,null));};exports[_0x5830('0x53')]=function(_0x59aaeb,_0x51f56e,_0x7cf436){var _0x51fa70={'raw':!![],'where':{}};var _0x2523ba={};var _0x427248={'count':0x0,'rows':[]};return db[_0x5830('0x3e')][_0x5830('0x54')]({'where':{'id':_0x59aaeb[_0x5830('0x43')]['id']}})[_0x5830('0x21')](handleEntityNotFound(_0x51f56e,null))['then'](function(_0x51ea80){if(_0x51ea80){_0x2523ba[_0x5830('0x2f')]=_[_0x5830('0x31')](db[_0x5830('0x55')]['rawAttributes']);_0x2523ba[_0x5830('0x30')]=_[_0x5830('0x31')](_0x59aaeb[_0x5830('0x30')]);_0x2523ba[_0x5830('0x32')]=_[_0x5830('0x33')](_0x2523ba['model'],_0x2523ba[_0x5830('0x30')]);_0x51fa70[_0x5830('0x34')]=_[_0x5830('0x33')](_0x2523ba[_0x5830('0x2f')],qs[_0x5830('0x35')](_0x59aaeb['query'][_0x5830('0x35')]));_0x51fa70[_0x5830('0x34')]=_0x51fa70['attributes'][_0x5830('0x36')]?_0x51fa70[_0x5830('0x34')]:_0x2523ba[_0x5830('0x2f')];if(!_0x59aaeb[_0x5830('0x30')]['hasOwnProperty'](_0x5830('0x38'))){_0x51fa70[_0x5830('0x19')]=qs[_0x5830('0x19')](_0x59aaeb[_0x5830('0x30')][_0x5830('0x19')]);_0x51fa70[_0x5830('0x17')]=qs['offset'](_0x59aaeb[_0x5830('0x30')][_0x5830('0x17')]);}_0x51fa70[_0x5830('0x56')]=qs['sort'](_0x59aaeb[_0x5830('0x30')]['sort']);_0x51fa70[_0x5830('0x3a')]=qs[_0x5830('0x32')](_['pick'](_0x59aaeb[_0x5830('0x30')],_0x2523ba['filters']));_0x51fa70[_0x5830('0x3a')][_0x5830('0x57')]=_0x51ea80['id'];if(_0x59aaeb['query'][_0x5830('0x3c')]){_0x51fa70[_0x5830('0x3a')]=_[_0x5830('0x3d')](_0x51fa70[_0x5830('0x3a')],{'$or':_[_0x5830('0x2a')](_0x51fa70[_0x5830('0x34')],function(_0x4d836d){var _0x3c0467={};_0x3c0467[_0x4d836d]={'$like':'%'+_0x59aaeb[_0x5830('0x30')][_0x5830('0x3c')]+'%'};return _0x3c0467;})});}_0x51fa70=_[_0x5830('0x3d')]({},_0x51fa70,_0x59aaeb['options']);return db[_0x5830('0x55')][_0x5830('0x1a')]({'where':_0x51fa70['where']})[_0x5830('0x21')](function(_0x2c0ee7){_0x427248[_0x5830('0x1a')]=_0x2c0ee7;if(_0x59aaeb[_0x5830('0x30')][_0x5830('0x3f')]){_0x51fa70[_0x5830('0x40')]=[{'all':!![]}];}return db[_0x5830('0x55')][_0x5830('0x41')](_0x51fa70);})['then'](function(_0x5a7dd3){_0x427248[_0x5830('0x42')]=_0x5a7dd3;return _0x427248;});}})[_0x5830('0x21')](respondWithFilteredResult(_0x51f56e,_0x51fa70))[_0x5830('0x46')](handleError(_0x51f56e,null));};exports[_0x5830('0x58')]=function(_0x12647d,_0x44d7d6,_0x28f82f){var _0x46034c={'raw':!![],'where':{}};var _0xc42ee1={};var _0x51ee10={'count':0x0,'rows':[]};return db[_0x5830('0x3e')][_0x5830('0x54')]({'where':{'id':_0x12647d[_0x5830('0x43')]['id']}})[_0x5830('0x21')](handleEntityNotFound(_0x44d7d6,null))[_0x5830('0x21')](function(_0x1406a2){if(_0x1406a2){_0xc42ee1[_0x5830('0x2f')]=_[_0x5830('0x31')](db['CmHopperHistory'][_0x5830('0x2b')]);_0xc42ee1[_0x5830('0x30')]=_[_0x5830('0x31')](_0x12647d['query']);_0xc42ee1[_0x5830('0x32')]=_['intersection'](_0xc42ee1[_0x5830('0x2f')],_0xc42ee1[_0x5830('0x30')]);_0x46034c[_0x5830('0x34')]=_[_0x5830('0x33')](_0xc42ee1['model'],qs[_0x5830('0x35')](_0x12647d['query'][_0x5830('0x35')]));_0x46034c[_0x5830('0x34')]=_0x46034c[_0x5830('0x34')][_0x5830('0x36')]?_0x46034c[_0x5830('0x34')]:_0xc42ee1[_0x5830('0x2f')];if(!_0x12647d[_0x5830('0x30')][_0x5830('0x37')](_0x5830('0x38'))){_0x46034c[_0x5830('0x19')]=qs[_0x5830('0x19')](_0x12647d['query'][_0x5830('0x19')]);_0x46034c[_0x5830('0x17')]=qs['offset'](_0x12647d[_0x5830('0x30')]['offset']);}_0x46034c['order']=qs[_0x5830('0x39')](_0x12647d['query']['sort']);_0x46034c['where']=qs[_0x5830('0x32')](_['pick'](_0x12647d[_0x5830('0x30')],_0xc42ee1['filters']));_0x46034c[_0x5830('0x3a')][_0x5830('0x57')]=_0x1406a2['id'];if(_0x12647d[_0x5830('0x30')]['filter']){_0x46034c[_0x5830('0x3a')]=_[_0x5830('0x3d')](_0x46034c[_0x5830('0x3a')],{'$or':_[_0x5830('0x2a')](_0x46034c['attributes'],function(_0x4c554a){var _0x1b5353={};_0x1b5353[_0x4c554a]={'$like':'%'+_0x12647d[_0x5830('0x30')][_0x5830('0x3c')]+'%'};return _0x1b5353;})});}_0x46034c=_[_0x5830('0x3d')]({},_0x46034c,_0x12647d[_0x5830('0x44')]);return db[_0x5830('0x59')][_0x5830('0x1a')]({'where':_0x46034c[_0x5830('0x3a')]})[_0x5830('0x21')](function(_0x43eb21){_0x51ee10[_0x5830('0x1a')]=_0x43eb21;if(_0x12647d[_0x5830('0x30')][_0x5830('0x3f')]){_0x46034c[_0x5830('0x40')]=[{'all':!![]}];}return db[_0x5830('0x59')][_0x5830('0x41')](_0x46034c);})['then'](function(_0x3ffaba){_0x51ee10['rows']=_0x3ffaba;return _0x51ee10;});}})[_0x5830('0x21')](respondWithFilteredResult(_0x44d7d6,_0x46034c))[_0x5830('0x46')](handleError(_0x44d7d6,null));};exports[_0x5830('0x5a')]=function(_0x3486f3,_0x32e153,_0x108fe4){var _0x586b73={'raw':!![],'where':{}};var _0x32fdc6={};var _0x3e8d0a={'count':0x0,'rows':[]};return db[_0x5830('0x3e')][_0x5830('0x54')]({'where':{'id':_0x3486f3['params']['id']}})['then'](handleEntityNotFound(_0x32e153,null))[_0x5830('0x21')](function(_0x5c381b){if(_0x5c381b){_0x32fdc6[_0x5830('0x2f')]=_[_0x5830('0x31')](db[_0x5830('0x5b')][_0x5830('0x2b')]);_0x32fdc6['query']=_['keys'](_0x3486f3[_0x5830('0x30')]);_0x32fdc6['filters']=_['intersection'](_0x32fdc6[_0x5830('0x2f')],_0x32fdc6[_0x5830('0x30')]);_0x586b73['attributes']=_[_0x5830('0x33')](_0x32fdc6[_0x5830('0x2f')],qs[_0x5830('0x35')](_0x3486f3[_0x5830('0x30')]['fields']));_0x586b73[_0x5830('0x34')]=_0x586b73[_0x5830('0x34')][_0x5830('0x36')]?_0x586b73[_0x5830('0x34')]:_0x32fdc6[_0x5830('0x2f')];if(!_0x3486f3[_0x5830('0x30')]['hasOwnProperty']('nolimit')){_0x586b73[_0x5830('0x19')]=qs[_0x5830('0x19')](_0x3486f3[_0x5830('0x30')][_0x5830('0x19')]);_0x586b73[_0x5830('0x17')]=qs['offset'](_0x3486f3[_0x5830('0x30')][_0x5830('0x17')]);}_0x586b73[_0x5830('0x56')]=qs[_0x5830('0x39')](_0x3486f3['query'][_0x5830('0x39')]);_0x586b73[_0x5830('0x3a')]=qs[_0x5830('0x32')](_['pick'](_0x3486f3['query'],_0x32fdc6[_0x5830('0x32')]));_0x586b73['where']['CampaignId']=_0x5c381b['id'];if(_0x3486f3[_0x5830('0x30')][_0x5830('0x3c')]){_0x586b73['where']=_['merge'](_0x586b73[_0x5830('0x3a')],{'$or':_[_0x5830('0x2a')](_0x586b73[_0x5830('0x34')],function(_0x160abc){var _0x1b919c={};_0x1b919c[_0x160abc]={'$like':'%'+_0x3486f3[_0x5830('0x30')][_0x5830('0x3c')]+'%'};return _0x1b919c;})});}_0x586b73=_[_0x5830('0x3d')]({},_0x586b73,_0x3486f3['options']);return db[_0x5830('0x5b')]['count']({'where':_0x586b73[_0x5830('0x3a')]})[_0x5830('0x21')](function(_0x33112a){_0x3e8d0a[_0x5830('0x1a')]=_0x33112a;if(_0x3486f3[_0x5830('0x30')][_0x5830('0x3f')]){_0x586b73[_0x5830('0x40')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x5830('0x41')](_0x586b73);})['then'](function(_0x2bed2a){_0x3e8d0a[_0x5830('0x42')]=_0x2bed2a;return _0x3e8d0a;});}})[_0x5830('0x21')](respondWithFilteredResult(_0x32e153,_0x586b73))[_0x5830('0x46')](handleError(_0x32e153,null));};exports['getHopperBlacks']=function(_0x15fc2f,_0x3d2d40,_0x3e8a49){var _0x3f0d3a={'raw':!![],'where':{}};var _0x35f8a0={};var _0x4eb650={'count':0x0,'rows':[]};return db[_0x5830('0x3e')]['findOne']({'where':{'id':_0x15fc2f[_0x5830('0x43')]['id']}})[_0x5830('0x21')](handleEntityNotFound(_0x3d2d40,null))[_0x5830('0x21')](function(_0x50ac22){if(_0x50ac22){_0x35f8a0[_0x5830('0x2f')]=_['keys'](db[_0x5830('0x5c')][_0x5830('0x2b')]);_0x35f8a0[_0x5830('0x30')]=_[_0x5830('0x31')](_0x15fc2f[_0x5830('0x30')]);_0x35f8a0[_0x5830('0x32')]=_[_0x5830('0x33')](_0x35f8a0['model'],_0x35f8a0[_0x5830('0x30')]);_0x3f0d3a['attributes']=_[_0x5830('0x33')](_0x35f8a0[_0x5830('0x2f')],qs['fields'](_0x15fc2f[_0x5830('0x30')][_0x5830('0x35')]));_0x3f0d3a['attributes']=_0x3f0d3a[_0x5830('0x34')][_0x5830('0x36')]?_0x3f0d3a[_0x5830('0x34')]:_0x35f8a0[_0x5830('0x2f')];if(!_0x15fc2f[_0x5830('0x30')]['hasOwnProperty']('nolimit')){_0x3f0d3a['limit']=qs[_0x5830('0x19')](_0x15fc2f[_0x5830('0x30')][_0x5830('0x19')]);_0x3f0d3a[_0x5830('0x17')]=qs[_0x5830('0x17')](_0x15fc2f[_0x5830('0x30')]['offset']);}_0x3f0d3a[_0x5830('0x56')]=qs[_0x5830('0x39')](_0x15fc2f[_0x5830('0x30')][_0x5830('0x39')]);_0x3f0d3a[_0x5830('0x3a')]=qs[_0x5830('0x32')](_[_0x5830('0x3b')](_0x15fc2f[_0x5830('0x30')],_0x35f8a0[_0x5830('0x32')]));_0x3f0d3a[_0x5830('0x3a')][_0x5830('0x57')]=_0x50ac22['id'];if(_0x15fc2f[_0x5830('0x30')][_0x5830('0x3c')]){_0x3f0d3a[_0x5830('0x3a')]=_['merge'](_0x3f0d3a[_0x5830('0x3a')],{'$or':_[_0x5830('0x2a')](_0x3f0d3a[_0x5830('0x34')],function(_0x55899d){var _0x1f7394={};_0x1f7394[_0x55899d]={'$like':'%'+_0x15fc2f['query'][_0x5830('0x3c')]+'%'};return _0x1f7394;})});}_0x3f0d3a=_[_0x5830('0x3d')]({},_0x3f0d3a,_0x15fc2f[_0x5830('0x44')]);return db['CmHopperBlack'][_0x5830('0x1a')]({'where':_0x3f0d3a[_0x5830('0x3a')]})['then'](function(_0x421a57){_0x4eb650[_0x5830('0x1a')]=_0x421a57;if(_0x15fc2f[_0x5830('0x30')][_0x5830('0x3f')]){_0x3f0d3a[_0x5830('0x40')]=[{'all':!![]}];}return db[_0x5830('0x5c')][_0x5830('0x41')](_0x3f0d3a);})[_0x5830('0x21')](function(_0x55497d){_0x4eb650['rows']=_0x55497d;return _0x4eb650;});}})[_0x5830('0x21')](respondWithFilteredResult(_0x3d2d40,_0x3f0d3a))[_0x5830('0x46')](handleError(_0x3d2d40,null));};exports[_0x5830('0x5d')]=function(_0x1d19a5,_0x2954e8,_0x308e70){var _0x589065={};var _0x3206fa={};var _0x11eef2;var _0x40c678;return db['Campaign']['findOne']({'where':{'id':_0x1d19a5[_0x5830('0x43')]['id']}})[_0x5830('0x21')](handleEntityNotFound(_0x2954e8,null))[_0x5830('0x21')](function(_0xace80b){if(_0xace80b){_0x11eef2=_0xace80b;_0x3206fa[_0x5830('0x2f')]=_[_0x5830('0x31')](db['CmList'][_0x5830('0x2b')]);_0x3206fa[_0x5830('0x30')]=_[_0x5830('0x31')](_0x1d19a5[_0x5830('0x30')]);_0x3206fa[_0x5830('0x32')]=_[_0x5830('0x33')](_0x3206fa[_0x5830('0x2f')],_0x3206fa[_0x5830('0x30')]);_0x589065[_0x5830('0x34')]=_[_0x5830('0x33')](_0x3206fa[_0x5830('0x2f')],qs['fields'](_0x1d19a5[_0x5830('0x30')][_0x5830('0x35')]));_0x589065[_0x5830('0x34')]=_0x589065[_0x5830('0x34')][_0x5830('0x36')]?_0x589065[_0x5830('0x34')]:_0x3206fa[_0x5830('0x2f')];_0x589065[_0x5830('0x56')]=qs[_0x5830('0x39')](_0x1d19a5['query'][_0x5830('0x39')]);_0x589065[_0x5830('0x3a')]=qs[_0x5830('0x32')](_[_0x5830('0x3b')](_0x1d19a5[_0x5830('0x30')],_0x3206fa['filters']));if(_0x1d19a5['query']['filter']){_0x589065[_0x5830('0x3a')]=_[_0x5830('0x3d')](_0x589065['where'],{'$or':_[_0x5830('0x2a')](_0x589065[_0x5830('0x34')],function(_0x127157){var _0x44e65a={};_0x44e65a[_0x127157]={'$like':'%'+_0x1d19a5[_0x5830('0x30')]['filter']+'%'};return _0x44e65a;})});}_0x589065=_[_0x5830('0x3d')]({},_0x589065,_0x1d19a5[_0x5830('0x44')]);return _0x11eef2[_0x5830('0x5d')](_0x589065);}})[_0x5830('0x21')](function(_0xc95413){if(_0xc95413){_0x40c678=_0xc95413[_0x5830('0x36')];if(!_0x1d19a5[_0x5830('0x30')][_0x5830('0x37')](_0x5830('0x38'))){_0x589065[_0x5830('0x19')]=qs[_0x5830('0x19')](_0x1d19a5[_0x5830('0x30')]['limit']);_0x589065['offset']=qs[_0x5830('0x17')](_0x1d19a5[_0x5830('0x30')]['offset']);}return _0x11eef2[_0x5830('0x5d')](_0x589065);}})['then'](function(_0x4ccf3a){if(_0x4ccf3a){return _0x4ccf3a?{'count':_0x40c678,'rows':_0x4ccf3a}:null;}})[_0x5830('0x21')](respondWithResult(_0x2954e8,null))['catch'](handleError(_0x2954e8,null));};exports[_0x5830('0x5e')]=function(_0x53ac05,_0x393180,_0x510787){var _0x14965b,_0x4ef511;var _0x412852=[];var _0x16e198=moment()[_0x5830('0x5f')](_0x5830('0x60'));return db[_0x5830('0x3e')]['find']({'where':{'id':_0x53ac05['params']['id']}})[_0x5830('0x21')](handleEntityNotFound(_0x393180,null))[_0x5830('0x21')](function(_0x235723){if(_0x235723){_0x4ef511=_0x235723;return _0x235723[_0x5830('0x5e')](_0x53ac05[_0x5830('0x48')][_0x5830('0x61')],_[_0x5830('0x4d')](_0x53ac05[_0x5830('0x48')],[_0x5830('0x61'),'id'])||{});}return null;})[_0x5830('0x62')](function(_0x9149ee){var _0x5b449d;var _0x44df40;_0x14965b=_0x9149ee||[];var _0x56df82=[];if(_0x9149ee){for(var _0x1fcf89=0x0;_0x1fcf89<_0x9149ee[_0x5830('0x36')];_0x1fcf89+=0x1){var _0x3c668f=_0x9149ee[_0x1fcf89]['get']({'plain':!![]});_0x4ef511[_0x5830('0x63')]=_0x53ac05[_0x5830('0x48')][_0x5830('0x63')]?_0x53ac05[_0x5830('0x48')][_0x5830('0x63')]:_0x4ef511['dialCheckDuplicateType'];switch(_0x4ef511[_0x5830('0x63')]){case _0x5830('0x64'):_0x5b449d=squel[_0x5830('0x65')]()[_0x5830('0x66')](_0x5830('0x67'))[_0x5830('0x68')]([_0x5830('0x69'),_0x5830('0x6a'),_0x5830('0x6b'),'ListId',_0x5830('0x57'),_0x5830('0x4e'),'updatedAt'],squel[_0x5830('0x6c')]()[_0x5830('0x6d')](_0x5830('0x69'),_0x5830('0x69'))[_0x5830('0x6d')]('NOW()',_0x5830('0x6a'))[_0x5830('0x6d')]('id',_0x5830('0x6b'))['field'](_0x3c668f[_0x5830('0x6e')][_0x5830('0x6f')](),_0x5830('0x70'))[_0x5830('0x6d')](_0x53ac05[_0x5830('0x43')]['id'][_0x5830('0x6f')](),_0x5830('0x57'))['field']('\x27'+_0x16e198+'\x27',_0x5830('0x4e'))[_0x5830('0x6d')]('\x27'+_0x16e198+'\x27',_0x5830('0x4f'))[_0x5830('0x71')]('cm_contacts')[_0x5830('0x3a')](_0x5830('0x72'))[_0x5830('0x3a')](_0x5830('0x73'),_0x3c668f[_0x5830('0x6e')]['toString']())['where'](_0x5830('0x74'))['where'](_0x5830('0x75'),squel['select']()[_0x5830('0x6d')](_0x5830('0x76'))['from'](_0x5830('0x77'))['where'](_0x5830('0x78'),_0x53ac05[_0x5830('0x43')]['id']['toString']()))[_0x5830('0x3a')](_0x5830('0x75'),squel[_0x5830('0x6c')]()[_0x5830('0x6d')](_0x5830('0x79'))[_0x5830('0x71')](_0x5830('0x67'))[_0x5830('0x3a')](_0x5830('0x78'),_0x53ac05[_0x5830('0x43')]['id'][_0x5830('0x6f')]())))['toString']();break;case'onlyIfOpen':_0x5b449d=squel[_0x5830('0x65')]()['into'](_0x5830('0x67'))[_0x5830('0x68')]([_0x5830('0x69'),_0x5830('0x6a'),'ContactId',_0x5830('0x70'),_0x5830('0x57'),_0x5830('0x4e'),_0x5830('0x4f')],squel[_0x5830('0x6c')]()[_0x5830('0x6d')](_0x5830('0x69'),_0x5830('0x69'))[_0x5830('0x6d')](_0x5830('0x7a'),_0x5830('0x6a'))[_0x5830('0x6d')]('id',_0x5830('0x6b'))[_0x5830('0x6d')](_0x3c668f['CmListId'][_0x5830('0x6f')](),'ListId')['field'](_0x53ac05[_0x5830('0x43')]['id'][_0x5830('0x6f')](),_0x5830('0x57'))[_0x5830('0x6d')]('\x27'+_0x16e198+'\x27',_0x5830('0x4e'))[_0x5830('0x6d')]('\x27'+_0x16e198+'\x27','updatedAt')[_0x5830('0x71')](_0x5830('0x7b'))[_0x5830('0x3a')](_0x5830('0x72'))[_0x5830('0x3a')](_0x5830('0x73'),_0x3c668f[_0x5830('0x6e')]['toString']())[_0x5830('0x3a')](_0x5830('0x74'))[_0x5830('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5830('0x6c')]()['field'](_0x5830('0x79'))[_0x5830('0x71')]('cm_hopper')[_0x5830('0x3a')](_0x5830('0x78'),_0x53ac05[_0x5830('0x43')]['id']['toString']())))[_0x5830('0x6f')]();break;default:_0x5b449d=squel[_0x5830('0x65')]()[_0x5830('0x66')](_0x5830('0x67'))[_0x5830('0x68')]([_0x5830('0x69'),_0x5830('0x6a'),'ContactId','ListId',_0x5830('0x57'),_0x5830('0x4e'),_0x5830('0x4f')],squel[_0x5830('0x6c')]()['field'](_0x5830('0x69'),_0x5830('0x69'))[_0x5830('0x6d')](_0x5830('0x7a'),_0x5830('0x6a'))[_0x5830('0x6d')]('id','ContactId')[_0x5830('0x6d')](_0x3c668f[_0x5830('0x6e')][_0x5830('0x6f')](),'ListId')[_0x5830('0x6d')](_0x53ac05[_0x5830('0x43')]['id'][_0x5830('0x6f')](),_0x5830('0x57'))[_0x5830('0x6d')]('\x27'+_0x16e198+'\x27',_0x5830('0x4e'))[_0x5830('0x6d')]('\x27'+_0x16e198+'\x27',_0x5830('0x4f'))[_0x5830('0x71')]('cm_contacts')[_0x5830('0x3a')](_0x5830('0x72'))['where'](_0x5830('0x73'),_0x3c668f[_0x5830('0x6e')]['toString']())[_0x5830('0x3a')](_0x5830('0x74')))['toString']();}_0x44df40=squel['insert']()['into'](_0x5830('0x7c'))['fromQuery'](['cmHopperId','scheduledAt',_0x5830('0x69'),_0x5830('0x7d'),_0x5830('0x4e'),'updatedAt'],squel[_0x5830('0x6c')]()[_0x5830('0x6d')](_0x5830('0x7e'),'id')[_0x5830('0x6d')](_0x5830('0x7a'),'scheduledAt')[_0x5830('0x6d')](_0x5830('0x7f'),'phone')[_0x5830('0x6d')]('ci.OrderBY',_0x5830('0x7d'))[_0x5830('0x6d')]('\x27'+_0x16e198+'\x27',_0x5830('0x4e'))['field']('\x27'+_0x16e198+'\x27','updatedAt')[_0x5830('0x71')](_0x5830('0x80'),'ci')[_0x5830('0x81')](_0x5830('0x67'),'h',_0x5830('0x82'))['where'](_0x5830('0x83'),_0x3c668f['CmListId'][_0x5830('0x6f')]())['where'](_0x5830('0x84'),_0x53ac05[_0x5830('0x43')]['id'][_0x5830('0x6f')]())[_0x5830('0x3a')](_0x5830('0x85'),_0x16e198))[_0x5830('0x6f')]();_0x56df82[_0x5830('0x86')](db['sequelize'][_0x5830('0x30')](_0x5b449d));_0x412852[_0x5830('0x86')](db['sequelize'][_0x5830('0x30')](_0x44df40));}return BPromise[_0x5830('0x87')](_0x56df82);}})[_0x5830('0x21')](function(){return BPromise[_0x5830('0x87')](_0x412852);})[_0x5830('0x21')](function(){return _0x14965b;})[_0x5830('0x21')](respondWithResult(_0x393180,null))[_0x5830('0x46')](handleError(_0x393180,null));};exports[_0x5830('0x88')]=function(_0x2268f4,_0x2befd3,_0x2105dc){return db[_0x5830('0x3e')][_0x5830('0x45')]({'where':{'id':_0x2268f4[_0x5830('0x43')]['id']}})[_0x5830('0x21')](handleEntityNotFound(_0x2befd3,null))[_0x5830('0x21')](function(_0x11b617){if(_0x11b617){return _0x11b617[_0x5830('0x88')](_0x2268f4[_0x5830('0x30')][_0x5830('0x61')]);}})[_0x5830('0x21')](function(_0x461bbf){if(_0x461bbf){return db[_0x5830('0x55')][_0x5830('0x22')]({'where':{'ListId':_0x2268f4[_0x5830('0x30')][_0x5830('0x61')],'CampaignId':_0x2268f4['params']['id']}})[_0x5830('0x21')](function(){return _0x461bbf;});}})[_0x5830('0x21')](respondWithStatusCode(_0x2befd3,null))[_0x5830('0x46')](handleError(_0x2befd3,null));};exports[_0x5830('0x89')]=function(_0x55c024,_0x12f6d5,_0x50b078){var _0x212e4b={};var _0x5806a7={};var _0x292f91;var _0x1c292d;return db[_0x5830('0x3e')][_0x5830('0x54')]({'where':{'id':_0x55c024[_0x5830('0x43')]['id']}})['then'](handleEntityNotFound(_0x12f6d5,null))[_0x5830('0x21')](function(_0x4b3093){if(_0x4b3093){_0x292f91=_0x4b3093;_0x5806a7[_0x5830('0x2f')]=_[_0x5830('0x31')](db['CmList'][_0x5830('0x2b')]);_0x5806a7[_0x5830('0x30')]=_['keys'](_0x55c024[_0x5830('0x30')]);_0x5806a7[_0x5830('0x32')]=_['intersection'](_0x5806a7[_0x5830('0x2f')],_0x5806a7[_0x5830('0x30')]);_0x212e4b[_0x5830('0x34')]=_[_0x5830('0x33')](_0x5806a7[_0x5830('0x2f')],qs[_0x5830('0x35')](_0x55c024['query']['fields']));_0x212e4b[_0x5830('0x34')]=_0x212e4b[_0x5830('0x34')][_0x5830('0x36')]?_0x212e4b['attributes']:_0x5806a7['model'];_0x212e4b[_0x5830('0x56')]=qs[_0x5830('0x39')](_0x55c024[_0x5830('0x30')]['sort']);_0x212e4b[_0x5830('0x3a')]=qs[_0x5830('0x32')](_[_0x5830('0x3b')](_0x55c024[_0x5830('0x30')],_0x5806a7['filters']));if(_0x55c024['query'][_0x5830('0x3c')]){_0x212e4b['where']=_['merge'](_0x212e4b[_0x5830('0x3a')],{'$or':_[_0x5830('0x2a')](_0x212e4b['attributes'],function(_0x4d24ab){var _0x49b35e={};_0x49b35e[_0x4d24ab]={'$like':'%'+_0x55c024[_0x5830('0x30')]['filter']+'%'};return _0x49b35e;})});}_0x212e4b=_[_0x5830('0x3d')]({},_0x212e4b,_0x55c024['options']);return _0x292f91[_0x5830('0x89')](_0x212e4b);}})[_0x5830('0x21')](function(_0x18b4ae){if(_0x18b4ae){_0x1c292d=_0x18b4ae['length'];if(!_0x55c024[_0x5830('0x30')][_0x5830('0x37')](_0x5830('0x38'))){_0x212e4b['limit']=qs['limit'](_0x55c024['query']['limit']);_0x212e4b[_0x5830('0x17')]=qs['offset'](_0x55c024[_0x5830('0x30')][_0x5830('0x17')]);}return _0x292f91['getBlackLists'](_0x212e4b);}})[_0x5830('0x21')](function(_0x31642e){if(_0x31642e){return _0x31642e?{'count':_0x1c292d,'rows':_0x31642e}:null;}})[_0x5830('0x21')](respondWithResult(_0x12f6d5,null))[_0x5830('0x46')](handleError(_0x12f6d5,null));};exports[_0x5830('0x8a')]=function(_0x4da8eb,_0x3a7c69,_0x450956){var _0x19e6a0,_0x52c698;var _0x315dee=[];var _0x3ce40a=moment()[_0x5830('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x5830('0x3e')][_0x5830('0x45')]({'where':{'id':_0x4da8eb['params']['id']}})[_0x5830('0x21')](handleEntityNotFound(_0x3a7c69,null))[_0x5830('0x21')](function(_0x4a9d95){if(_0x4a9d95){_0x52c698=_0x4a9d95;return _0x4a9d95['addBlackLists'](_0x4da8eb[_0x5830('0x48')][_0x5830('0x61')],_[_0x5830('0x4d')](_0x4da8eb[_0x5830('0x48')],['ids','id'])||{});}return null;})[_0x5830('0x62')](function(_0x50895d){var _0x350c89;var _0x16fdf7;_0x19e6a0=_0x50895d||[];var _0x5adc83=[];if(_0x50895d){for(var _0x4fd441=0x0;_0x4fd441<_0x50895d[_0x5830('0x36')];_0x4fd441+=0x1){var _0x255278=_0x50895d[_0x4fd441]['get']({'plain':!![]});_0x350c89=squel['insert']()[_0x5830('0x66')](_0x5830('0x8b'))['fromQuery']([_0x5830('0x69'),_0x5830('0x6b'),'ListId','CampaignId',_0x5830('0x4e'),_0x5830('0x4f')],squel[_0x5830('0x6c')]()[_0x5830('0x6d')](_0x5830('0x69'),_0x5830('0x69'))[_0x5830('0x6d')]('id',_0x5830('0x6b'))[_0x5830('0x6d')](_0x255278[_0x5830('0x6e')][_0x5830('0x6f')](),_0x5830('0x70'))[_0x5830('0x6d')](_0x4da8eb[_0x5830('0x43')]['id']['toString'](),_0x5830('0x57'))[_0x5830('0x6d')](_0x5830('0x7a'),_0x5830('0x4e'))['field'](_0x5830('0x7a'),_0x5830('0x4f'))[_0x5830('0x71')](_0x5830('0x7b'))[_0x5830('0x3a')](_0x5830('0x72'))[_0x5830('0x3a')](_0x5830('0x73'),_0x255278[_0x5830('0x6e')][_0x5830('0x6f')]())[_0x5830('0x3a')](_0x5830('0x74')))[_0x5830('0x6f')]();_0x5adc83[_0x5830('0x86')](db[_0x5830('0x8c')][_0x5830('0x30')](_0x350c89));}return BPromise[_0x5830('0x87')](_0x5adc83);}})[_0x5830('0x21')](function(){return _0x19e6a0;})['then'](respondWithResult(_0x3a7c69,null))[_0x5830('0x46')](handleError(_0x3a7c69,null));};exports[_0x5830('0x8d')]=function(_0x1ef3d5,_0x46a406,_0x5a00c9){return db[_0x5830('0x3e')][_0x5830('0x45')]({'where':{'id':_0x1ef3d5[_0x5830('0x43')]['id']}})['then'](handleEntityNotFound(_0x46a406,null))[_0x5830('0x21')](function(_0x1b15ff){if(_0x1b15ff){return _0x1b15ff[_0x5830('0x8d')](_0x1ef3d5[_0x5830('0x30')]['ids']);}})[_0x5830('0x21')](function(_0x4a8751){if(_0x4a8751){return db['CmHopperBlack'][_0x5830('0x22')]({'where':{'ListId':_0x1ef3d5[_0x5830('0x30')][_0x5830('0x61')],'CampaignId':_0x1ef3d5['params']['id']}})[_0x5830('0x21')](function(){return _0x4a8751;});}})[_0x5830('0x21')](respondWithStatusCode(_0x46a406,null))[_0x5830('0x46')](handleError(_0x46a406,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 5de6a3c..dca083c 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(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 9ac1ea8..6175b39 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 _0xe9f9=['code','message','findAll','options','where','include','map','model','attributes','GetCampaign','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xe9f9,0x174));var _0x9e9f=function(_0x468364,_0x5edb29){_0x468364=_0x468364-0x0;var _0x1dec71=_0xe9f9[_0x468364];return _0x1dec71;};'use strict';var _=require(_0x9e9f('0x0'));var util=require('util');var moment=require(_0x9e9f('0x1'));var BPromise=require(_0x9e9f('0x2'));var rs=require(_0x9e9f('0x3'));var fs=require('fs');var Redis=require(_0x9e9f('0x4'));var db=require(_0x9e9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e9f('0x6'))('rpc');var config=require(_0x9e9f('0x7'));var jayson=require(_0x9e9f('0x8'));var client=jayson['client'][_0x9e9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54f87c,_0x310be8,_0x661886){return new BPromise(function(_0x10d43b,_0x5256b3){return client[_0x9e9f('0xa')](_0x54f87c,_0x661886)[_0x9e9f('0xb')](function(_0x2e1e8e){logger[_0x9e9f('0xc')](_0x9e9f('0xd'),_0x310be8,_0x9e9f('0xe'));logger['debug'](_0x9e9f('0xf'),_0x310be8,_0x9e9f('0xe'),JSON[_0x9e9f('0x10')](_0x2e1e8e));if(_0x2e1e8e['error']){if(_0x2e1e8e[_0x9e9f('0x11')][_0x9e9f('0x12')]===0x1f4){logger[_0x9e9f('0x11')](_0x9e9f('0xd'),_0x310be8,_0x2e1e8e[_0x9e9f('0x11')][_0x9e9f('0x13')]);return _0x5256b3(_0x2e1e8e[_0x9e9f('0x11')][_0x9e9f('0x13')]);}logger[_0x9e9f('0x11')]('Campaign,\x20%s,\x20%s',_0x310be8,_0x2e1e8e['error'][_0x9e9f('0x13')]);return _0x10d43b(_0x2e1e8e[_0x9e9f('0x11')][_0x9e9f('0x13')]);}else{logger[_0x9e9f('0xc')](_0x9e9f('0xd'),_0x310be8,_0x9e9f('0xe'));_0x10d43b(_0x2e1e8e['result'][_0x9e9f('0x13')]);}})['catch'](function(_0x38897c){logger['error']('Campaign,\x20%s,\x20%s',_0x310be8,_0x38897c);_0x5256b3(_0x38897c);});});}exports['GetCampaign']=function(_0x3e1c64){var _0x4576ed=this;return new Promise(function(_0xfadc07,_0x21f5b7){return db['Campaign'][_0x9e9f('0x14')]({'raw':_0x3e1c64[_0x9e9f('0x15')]?_0x3e1c64[_0x9e9f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3e1c64[_0x9e9f('0x15')]?_0x3e1c64[_0x9e9f('0x15')][_0x9e9f('0x16')]||null:null,'attributes':_0x3e1c64[_0x9e9f('0x15')]?_0x3e1c64['options']['attributes']||null:null,'limit':_0x3e1c64[_0x9e9f('0x15')]?_0x3e1c64[_0x9e9f('0x15')]['limit']||null:null,'include':_0x3e1c64[_0x9e9f('0x15')]?_0x3e1c64[_0x9e9f('0x15')][_0x9e9f('0x17')]?_[_0x9e9f('0x18')](_0x3e1c64['options'][_0x9e9f('0x17')],function(_0x1172c2){return{'model':db[_0x1172c2['model']],'as':_0x1172c2['as'],'attributes':_0x1172c2['attributes'],'include':_0x1172c2[_0x9e9f('0x17')]?_[_0x9e9f('0x18')](_0x1172c2['include'],function(_0x172dd1){return{'model':db[_0x172dd1[_0x9e9f('0x19')]],'as':_0x172dd1['as'],'attributes':_0x172dd1['attributes'],'include':_0x172dd1[_0x9e9f('0x17')]?_[_0x9e9f('0x18')](_0x172dd1['include'],function(_0x5cdfe6){return{'model':db[_0x5cdfe6[_0x9e9f('0x19')]],'as':_0x5cdfe6['as'],'attributes':_0x5cdfe6[_0x9e9f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9e9f('0xb')](function(_0xc12c4c){logger['info'](_0x9e9f('0x1b'),_0x3e1c64);logger[_0x9e9f('0x1c')](_0x9e9f('0x1b'),_0x3e1c64,JSON['stringify'](_0xc12c4c));_0xfadc07(_0xc12c4c);})[_0x9e9f('0x1d')](function(_0xa3a2d7){logger[_0x9e9f('0x11')]('GetCampaign',_0xa3a2d7[_0x9e9f('0x13')],_0x3e1c64);_0x21f5b7(_0x4576ed[_0x9e9f('0x11')](0x1f4,_0xa3a2d7[_0x9e9f('0x13')]));});});};
\ No newline at end of file
+var _0x2060=['Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','map','include','model','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2060,0x1be));var _0x0206=function(_0x2290ea,_0x9b83be){_0x2290ea=_0x2290ea-0x0;var _0x3a33a0=_0x2060[_0x2290ea];return _0x3a33a0;};'use strict';var _=require(_0x0206('0x0'));var util=require('util');var moment=require(_0x0206('0x1'));var BPromise=require(_0x0206('0x2'));var rs=require(_0x0206('0x3'));var fs=require('fs');var Redis=require(_0x0206('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0206('0x5'));var logger=require(_0x0206('0x6'))('rpc');var config=require(_0x0206('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0206('0x8')][_0x0206('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x529d59,_0x2eda0e,_0x5c8dbb){return new BPromise(function(_0x4ffb51,_0x46dd94){return client[_0x0206('0xa')](_0x529d59,_0x5c8dbb)[_0x0206('0xb')](function(_0x194718){logger[_0x0206('0xc')](_0x0206('0xd'),_0x2eda0e,_0x0206('0xe'));logger[_0x0206('0xf')](_0x0206('0x10'),_0x2eda0e,_0x0206('0xe'),JSON[_0x0206('0x11')](_0x194718));if(_0x194718['error']){if(_0x194718['error'][_0x0206('0x12')]===0x1f4){logger[_0x0206('0x13')]('Campaign,\x20%s,\x20%s',_0x2eda0e,_0x194718[_0x0206('0x13')][_0x0206('0x14')]);return _0x46dd94(_0x194718[_0x0206('0x13')]['message']);}logger[_0x0206('0x13')](_0x0206('0xd'),_0x2eda0e,_0x194718[_0x0206('0x13')][_0x0206('0x14')]);return _0x4ffb51(_0x194718['error'][_0x0206('0x14')]);}else{logger['info'](_0x0206('0xd'),_0x2eda0e,_0x0206('0xe'));_0x4ffb51(_0x194718[_0x0206('0x15')][_0x0206('0x14')]);}})[_0x0206('0x16')](function(_0x26c261){logger['error']('Campaign,\x20%s,\x20%s',_0x2eda0e,_0x26c261);_0x46dd94(_0x26c261);});});}exports[_0x0206('0x17')]=function(_0x5641df){var _0x58291b=this;return new Promise(function(_0x2db2da,_0x3ecd80){return db[_0x0206('0x18')][_0x0206('0x19')]({'raw':_0x5641df['options']?_0x5641df[_0x0206('0x1a')][_0x0206('0x1b')]===undefined?!![]:![]:!![],'where':_0x5641df[_0x0206('0x1a')]?_0x5641df[_0x0206('0x1a')][_0x0206('0x1c')]||null:null,'attributes':_0x5641df[_0x0206('0x1a')]?_0x5641df[_0x0206('0x1a')][_0x0206('0x1d')]||null:null,'limit':_0x5641df['options']?_0x5641df[_0x0206('0x1a')]['limit']||null:null,'include':_0x5641df['options']?_0x5641df[_0x0206('0x1a')]['include']?_[_0x0206('0x1e')](_0x5641df[_0x0206('0x1a')][_0x0206('0x1f')],function(_0x4c5452){return{'model':db[_0x4c5452[_0x0206('0x20')]],'as':_0x4c5452['as'],'attributes':_0x4c5452[_0x0206('0x1d')],'include':_0x4c5452[_0x0206('0x1f')]?_['map'](_0x4c5452['include'],function(_0x3b9890){return{'model':db[_0x3b9890[_0x0206('0x20')]],'as':_0x3b9890['as'],'attributes':_0x3b9890['attributes'],'include':_0x3b9890[_0x0206('0x1f')]?_[_0x0206('0x1e')](_0x3b9890[_0x0206('0x1f')],function(_0x38ebfe){return{'model':db[_0x38ebfe[_0x0206('0x20')]],'as':_0x38ebfe['as'],'attributes':_0x38ebfe['attributes']};}):[]};}):[]};}):[]:[]})[_0x0206('0xb')](function(_0x18513c){logger[_0x0206('0xc')]('GetCampaign',_0x5641df);logger[_0x0206('0xf')](_0x0206('0x17'),_0x5641df,JSON[_0x0206('0x11')](_0x18513c));_0x2db2da(_0x18513c);})['catch'](function(_0xe6320c){logger[_0x0206('0x13')]('GetCampaign',_0xe6320c[_0x0206('0x14')],_0x5641df);_0x3ecd80(_0x58291b[_0x0206('0x13')](0x1f4,_0xe6320c[_0x0206('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 2e3bb94..b9ca3ea 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 _0xa4ce=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout'];(function(_0x4560e1,_0x429f0c){var _0x5ee331=function(_0x33a3eb){while(--_0x33a3eb){_0x4560e1['push'](_0x4560e1['shift']());}};_0x5ee331(++_0x429f0c);}(_0xa4ce,0x193));var _0xea4c=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa4ce[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0xea4c('0x0'));var util=require(_0xea4c('0x1'));var path=require(_0xea4c('0x2'));var timeout=require(_0xea4c('0x3'));var express=require(_0xea4c('0x4'));var router=express[_0xea4c('0x5')]();var fs_extra=require(_0xea4c('0x6'));var auth=require(_0xea4c('0x7'));var interaction=require(_0xea4c('0x8'));var config=require(_0xea4c('0x9'));var controller=require('./campaign.controller');router[_0xea4c('0xa')]('/',auth['isAuthenticated'](),controller[_0xea4c('0xb')]);router[_0xea4c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xea4c('0xc')]);router[_0xea4c('0xa')](_0xea4c('0xd'),auth[_0xea4c('0xe')](),controller[_0xea4c('0xf')]);router[_0xea4c('0xa')]('/:id/hopper_histories',auth[_0xea4c('0xe')](),controller[_0xea4c('0x10')]);router[_0xea4c('0xa')](_0xea4c('0x11'),auth['isAuthenticated'](),controller[_0xea4c('0x12')]);router['get'](_0xea4c('0x13'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x14')]);router[_0xea4c('0xa')](_0xea4c('0x15'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x16')]);router[_0xea4c('0xa')](_0xea4c('0x17'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x18')]);router[_0xea4c('0x19')]('/',auth[_0xea4c('0xe')](),controller[_0xea4c('0x1a')]);router[_0xea4c('0x19')](_0xea4c('0x1b'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x1c')]);router[_0xea4c('0x19')](_0xea4c('0x15'),auth['isAuthenticated'](),controller[_0xea4c('0x1d')]);router[_0xea4c('0x19')](_0xea4c('0x17'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x1e')]);router['put'](_0xea4c('0x1f'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x20')]);router[_0xea4c('0x21')](_0xea4c('0x1f'),auth['isAuthenticated'](),controller['destroy']);router[_0xea4c('0x21')](_0xea4c('0x15'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x22')]);router[_0xea4c('0x21')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xea4c('0x23')]);module[_0xea4c('0x24')]=router;
\ No newline at end of file
+var _0xdd12=['getBlackLists','create','/:id/clone','clone','post','addLists','addBlackLists','put','/:id','delete','destroy','removeLists','/:id/blacklists','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists'];(function(_0x58a975,_0x4f7451){var _0x47f055=function(_0x4f57e1){while(--_0x4f57e1){_0x58a975['push'](_0x58a975['shift']());}};_0x47f055(++_0x4f7451);}(_0xdd12,0x1ee));var _0x2dd1=function(_0x202889,_0x524717){_0x202889=_0x202889-0x0;var _0xdfbc91=_0xdd12[_0x202889];return _0xdfbc91;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2dd1('0x0'));var timeout=require(_0x2dd1('0x1'));var express=require(_0x2dd1('0x2'));var router=express['Router']();var fs_extra=require(_0x2dd1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2dd1('0x4'));var config=require(_0x2dd1('0x5'));var controller=require('./campaign.controller');router['get']('/',auth[_0x2dd1('0x6')](),controller[_0x2dd1('0x7')]);router[_0x2dd1('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2dd1('0x8')](_0x2dd1('0x9'),auth[_0x2dd1('0x6')](),controller['getHoppers']);router['get'](_0x2dd1('0xa'),auth[_0x2dd1('0x6')](),controller[_0x2dd1('0xb')]);router['get'](_0x2dd1('0xc'),auth[_0x2dd1('0x6')](),controller[_0x2dd1('0xd')]);router['get'](_0x2dd1('0xe'),auth[_0x2dd1('0x6')](),controller[_0x2dd1('0xf')]);router[_0x2dd1('0x8')](_0x2dd1('0x10'),auth['isAuthenticated'](),controller[_0x2dd1('0x11')]);router[_0x2dd1('0x8')]('/:id/blacklists',auth[_0x2dd1('0x6')](),controller[_0x2dd1('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2dd1('0x13')]);router['post'](_0x2dd1('0x14'),auth[_0x2dd1('0x6')](),controller[_0x2dd1('0x15')]);router[_0x2dd1('0x16')](_0x2dd1('0x10'),auth[_0x2dd1('0x6')](),controller[_0x2dd1('0x17')]);router[_0x2dd1('0x16')]('/:id/blacklists',auth[_0x2dd1('0x6')](),controller[_0x2dd1('0x18')]);router[_0x2dd1('0x19')](_0x2dd1('0x1a'),auth[_0x2dd1('0x6')](),controller['update']);router[_0x2dd1('0x1b')](_0x2dd1('0x1a'),auth[_0x2dd1('0x6')](),controller[_0x2dd1('0x1c')]);router[_0x2dd1('0x1b')](_0x2dd1('0x10'),auth['isAuthenticated'](),controller[_0x2dd1('0x1d')]);router['delete'](_0x2dd1('0x1e'),auth[_0x2dd1('0x6')](),controller['removeBlackLists']);module[_0x2dd1('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index fa8a201..58df19f 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 _0x1621=['STRING','getDataValue','key','sequelize','exports'];(function(_0x43ba69,_0x3760ec){var _0x33ca5e=function(_0x354c09){while(--_0x354c09){_0x43ba69['push'](_0x43ba69['shift']());}};_0x33ca5e(++_0x3760ec);}(_0x1621,0x8f));var _0x1162=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x1621[_0x2132a3];return _0x21890c;};'use strict';var Sequelize=require(_0x1162('0x0'));module[_0x1162('0x1')]={'key':{'type':Sequelize[_0x1162('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1162('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1162('0x3')](_0x1162('0x4'));}}};
\ No newline at end of file
+var _0x1e12=['sequelize','exports','STRING','TEXT','key'];(function(_0x43736f,_0x2b8921){var _0x29be55=function(_0xb03515){while(--_0xb03515){_0x43736f['push'](_0x43736f['shift']());}};_0x29be55(++_0x2b8921);}(_0x1e12,0x1d1));var _0x21e1=function(_0x2260ed,_0x436c52){_0x2260ed=_0x2260ed-0x0;var _0x585d57=_0x1e12[_0x2260ed];return _0x585d57;};'use strict';var Sequelize=require(_0x21e1('0x0'));module[_0x21e1('0x1')]={'key':{'type':Sequelize[_0x21e1('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x21e1('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x21e1('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x21e1('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index d4fd039..3489ca1 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 _0x06de=['rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','show','params','catch','update','body','find','create','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','mustache','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/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','Content-Range','save','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer'];(function(_0x423265,_0x5d5191){var _0x247f70=function(_0x3c293b){while(--_0x3c293b){_0x423265['push'](_0x423265['shift']());}};_0x247f70(++_0x5d5191);}(_0x06de,0xd8));var _0xe06d=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x06de[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe06d('0x0'));var zipdir=require(_0xe06d('0x1'));var jsonpatch=require(_0xe06d('0x2'));var rp=require('request-promise');var moment=require(_0xe06d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe06d('0x4'));var util=require('util');var path=require(_0xe06d('0x5'));var sox=require(_0xe06d('0x6'));var csv=require(_0xe06d('0x7'));var ejs=require(_0xe06d('0x8'));var fs=require('fs');var fs_extra=require(_0xe06d('0x9'));var _=require(_0xe06d('0xa'));var squel=require(_0xe06d('0xb'));var crypto=require(_0xe06d('0xc'));var jsforce=require(_0xe06d('0xd'));var deskjs=require(_0xe06d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe06d('0xf'));var Papa=require(_0xe06d('0x10'));var Redis=require('ioredis');var authService=require(_0xe06d('0x11'));var qs=require(_0xe06d('0x12'));var as=require(_0xe06d('0x13'));var hardwareService=require(_0xe06d('0x14'));var logger=require(_0xe06d('0x15'))(_0xe06d('0x16'));var utils=require(_0xe06d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe06d('0x18'))['db'];function respondWithStatusCode(_0x1b8574,_0x1b2981){_0x1b2981=_0x1b2981||0xcc;return function(_0x159ae8){if(_0x159ae8){return _0x1b8574[_0xe06d('0x19')](_0x1b2981);}return _0x1b8574[_0xe06d('0x1a')](_0x1b2981)[_0xe06d('0x1b')]();};}function respondWithResult(_0x506c37,_0x2add77){_0x2add77=_0x2add77||0xc8;return function(_0x17347a){if(_0x17347a){return _0x506c37['status'](_0x2add77)[_0xe06d('0x1c')](_0x17347a);}};}function respondWithFilteredResult(_0x6874fe,_0x18962e){return function(_0x134c3c){if(_0x134c3c){var _0x3add6d=typeof _0x18962e[_0xe06d('0x1d')]===_0xe06d('0x1e')&&typeof _0x18962e['limit']==='undefined';var _0x50aa95=_0x134c3c['count'];var _0x4db06a=_0x3add6d?0x0:_0x18962e[_0xe06d('0x1d')];var _0x63dc47=_0x3add6d?_0x134c3c['count']:_0x18962e[_0xe06d('0x1d')]+_0x18962e['limit'];var _0x16b92b;if(_0x63dc47>=_0x50aa95){_0x63dc47=_0x50aa95;_0x16b92b=0xc8;}else{_0x16b92b=0xce;}_0x6874fe['status'](_0x16b92b);return _0x6874fe['set'](_0xe06d('0x1f'),_0x4db06a+'-'+_0x63dc47+'/'+_0x50aa95)[_0xe06d('0x1c')](_0x134c3c);}return null;};}function patchUpdates(_0x19cde2){return function(_0x2f23e0){try{jsonpatch['apply'](_0x2f23e0,_0x19cde2,!![]);}catch(_0x4f0c35){return BPromise['reject'](_0x4f0c35);}return _0x2f23e0[_0xe06d('0x20')]();};}function saveUpdates(_0x20e79e,_0x4f0626){return function(_0x4e0f88){if(_0x4e0f88){return _0x4e0f88['update'](_0x20e79e)[_0xe06d('0x21')](function(_0x62bb6e){return _0x62bb6e;});}return null;};}function removeEntity(_0x23d228,_0x393867){return function(_0x24874e){if(_0x24874e){return _0x24874e[_0xe06d('0x22')]()['then'](function(){var _0x5c41de=_0x24874e[_0xe06d('0x23')]({'plain':!![]});var _0x5261a2=_0xe06d('0x24');return db[_0xe06d('0x25')][_0xe06d('0x22')]({'where':{'type':_0x5261a2,'resourceId':_0x5c41de['id']}})[_0xe06d('0x21')](function(){return _0x24874e;});})[_0xe06d('0x21')](function(){_0x23d228[_0xe06d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x465d06,_0x586873){return function(_0x21e2ce){if(!_0x21e2ce){_0x465d06['sendStatus'](0x194);}return _0x21e2ce;};}function handleError(_0x2e582f,_0x757258){_0x757258=_0x757258||0x1f4;return function(_0x3568f8){logger[_0xe06d('0x26')](_0x3568f8[_0xe06d('0x27')]);if(_0x3568f8[_0xe06d('0x28')]){delete _0x3568f8[_0xe06d('0x28')];}_0x2e582f['status'](_0x757258)[_0xe06d('0x29')](_0x3568f8);};}exports[_0xe06d('0x2a')]=function(_0x4288bd,_0x1ecc99){var _0x2f545a={},_0xb14c75={},_0x2585b4={'count':0x0,'rows':[]};var _0x7b8e78=_[_0xe06d('0x2b')](db[_0xe06d('0x2c')][_0xe06d('0x2d')],function(_0x35defe){return{'name':_0x35defe[_0xe06d('0x2e')],'type':_0x35defe[_0xe06d('0x2f')][_0xe06d('0x30')]};});_0xb14c75['model']=_[_0xe06d('0x2b')](_0x7b8e78,_0xe06d('0x28'));_0xb14c75['query']=_[_0xe06d('0x31')](_0x4288bd[_0xe06d('0x32')]);_0xb14c75[_0xe06d('0x33')]=_['intersection'](_0xb14c75['model'],_0xb14c75[_0xe06d('0x32')]);_0x2f545a[_0xe06d('0x34')]=_[_0xe06d('0x35')](_0xb14c75[_0xe06d('0x36')],qs['fields'](_0x4288bd['query'][_0xe06d('0x37')]));_0x2f545a[_0xe06d('0x34')]=_0x2f545a[_0xe06d('0x34')][_0xe06d('0x38')]?_0x2f545a[_0xe06d('0x34')]:_0xb14c75[_0xe06d('0x36')];if(!_0x4288bd['query']['hasOwnProperty'](_0xe06d('0x39'))){_0x2f545a['limit']=qs['limit'](_0x4288bd[_0xe06d('0x32')][_0xe06d('0x3a')]);_0x2f545a[_0xe06d('0x1d')]=qs[_0xe06d('0x1d')](_0x4288bd[_0xe06d('0x32')][_0xe06d('0x1d')]);}_0x2f545a[_0xe06d('0x3b')]=qs[_0xe06d('0x3c')](_0x4288bd['query'][_0xe06d('0x3c')]);_0x2f545a[_0xe06d('0x3d')]=qs[_0xe06d('0x33')](_[_0xe06d('0x3e')](_0x4288bd[_0xe06d('0x32')],_0xb14c75[_0xe06d('0x33')]),_0x7b8e78);if(_0x4288bd[_0xe06d('0x32')][_0xe06d('0x3f')]){_0x2f545a['where']=_['merge'](_0x2f545a[_0xe06d('0x3d')],{'$or':[{'key':{'$like':'%'+_0x4288bd[_0xe06d('0x32')][_0xe06d('0x3f')]+'%'}},{'value':{'$like':'%'+_0x4288bd['query'][_0xe06d('0x3f')]+'%'}}]});}_0x2f545a=_[_0xe06d('0x40')]({},_0x2f545a,_0x4288bd[_0xe06d('0x41')]);var _0x4060e5={'where':_0x2f545a[_0xe06d('0x3d')]};return db['CannedAnswer'][_0xe06d('0x42')](_0x4060e5)['then'](function(_0x3c705a){_0x2585b4[_0xe06d('0x42')]=_0x3c705a;if(_0x4288bd[_0xe06d('0x32')][_0xe06d('0x43')]){_0x2f545a[_0xe06d('0x44')]=[{'all':!![]}];}return db[_0xe06d('0x2c')][_0xe06d('0x45')](_0x2f545a);})[_0xe06d('0x21')](function(_0x4d0987){_0x2585b4['rows']=_0x4d0987;return _0x2585b4;})[_0xe06d('0x21')](respondWithFilteredResult(_0x1ecc99,_0x2f545a))['catch'](handleError(_0x1ecc99,null));};exports[_0xe06d('0x46')]=function(_0x59e3e8,_0x33462d){var _0x31e155={'raw':!![],'where':{'id':_0x59e3e8[_0xe06d('0x47')]['id']}},_0x32be1a={};_0x32be1a['model']=_['keys'](db[_0xe06d('0x2c')]['rawAttributes']);_0x32be1a[_0xe06d('0x32')]=_['keys'](_0x59e3e8[_0xe06d('0x32')]);_0x32be1a[_0xe06d('0x33')]=_[_0xe06d('0x35')](_0x32be1a[_0xe06d('0x36')],_0x32be1a[_0xe06d('0x32')]);_0x31e155['attributes']=_[_0xe06d('0x35')](_0x32be1a[_0xe06d('0x36')],qs['fields'](_0x59e3e8[_0xe06d('0x32')][_0xe06d('0x37')]));_0x31e155[_0xe06d('0x34')]=_0x31e155[_0xe06d('0x34')][_0xe06d('0x38')]?_0x31e155[_0xe06d('0x34')]:_0x32be1a[_0xe06d('0x36')];if(_0x59e3e8['query']['includeAll']){_0x31e155[_0xe06d('0x44')]=[{'all':!![]}];}_0x31e155=_[_0xe06d('0x40')]({},_0x31e155,_0x59e3e8[_0xe06d('0x41')]);return db[_0xe06d('0x2c')]['find'](_0x31e155)[_0xe06d('0x21')](handleEntityNotFound(_0x33462d,null))[_0xe06d('0x21')](respondWithResult(_0x33462d,null))[_0xe06d('0x48')](handleError(_0x33462d,null));};exports[_0xe06d('0x49')]=function(_0x2ae4c5,_0x498b00){if(_0x2ae4c5[_0xe06d('0x4a')]['id']){delete _0x2ae4c5[_0xe06d('0x4a')]['id'];}return db[_0xe06d('0x2c')][_0xe06d('0x4b')]({'where':{'id':_0x2ae4c5[_0xe06d('0x47')]['id']}})['then'](handleEntityNotFound(_0x498b00,null))[_0xe06d('0x21')](saveUpdates(_0x2ae4c5[_0xe06d('0x4a')],null))[_0xe06d('0x21')](respondWithResult(_0x498b00,null))['catch'](handleError(_0x498b00,null));};exports['destroy']=function(_0x2183c2,_0x341404){return db[_0xe06d('0x2c')]['find']({'where':{'id':_0x2183c2['params']['id']}})[_0xe06d('0x21')](handleEntityNotFound(_0x341404,null))['then'](removeEntity(_0x341404,null))['catch'](handleError(_0x341404,null));};exports[_0xe06d('0x4c')]=function(_0x18f12e,_0x60392d){var _0x428ce7={'key':_0x18f12e['body'][_0xe06d('0x30')]};if(_0x18f12e[_0xe06d('0x4a')]['MailAccountId']){_0x428ce7['MailAccountId']=_0x18f12e['body']['MailAccountId'];}else if(_0x18f12e[_0xe06d('0x4a')][_0xe06d('0x4d')]){_0x428ce7[_0xe06d('0x4d')]=_0x18f12e[_0xe06d('0x4a')][_0xe06d('0x4d')];}else if(_0x18f12e[_0xe06d('0x4a')]['OpenchannelAccountId']){_0x428ce7['OpenchannelAccountId']=_0x18f12e[_0xe06d('0x4a')][_0xe06d('0x4e')];}else if(_0x18f12e['body'][_0xe06d('0x4f')]){_0x428ce7[_0xe06d('0x4f')]=_0x18f12e[_0xe06d('0x4a')][_0xe06d('0x4f')];}return db[_0xe06d('0x2c')][_0xe06d('0x4b')]({'where':_0x428ce7})[_0xe06d('0x21')](function(_0x4c3c79){if(_0x4c3c79){throw new db[(_0xe06d('0x50'))]['ValidationError'](_0xe06d('0x51'));}return db[_0xe06d('0x2c')]['create'](_0x18f12e[_0xe06d('0x4a')]);})[_0xe06d('0x21')](function(_0x1b8afc){var _0x3d02bd=_0x18f12e[_0xe06d('0x52')][_0xe06d('0x23')]({'plain':!![]});if(!_0x3d02bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d02bd[_0xe06d('0x53')]===_0xe06d('0x52')){var _0x591a1c=_0x1b8afc[_0xe06d('0x23')]({'plain':!![]});return db[_0xe06d('0x54')][_0xe06d('0x4b')]({'where':{'name':_0xe06d('0x24'),'userProfileId':_0x3d02bd['userProfileId']},'raw':!![]})[_0xe06d('0x21')](function(_0x17aa90){if(_0x17aa90&&_0x17aa90[_0xe06d('0x55')]===0x0){return db[_0xe06d('0x25')][_0xe06d('0x4c')]({'name':_0x591a1c[_0xe06d('0x28')],'resourceId':_0x591a1c['id'],'type':_0x17aa90[_0xe06d('0x28')],'sectionId':_0x17aa90['id']},{})[_0xe06d('0x21')](function(){return _0x1b8afc;});}else{return _0x1b8afc;}})[_0xe06d('0x48')](function(_0x47e6d6){logger[_0xe06d('0x26')](_0xe06d('0x56'),_0x47e6d6);throw _0x47e6d6;});}return _0x1b8afc;})[_0xe06d('0x21')](respondWithResult(_0x60392d,0xc9))[_0xe06d('0x48')](handleError(_0x60392d,null));};
\ No newline at end of file
+var _0xda64=['limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0xda64,0x96));var _0x4da6=function(_0x27a196,_0x4f6a2e){_0x27a196=_0x27a196-0x0;var _0x482900=_0xda64[_0x27a196];return _0x482900;};'use strict';var emlformat=require(_0x4da6('0x0'));var rimraf=require(_0x4da6('0x1'));var zipdir=require(_0x4da6('0x2'));var jsonpatch=require(_0x4da6('0x3'));var rp=require(_0x4da6('0x4'));var moment=require(_0x4da6('0x5'));var BPromise=require(_0x4da6('0x6'));var Mustache=require(_0x4da6('0x7'));var util=require(_0x4da6('0x8'));var path=require(_0x4da6('0x9'));var sox=require(_0x4da6('0xa'));var csv=require(_0x4da6('0xb'));var ejs=require(_0x4da6('0xc'));var fs=require('fs');var fs_extra=require(_0x4da6('0xd'));var _=require(_0x4da6('0xe'));var squel=require(_0x4da6('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4da6('0x10'));var toCsv=require(_0x4da6('0xb'));var querystring=require(_0x4da6('0x11'));var Papa=require('papaparse');var Redis=require(_0x4da6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4da6('0x13'));var as=require(_0x4da6('0x14'));var hardwareService=require(_0x4da6('0x15'));var logger=require(_0x4da6('0x16'))(_0x4da6('0x17'));var utils=require(_0x4da6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4da6('0x19'));var db=require(_0x4da6('0x1a'))['db'];function respondWithStatusCode(_0x84e0f5,_0x57155f){_0x57155f=_0x57155f||0xcc;return function(_0x598c5f){if(_0x598c5f){return _0x84e0f5[_0x4da6('0x1b')](_0x57155f);}return _0x84e0f5[_0x4da6('0x1c')](_0x57155f)[_0x4da6('0x1d')]();};}function respondWithResult(_0x3ee88d,_0x4c9089){_0x4c9089=_0x4c9089||0xc8;return function(_0x1a8a38){if(_0x1a8a38){return _0x3ee88d[_0x4da6('0x1c')](_0x4c9089)[_0x4da6('0x1e')](_0x1a8a38);}};}function respondWithFilteredResult(_0x41aba8,_0x518653){return function(_0x1fd32f){if(_0x1fd32f){var _0x13abf5=typeof _0x518653[_0x4da6('0x1f')]==='undefined'&&typeof _0x518653[_0x4da6('0x20')]===_0x4da6('0x21');var _0x2e8385=_0x1fd32f[_0x4da6('0x22')];var _0x3db891=_0x13abf5?0x0:_0x518653[_0x4da6('0x1f')];var _0x566854=_0x13abf5?_0x1fd32f[_0x4da6('0x22')]:_0x518653['offset']+_0x518653['limit'];var _0x53227e;if(_0x566854>=_0x2e8385){_0x566854=_0x2e8385;_0x53227e=0xc8;}else{_0x53227e=0xce;}_0x41aba8[_0x4da6('0x1c')](_0x53227e);return _0x41aba8[_0x4da6('0x23')](_0x4da6('0x24'),_0x3db891+'-'+_0x566854+'/'+_0x2e8385)[_0x4da6('0x1e')](_0x1fd32f);}return null;};}function patchUpdates(_0x16e71e){return function(_0x1e68d0){try{jsonpatch[_0x4da6('0x25')](_0x1e68d0,_0x16e71e,!![]);}catch(_0x1966ed){return BPromise[_0x4da6('0x26')](_0x1966ed);}return _0x1e68d0[_0x4da6('0x27')]();};}function saveUpdates(_0x18dc26,_0x2eb772){return function(_0x17b1c9){if(_0x17b1c9){return _0x17b1c9[_0x4da6('0x28')](_0x18dc26)[_0x4da6('0x29')](function(_0x1c6c5f){return _0x1c6c5f;});}return null;};}function removeEntity(_0x1e5d37,_0x41ab40){return function(_0xe8ef0a){if(_0xe8ef0a){return _0xe8ef0a['destroy']()[_0x4da6('0x29')](function(){var _0x9c43e2=_0xe8ef0a[_0x4da6('0x2a')]({'plain':!![]});var _0x194a42='CannedAnswers';return db[_0x4da6('0x2b')]['destroy']({'where':{'type':_0x194a42,'resourceId':_0x9c43e2['id']}})['then'](function(){return _0xe8ef0a;});})[_0x4da6('0x29')](function(){_0x1e5d37[_0x4da6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5afd,_0x55d5d8){return function(_0x52a5fb){if(!_0x52a5fb){_0x2d5afd[_0x4da6('0x1b')](0x194);}return _0x52a5fb;};}function handleError(_0x3d4f48,_0x361a80){_0x361a80=_0x361a80||0x1f4;return function(_0x1fd7b3){logger[_0x4da6('0x2c')](_0x1fd7b3['stack']);if(_0x1fd7b3[_0x4da6('0x2d')]){delete _0x1fd7b3['name'];}_0x3d4f48[_0x4da6('0x1c')](_0x361a80)[_0x4da6('0x2e')](_0x1fd7b3);};}exports[_0x4da6('0x2f')]=function(_0x5ae079,_0x58a03b){var _0x16aa70={},_0x37971f={},_0x4704ad={'count':0x0,'rows':[]};var _0x170a5f=_[_0x4da6('0x30')](db[_0x4da6('0x31')][_0x4da6('0x32')],function(_0x43ea97){return{'name':_0x43ea97[_0x4da6('0x33')],'type':_0x43ea97[_0x4da6('0x34')][_0x4da6('0x35')]};});_0x37971f[_0x4da6('0x36')]=_[_0x4da6('0x30')](_0x170a5f,_0x4da6('0x2d'));_0x37971f['query']=_[_0x4da6('0x37')](_0x5ae079[_0x4da6('0x38')]);_0x37971f[_0x4da6('0x39')]=_[_0x4da6('0x3a')](_0x37971f[_0x4da6('0x36')],_0x37971f[_0x4da6('0x38')]);_0x16aa70[_0x4da6('0x3b')]=_[_0x4da6('0x3a')](_0x37971f['model'],qs[_0x4da6('0x3c')](_0x5ae079[_0x4da6('0x38')][_0x4da6('0x3c')]));_0x16aa70['attributes']=_0x16aa70[_0x4da6('0x3b')][_0x4da6('0x3d')]?_0x16aa70[_0x4da6('0x3b')]:_0x37971f['model'];if(!_0x5ae079['query']['hasOwnProperty'](_0x4da6('0x3e'))){_0x16aa70[_0x4da6('0x20')]=qs[_0x4da6('0x20')](_0x5ae079[_0x4da6('0x38')][_0x4da6('0x20')]);_0x16aa70[_0x4da6('0x1f')]=qs['offset'](_0x5ae079[_0x4da6('0x38')][_0x4da6('0x1f')]);}_0x16aa70[_0x4da6('0x3f')]=qs[_0x4da6('0x40')](_0x5ae079[_0x4da6('0x38')][_0x4da6('0x40')]);_0x16aa70[_0x4da6('0x41')]=qs['filters'](_[_0x4da6('0x42')](_0x5ae079[_0x4da6('0x38')],_0x37971f[_0x4da6('0x39')]),_0x170a5f);if(_0x5ae079[_0x4da6('0x38')][_0x4da6('0x43')]){_0x16aa70[_0x4da6('0x41')]=_['merge'](_0x16aa70[_0x4da6('0x41')],{'$or':[{'key':{'$like':'%'+_0x5ae079[_0x4da6('0x38')]['filter']+'%'}},{'value':{'$like':'%'+_0x5ae079[_0x4da6('0x38')]['filter']+'%'}}]});}_0x16aa70=_[_0x4da6('0x44')]({},_0x16aa70,_0x5ae079[_0x4da6('0x45')]);var _0x6d58b7={'where':_0x16aa70[_0x4da6('0x41')]};return db['CannedAnswer'][_0x4da6('0x22')](_0x6d58b7)[_0x4da6('0x29')](function(_0x123674){_0x4704ad[_0x4da6('0x22')]=_0x123674;if(_0x5ae079['query']['includeAll']){_0x16aa70[_0x4da6('0x46')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x16aa70);})[_0x4da6('0x29')](function(_0xa7a5eb){_0x4704ad[_0x4da6('0x47')]=_0xa7a5eb;return _0x4704ad;})[_0x4da6('0x29')](respondWithFilteredResult(_0x58a03b,_0x16aa70))[_0x4da6('0x48')](handleError(_0x58a03b,null));};exports[_0x4da6('0x49')]=function(_0x3be63c,_0x218437){var _0x51b5f1={'raw':!![],'where':{'id':_0x3be63c[_0x4da6('0x4a')]['id']}},_0x1ca64c={};_0x1ca64c[_0x4da6('0x36')]=_[_0x4da6('0x37')](db[_0x4da6('0x31')]['rawAttributes']);_0x1ca64c[_0x4da6('0x38')]=_[_0x4da6('0x37')](_0x3be63c[_0x4da6('0x38')]);_0x1ca64c['filters']=_['intersection'](_0x1ca64c[_0x4da6('0x36')],_0x1ca64c[_0x4da6('0x38')]);_0x51b5f1[_0x4da6('0x3b')]=_[_0x4da6('0x3a')](_0x1ca64c[_0x4da6('0x36')],qs[_0x4da6('0x3c')](_0x3be63c[_0x4da6('0x38')][_0x4da6('0x3c')]));_0x51b5f1[_0x4da6('0x3b')]=_0x51b5f1[_0x4da6('0x3b')][_0x4da6('0x3d')]?_0x51b5f1[_0x4da6('0x3b')]:_0x1ca64c[_0x4da6('0x36')];if(_0x3be63c[_0x4da6('0x38')]['includeAll']){_0x51b5f1[_0x4da6('0x46')]=[{'all':!![]}];}_0x51b5f1=_[_0x4da6('0x44')]({},_0x51b5f1,_0x3be63c['options']);return db['CannedAnswer'][_0x4da6('0x4b')](_0x51b5f1)[_0x4da6('0x29')](handleEntityNotFound(_0x218437,null))[_0x4da6('0x29')](respondWithResult(_0x218437,null))['catch'](handleError(_0x218437,null));};exports[_0x4da6('0x28')]=function(_0x4d76b2,_0x542997){if(_0x4d76b2['body']['id']){delete _0x4d76b2[_0x4da6('0x4c')]['id'];}return db[_0x4da6('0x31')][_0x4da6('0x4b')]({'where':{'id':_0x4d76b2['params']['id']}})[_0x4da6('0x29')](handleEntityNotFound(_0x542997,null))[_0x4da6('0x29')](saveUpdates(_0x4d76b2[_0x4da6('0x4c')],null))[_0x4da6('0x29')](respondWithResult(_0x542997,null))[_0x4da6('0x48')](handleError(_0x542997,null));};exports['destroy']=function(_0x3ee2ba,_0x384d8c){return db[_0x4da6('0x31')][_0x4da6('0x4b')]({'where':{'id':_0x3ee2ba[_0x4da6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x384d8c,null))[_0x4da6('0x29')](removeEntity(_0x384d8c,null))[_0x4da6('0x48')](handleError(_0x384d8c,null));};exports[_0x4da6('0x4d')]=function(_0x3d17c5,_0x396213){var _0x351b7d={'key':_0x3d17c5['body'][_0x4da6('0x35')]};if(_0x3d17c5[_0x4da6('0x4c')][_0x4da6('0x4e')]){_0x351b7d['MailAccountId']=_0x3d17c5[_0x4da6('0x4c')][_0x4da6('0x4e')];}else if(_0x3d17c5[_0x4da6('0x4c')][_0x4da6('0x4f')]){_0x351b7d[_0x4da6('0x4f')]=_0x3d17c5[_0x4da6('0x4c')][_0x4da6('0x4f')];}else if(_0x3d17c5[_0x4da6('0x4c')][_0x4da6('0x50')]){_0x351b7d[_0x4da6('0x50')]=_0x3d17c5[_0x4da6('0x4c')]['OpenchannelAccountId'];}else if(_0x3d17c5[_0x4da6('0x4c')][_0x4da6('0x51')]){_0x351b7d[_0x4da6('0x51')]=_0x3d17c5['body'][_0x4da6('0x51')];}return db[_0x4da6('0x31')][_0x4da6('0x4b')]({'where':_0x351b7d})[_0x4da6('0x29')](function(_0x1a65e1){if(_0x1a65e1){throw new db['Sequelize'][(_0x4da6('0x52'))](_0x4da6('0x53'));}return db[_0x4da6('0x31')][_0x4da6('0x4d')](_0x3d17c5[_0x4da6('0x4c')]);})['then'](function(_0x452c79){var _0x103dd4=_0x3d17c5['user']['get']({'plain':!![]});if(!_0x103dd4)throw new Error(_0x4da6('0x54'));if(_0x103dd4[_0x4da6('0x55')]===_0x4da6('0x56')){var _0x5e6dbb=_0x452c79[_0x4da6('0x2a')]({'plain':!![]});return db[_0x4da6('0x57')][_0x4da6('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x103dd4[_0x4da6('0x58')]},'raw':!![]})['then'](function(_0x3e8f2a){if(_0x3e8f2a&&_0x3e8f2a[_0x4da6('0x59')]===0x0){return db[_0x4da6('0x2b')][_0x4da6('0x4d')]({'name':_0x5e6dbb[_0x4da6('0x2d')],'resourceId':_0x5e6dbb['id'],'type':_0x3e8f2a[_0x4da6('0x2d')],'sectionId':_0x3e8f2a['id']},{})['then'](function(){return _0x452c79;});}else{return _0x452c79;}})[_0x4da6('0x48')](function(_0x421c75){logger[_0x4da6('0x2c')](_0x4da6('0x5a'),_0x421c75);throw _0x421c75;});}return _0x452c79;})[_0x4da6('0x29')](respondWithResult(_0x396213,0xc9))[_0x4da6('0x48')](handleError(_0x396213,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 7643bf8..fe6449f 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 _0x8144=['api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','lodash','util'];(function(_0x46e523,_0xe6fccb){var _0x5da0ee=function(_0x396682){while(--_0x396682){_0x46e523['push'](_0x46e523['shift']());}};_0x5da0ee(++_0xe6fccb);}(_0x8144,0xf5));var _0x4814=function(_0x4e70fd,_0xd0ef5b){_0x4e70fd=_0x4e70fd-0x0;var _0x51cd96=_0x8144[_0x4e70fd];return _0x51cd96;};'use strict';var _=require(_0x4814('0x0'));var util=require(_0x4814('0x1'));var logger=require('../../config/logger')(_0x4814('0x2'));var moment=require(_0x4814('0x3'));var BPromise=require('bluebird');var rp=require(_0x4814('0x4'));var fs=require('fs');var path=require(_0x4814('0x5'));var rimraf=require(_0x4814('0x6'));var config=require(_0x4814('0x7'));var attributes=require(_0x4814('0x8'));module[_0x4814('0x9')]=function(_0x3da152,_0x50164c){return _0x3da152[_0x4814('0xa')](_0x4814('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4814('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe2aa=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x2a47ad,_0x1cda26){var _0x3794b4=function(_0x1dc1f7){while(--_0x1dc1f7){_0x2a47ad['push'](_0x2a47ad['shift']());}};_0x3794b4(++_0x1cda26);}(_0xe2aa,0x9c));var _0xae2a=function(_0x24e866,_0x59c07a){_0x24e866=_0x24e866-0x0;var _0xe36df0=_0xe2aa[_0x24e866];return _0xe36df0;};'use strict';var _=require(_0xae2a('0x0'));var util=require(_0xae2a('0x1'));var logger=require(_0xae2a('0x2'))(_0xae2a('0x3'));var moment=require(_0xae2a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xae2a('0x5'));var rimraf=require(_0xae2a('0x6'));var config=require('../../config/environment');var attributes=require(_0xae2a('0x7'));module[_0xae2a('0x8')]=function(_0x4512ec,_0x265e9d){return _0x4512ec[_0xae2a('0x9')](_0xae2a('0xa'),attributes,{'tableName':_0xae2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae2a('0xc'),'collate':_0xae2a('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index fe6c60f..b000b97 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(_0x21d7a8,_0x551f3a){var _0x1f2320=function(_0x2a8eb6){while(--_0x2a8eb6){_0x21d7a8['push'](_0x21d7a8['shift']());}};_0x1f2320(++_0x551f3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x53bb21,_0x485e52){var _0x576d85=function(_0x2eaf2e){while(--_0x2eaf2e){_0x53bb21['push'](_0x53bb21['shift']());}};_0x576d85(++_0x485e52);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 251d248..c8c5d00 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 _0x8d0f=['get','isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x5987a3,_0x1dee96){var _0x477db4=function(_0x3dd0b2){while(--_0x3dd0b2){_0x5987a3['push'](_0x5987a3['shift']());}};_0x477db4(++_0x1dee96);}(_0x8d0f,0x129));var _0xf8d0=function(_0x1f2758,_0x153885){_0x1f2758=_0x1f2758-0x0;var _0x3bc8c3=_0x8d0f[_0x1f2758];return _0x3bc8c3;};'use strict';var multer=require(_0xf8d0('0x0'));var util=require(_0xf8d0('0x1'));var path=require(_0xf8d0('0x2'));var timeout=require(_0xf8d0('0x3'));var express=require('express');var router=express[_0xf8d0('0x4')]();var fs_extra=require(_0xf8d0('0x5'));var auth=require(_0xf8d0('0x6'));var interaction=require(_0xf8d0('0x7'));var config=require('../../config/environment');var controller=require(_0xf8d0('0x8'));router[_0xf8d0('0x9')]('/',auth[_0xf8d0('0xa')](),controller[_0xf8d0('0xb')]);router['get'](_0xf8d0('0xc'),auth[_0xf8d0('0xa')](),controller[_0xf8d0('0xd')]);router[_0xf8d0('0xe')]('/',auth[_0xf8d0('0xa')](),controller['create']);router['put']('/:id',auth[_0xf8d0('0xa')](),controller[_0xf8d0('0xf')]);router['delete'](_0xf8d0('0xc'),auth[_0xf8d0('0xa')](),controller[_0xf8d0('0x10')]);module[_0xf8d0('0x11')]=router;
\ No newline at end of file
+var _0x081f=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','/:id','show','post','create','isAuthenticated','update','delete','exports'];(function(_0x64b86a,_0x386825){var _0xcb4fc3=function(_0x245e46){while(--_0x245e46){_0x64b86a['push'](_0x64b86a['shift']());}};_0xcb4fc3(++_0x386825);}(_0x081f,0x1c2));var _0xf081=function(_0x5090d4,_0x1950a7){_0x5090d4=_0x5090d4-0x0;var _0x56c310=_0x081f[_0x5090d4];return _0x56c310;};'use strict';var multer=require(_0xf081('0x0'));var util=require(_0xf081('0x1'));var path=require(_0xf081('0x2'));var timeout=require(_0xf081('0x3'));var express=require('express');var router=express[_0xf081('0x4')]();var fs_extra=require(_0xf081('0x5'));var auth=require(_0xf081('0x6'));var interaction=require(_0xf081('0x7'));var config=require('../../config/environment');var controller=require(_0xf081('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf081('0x9')](_0xf081('0xa'),auth['isAuthenticated'](),controller[_0xf081('0xb')]);router[_0xf081('0xc')]('/',auth['isAuthenticated'](),controller[_0xf081('0xd')]);router['put'](_0xf081('0xa'),auth[_0xf081('0xe')](),controller[_0xf081('0xf')]);router[_0xf081('0x10')]('/:id',auth[_0xf081('0xe')](),controller['destroy']);module[_0xf081('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 82b442a..e6c0a29 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 _0x7b6b=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0x7b6b,0xac));var _0xb7b6=function(_0x32761f,_0x49ef6f){_0x32761f=_0x32761f-0x0;var _0x43ba7d=_0x7b6b[_0x32761f];return _0x43ba7d;};'use strict';var Sequelize=require(_0xb7b6('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xb7b6('0x1')],'allowNull':![],'defaultValue':_0xb7b6('0x2')},'clid':{'type':Sequelize[_0xb7b6('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb7b6('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb7b6('0x3')]},'dstchannel':{'type':Sequelize[_0xb7b6('0x3')]},'lastapp':{'type':Sequelize[_0xb7b6('0x3')]},'lastdata':{'type':Sequelize[_0xb7b6('0x3')]},'duration':{'type':Sequelize[_0xb7b6('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb7b6('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb7b6('0x3')]},'amaflags':{'type':Sequelize[_0xb7b6('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb7b6('0x3')]},'userfield':{'type':Sequelize[_0xb7b6('0x3')]},'uniqueid':{'type':Sequelize[_0xb7b6('0x3')]},'linkedid':{'type':Sequelize[_0xb7b6('0x3')]},'sequence':{'type':Sequelize[_0xb7b6('0x3')]},'peeraccount':{'type':Sequelize[_0xb7b6('0x3')]},'type':{'type':Sequelize[_0xb7b6('0x3')]},'tag':{'type':Sequelize[_0xb7b6('0x3')]}};
\ No newline at end of file
+var _0xfc1e=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0x471452,_0x157074){var _0x1220ac=function(_0x404d5c){while(--_0x404d5c){_0x471452['push'](_0x471452['shift']());}};_0x1220ac(++_0x157074);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x5090d4,_0x1950a7){_0x5090d4=_0x5090d4-0x0;var _0x56c310=_0xfc1e[_0x5090d4];return _0x56c310;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xefc1('0x0')},'clid':{'type':Sequelize[_0xefc1('0x1')]},'src':{'type':Sequelize[_0xefc1('0x1')]},'dst':{'type':Sequelize[_0xefc1('0x1')]},'dcontext':{'type':Sequelize[_0xefc1('0x1')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xefc1('0x1')]},'lastapp':{'type':Sequelize[_0xefc1('0x1')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xefc1('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xefc1('0x1')]},'amaflags':{'type':Sequelize[_0xefc1('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xefc1('0x1')]},'userfield':{'type':Sequelize[_0xefc1('0x1')]},'uniqueid':{'type':Sequelize[_0xefc1('0x1')]},'linkedid':{'type':Sequelize[_0xefc1('0x1')]},'sequence':{'type':Sequelize[_0xefc1('0x1')]},'peeraccount':{'type':Sequelize[_0xefc1('0x1')]},'type':{'type':Sequelize[_0xefc1('0x1')]},'tag':{'type':Sequelize[_0xefc1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index b0480c4..a0c4fb0 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 _0x5577=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','Cdr','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','rows','show','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x39d266,_0x52d1cc){var _0x276890=function(_0x5fac60){while(--_0x5fac60){_0x39d266['push'](_0x39d266['shift']());}};_0x276890(++_0x52d1cc);}(_0x5577,0x1b4));var _0x7557=function(_0x5bb85c,_0x2a41da){_0x5bb85c=_0x5bb85c-0x0;var _0x180e0b=_0x5577[_0x5bb85c];return _0x180e0b;};'use strict';var emlformat=require(_0x7557('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7557('0x1'));var jsonpatch=require(_0x7557('0x2'));var rp=require('request-promise');var moment=require(_0x7557('0x3'));var BPromise=require(_0x7557('0x4'));var Mustache=require(_0x7557('0x5'));var util=require(_0x7557('0x6'));var path=require(_0x7557('0x7'));var sox=require(_0x7557('0x8'));var csv=require('to-csv');var ejs=require(_0x7557('0x9'));var fs=require('fs');var fs_extra=require(_0x7557('0xa'));var _=require(_0x7557('0xb'));var squel=require(_0x7557('0xc'));var crypto=require(_0x7557('0xd'));var jsforce=require(_0x7557('0xe'));var deskjs=require(_0x7557('0xf'));var toCsv=require(_0x7557('0x10'));var querystring=require(_0x7557('0x11'));var Papa=require(_0x7557('0x12'));var Redis=require(_0x7557('0x13'));var authService=require(_0x7557('0x14'));var qs=require(_0x7557('0x15'));var as=require(_0x7557('0x16'));var hardwareService=require(_0x7557('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x7557('0x18'));var config=require(_0x7557('0x19'));var licenseUtil=require(_0x7557('0x1a'));var db=require(_0x7557('0x1b'))['db'];function respondWithStatusCode(_0xb6ed30,_0x467ac5){_0x467ac5=_0x467ac5||0xcc;return function(_0x156ac1){if(_0x156ac1){return _0xb6ed30[_0x7557('0x1c')](_0x467ac5);}return _0xb6ed30[_0x7557('0x1d')](_0x467ac5)[_0x7557('0x1e')]();};}function respondWithResult(_0x5468df,_0x276031){_0x276031=_0x276031||0xc8;return function(_0x3fb7a6){if(_0x3fb7a6){return _0x5468df[_0x7557('0x1d')](_0x276031)['json'](_0x3fb7a6);}};}function respondWithFilteredResult(_0x3ad3a1,_0x3c3953){return function(_0x33098f){if(_0x33098f){var _0x325849=typeof _0x3c3953['offset']===_0x7557('0x1f')&&typeof _0x3c3953[_0x7557('0x20')]==='undefined';var _0x4a9cae=_0x33098f[_0x7557('0x21')];var _0x11f186=_0x325849?0x0:_0x3c3953[_0x7557('0x22')];var _0x40a81b=_0x325849?_0x33098f['count']:_0x3c3953[_0x7557('0x22')]+_0x3c3953['limit'];var _0x3e2972;if(_0x40a81b>=_0x4a9cae){_0x40a81b=_0x4a9cae;_0x3e2972=0xc8;}else{_0x3e2972=0xce;}_0x3ad3a1[_0x7557('0x1d')](_0x3e2972);return _0x3ad3a1[_0x7557('0x23')](_0x7557('0x24'),_0x11f186+'-'+_0x40a81b+'/'+_0x4a9cae)['json'](_0x33098f);}return null;};}function patchUpdates(_0x1b60a9){return function(_0x3180cd){try{jsonpatch[_0x7557('0x25')](_0x3180cd,_0x1b60a9,!![]);}catch(_0x34bed5){return BPromise[_0x7557('0x26')](_0x34bed5);}return _0x3180cd['save']();};}function saveUpdates(_0x502e49,_0x4eb212){return function(_0x211fbe){if(_0x211fbe){return _0x211fbe['update'](_0x502e49)[_0x7557('0x27')](function(_0x352b63){return _0x352b63;});}return null;};}function removeEntity(_0x1e97d3,_0x9bbcf6){return function(_0x1533b2){if(_0x1533b2){return _0x1533b2[_0x7557('0x28')]()[_0x7557('0x27')](function(){_0x1e97d3['status'](0xcc)[_0x7557('0x1e')]();});}};}function handleEntityNotFound(_0x5bc953,_0x3daeac){return function(_0x5b2c6a){if(!_0x5b2c6a){_0x5bc953[_0x7557('0x1c')](0x194);}return _0x5b2c6a;};}function handleError(_0x3aa642,_0x4758b9){_0x4758b9=_0x4758b9||0x1f4;return function(_0x42ae94){logger['error'](_0x42ae94[_0x7557('0x29')]);if(_0x42ae94['name']){delete _0x42ae94[_0x7557('0x2a')];}_0x3aa642[_0x7557('0x1d')](_0x4758b9)[_0x7557('0x2b')](_0x42ae94);};}exports['index']=function(_0x3b36eb,_0x2b4ca8){var _0x1c6df9={},_0x1c4649={},_0x19095d={'count':0x0,'rows':[]};var _0x414eec=_['map'](db[_0x7557('0x2c')][_0x7557('0x2d')],function(_0x9080c6){return{'name':_0x9080c6[_0x7557('0x2e')],'type':_0x9080c6['type'][_0x7557('0x2f')]};});_0x1c4649[_0x7557('0x30')]=_[_0x7557('0x31')](_0x414eec,_0x7557('0x2a'));_0x1c4649[_0x7557('0x32')]=_[_0x7557('0x33')](_0x3b36eb[_0x7557('0x32')]);_0x1c4649[_0x7557('0x34')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],_0x1c4649[_0x7557('0x32')]);_0x1c6df9[_0x7557('0x36')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],qs[_0x7557('0x37')](_0x3b36eb[_0x7557('0x32')][_0x7557('0x37')]));_0x1c6df9[_0x7557('0x36')]=_0x1c6df9[_0x7557('0x36')][_0x7557('0x38')]?_0x1c6df9[_0x7557('0x36')]:_0x1c4649[_0x7557('0x30')];if(!_0x3b36eb['query'][_0x7557('0x39')]('nolimit')){_0x1c6df9['limit']=qs[_0x7557('0x20')](_0x3b36eb['query'][_0x7557('0x20')]);_0x1c6df9['offset']=qs['offset'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x22')]);}_0x1c6df9[_0x7557('0x3a')]=qs['sort'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x3b')]);_0x1c6df9[_0x7557('0x3c')]=qs[_0x7557('0x34')](_[_0x7557('0x3d')](_0x3b36eb[_0x7557('0x32')],_0x1c4649[_0x7557('0x34')]),_0x414eec);if(_0x3b36eb[_0x7557('0x32')]['filter']){_0x1c6df9['where']=_['merge'](_0x1c6df9['where'],{'$or':_['map'](_0x414eec,function(_0x4f3c68){if(_0x4f3c68[_0x7557('0x3e')]!==_0x7557('0x3f')){var _0x3a7c60={};_0x3a7c60[_0x4f3c68[_0x7557('0x2a')]]={'$like':'%'+_0x3b36eb['query']['filter']+'%'};return _0x3a7c60;}})});}_0x1c6df9=_[_0x7557('0x40')]({},_0x1c6df9,_0x3b36eb[_0x7557('0x41')]);var _0x962488={'where':_0x1c6df9[_0x7557('0x3c')]};return db[_0x7557('0x2c')]['count'](_0x962488)[_0x7557('0x27')](function(_0x5149c9){_0x19095d[_0x7557('0x21')]=_0x5149c9;if(_0x3b36eb[_0x7557('0x32')][_0x7557('0x42')]){_0x1c6df9[_0x7557('0x43')]=[{'all':!![]}];}return db[_0x7557('0x2c')]['findAll'](_0x1c6df9);})[_0x7557('0x27')](function(_0x3023e5){_0x19095d[_0x7557('0x44')]=_0x3023e5;return _0x19095d;})[_0x7557('0x27')](respondWithFilteredResult(_0x2b4ca8,_0x1c6df9))['catch'](handleError(_0x2b4ca8,null));};exports[_0x7557('0x45')]=function(_0x59a75a,_0x156f3b){var _0x576461={'raw':!![],'where':{'id':_0x59a75a['params']['id']}},_0x16e40f={};_0x16e40f[_0x7557('0x30')]=_['keys'](db[_0x7557('0x2c')]['rawAttributes']);_0x16e40f[_0x7557('0x32')]=_[_0x7557('0x33')](_0x59a75a[_0x7557('0x32')]);_0x16e40f[_0x7557('0x34')]=_[_0x7557('0x35')](_0x16e40f[_0x7557('0x30')],_0x16e40f['query']);_0x576461['attributes']=_['intersection'](_0x16e40f[_0x7557('0x30')],qs[_0x7557('0x37')](_0x59a75a[_0x7557('0x32')][_0x7557('0x37')]));_0x576461[_0x7557('0x36')]=_0x576461['attributes'][_0x7557('0x38')]?_0x576461['attributes']:_0x16e40f[_0x7557('0x30')];if(_0x59a75a[_0x7557('0x32')][_0x7557('0x42')]){_0x576461[_0x7557('0x43')]=[{'all':!![]}];}_0x576461=_[_0x7557('0x40')]({},_0x576461,_0x59a75a[_0x7557('0x41')]);return db[_0x7557('0x2c')][_0x7557('0x46')](_0x576461)['then'](handleEntityNotFound(_0x156f3b,null))[_0x7557('0x27')](respondWithResult(_0x156f3b,null))[_0x7557('0x47')](handleError(_0x156f3b,null));};exports[_0x7557('0x48')]=function(_0x59904c,_0xb25031){return db['Cdr']['create'](_0x59904c[_0x7557('0x49')],{})[_0x7557('0x27')](respondWithResult(_0xb25031,0xc9))[_0x7557('0x47')](handleError(_0xb25031,null));};exports[_0x7557('0x4a')]=function(_0x3683c9,_0x4d9b43){if(_0x3683c9[_0x7557('0x49')]['id']){delete _0x3683c9[_0x7557('0x49')]['id'];}return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x3683c9[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x4d9b43,null))[_0x7557('0x27')](saveUpdates(_0x3683c9['body'],null))['then'](respondWithResult(_0x4d9b43,null))['catch'](handleError(_0x4d9b43,null));};exports['destroy']=function(_0x2b85c5,_0x36a2a1){return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x2b85c5[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x36a2a1,null))[_0x7557('0x27')](removeEntity(_0x36a2a1,null))[_0x7557('0x47')](handleError(_0x36a2a1,null));};exports['describe']=function(_0x46b871,_0x445e17){return db['Cdr'][_0x7557('0x4c')]()['then'](respondWithResult(_0x445e17,null))[_0x7557('0x47')](handleError(_0x445e17,null));};
\ No newline at end of file
+var _0xe14b=['rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe14b,0x93));var _0xbe14=function(_0x41c836,_0x58d575){_0x41c836=_0x41c836-0x0;var _0x5aa3d4=_0xe14b[_0x41c836];return _0x5aa3d4;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){_0x3d3608['status'](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x5fa043,_0x1ee9c1){return function(_0x39cc81){if(!_0x39cc81){_0x5fa043[_0xbe14('0x16')](0x194);}return _0x39cc81;};}function handleError(_0x2703f5,_0x55d001){_0x55d001=_0x55d001||0x1f4;return function(_0x1822e0){logger[_0xbe14('0x23')](_0x1822e0[_0xbe14('0x24')]);if(_0x1822e0[_0xbe14('0x25')]){delete _0x1822e0['name'];}_0x2703f5[_0xbe14('0x17')](_0x55d001)[_0xbe14('0x26')](_0x1822e0);};}exports['index']=function(_0x3c3613,_0x3b3e84){var _0x1c7cc7={},_0x19252f={},_0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x27')](db[_0xbe14('0x28')][_0xbe14('0x29')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x2a')],'type':_0x16a159[_0xbe14('0x2b')][_0xbe14('0x2c')]};});_0x19252f[_0xbe14('0x2d')]=_[_0xbe14('0x27')](_0x36d4b2,_0xbe14('0x25'));_0x19252f[_0xbe14('0x2e')]=_[_0xbe14('0x2f')](_0x3c3613[_0xbe14('0x2e')]);_0x19252f[_0xbe14('0x30')]=_['intersection'](_0x19252f[_0xbe14('0x2d')],_0x19252f['query']);_0x1c7cc7['attributes']=_[_0xbe14('0x31')](_0x19252f['model'],qs[_0xbe14('0x32')](_0x3c3613[_0xbe14('0x2e')]['fields']));_0x1c7cc7['attributes']=_0x1c7cc7['attributes'][_0xbe14('0x33')]?_0x1c7cc7[_0xbe14('0x34')]:_0x19252f['model'];if(!_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x35')](_0xbe14('0x36'))){_0x1c7cc7[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x3c3613['query']['limit']);_0x1c7cc7[_0xbe14('0x1c')]=qs['offset'](_0x3c3613['query']['offset']);}_0x1c7cc7[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x38')]);_0x1c7cc7[_0xbe14('0x39')]=qs[_0xbe14('0x30')](_[_0xbe14('0x3a')](_0x3c3613[_0xbe14('0x2e')],_0x19252f[_0xbe14('0x30')]),_0x36d4b2);if(_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3b')]){_0x1c7cc7[_0xbe14('0x39')]=_['merge'](_0x1c7cc7['where'],{'$or':_[_0xbe14('0x27')](_0x36d4b2,function(_0x2951e1){if(_0x2951e1[_0xbe14('0x2b')]!=='VIRTUAL'){var _0x326329={};_0x326329[_0x2951e1[_0xbe14('0x25')]]={'$like':'%'+_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3b')]+'%'};return _0x326329;}})});}_0x1c7cc7=_[_0xbe14('0x3c')]({},_0x1c7cc7,_0x3c3613[_0xbe14('0x3d')]);var _0x19fa30={'where':_0x1c7cc7[_0xbe14('0x39')]};return db[_0xbe14('0x28')]['count'](_0x19fa30)[_0xbe14('0x22')](function(_0x841b71){_0x34d648[_0xbe14('0x1b')]=_0x841b71;if(_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3e')]){_0x1c7cc7[_0xbe14('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0xbe14('0x40')](_0x1c7cc7);})[_0xbe14('0x22')](function(_0x1220c9){_0x34d648[_0xbe14('0x41')]=_0x1220c9;return _0x34d648;})['then'](respondWithFilteredResult(_0x3b3e84,_0x1c7cc7))['catch'](handleError(_0x3b3e84,null));};exports[_0xbe14('0x42')]=function(_0xe417b,_0x3272ae){var _0x51c859={'raw':!![],'where':{'id':_0xe417b[_0xbe14('0x43')]['id']}},_0x5d5318={};_0x5d5318['model']=_['keys'](db[_0xbe14('0x28')][_0xbe14('0x29')]);_0x5d5318[_0xbe14('0x2e')]=_['keys'](_0xe417b['query']);_0x5d5318['filters']=_[_0xbe14('0x31')](_0x5d5318[_0xbe14('0x2d')],_0x5d5318[_0xbe14('0x2e')]);_0x51c859['attributes']=_[_0xbe14('0x31')](_0x5d5318[_0xbe14('0x2d')],qs[_0xbe14('0x32')](_0xe417b[_0xbe14('0x2e')]['fields']));_0x51c859['attributes']=_0x51c859[_0xbe14('0x34')][_0xbe14('0x33')]?_0x51c859[_0xbe14('0x34')]:_0x5d5318[_0xbe14('0x2d')];if(_0xe417b[_0xbe14('0x2e')]['includeAll']){_0x51c859['include']=[{'all':!![]}];}_0x51c859=_[_0xbe14('0x3c')]({},_0x51c859,_0xe417b[_0xbe14('0x3d')]);return db[_0xbe14('0x28')][_0xbe14('0x44')](_0x51c859)['then'](handleEntityNotFound(_0x3272ae,null))[_0xbe14('0x22')](respondWithResult(_0x3272ae,null))[_0xbe14('0x45')](handleError(_0x3272ae,null));};exports['create']=function(_0x396e40,_0x2a35e5){return db[_0xbe14('0x28')][_0xbe14('0x46')](_0x396e40['body'],{})['then'](respondWithResult(_0x2a35e5,0xc9))[_0xbe14('0x45')](handleError(_0x2a35e5,null));};exports[_0xbe14('0x21')]=function(_0x4a1a37,_0x5acf90){if(_0x4a1a37[_0xbe14('0x47')]['id']){delete _0x4a1a37[_0xbe14('0x47')]['id'];}return db[_0xbe14('0x28')][_0xbe14('0x44')]({'where':{'id':_0x4a1a37[_0xbe14('0x43')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x5acf90,null))[_0xbe14('0x22')](saveUpdates(_0x4a1a37['body'],null))[_0xbe14('0x22')](respondWithResult(_0x5acf90,null))[_0xbe14('0x45')](handleError(_0x5acf90,null));};exports[_0xbe14('0x48')]=function(_0x22b1f8,_0x2fc073){return db['Cdr'][_0xbe14('0x44')]({'where':{'id':_0x22b1f8[_0xbe14('0x43')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x2fc073,null))[_0xbe14('0x22')](removeEntity(_0x2fc073,null))[_0xbe14('0x45')](handleError(_0x2fc073,null));};exports[_0xbe14('0x49')]=function(_0x505829,_0x5aeea9){return db[_0xbe14('0x28')][_0xbe14('0x49')]()[_0xbe14('0x22')](respondWithResult(_0x5aeea9,null))['catch'](handleError(_0x5aeea9,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index a14c030..1a353bf 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2c3632,_0x190e8a){var _0x1dced1=function(_0xd6cc1a){while(--_0xd6cc1a){_0x2c3632['push'](_0x2c3632['shift']());}};_0x1dced1(++_0x190e8a);}(_0x7a54,0x106));var _0x47a5=function(_0x580f0f,_0x5e8392){_0x580f0f=_0x580f0f-0x0;var _0x19746c=_0x7a54[_0x580f0f];return _0x19746c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x400f05,_0x1c734d){var _0x4bda7b=function(_0x2c0040){while(--_0x2c0040){_0x400f05['push'](_0x400f05['shift']());}};_0x4bda7b(++_0x1c734d);}(_0x7a54,0x106));var _0x47a5=function(_0x4e2b05,_0x3f8656){_0x4e2b05=_0x4e2b05-0x0;var _0x1cb000=_0x7a54[_0x4e2b05];return _0x1cb000;};'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 208bd9c..4f6e875 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 _0xc92f=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xc92f,0x15d));var _0xfc92=function(_0x208df7,_0x54a7bd){_0x208df7=_0x208df7-0x0;var _0x140f61=_0xc92f[_0x208df7];return _0x140f61;};'use strict';var _=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var moment=require(_0xfc92('0x2'));var BPromise=require(_0xfc92('0x3'));var rs=require(_0xfc92('0x4'));var fs=require('fs');var Redis=require(_0xfc92('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc92('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc92('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfc92('0x8')][_0xfc92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x303889,_0x5effba,_0xec7aff){return new BPromise(function(_0x596d29,_0x16a99d){return client[_0xfc92('0xa')](_0x303889,_0xec7aff)[_0xfc92('0xb')](function(_0x572236){logger[_0xfc92('0xc')](_0xfc92('0xd'),_0x5effba,_0xfc92('0xe'));logger[_0xfc92('0xf')](_0xfc92('0x10'),_0x5effba,_0xfc92('0xe'),JSON[_0xfc92('0x11')](_0x572236));if(_0x572236[_0xfc92('0x12')]){if(_0x572236['error']['code']===0x1f4){logger['error'](_0xfc92('0xd'),_0x5effba,_0x572236[_0xfc92('0x12')]['message']);return _0x16a99d(_0x572236['error'][_0xfc92('0x13')]);}logger[_0xfc92('0x12')](_0xfc92('0xd'),_0x5effba,_0x572236['error'][_0xfc92('0x13')]);return _0x596d29(_0x572236[_0xfc92('0x12')][_0xfc92('0x13')]);}else{logger['info'](_0xfc92('0xd'),_0x5effba,'request\x20sent');_0x596d29(_0x572236[_0xfc92('0x14')][_0xfc92('0x13')]);}})[_0xfc92('0x15')](function(_0x18335b){logger[_0xfc92('0x12')]('Cdr,\x20%s,\x20%s',_0x5effba,_0x18335b);_0x16a99d(_0x18335b);});});}
\ No newline at end of file
+var _0xba6f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash'];(function(_0x3fcd86,_0x2f3d34){var _0x4676cd=function(_0x23fd6a){while(--_0x23fd6a){_0x3fcd86['push'](_0x3fcd86['shift']());}};_0x4676cd(++_0x2f3d34);}(_0xba6f,0x12a));var _0xfba6=function(_0x4e6913,_0xba423b){_0x4e6913=_0x4e6913-0x0;var _0x9ef2ad=_0xba6f[_0x4e6913];return _0x9ef2ad;};'use strict';var _=require(_0xfba6('0x0'));var util=require(_0xfba6('0x1'));var moment=require(_0xfba6('0x2'));var BPromise=require(_0xfba6('0x3'));var rs=require(_0xfba6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfba6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfba6('0x6'))(_0xfba6('0x7'));var config=require(_0xfba6('0x8'));var jayson=require(_0xfba6('0x9'));var client=jayson[_0xfba6('0xa')][_0xfba6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcd860,_0x477320,_0x31a34e){return new BPromise(function(_0x24f474,_0x2c1446){return client[_0xfba6('0xc')](_0xcd860,_0x31a34e)[_0xfba6('0xd')](function(_0x3c8d25){logger[_0xfba6('0xe')]('Cdr,\x20%s,\x20%s',_0x477320,_0xfba6('0xf'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x477320,'request\x20sent',JSON[_0xfba6('0x10')](_0x3c8d25));if(_0x3c8d25[_0xfba6('0x11')]){if(_0x3c8d25[_0xfba6('0x11')][_0xfba6('0x12')]===0x1f4){logger[_0xfba6('0x11')]('Cdr,\x20%s,\x20%s',_0x477320,_0x3c8d25[_0xfba6('0x11')][_0xfba6('0x13')]);return _0x2c1446(_0x3c8d25[_0xfba6('0x11')][_0xfba6('0x13')]);}logger[_0xfba6('0x11')](_0xfba6('0x14'),_0x477320,_0x3c8d25[_0xfba6('0x11')][_0xfba6('0x13')]);return _0x24f474(_0x3c8d25[_0xfba6('0x11')][_0xfba6('0x13')]);}else{logger[_0xfba6('0xe')]('Cdr,\x20%s,\x20%s',_0x477320,'request\x20sent');_0x24f474(_0x3c8d25[_0xfba6('0x15')][_0xfba6('0x13')]);}})[_0xfba6('0x16')](function(_0x4d754f){logger[_0xfba6('0x11')]('Cdr,\x20%s,\x20%s',_0x477320,_0x4d754f);_0x2c1446(_0x4d754f);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 1e8ee8f..0111938 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(_0x2c0f27,_0x43abab){var _0x586e67=function(_0xe460df){while(--_0xe460df){_0x2c0f27['push'](_0x2c0f27['shift']());}};_0x586e67(++_0x43abab);}(_0xb10b,0x12a));var _0xbb10=function(_0x24b8ec,_0x3c8c5b){_0x24b8ec=_0x24b8ec-0x0;var _0x1d1b63=_0xb10b[_0x24b8ec];return _0x1d1b63;};'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 _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(_0x51612a,_0x431d42){var _0x57db77=function(_0x479545){while(--_0x479545){_0x51612a['push'](_0x51612a['shift']());}};_0x57db77(++_0x431d42);}(_0xb10b,0x12a));var _0xbb10=function(_0x5528ea,_0x4d95cf){_0x5528ea=_0x5528ea-0x0;var _0x1253b8=_0xb10b[_0x5528ea];return _0x1253b8;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 9522fc5..59b81a9 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 _0xac9d=['exports','noop','TEXT','STRING'];(function(_0x480136,_0x49744e){var _0x22e760=function(_0x214fb3){while(--_0x214fb3){_0x480136['push'](_0x480136['shift']());}};_0x22e760(++_0x49744e);}(_0xac9d,0xa0));var _0xdac9=function(_0x2aee7b,_0x181285){_0x2aee7b=_0x2aee7b-0x0;var _0x5a4554=_0xac9d[_0x2aee7b];return _0x5a4554;};'use strict';var Sequelize=require('sequelize');module[_0xdac9('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdac9('0x1')},'appdata':{'type':Sequelize[_0xdac9('0x2')]()},'description':{'type':Sequelize[_0xdac9('0x3')]},'interval':{'type':Sequelize[_0xdac9('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x74b6=['exports','STRING','*,*,*,*','sequelize'];(function(_0x295d2b,_0x3d67ac){var _0xf92af1=function(_0x2ede4){while(--_0x2ede4){_0x295d2b['push'](_0x295d2b['shift']());}};_0xf92af1(++_0x3d67ac);}(_0x74b6,0xd7));var _0x674b=function(_0x1a32f4,_0x5985e8){_0x1a32f4=_0x1a32f4-0x0;var _0x5ec48e=_0x74b6[_0x1a32f4];return _0x5ec48e;};'use strict';var Sequelize=require(_0x674b('0x0'));module[_0x674b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x674b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x674b('0x2')]},'interval':{'type':Sequelize[_0x674b('0x2')],'defaultValue':_0x674b('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 2b8904b..99fffe7 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 _0x56dc=['send','params','model','keys','rawAttributes','filters','query','attributes','fields','includeAll','include','options','ChatApplication','find','catch','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','save','then','destroy','error','stack','name'];(function(_0x322f36,_0xcd7efe){var _0x3dc6d5=function(_0xb03f08){while(--_0xb03f08){_0x322f36['push'](_0x322f36['shift']());}};_0x3dc6d5(++_0xcd7efe);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc56d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc56d('0x1'));var jsonpatch=require(_0xc56d('0x2'));var rp=require(_0xc56d('0x3'));var moment=require(_0xc56d('0x4'));var BPromise=require(_0xc56d('0x5'));var Mustache=require('mustache');var util=require(_0xc56d('0x6'));var path=require(_0xc56d('0x7'));var sox=require(_0xc56d('0x8'));var csv=require(_0xc56d('0x9'));var ejs=require(_0xc56d('0xa'));var fs=require('fs');var fs_extra=require(_0xc56d('0xb'));var _=require('lodash');var squel=require(_0xc56d('0xc'));var crypto=require(_0xc56d('0xd'));var jsforce=require(_0xc56d('0xe'));var deskjs=require(_0xc56d('0xf'));var toCsv=require(_0xc56d('0x9'));var querystring=require(_0xc56d('0x10'));var Papa=require(_0xc56d('0x11'));var Redis=require(_0xc56d('0x12'));var authService=require(_0xc56d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc56d('0x14'));var hardwareService=require(_0xc56d('0x15'));var logger=require(_0xc56d('0x16'))('api');var utils=require(_0xc56d('0x17'));var config=require(_0xc56d('0x18'));var licenseUtil=require(_0xc56d('0x19'));var db=require(_0xc56d('0x1a'))['db'];function respondWithStatusCode(_0x585ca5,_0xf82e05){_0xf82e05=_0xf82e05||0xcc;return function(_0x2f120a){if(_0x2f120a){return _0x585ca5[_0xc56d('0x1b')](_0xf82e05);}return _0x585ca5['status'](_0xf82e05)[_0xc56d('0x1c')]();};}function respondWithResult(_0x3c0bb5,_0xf3e4eb){_0xf3e4eb=_0xf3e4eb||0xc8;return function(_0x13a712){if(_0x13a712){return _0x3c0bb5['status'](_0xf3e4eb)[_0xc56d('0x1d')](_0x13a712);}};}function respondWithFilteredResult(_0x372724,_0x4aedd3){return function(_0x4c5651){if(_0x4c5651){var _0x259967=typeof _0x4aedd3[_0xc56d('0x1e')]===_0xc56d('0x1f')&&typeof _0x4aedd3[_0xc56d('0x20')]==='undefined';var _0x432f28=_0x4c5651['count'];var _0x25df28=_0x259967?0x0:_0x4aedd3[_0xc56d('0x1e')];var _0x523cfd=_0x259967?_0x4c5651[_0xc56d('0x21')]:_0x4aedd3[_0xc56d('0x1e')]+_0x4aedd3[_0xc56d('0x20')];var _0x2bdb45;if(_0x523cfd>=_0x432f28){_0x523cfd=_0x432f28;_0x2bdb45=0xc8;}else{_0x2bdb45=0xce;}_0x372724[_0xc56d('0x22')](_0x2bdb45);return _0x372724['set'](_0xc56d('0x23'),_0x25df28+'-'+_0x523cfd+'/'+_0x432f28)[_0xc56d('0x1d')](_0x4c5651);}return null;};}function patchUpdates(_0x1dcc97){return function(_0x109254){try{jsonpatch['apply'](_0x109254,_0x1dcc97,!![]);}catch(_0x4ad703){return BPromise['reject'](_0x4ad703);}return _0x109254[_0xc56d('0x24')]();};}function saveUpdates(_0x1c9a1c,_0x44a380){return function(_0x52a5f1){if(_0x52a5f1){return _0x52a5f1['update'](_0x1c9a1c)[_0xc56d('0x25')](function(_0x22d927){return _0x22d927;});}return null;};}function removeEntity(_0x5edf2c,_0x446792){return function(_0x41e336){if(_0x41e336){return _0x41e336[_0xc56d('0x26')]()[_0xc56d('0x25')](function(){_0x5edf2c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a769c,_0x30eacf){return function(_0x5405a8){if(!_0x5405a8){_0x2a769c[_0xc56d('0x1b')](0x194);}return _0x5405a8;};}function handleError(_0x27747e,_0x20ab1c){_0x20ab1c=_0x20ab1c||0x1f4;return function(_0x4d4b8e){logger[_0xc56d('0x27')](_0x4d4b8e[_0xc56d('0x28')]);if(_0x4d4b8e[_0xc56d('0x29')]){delete _0x4d4b8e[_0xc56d('0x29')];}_0x27747e[_0xc56d('0x22')](_0x20ab1c)[_0xc56d('0x2a')](_0x4d4b8e);};}exports['show']=function(_0x5a50fb,_0x51e7c7){var _0xb1c8ab={'raw':!![],'where':{'id':_0x5a50fb[_0xc56d('0x2b')]['id']}},_0xf81a5d={};_0xf81a5d[_0xc56d('0x2c')]=_[_0xc56d('0x2d')](db['ChatApplication'][_0xc56d('0x2e')]);_0xf81a5d['query']=_['keys'](_0x5a50fb['query']);_0xf81a5d[_0xc56d('0x2f')]=_['intersection'](_0xf81a5d[_0xc56d('0x2c')],_0xf81a5d[_0xc56d('0x30')]);_0xb1c8ab[_0xc56d('0x31')]=_['intersection'](_0xf81a5d[_0xc56d('0x2c')],qs[_0xc56d('0x32')](_0x5a50fb[_0xc56d('0x30')][_0xc56d('0x32')]));_0xb1c8ab['attributes']=_0xb1c8ab['attributes']['length']?_0xb1c8ab[_0xc56d('0x31')]:_0xf81a5d[_0xc56d('0x2c')];if(_0x5a50fb[_0xc56d('0x30')][_0xc56d('0x33')]){_0xb1c8ab[_0xc56d('0x34')]=[{'all':!![]}];}_0xb1c8ab=_['merge']({},_0xb1c8ab,_0x5a50fb[_0xc56d('0x35')]);return db[_0xc56d('0x36')][_0xc56d('0x37')](_0xb1c8ab)[_0xc56d('0x25')](handleEntityNotFound(_0x51e7c7,null))[_0xc56d('0x25')](respondWithResult(_0x51e7c7,null))[_0xc56d('0x38')](handleError(_0x51e7c7,null));};exports[_0xc56d('0x39')]=function(_0x4a855f,_0x1219aa){if(_0x4a855f['body']['id']){delete _0x4a855f[_0xc56d('0x3a')]['id'];}return db[_0xc56d('0x36')]['find']({'where':{'id':_0x4a855f[_0xc56d('0x2b')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0x1219aa,null))[_0xc56d('0x25')](saveUpdates(_0x4a855f[_0xc56d('0x3a')],null))[_0xc56d('0x25')](respondWithResult(_0x1219aa,null))[_0xc56d('0x38')](handleError(_0x1219aa,null));};exports[_0xc56d('0x26')]=function(_0x37b4a8,_0x475408){return db[_0xc56d('0x36')][_0xc56d('0x37')]({'where':{'id':_0x37b4a8[_0xc56d('0x2b')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0x475408,null))[_0xc56d('0x25')](removeEntity(_0x475408,null))[_0xc56d('0x38')](handleError(_0x475408,null));};
\ No newline at end of file
+var _0x4157=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','model','rawAttributes','query','keys','intersection','attributes','fields','includeAll','include','merge','options','ChatApplication','find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x13ef87,_0x2eb286){var _0xaed376=function(_0x47392e){while(--_0x47392e){_0x13ef87['push'](_0x13ef87['shift']());}};_0xaed376(++_0x2eb286);}(_0x4157,0xf3));var _0x7415=function(_0x45d1e0,_0x5f231e){_0x45d1e0=_0x45d1e0-0x0;var _0x47d81d=_0x4157[_0x45d1e0];return _0x47d81d;};'use strict';var emlformat=require(_0x7415('0x0'));var rimraf=require(_0x7415('0x1'));var zipdir=require(_0x7415('0x2'));var jsonpatch=require(_0x7415('0x3'));var rp=require(_0x7415('0x4'));var moment=require('moment');var BPromise=require(_0x7415('0x5'));var Mustache=require(_0x7415('0x6'));var util=require(_0x7415('0x7'));var path=require(_0x7415('0x8'));var sox=require(_0x7415('0x9'));var csv=require(_0x7415('0xa'));var ejs=require(_0x7415('0xb'));var fs=require('fs');var fs_extra=require(_0x7415('0xc'));var _=require(_0x7415('0xd'));var squel=require('squel');var crypto=require(_0x7415('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7415('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7415('0x10'));var Papa=require(_0x7415('0x11'));var Redis=require(_0x7415('0x12'));var authService=require(_0x7415('0x13'));var qs=require(_0x7415('0x14'));var as=require(_0x7415('0x15'));var hardwareService=require(_0x7415('0x16'));var logger=require('../../config/logger')(_0x7415('0x17'));var utils=require(_0x7415('0x18'));var config=require(_0x7415('0x19'));var licenseUtil=require(_0x7415('0x1a'));var db=require(_0x7415('0x1b'))['db'];function respondWithStatusCode(_0x4e2173,_0x3cfa3b){_0x3cfa3b=_0x3cfa3b||0xcc;return function(_0x186640){if(_0x186640){return _0x4e2173[_0x7415('0x1c')](_0x3cfa3b);}return _0x4e2173[_0x7415('0x1d')](_0x3cfa3b)[_0x7415('0x1e')]();};}function respondWithResult(_0x11a840,_0x37eb93){_0x37eb93=_0x37eb93||0xc8;return function(_0x31759a){if(_0x31759a){return _0x11a840[_0x7415('0x1d')](_0x37eb93)[_0x7415('0x1f')](_0x31759a);}};}function respondWithFilteredResult(_0x3f3e06,_0x1c193d){return function(_0x42efeb){if(_0x42efeb){var _0x4b8111=typeof _0x1c193d[_0x7415('0x20')]===_0x7415('0x21')&&typeof _0x1c193d[_0x7415('0x22')]===_0x7415('0x21');var _0x55b1bf=_0x42efeb[_0x7415('0x23')];var _0x2543f1=_0x4b8111?0x0:_0x1c193d['offset'];var _0x302a2b=_0x4b8111?_0x42efeb['count']:_0x1c193d[_0x7415('0x20')]+_0x1c193d[_0x7415('0x22')];var _0x47648d;if(_0x302a2b>=_0x55b1bf){_0x302a2b=_0x55b1bf;_0x47648d=0xc8;}else{_0x47648d=0xce;}_0x3f3e06[_0x7415('0x1d')](_0x47648d);return _0x3f3e06[_0x7415('0x24')](_0x7415('0x25'),_0x2543f1+'-'+_0x302a2b+'/'+_0x55b1bf)[_0x7415('0x1f')](_0x42efeb);}return null;};}function patchUpdates(_0x36a934){return function(_0x2fe93d){try{jsonpatch[_0x7415('0x26')](_0x2fe93d,_0x36a934,!![]);}catch(_0x1075cd){return BPromise['reject'](_0x1075cd);}return _0x2fe93d['save']();};}function saveUpdates(_0x28260b,_0x43df4a){return function(_0x129b3f){if(_0x129b3f){return _0x129b3f[_0x7415('0x27')](_0x28260b)['then'](function(_0x3a0df2){return _0x3a0df2;});}return null;};}function removeEntity(_0x530eea,_0x478abe){return function(_0xca366e){if(_0xca366e){return _0xca366e[_0x7415('0x28')]()[_0x7415('0x29')](function(){_0x530eea[_0x7415('0x1d')](0xcc)[_0x7415('0x1e')]();});}};}function handleEntityNotFound(_0x24a554,_0x26234c){return function(_0x3817d4){if(!_0x3817d4){_0x24a554[_0x7415('0x1c')](0x194);}return _0x3817d4;};}function handleError(_0x23a7be,_0x57b08a){_0x57b08a=_0x57b08a||0x1f4;return function(_0x464f49){logger[_0x7415('0x2a')](_0x464f49[_0x7415('0x2b')]);if(_0x464f49[_0x7415('0x2c')]){delete _0x464f49[_0x7415('0x2c')];}_0x23a7be['status'](_0x57b08a)[_0x7415('0x2d')](_0x464f49);};}exports['show']=function(_0xea1932,_0xbe0c21){var _0x115e0c={'raw':!![],'where':{'id':_0xea1932['params']['id']}},_0x31588b={};_0x31588b[_0x7415('0x2e')]=_['keys'](db['ChatApplication'][_0x7415('0x2f')]);_0x31588b[_0x7415('0x30')]=_[_0x7415('0x31')](_0xea1932[_0x7415('0x30')]);_0x31588b['filters']=_[_0x7415('0x32')](_0x31588b[_0x7415('0x2e')],_0x31588b[_0x7415('0x30')]);_0x115e0c[_0x7415('0x33')]=_[_0x7415('0x32')](_0x31588b[_0x7415('0x2e')],qs[_0x7415('0x34')](_0xea1932[_0x7415('0x30')][_0x7415('0x34')]));_0x115e0c[_0x7415('0x33')]=_0x115e0c[_0x7415('0x33')]['length']?_0x115e0c[_0x7415('0x33')]:_0x31588b[_0x7415('0x2e')];if(_0xea1932['query'][_0x7415('0x35')]){_0x115e0c[_0x7415('0x36')]=[{'all':!![]}];}_0x115e0c=_[_0x7415('0x37')]({},_0x115e0c,_0xea1932[_0x7415('0x38')]);return db[_0x7415('0x39')][_0x7415('0x3a')](_0x115e0c)[_0x7415('0x29')](handleEntityNotFound(_0xbe0c21,null))['then'](respondWithResult(_0xbe0c21,null))[_0x7415('0x3b')](handleError(_0xbe0c21,null));};exports[_0x7415('0x27')]=function(_0x512468,_0xc120){if(_0x512468[_0x7415('0x3c')]['id']){delete _0x512468[_0x7415('0x3c')]['id'];}return db[_0x7415('0x39')]['find']({'where':{'id':_0x512468['params']['id']}})[_0x7415('0x29')](handleEntityNotFound(_0xc120,null))['then'](saveUpdates(_0x512468[_0x7415('0x3c')],null))[_0x7415('0x29')](respondWithResult(_0xc120,null))['catch'](handleError(_0xc120,null));};exports['destroy']=function(_0x51af31,_0xb3cbff){return db['ChatApplication'][_0x7415('0x3a')]({'where':{'id':_0x51af31[_0x7415('0x3d')]['id']}})[_0x7415('0x29')](handleEntityNotFound(_0xb3cbff,null))['then'](removeEntity(_0xb3cbff,null))[_0x7415('0x3b')](handleError(_0xb3cbff,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 9978144..ab7074e 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 _0xefe7=['lodash','../../config/logger','api','request-promise','path','../../config/environment','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3e10d1,_0x175845){var _0x5b178e=function(_0x37f575){while(--_0x37f575){_0x3e10d1['push'](_0x3e10d1['shift']());}};_0x5b178e(++_0x175845);}(_0xefe7,0x168));var _0x7efe=function(_0x14fee0,_0xdc7465){_0x14fee0=_0x14fee0-0x0;var _0x21fa12=_0xefe7[_0x14fee0];return _0x21fa12;};'use strict';var _=require(_0x7efe('0x0'));var util=require('util');var logger=require(_0x7efe('0x1'))(_0x7efe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7efe('0x3'));var fs=require('fs');var path=require(_0x7efe('0x4'));var rimraf=require('rimraf');var config=require(_0x7efe('0x5'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x4183a6,_0x43ac91){return _0x4183a6[_0x7efe('0x6')](_0x7efe('0x7'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7efe('0x8'),'collate':_0x7efe('0x9')});};
\ No newline at end of file
+var _0x032a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications'];(function(_0x16037f,_0x2e02db){var _0x21760e=function(_0x433ec8){while(--_0x433ec8){_0x16037f['push'](_0x16037f['shift']());}};_0x21760e(++_0x2e02db);}(_0x032a,0xf0));var _0xa032=function(_0x329905,_0x13c144){_0x329905=_0x329905-0x0;var _0x3aa42=_0x032a[_0x329905];return _0x3aa42;};'use strict';var _=require('lodash');var util=require(_0xa032('0x0'));var logger=require('../../config/logger')(_0xa032('0x1'));var moment=require(_0xa032('0x2'));var BPromise=require(_0xa032('0x3'));var rp=require(_0xa032('0x4'));var fs=require('fs');var path=require(_0xa032('0x5'));var rimraf=require(_0xa032('0x6'));var config=require(_0xa032('0x7'));var attributes=require(_0xa032('0x8'));module[_0xa032('0x9')]=function(_0x2b1445,_0x43d0f5){return _0x2b1445[_0xa032('0xa')]('ChatApplication',attributes,{'tableName':_0xa032('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 747e4c7..75ab279 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 _0x4d68=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','util','moment','bluebird'];(function(_0x2d44c3,_0x4ce66a){var _0x54cf65=function(_0x110af3){while(--_0x110af3){_0x2d44c3['push'](_0x2d44c3['shift']());}};_0x54cf65(++_0x4ce66a);}(_0x4d68,0x189));var _0x84d6=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x4d68[_0x401676];return _0x4f13fe;};'use strict';var _=require('lodash');var util=require(_0x84d6('0x0'));var moment=require(_0x84d6('0x1'));var BPromise=require(_0x84d6('0x2'));var rs=require(_0x84d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84d6('0x4'))['db'];var utils=require(_0x84d6('0x5'));var logger=require(_0x84d6('0x6'))(_0x84d6('0x7'));var config=require(_0x84d6('0x8'));var jayson=require(_0x84d6('0x9'));var client=jayson[_0x84d6('0xa')][_0x84d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40b82d,_0xde7de6,_0x28fec1){return new BPromise(function(_0x11174b,_0x292340){return client['request'](_0x40b82d,_0x28fec1)[_0x84d6('0xc')](function(_0x1cae6c){logger[_0x84d6('0xd')]('ChatApplication,\x20%s,\x20%s',_0xde7de6,_0x84d6('0xe'));logger[_0x84d6('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0xde7de6,'request\x20sent',JSON[_0x84d6('0x10')](_0x1cae6c));if(_0x1cae6c['error']){if(_0x1cae6c[_0x84d6('0x11')][_0x84d6('0x12')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0xde7de6,_0x1cae6c[_0x84d6('0x11')]['message']);return _0x292340(_0x1cae6c[_0x84d6('0x11')]['message']);}logger[_0x84d6('0x11')](_0x84d6('0x13'),_0xde7de6,_0x1cae6c[_0x84d6('0x11')]['message']);return _0x11174b(_0x1cae6c[_0x84d6('0x11')][_0x84d6('0x14')]);}else{logger[_0x84d6('0xd')](_0x84d6('0x13'),_0xde7de6,_0x84d6('0xe'));_0x11174b(_0x1cae6c[_0x84d6('0x15')][_0x84d6('0x14')]);}})['catch'](function(_0x260bbf){logger[_0x84d6('0x11')](_0x84d6('0x13'),_0xde7de6,_0x260bbf);_0x292340(_0x260bbf);});});}
\ No newline at end of file
+var _0xc069=['client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4784a3,_0x1d0877){var _0x4917cd=function(_0x299cf6){while(--_0x299cf6){_0x4784a3['push'](_0x4784a3['shift']());}};_0x4917cd(++_0x1d0877);}(_0xc069,0x1f1));var _0x9c06=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc069[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9c06('0x0'));var rs=require(_0x9c06('0x1'));var fs=require('fs');var Redis=require(_0x9c06('0x2'));var db=require(_0x9c06('0x3'))['db'];var utils=require(_0x9c06('0x4'));var logger=require(_0x9c06('0x5'))(_0x9c06('0x6'));var config=require(_0x9c06('0x7'));var jayson=require(_0x9c06('0x8'));var client=jayson[_0x9c06('0x9')][_0x9c06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eb35e,_0x43ba1c,_0x31876c){return new BPromise(function(_0x587234,_0x2a0dd4){return client[_0x9c06('0xb')](_0x2eb35e,_0x31876c)[_0x9c06('0xc')](function(_0x3d6057){logger[_0x9c06('0xd')](_0x9c06('0xe'),_0x43ba1c,_0x9c06('0xf'));logger[_0x9c06('0x10')](_0x9c06('0x11'),_0x43ba1c,_0x9c06('0xf'),JSON[_0x9c06('0x12')](_0x3d6057));if(_0x3d6057[_0x9c06('0x13')]){if(_0x3d6057[_0x9c06('0x13')]['code']===0x1f4){logger[_0x9c06('0x13')]('ChatApplication,\x20%s,\x20%s',_0x43ba1c,_0x3d6057[_0x9c06('0x13')][_0x9c06('0x14')]);return _0x2a0dd4(_0x3d6057[_0x9c06('0x13')][_0x9c06('0x14')]);}logger[_0x9c06('0x13')]('ChatApplication,\x20%s,\x20%s',_0x43ba1c,_0x3d6057[_0x9c06('0x13')][_0x9c06('0x14')]);return _0x587234(_0x3d6057['error']['message']);}else{logger[_0x9c06('0xd')](_0x9c06('0xe'),_0x43ba1c,_0x9c06('0xf'));_0x587234(_0x3d6057[_0x9c06('0x15')][_0x9c06('0x14')]);}})[_0x9c06('0x16')](function(_0x2a15b2){logger[_0x9c06('0x13')]('ChatApplication,\x20%s,\x20%s',_0x43ba1c,_0x2a15b2);_0x2a0dd4(_0x2a15b2);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 98b4bb9..19d6032 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 _0x5092=['show','put','update','delete','destroy','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','/:id','isAuthenticated'];(function(_0x54cbf6,_0x1f9806){var _0x361032=function(_0x503bec){while(--_0x503bec){_0x54cbf6['push'](_0x54cbf6['shift']());}};_0x361032(++_0x1f9806);}(_0x5092,0x125));var _0x2509=function(_0x47319f,_0x27849a){_0x47319f=_0x47319f-0x0;var _0x5d8a7a=_0x5092[_0x47319f];return _0x5d8a7a;};'use strict';var multer=require('multer');var util=require(_0x2509('0x0'));var path=require('path');var timeout=require(_0x2509('0x1'));var express=require('express');var router=express[_0x2509('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2509('0x3'));var config=require(_0x2509('0x4'));var controller=require('./chatApplication.controller');router['get'](_0x2509('0x5'),auth[_0x2509('0x6')](),controller[_0x2509('0x7')]);router[_0x2509('0x8')](_0x2509('0x5'),auth[_0x2509('0x6')](),controller[_0x2509('0x9')]);router[_0x2509('0xa')](_0x2509('0x5'),auth[_0x2509('0x6')](),controller[_0x2509('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xdae0=['update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x35228c,_0x1e6824){var _0x56b5c0=function(_0x11886f){while(--_0x11886f){_0x35228c['push'](_0x35228c['shift']());}};_0x56b5c0(++_0x1e6824);}(_0xdae0,0x83));var _0x0dae=function(_0x4bfb48,_0x9b1ab5){_0x4bfb48=_0x4bfb48-0x0;var _0x407e33=_0xdae0[_0x4bfb48];return _0x407e33;};'use strict';var multer=require(_0x0dae('0x0'));var util=require(_0x0dae('0x1'));var path=require('path');var timeout=require(_0x0dae('0x2'));var express=require(_0x0dae('0x3'));var router=express[_0x0dae('0x4')]();var fs_extra=require(_0x0dae('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0dae('0x6'));var config=require('../../config/environment');var controller=require(_0x0dae('0x7'));router[_0x0dae('0x8')](_0x0dae('0x9'),auth[_0x0dae('0xa')](),controller[_0x0dae('0xb')]);router[_0x0dae('0xc')]('/:id',auth[_0x0dae('0xa')](),controller[_0x0dae('0xd')]);router['delete'](_0x0dae('0x9'),auth[_0x0dae('0xa')](),controller[_0x0dae('0xe')]);module[_0x0dae('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 58bcafe..a6291ef 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 _0x261a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x261a,0x1e6));var _0xa261=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x261a[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xa261('0x0'));module[_0xa261('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa261('0x2')]},'write':{'type':Sequelize[_0xa261('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xcbe1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcbe1,0xd7));var _0x1cbe=function(_0x1951de,_0x173387){_0x1951de=_0x1951de-0x0;var _0x418584=_0xcbe1[_0x1951de];return _0x418584;};'use strict';var Sequelize=require(_0x1cbe('0x0'));module[_0x1cbe('0x1')]={'name':{'type':Sequelize[_0x1cbe('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x1cbe('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 79fdaec..3f4d4d2 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 _0x062d=['name','map','ChatGroup','rawAttributes','fieldName','query','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','User','getMembers','removeMembers','ChatGroupId','getMessages','$gte','format','eml-format','zip-dir','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack'];(function(_0x57d65d,_0x4c1202){var _0x5a6bd3=function(_0x22dd2c){while(--_0x22dd2c){_0x57d65d['push'](_0x57d65d['shift']());}};_0x5a6bd3(++_0x4c1202);}(_0x062d,0x1a1));var _0xd062=function(_0x25996d,_0x5b282e){_0x25996d=_0x25996d-0x0;var _0x12d802=_0x062d[_0x25996d];return _0x12d802;};'use strict';var emlformat=require(_0xd062('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd062('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd062('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd062('0x3'));var path=require(_0xd062('0x4'));var sox=require(_0xd062('0x5'));var csv=require('to-csv');var ejs=require(_0xd062('0x6'));var fs=require('fs');var fs_extra=require(_0xd062('0x7'));var _=require(_0xd062('0x8'));var squel=require(_0xd062('0x9'));var crypto=require(_0xd062('0xa'));var jsforce=require(_0xd062('0xb'));var deskjs=require(_0xd062('0xc'));var toCsv=require(_0xd062('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd062('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd062('0xf'));var hardwareService=require(_0xd062('0x10'));var logger=require('../../config/logger')(_0xd062('0x11'));var utils=require(_0xd062('0x12'));var config=require(_0xd062('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd062('0x14'))['db'];config[_0xd062('0x15')]=_['defaults'](config[_0xd062('0x15')],{'host':_0xd062('0x16'),'port':0x18eb});var socket=require(_0xd062('0x17'))(new Redis(config[_0xd062('0x15')]));require(_0xd062('0x18'))[_0xd062('0x19')](socket);function respondWithStatusCode(_0x18fc52,_0xa185c9){_0xa185c9=_0xa185c9||0xcc;return function(_0x5a7889){if(_0x5a7889){return _0x18fc52[_0xd062('0x1a')](_0xa185c9);}return _0x18fc52[_0xd062('0x1b')](_0xa185c9)[_0xd062('0x1c')]();};}function respondWithResult(_0x1f3471,_0x5cfb93){_0x5cfb93=_0x5cfb93||0xc8;return function(_0xeef60){if(_0xeef60){return _0x1f3471[_0xd062('0x1b')](_0x5cfb93)[_0xd062('0x1d')](_0xeef60);}};}function respondWithFilteredResult(_0x377685,_0x4d8470){return function(_0x38b6b6){if(_0x38b6b6){var _0xbe50a4=typeof _0x4d8470[_0xd062('0x1e')]==='undefined'&&typeof _0x4d8470[_0xd062('0x1f')]===_0xd062('0x20');var _0x2eb38e=_0x38b6b6[_0xd062('0x21')];var _0x410014=_0xbe50a4?0x0:_0x4d8470[_0xd062('0x1e')];var _0x4120b3=_0xbe50a4?_0x38b6b6[_0xd062('0x21')]:_0x4d8470['offset']+_0x4d8470[_0xd062('0x1f')];var _0x119694;if(_0x4120b3>=_0x2eb38e){_0x4120b3=_0x2eb38e;_0x119694=0xc8;}else{_0x119694=0xce;}_0x377685[_0xd062('0x1b')](_0x119694);return _0x377685[_0xd062('0x22')](_0xd062('0x23'),_0x410014+'-'+_0x4120b3+'/'+_0x2eb38e)['json'](_0x38b6b6);}return null;};}function patchUpdates(_0x525245){return function(_0x2f4e28){try{jsonpatch['apply'](_0x2f4e28,_0x525245,!![]);}catch(_0x2993bc){return BPromise[_0xd062('0x24')](_0x2993bc);}return _0x2f4e28[_0xd062('0x25')]();};}function saveUpdates(_0x1011b3,_0x50a180){return function(_0x46401e){if(_0x46401e){return _0x46401e[_0xd062('0x26')](_0x1011b3)['then'](function(_0x365f1b){return _0x365f1b;});}return null;};}function removeEntity(_0xa8a46a,_0x5cb1e8){return function(_0x503053){if(_0x503053){return _0x503053[_0xd062('0x27')]()[_0xd062('0x28')](function(){_0xa8a46a[_0xd062('0x1b')](0xcc)[_0xd062('0x1c')]();});}};}function handleEntityNotFound(_0x4415b4,_0xbd92e6){return function(_0x516b4d){if(!_0x516b4d){_0x4415b4['sendStatus'](0x194);}return _0x516b4d;};}function handleError(_0x36e501,_0x49ee66){_0x49ee66=_0x49ee66||0x1f4;return function(_0x1a0b05){logger[_0xd062('0x29')](_0x1a0b05[_0xd062('0x2a')]);if(_0x1a0b05[_0xd062('0x2b')]){delete _0x1a0b05[_0xd062('0x2b')];}_0x36e501[_0xd062('0x1b')](_0x49ee66)['send'](_0x1a0b05);};}exports['index']=function(_0x5209f8,_0x20b2f7){var _0x1cd6a1={},_0x8952b3={},_0x112f6a={'count':0x0,'rows':[]};var _0x259ffb=_[_0xd062('0x2c')](db[_0xd062('0x2d')][_0xd062('0x2e')],function(_0x69d94a){return{'name':_0x69d94a[_0xd062('0x2f')],'type':_0x69d94a['type']['key']};});_0x8952b3['model']=_[_0xd062('0x2c')](_0x259ffb,_0xd062('0x2b'));_0x8952b3['query']=_['keys'](_0x5209f8[_0xd062('0x30')]);_0x8952b3[_0xd062('0x31')]=_['intersection'](_0x8952b3['model'],_0x8952b3[_0xd062('0x30')]);_0x1cd6a1[_0xd062('0x32')]=_[_0xd062('0x33')](_0x8952b3['model'],qs[_0xd062('0x34')](_0x5209f8[_0xd062('0x30')]['fields']));_0x1cd6a1['attributes']=_0x1cd6a1[_0xd062('0x32')][_0xd062('0x35')]?_0x1cd6a1['attributes']:_0x8952b3[_0xd062('0x36')];if(!_0x5209f8[_0xd062('0x30')][_0xd062('0x37')](_0xd062('0x38'))){_0x1cd6a1[_0xd062('0x1f')]=qs[_0xd062('0x1f')](_0x5209f8[_0xd062('0x30')][_0xd062('0x1f')]);_0x1cd6a1[_0xd062('0x1e')]=qs[_0xd062('0x1e')](_0x5209f8['query'][_0xd062('0x1e')]);}_0x1cd6a1[_0xd062('0x39')]=qs[_0xd062('0x3a')](_0x5209f8['query'][_0xd062('0x3a')]);_0x1cd6a1['where']=qs[_0xd062('0x31')](_[_0xd062('0x3b')](_0x5209f8[_0xd062('0x30')],_0x8952b3[_0xd062('0x31')]),_0x259ffb);if(_0x5209f8[_0xd062('0x30')][_0xd062('0x3c')]){_0x1cd6a1['where']=_['merge'](_0x1cd6a1[_0xd062('0x3d')],{'$or':_['map'](_0x259ffb,function(_0x1edd0d){if(_0x1edd0d[_0xd062('0x3e')]!==_0xd062('0x3f')){var _0x3e2297={};_0x3e2297[_0x1edd0d[_0xd062('0x2b')]]={'$like':'%'+_0x5209f8[_0xd062('0x30')][_0xd062('0x3c')]+'%'};return _0x3e2297;}})});}_0x1cd6a1=_[_0xd062('0x40')]({},_0x1cd6a1,_0x5209f8[_0xd062('0x41')]);var _0x4495d2={'where':_0x1cd6a1[_0xd062('0x3d')]};return db['ChatGroup'][_0xd062('0x21')](_0x4495d2)[_0xd062('0x28')](function(_0x275ed1){_0x112f6a['count']=_0x275ed1;if(_0x5209f8[_0xd062('0x30')][_0xd062('0x42')]){_0x1cd6a1[_0xd062('0x43')]=[{'all':!![]}];}return db[_0xd062('0x2d')][_0xd062('0x44')](_0x1cd6a1);})[_0xd062('0x28')](function(_0x3bb30c){_0x112f6a[_0xd062('0x45')]=_0x3bb30c;return _0x112f6a;})[_0xd062('0x28')](respondWithFilteredResult(_0x20b2f7,_0x1cd6a1))[_0xd062('0x46')](handleError(_0x20b2f7,null));};exports[_0xd062('0x47')]=function(_0x287cfc,_0x1ffcea){var _0x215ff7={'raw':!![],'where':{'id':_0x287cfc[_0xd062('0x48')]['id']}},_0x359ee5={};_0x359ee5[_0xd062('0x36')]=_['keys'](db[_0xd062('0x2d')][_0xd062('0x2e')]);_0x359ee5[_0xd062('0x30')]=_[_0xd062('0x49')](_0x287cfc[_0xd062('0x30')]);_0x359ee5[_0xd062('0x31')]=_['intersection'](_0x359ee5[_0xd062('0x36')],_0x359ee5['query']);_0x215ff7['attributes']=_['intersection'](_0x359ee5[_0xd062('0x36')],qs[_0xd062('0x34')](_0x287cfc[_0xd062('0x30')][_0xd062('0x34')]));_0x215ff7[_0xd062('0x32')]=_0x215ff7[_0xd062('0x32')][_0xd062('0x35')]?_0x215ff7[_0xd062('0x32')]:_0x359ee5[_0xd062('0x36')];if(_0x287cfc[_0xd062('0x30')][_0xd062('0x42')]){_0x215ff7[_0xd062('0x43')]=[{'all':!![]}];}_0x215ff7=_[_0xd062('0x40')]({},_0x215ff7,_0x287cfc['options']);return db[_0xd062('0x2d')][_0xd062('0x4a')](_0x215ff7)[_0xd062('0x28')](handleEntityNotFound(_0x1ffcea,null))[_0xd062('0x28')](respondWithResult(_0x1ffcea,null))['catch'](handleError(_0x1ffcea,null));};exports['create']=function(_0x26f238,_0x3dea31){return db[_0xd062('0x2d')][_0xd062('0x4b')](_0x26f238[_0xd062('0x4c')],{})['then'](respondWithResult(_0x3dea31,0xc9))['catch'](handleError(_0x3dea31,null));};exports['update']=function(_0x2f311b,_0x1c0ee1){if(_0x2f311b['body']['id']){delete _0x2f311b[_0xd062('0x4c')]['id'];}return db['ChatGroup'][_0xd062('0x4a')]({'where':{'id':_0x2f311b[_0xd062('0x48')]['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x1c0ee1,null))[_0xd062('0x28')](saveUpdates(_0x2f311b[_0xd062('0x4c')],null))['then'](respondWithResult(_0x1c0ee1,null))[_0xd062('0x46')](handleError(_0x1c0ee1,null));};exports[_0xd062('0x27')]=function(_0x543cc0,_0x21f9c5){return db[_0xd062('0x2d')][_0xd062('0x4a')]({'where':{'id':_0x543cc0[_0xd062('0x48')]['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x21f9c5,null))[_0xd062('0x28')](removeEntity(_0x21f9c5,null))[_0xd062('0x46')](handleError(_0x21f9c5,null));};exports[_0xd062('0x4d')]=function(_0x285387,_0x4a952a){return db[_0xd062('0x2d')][_0xd062('0x4d')]()[_0xd062('0x28')](respondWithResult(_0x4a952a,null))[_0xd062('0x46')](handleError(_0x4a952a,null));};exports[_0xd062('0x4e')]=function(_0x5a32f1,_0x249599,_0x4f8b46){return db[_0xd062('0x4f')]['count']({'where':{'ChatGroupId':_0x5a32f1[_0xd062('0x48')]['id'],'ToId':_0x5a32f1['user']['id'],'read':![]}})['then'](function(_0xe7ac90){return{'id':_[_0xd062('0x50')](_0x5a32f1[_0xd062('0x48')]['id']),'count':_0xe7ac90};})[_0xd062('0x28')](respondWithResult(_0x249599,null))['catch'](handleError(_0x249599,null));};exports[_0xd062('0x51')]=function(_0x14b192,_0x2578af,_0x3ce12d){return db[_0xd062('0x2d')][_0xd062('0x4a')]({'where':{'id':_0x14b192[_0xd062('0x48')]['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x2578af,null))[_0xd062('0x28')](function(_0x21f63e){if(_0x21f63e){return _0x21f63e[_0xd062('0x51')](_0x14b192[_0xd062('0x4c')][_0xd062('0x52')],_[_0xd062('0x53')](_0x14b192[_0xd062('0x4c')],[_0xd062('0x52'),'id'])||{});}})[_0xd062('0x28')](respondWithResult(_0x2578af,null))[_0xd062('0x46')](handleError(_0x2578af,null));};exports['getMembers']=function(_0x5814ee,_0x35f8ea,_0x1d9189){var _0x3145f3={};var _0x1bf302={};var _0x5c6123;var _0x287fcf;return db[_0xd062('0x2d')][_0xd062('0x54')]({'where':{'id':_0x5814ee[_0xd062('0x48')]['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x35f8ea,null))[_0xd062('0x28')](function(_0x1044f3){if(_0x1044f3){_0x5c6123=_0x1044f3;_0x1bf302[_0xd062('0x36')]=_['keys'](db[_0xd062('0x55')]['rawAttributes']);_0x1bf302[_0xd062('0x30')]=_['keys'](_0x5814ee[_0xd062('0x30')]);_0x1bf302[_0xd062('0x31')]=_['intersection'](_0x1bf302['model'],_0x1bf302['query']);_0x3145f3[_0xd062('0x32')]=_[_0xd062('0x33')](_0x1bf302[_0xd062('0x36')],qs['fields'](_0x5814ee[_0xd062('0x30')][_0xd062('0x34')]));_0x3145f3[_0xd062('0x32')]=_0x3145f3[_0xd062('0x32')][_0xd062('0x35')]?_0x3145f3['attributes']:_0x1bf302['model'];_0x3145f3[_0xd062('0x39')]=qs[_0xd062('0x3a')](_0x5814ee[_0xd062('0x30')]['sort']);_0x3145f3[_0xd062('0x3d')]=qs['filters'](_[_0xd062('0x3b')](_0x5814ee[_0xd062('0x30')],_0x1bf302[_0xd062('0x31')]));if(_0x5814ee[_0xd062('0x30')][_0xd062('0x3c')]){_0x3145f3['where']=_['merge'](_0x3145f3[_0xd062('0x3d')],{'$or':_['map'](_0x3145f3[_0xd062('0x32')],function(_0x542118){var _0x2c18f2={};_0x2c18f2[_0x542118]={'$like':'%'+_0x5814ee['query'][_0xd062('0x3c')]+'%'};return _0x2c18f2;})});}_0x3145f3=_[_0xd062('0x40')]({},_0x3145f3,_0x5814ee[_0xd062('0x41')]);return _0x5c6123[_0xd062('0x56')](_0x3145f3);}})[_0xd062('0x28')](function(_0x36da07){if(_0x36da07){_0x287fcf=_0x36da07[_0xd062('0x35')];if(!_0x5814ee[_0xd062('0x30')][_0xd062('0x37')](_0xd062('0x38'))){_0x3145f3[_0xd062('0x1f')]=qs['limit'](_0x5814ee[_0xd062('0x30')]['limit']);_0x3145f3[_0xd062('0x1e')]=qs[_0xd062('0x1e')](_0x5814ee['query'][_0xd062('0x1e')]);}return _0x5c6123['getMembers'](_0x3145f3);}})[_0xd062('0x28')](function(_0x326998){if(_0x326998){return _0x326998?{'count':_0x287fcf,'rows':_0x326998}:null;}})[_0xd062('0x28')](respondWithResult(_0x35f8ea,null))[_0xd062('0x46')](handleError(_0x35f8ea,null));};exports['removeMembers']=function(_0x132706,_0x2cf1b8,_0x141a57){return db[_0xd062('0x2d')][_0xd062('0x4a')]({'where':{'id':_0x132706[_0xd062('0x48')]['id']}})['then'](handleEntityNotFound(_0x2cf1b8,null))[_0xd062('0x28')](function(_0x325c79){if(_0x325c79){return _0x325c79[_0xd062('0x57')](_0x132706[_0xd062('0x30')]['ids']);}})[_0xd062('0x28')](respondWithStatusCode(_0x2cf1b8,null))[_0xd062('0x46')](handleError(_0x2cf1b8,null));};exports['addMessage']=function(_0x2d1d2e,_0x3ff50e,_0x22edd9){if(_0x2d1d2e[_0xd062('0x4c')]['id']){delete _0x2d1d2e['body']['id'];}return db[_0xd062('0x2d')][_0xd062('0x4a')]({'where':{'id':_0x2d1d2e[_0xd062('0x48')]['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x3ff50e,null))[_0xd062('0x28')](function(_0x372282){if(_0x372282){_0x2d1d2e[_0xd062('0x4c')][_0xd062('0x58')]=_0x372282['id'];return db[_0xd062('0x4f')][_0xd062('0x4b')](_0x2d1d2e[_0xd062('0x4c')]);}})['then'](respondWithResult(_0x3ff50e,null))[_0xd062('0x46')](handleError(_0x3ff50e,null));};exports[_0xd062('0x59')]=function(_0x22ecda,_0x4baeb4,_0x530be2){var _0x4de536={};var _0x28ced3={};var _0x475c72;var _0x34d509;return db[_0xd062('0x2d')]['findOne']({'where':{'id':_0x22ecda['params']['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x4baeb4,null))['then'](function(_0x2f6aff){if(_0x2f6aff){_0x475c72=_0x2f6aff;_0x28ced3[_0xd062('0x36')]=_[_0xd062('0x49')](db[_0xd062('0x4f')][_0xd062('0x2e')]);_0x28ced3[_0xd062('0x30')]=_[_0xd062('0x49')](_0x22ecda['query']);_0x28ced3[_0xd062('0x31')]=_[_0xd062('0x33')](_0x28ced3[_0xd062('0x36')],_0x28ced3[_0xd062('0x30')]);_0x4de536[_0xd062('0x32')]=_['intersection'](_0x28ced3[_0xd062('0x36')],qs[_0xd062('0x34')](_0x22ecda[_0xd062('0x30')][_0xd062('0x34')]));_0x4de536['attributes']=_0x4de536[_0xd062('0x32')]['length']?_0x4de536['attributes']:_0x28ced3[_0xd062('0x36')];_0x4de536[_0xd062('0x39')]=qs[_0xd062('0x3a')](_0x22ecda[_0xd062('0x30')][_0xd062('0x3a')]);_0x4de536[_0xd062('0x3d')]=qs[_0xd062('0x31')](_[_0xd062('0x3b')](_0x22ecda['query'],_0x28ced3[_0xd062('0x31')]));if(_0x22ecda[_0xd062('0x30')]['filter']){_0x4de536['where']=_[_0xd062('0x40')](_0x4de536[_0xd062('0x3d')],{'$or':_[_0xd062('0x2c')](_0x4de536[_0xd062('0x32')],function(_0x564950){var _0x4a318a={};_0x4a318a[_0x564950]={'$like':'%'+_0x22ecda['query'][_0xd062('0x3c')]+'%'};return _0x4a318a;})});}if(_0x22ecda[_0xd062('0x30')][_0xd062('0x5a')]){var _0x58c5ed=_0x22ecda[_0xd062('0x30')][_0xd062('0x5a')]['split'](',');var _0x439679={};_0x439679[_0x58c5ed[0x0]]={'$gte':moment(_0x58c5ed[0x1])[_0xd062('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4de536['where']=_[_0xd062('0x40')](_0x4de536[_0xd062('0x3d')],_0x439679);}_0x4de536=_[_0xd062('0x40')]({},_0x4de536,_0x22ecda[_0xd062('0x41')]);return _0x475c72[_0xd062('0x59')](_0x4de536);}})[_0xd062('0x28')](function(_0xbe6dc9){if(_0xbe6dc9){_0x34d509=_0xbe6dc9[_0xd062('0x35')];if(!_0x22ecda[_0xd062('0x30')][_0xd062('0x37')](_0xd062('0x38'))){_0x4de536['limit']=qs['limit'](_0x22ecda[_0xd062('0x30')][_0xd062('0x1f')]);_0x4de536[_0xd062('0x1e')]=qs['offset'](_0x22ecda[_0xd062('0x30')]['offset']);}return _0x475c72[_0xd062('0x59')](_0x4de536);}})[_0xd062('0x28')](function(_0x177e22){if(_0x177e22){return _0x177e22?{'count':_0x34d509,'rows':_0x177e22}:null;}})['then'](respondWithResult(_0x4baeb4,null))[_0xd062('0x46')](handleError(_0x4baeb4,null));};
\ No newline at end of file
+var _0x2e75=['format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','json','undefined','count','offset','apply','reject','update','then','error','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','length','nolimit','limit','order','sort','where','filters','filter','merge','options','ChatGroup','includeAll','include','findAll','rows','catch','fields','create','body','params','destroy','find','describe','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','pick','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split'];(function(_0x5089ea,_0x3d8378){var _0xabe953=function(_0x18e67e){while(--_0x18e67e){_0x5089ea['push'](_0x5089ea['shift']());}};_0xabe953(++_0x3d8378);}(_0x2e75,0x128));var _0x52e7=function(_0x5a95e5,_0x26061b){_0x5a95e5=_0x5a95e5-0x0;var _0x6b7abc=_0x2e75[_0x5a95e5];return _0x6b7abc;};'use strict';var emlformat=require(_0x52e7('0x0'));var rimraf=require(_0x52e7('0x1'));var zipdir=require(_0x52e7('0x2'));var jsonpatch=require(_0x52e7('0x3'));var rp=require('request-promise');var moment=require(_0x52e7('0x4'));var BPromise=require(_0x52e7('0x5'));var Mustache=require(_0x52e7('0x6'));var util=require(_0x52e7('0x7'));var path=require('path');var sox=require(_0x52e7('0x8'));var csv=require(_0x52e7('0x9'));var ejs=require(_0x52e7('0xa'));var fs=require('fs');var fs_extra=require(_0x52e7('0xb'));var _=require(_0x52e7('0xc'));var squel=require(_0x52e7('0xd'));var crypto=require(_0x52e7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x52e7('0xf'));var toCsv=require(_0x52e7('0x9'));var querystring=require(_0x52e7('0x10'));var Papa=require(_0x52e7('0x11'));var Redis=require(_0x52e7('0x12'));var authService=require(_0x52e7('0x13'));var qs=require(_0x52e7('0x14'));var as=require(_0x52e7('0x15'));var hardwareService=require(_0x52e7('0x16'));var logger=require(_0x52e7('0x17'))('api');var utils=require(_0x52e7('0x18'));var config=require(_0x52e7('0x19'));var licenseUtil=require(_0x52e7('0x1a'));var db=require(_0x52e7('0x1b'))['db'];config[_0x52e7('0x1c')]=_[_0x52e7('0x1d')](config[_0x52e7('0x1c')],{'host':_0x52e7('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x52e7('0x1c')]));require(_0x52e7('0x1f'))[_0x52e7('0x20')](socket);function respondWithStatusCode(_0x57d90e,_0xf66ba4){_0xf66ba4=_0xf66ba4||0xcc;return function(_0x251378){if(_0x251378){return _0x57d90e[_0x52e7('0x21')](_0xf66ba4);}return _0x57d90e[_0x52e7('0x22')](_0xf66ba4)['end']();};}function respondWithResult(_0xefafd1,_0x330689){_0x330689=_0x330689||0xc8;return function(_0x4aa0a1){if(_0x4aa0a1){return _0xefafd1['status'](_0x330689)[_0x52e7('0x23')](_0x4aa0a1);}};}function respondWithFilteredResult(_0x2bdfe3,_0x52084){return function(_0x15d1bc){if(_0x15d1bc){var _0x29e050=typeof _0x52084['offset']===_0x52e7('0x24')&&typeof _0x52084['limit']===_0x52e7('0x24');var _0x2a254b=_0x15d1bc[_0x52e7('0x25')];var _0x47f74a=_0x29e050?0x0:_0x52084[_0x52e7('0x26')];var _0x551bba=_0x29e050?_0x15d1bc[_0x52e7('0x25')]:_0x52084[_0x52e7('0x26')]+_0x52084['limit'];var _0x4bc250;if(_0x551bba>=_0x2a254b){_0x551bba=_0x2a254b;_0x4bc250=0xc8;}else{_0x4bc250=0xce;}_0x2bdfe3[_0x52e7('0x22')](_0x4bc250);return _0x2bdfe3['set']('Content-Range',_0x47f74a+'-'+_0x551bba+'/'+_0x2a254b)[_0x52e7('0x23')](_0x15d1bc);}return null;};}function patchUpdates(_0x3d1368){return function(_0x121348){try{jsonpatch[_0x52e7('0x27')](_0x121348,_0x3d1368,!![]);}catch(_0x50d97c){return BPromise[_0x52e7('0x28')](_0x50d97c);}return _0x121348['save']();};}function saveUpdates(_0x53c063,_0x2bda08){return function(_0x78a338){if(_0x78a338){return _0x78a338[_0x52e7('0x29')](_0x53c063)[_0x52e7('0x2a')](function(_0x24cea0){return _0x24cea0;});}return null;};}function removeEntity(_0x3eec0a,_0x5b4d3c){return function(_0x5490ef){if(_0x5490ef){return _0x5490ef['destroy']()['then'](function(){_0x3eec0a[_0x52e7('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x489b3a,_0x16b8b3){return function(_0x4f181b){if(!_0x4f181b){_0x489b3a[_0x52e7('0x21')](0x194);}return _0x4f181b;};}function handleError(_0x5c5468,_0x49b694){_0x49b694=_0x49b694||0x1f4;return function(_0x3654a9){logger[_0x52e7('0x2b')](_0x3654a9['stack']);if(_0x3654a9[_0x52e7('0x2c')]){delete _0x3654a9[_0x52e7('0x2c')];}_0x5c5468[_0x52e7('0x22')](_0x49b694)[_0x52e7('0x2d')](_0x3654a9);};}exports[_0x52e7('0x2e')]=function(_0x36fb85,_0x4aa06a){var _0x131f66={},_0x4a31ff={},_0x220818={'count':0x0,'rows':[]};var _0x4a589c=_['map'](db['ChatGroup'][_0x52e7('0x2f')],function(_0x444385){return{'name':_0x444385[_0x52e7('0x30')],'type':_0x444385[_0x52e7('0x31')][_0x52e7('0x32')]};});_0x4a31ff[_0x52e7('0x33')]=_[_0x52e7('0x34')](_0x4a589c,'name');_0x4a31ff['query']=_[_0x52e7('0x35')](_0x36fb85[_0x52e7('0x36')]);_0x4a31ff['filters']=_[_0x52e7('0x37')](_0x4a31ff['model'],_0x4a31ff[_0x52e7('0x36')]);_0x131f66[_0x52e7('0x38')]=_[_0x52e7('0x37')](_0x4a31ff[_0x52e7('0x33')],qs['fields'](_0x36fb85[_0x52e7('0x36')]['fields']));_0x131f66[_0x52e7('0x38')]=_0x131f66['attributes'][_0x52e7('0x39')]?_0x131f66['attributes']:_0x4a31ff[_0x52e7('0x33')];if(!_0x36fb85['query']['hasOwnProperty'](_0x52e7('0x3a'))){_0x131f66['limit']=qs[_0x52e7('0x3b')](_0x36fb85['query']['limit']);_0x131f66[_0x52e7('0x26')]=qs[_0x52e7('0x26')](_0x36fb85[_0x52e7('0x36')]['offset']);}_0x131f66[_0x52e7('0x3c')]=qs['sort'](_0x36fb85[_0x52e7('0x36')][_0x52e7('0x3d')]);_0x131f66[_0x52e7('0x3e')]=qs[_0x52e7('0x3f')](_['pick'](_0x36fb85[_0x52e7('0x36')],_0x4a31ff[_0x52e7('0x3f')]),_0x4a589c);if(_0x36fb85[_0x52e7('0x36')][_0x52e7('0x40')]){_0x131f66[_0x52e7('0x3e')]=_['merge'](_0x131f66[_0x52e7('0x3e')],{'$or':_[_0x52e7('0x34')](_0x4a589c,function(_0x5ba0a1){if(_0x5ba0a1[_0x52e7('0x31')]!=='VIRTUAL'){var _0x86f3ed={};_0x86f3ed[_0x5ba0a1['name']]={'$like':'%'+_0x36fb85[_0x52e7('0x36')][_0x52e7('0x40')]+'%'};return _0x86f3ed;}})});}_0x131f66=_[_0x52e7('0x41')]({},_0x131f66,_0x36fb85[_0x52e7('0x42')]);var _0x2fd907={'where':_0x131f66[_0x52e7('0x3e')]};return db[_0x52e7('0x43')][_0x52e7('0x25')](_0x2fd907)[_0x52e7('0x2a')](function(_0x4d2347){_0x220818[_0x52e7('0x25')]=_0x4d2347;if(_0x36fb85[_0x52e7('0x36')][_0x52e7('0x44')]){_0x131f66[_0x52e7('0x45')]=[{'all':!![]}];}return db[_0x52e7('0x43')][_0x52e7('0x46')](_0x131f66);})[_0x52e7('0x2a')](function(_0x497c84){_0x220818[_0x52e7('0x47')]=_0x497c84;return _0x220818;})['then'](respondWithFilteredResult(_0x4aa06a,_0x131f66))[_0x52e7('0x48')](handleError(_0x4aa06a,null));};exports['show']=function(_0x46a03c,_0x208b9c){var _0x1bfeac={'raw':!![],'where':{'id':_0x46a03c['params']['id']}},_0x173252={};_0x173252[_0x52e7('0x33')]=_[_0x52e7('0x35')](db['ChatGroup'][_0x52e7('0x2f')]);_0x173252[_0x52e7('0x36')]=_[_0x52e7('0x35')](_0x46a03c[_0x52e7('0x36')]);_0x173252['filters']=_[_0x52e7('0x37')](_0x173252[_0x52e7('0x33')],_0x173252['query']);_0x1bfeac[_0x52e7('0x38')]=_[_0x52e7('0x37')](_0x173252['model'],qs[_0x52e7('0x49')](_0x46a03c[_0x52e7('0x36')][_0x52e7('0x49')]));_0x1bfeac[_0x52e7('0x38')]=_0x1bfeac[_0x52e7('0x38')][_0x52e7('0x39')]?_0x1bfeac[_0x52e7('0x38')]:_0x173252[_0x52e7('0x33')];if(_0x46a03c[_0x52e7('0x36')][_0x52e7('0x44')]){_0x1bfeac[_0x52e7('0x45')]=[{'all':!![]}];}_0x1bfeac=_[_0x52e7('0x41')]({},_0x1bfeac,_0x46a03c[_0x52e7('0x42')]);return db[_0x52e7('0x43')]['find'](_0x1bfeac)[_0x52e7('0x2a')](handleEntityNotFound(_0x208b9c,null))['then'](respondWithResult(_0x208b9c,null))[_0x52e7('0x48')](handleError(_0x208b9c,null));};exports[_0x52e7('0x4a')]=function(_0x1a20f5,_0x528d58){return db[_0x52e7('0x43')][_0x52e7('0x4a')](_0x1a20f5['body'],{})['then'](respondWithResult(_0x528d58,0xc9))[_0x52e7('0x48')](handleError(_0x528d58,null));};exports[_0x52e7('0x29')]=function(_0x1c9fd9,_0x3e88ed){if(_0x1c9fd9['body']['id']){delete _0x1c9fd9[_0x52e7('0x4b')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1c9fd9[_0x52e7('0x4c')]['id']}})[_0x52e7('0x2a')](handleEntityNotFound(_0x3e88ed,null))['then'](saveUpdates(_0x1c9fd9[_0x52e7('0x4b')],null))['then'](respondWithResult(_0x3e88ed,null))['catch'](handleError(_0x3e88ed,null));};exports[_0x52e7('0x4d')]=function(_0x40a5c0,_0x3ff917){return db[_0x52e7('0x43')][_0x52e7('0x4e')]({'where':{'id':_0x40a5c0[_0x52e7('0x4c')]['id']}})[_0x52e7('0x2a')](handleEntityNotFound(_0x3ff917,null))['then'](removeEntity(_0x3ff917,null))[_0x52e7('0x48')](handleError(_0x3ff917,null));};exports['describe']=function(_0x5621ff,_0x48d729){return db[_0x52e7('0x43')][_0x52e7('0x4f')]()[_0x52e7('0x2a')](respondWithResult(_0x48d729,null))['catch'](handleError(_0x48d729,null));};exports[_0x52e7('0x50')]=function(_0x50a046,_0x1eb883,_0x15a7a1){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x50a046[_0x52e7('0x4c')]['id'],'ToId':_0x50a046[_0x52e7('0x51')]['id'],'read':![]}})[_0x52e7('0x2a')](function(_0x46b3e6){return{'id':_[_0x52e7('0x52')](_0x50a046['params']['id']),'count':_0x46b3e6};})[_0x52e7('0x2a')](respondWithResult(_0x1eb883,null))[_0x52e7('0x48')](handleError(_0x1eb883,null));};exports[_0x52e7('0x53')]=function(_0x4dbb00,_0x5ccc7c,_0x442e43){return db[_0x52e7('0x43')][_0x52e7('0x4e')]({'where':{'id':_0x4dbb00['params']['id']}})[_0x52e7('0x2a')](handleEntityNotFound(_0x5ccc7c,null))[_0x52e7('0x2a')](function(_0x38dc8c){if(_0x38dc8c){return _0x38dc8c[_0x52e7('0x53')](_0x4dbb00[_0x52e7('0x4b')][_0x52e7('0x54')],_['omit'](_0x4dbb00[_0x52e7('0x4b')],[_0x52e7('0x54'),'id'])||{});}})['then'](respondWithResult(_0x5ccc7c,null))['catch'](handleError(_0x5ccc7c,null));};exports[_0x52e7('0x55')]=function(_0xa2c69a,_0x2207bb,_0x42f6c1){var _0x387307={};var _0x3f29a9={};var _0x570a8b;var _0x249f43;return db[_0x52e7('0x43')][_0x52e7('0x56')]({'where':{'id':_0xa2c69a[_0x52e7('0x4c')]['id']}})[_0x52e7('0x2a')](handleEntityNotFound(_0x2207bb,null))[_0x52e7('0x2a')](function(_0x4f65eb){if(_0x4f65eb){_0x570a8b=_0x4f65eb;_0x3f29a9[_0x52e7('0x33')]=_[_0x52e7('0x35')](db['User'][_0x52e7('0x2f')]);_0x3f29a9[_0x52e7('0x36')]=_[_0x52e7('0x35')](_0xa2c69a[_0x52e7('0x36')]);_0x3f29a9[_0x52e7('0x3f')]=_[_0x52e7('0x37')](_0x3f29a9[_0x52e7('0x33')],_0x3f29a9[_0x52e7('0x36')]);_0x387307['attributes']=_['intersection'](_0x3f29a9[_0x52e7('0x33')],qs[_0x52e7('0x49')](_0xa2c69a[_0x52e7('0x36')][_0x52e7('0x49')]));_0x387307[_0x52e7('0x38')]=_0x387307['attributes'][_0x52e7('0x39')]?_0x387307[_0x52e7('0x38')]:_0x3f29a9[_0x52e7('0x33')];_0x387307[_0x52e7('0x3c')]=qs['sort'](_0xa2c69a['query'][_0x52e7('0x3d')]);_0x387307[_0x52e7('0x3e')]=qs[_0x52e7('0x3f')](_[_0x52e7('0x57')](_0xa2c69a['query'],_0x3f29a9['filters']));if(_0xa2c69a[_0x52e7('0x36')][_0x52e7('0x40')]){_0x387307[_0x52e7('0x3e')]=_[_0x52e7('0x41')](_0x387307[_0x52e7('0x3e')],{'$or':_[_0x52e7('0x34')](_0x387307[_0x52e7('0x38')],function(_0x553ae4){var _0x480290={};_0x480290[_0x553ae4]={'$like':'%'+_0xa2c69a[_0x52e7('0x36')][_0x52e7('0x40')]+'%'};return _0x480290;})});}_0x387307=_[_0x52e7('0x41')]({},_0x387307,_0xa2c69a[_0x52e7('0x42')]);return _0x570a8b[_0x52e7('0x55')](_0x387307);}})[_0x52e7('0x2a')](function(_0x5c011b){if(_0x5c011b){_0x249f43=_0x5c011b['length'];if(!_0xa2c69a[_0x52e7('0x36')][_0x52e7('0x58')]('nolimit')){_0x387307['limit']=qs[_0x52e7('0x3b')](_0xa2c69a[_0x52e7('0x36')][_0x52e7('0x3b')]);_0x387307[_0x52e7('0x26')]=qs[_0x52e7('0x26')](_0xa2c69a['query'][_0x52e7('0x26')]);}return _0x570a8b['getMembers'](_0x387307);}})['then'](function(_0x569857){if(_0x569857){return _0x569857?{'count':_0x249f43,'rows':_0x569857}:null;}})[_0x52e7('0x2a')](respondWithResult(_0x2207bb,null))[_0x52e7('0x48')](handleError(_0x2207bb,null));};exports[_0x52e7('0x59')]=function(_0x475d8c,_0x111941,_0x3c935f){return db[_0x52e7('0x43')]['find']({'where':{'id':_0x475d8c[_0x52e7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x111941,null))[_0x52e7('0x2a')](function(_0x4db080){if(_0x4db080){return _0x4db080[_0x52e7('0x59')](_0x475d8c[_0x52e7('0x36')]['ids']);}})[_0x52e7('0x2a')](respondWithStatusCode(_0x111941,null))[_0x52e7('0x48')](handleError(_0x111941,null));};exports[_0x52e7('0x5a')]=function(_0x3ce6b1,_0x3328fe,_0x517d5b){if(_0x3ce6b1[_0x52e7('0x4b')]['id']){delete _0x3ce6b1['body']['id'];}return db[_0x52e7('0x43')][_0x52e7('0x4e')]({'where':{'id':_0x3ce6b1[_0x52e7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3328fe,null))[_0x52e7('0x2a')](function(_0xc3330c){if(_0xc3330c){_0x3ce6b1[_0x52e7('0x4b')][_0x52e7('0x5b')]=_0xc3330c['id'];return db[_0x52e7('0x5c')]['create'](_0x3ce6b1[_0x52e7('0x4b')]);}})[_0x52e7('0x2a')](respondWithResult(_0x3328fe,null))[_0x52e7('0x48')](handleError(_0x3328fe,null));};exports[_0x52e7('0x5d')]=function(_0x13f665,_0x97896,_0x5adf7a){var _0x203c8c={};var _0x16768a={};var _0xf6ee42;var _0x3f0607;return db[_0x52e7('0x43')][_0x52e7('0x56')]({'where':{'id':_0x13f665[_0x52e7('0x4c')]['id']}})[_0x52e7('0x2a')](handleEntityNotFound(_0x97896,null))[_0x52e7('0x2a')](function(_0x5803e0){if(_0x5803e0){_0xf6ee42=_0x5803e0;_0x16768a[_0x52e7('0x33')]=_[_0x52e7('0x35')](db[_0x52e7('0x5c')][_0x52e7('0x2f')]);_0x16768a[_0x52e7('0x36')]=_[_0x52e7('0x35')](_0x13f665[_0x52e7('0x36')]);_0x16768a[_0x52e7('0x3f')]=_[_0x52e7('0x37')](_0x16768a[_0x52e7('0x33')],_0x16768a[_0x52e7('0x36')]);_0x203c8c[_0x52e7('0x38')]=_[_0x52e7('0x37')](_0x16768a[_0x52e7('0x33')],qs[_0x52e7('0x49')](_0x13f665[_0x52e7('0x36')][_0x52e7('0x49')]));_0x203c8c[_0x52e7('0x38')]=_0x203c8c[_0x52e7('0x38')][_0x52e7('0x39')]?_0x203c8c[_0x52e7('0x38')]:_0x16768a['model'];_0x203c8c[_0x52e7('0x3c')]=qs['sort'](_0x13f665[_0x52e7('0x36')]['sort']);_0x203c8c[_0x52e7('0x3e')]=qs[_0x52e7('0x3f')](_[_0x52e7('0x57')](_0x13f665['query'],_0x16768a[_0x52e7('0x3f')]));if(_0x13f665[_0x52e7('0x36')][_0x52e7('0x40')]){_0x203c8c[_0x52e7('0x3e')]=_[_0x52e7('0x41')](_0x203c8c[_0x52e7('0x3e')],{'$or':_['map'](_0x203c8c[_0x52e7('0x38')],function(_0x46087d){var _0x1aed67={};_0x1aed67[_0x46087d]={'$like':'%'+_0x13f665[_0x52e7('0x36')][_0x52e7('0x40')]+'%'};return _0x1aed67;})});}if(_0x13f665[_0x52e7('0x36')]['$gte']){var _0x4be488=_0x13f665[_0x52e7('0x36')][_0x52e7('0x5e')][_0x52e7('0x5f')](',');var _0x1da4a2={};_0x1da4a2[_0x4be488[0x0]]={'$gte':moment(_0x4be488[0x1])[_0x52e7('0x60')](_0x52e7('0x61'))};_0x203c8c[_0x52e7('0x3e')]=_[_0x52e7('0x41')](_0x203c8c['where'],_0x1da4a2);}_0x203c8c=_['merge']({},_0x203c8c,_0x13f665[_0x52e7('0x42')]);return _0xf6ee42[_0x52e7('0x5d')](_0x203c8c);}})[_0x52e7('0x2a')](function(_0x4afba5){if(_0x4afba5){_0x3f0607=_0x4afba5['length'];if(!_0x13f665[_0x52e7('0x36')][_0x52e7('0x58')](_0x52e7('0x3a'))){_0x203c8c[_0x52e7('0x3b')]=qs[_0x52e7('0x3b')](_0x13f665[_0x52e7('0x36')][_0x52e7('0x3b')]);_0x203c8c[_0x52e7('0x26')]=qs[_0x52e7('0x26')](_0x13f665['query'][_0x52e7('0x26')]);}return _0xf6ee42[_0x52e7('0x5d')](_0x203c8c);}})['then'](function(_0x2b31cd){if(_0x2b31cd){return _0x2b31cd?{'count':_0x3f0607,'rows':_0x2b31cd}:null;}})[_0x52e7('0x2a')](respondWithResult(_0x97896,null))[_0x52e7('0x48')](handleError(_0x97896,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 6dd0a0a..f3996b7 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 _0x9782=['events','../../mysqldb','setMaxListeners','remove','emit','hook'];(function(_0x568e4a,_0x82a00){var _0xb6e552=function(_0x42bb16){while(--_0x42bb16){_0x568e4a['push'](_0x568e4a['shift']());}};_0xb6e552(++_0x82a00);}(_0x9782,0xf6));var _0x2978=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0x9782[_0x13e758];return _0x5b53c3;};'use strict';var EventEmitter=require(_0x2978('0x0'));var ChatGroup=require(_0x2978('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2978('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2978('0x3')};function emitEvent(_0x1fe2bd){return function(_0x104f79,_0x452f52,_0x1f1502){ChatGroupEvents[_0x2978('0x4')](_0x1fe2bd+':'+_0x104f79['id'],_0x104f79);ChatGroupEvents[_0x2978('0x4')](_0x1fe2bd,_0x104f79);_0x1f1502(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x2978('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x202a=['update','hasOwnProperty','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x202a,0xc0));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xa202('0x0'))['db'][_0xa202('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa202('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa202('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4878f5){return function(_0x595945,_0x32f8b7,_0x1ce932){ChatGroupEvents['emit'](_0x4878f5+':'+_0x595945['id'],_0x595945);ChatGroupEvents['emit'](_0x4878f5,_0x595945);_0x1ce932(null);};}for(var e in events){if(events[_0xa202('0x4')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index d804034..8536f97 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 _0x62da=['../../config/environment','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x471f82,_0x2defed){var _0x144bb1=function(_0x112b07){while(--_0x112b07){_0x471f82['push'](_0x471f82['shift']());}};_0x144bb1(++_0x2defed);}(_0x62da,0x1f0));var _0xa62d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62da[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa62d('0x0'));var util=require(_0xa62d('0x1'));var logger=require(_0xa62d('0x2'))(_0xa62d('0x3'));var moment=require(_0xa62d('0x4'));var BPromise=require('bluebird');var rp=require(_0xa62d('0x5'));var fs=require('fs');var path=require(_0xa62d('0x6'));var rimraf=require(_0xa62d('0x7'));var config=require(_0xa62d('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x2e77d1,_0x59ce4b){return _0x2e77d1[_0xa62d('0x9')](_0xa62d('0xa'),attributes,{'tableName':_0xa62d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc9c=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','chat_groups','lodash'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xdc9c,0x133));var _0xcdc9=function(_0x4fb9f2,_0x5c2fcb){_0x4fb9f2=_0x4fb9f2-0x0;var _0x47332e=_0xdc9c[_0x4fb9f2];return _0x47332e;};'use strict';var _=require(_0xcdc9('0x0'));var util=require(_0xcdc9('0x1'));var logger=require(_0xcdc9('0x2'))(_0xcdc9('0x3'));var moment=require(_0xcdc9('0x4'));var BPromise=require('bluebird');var rp=require(_0xcdc9('0x5'));var fs=require('fs');var path=require(_0xcdc9('0x6'));var rimraf=require(_0xcdc9('0x7'));var config=require(_0xcdc9('0x8'));var attributes=require(_0xcdc9('0x9'));module['exports']=function(_0x40d6de,_0x399c75){return _0x40d6de['define']('ChatGroup',attributes,{'tableName':_0xcdc9('0xa'),'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 b3ffb25..30dd1af 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 _0x15ff=['code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2912d8,_0x201076){var _0x6b361c=function(_0x177d9f){while(--_0x177d9f){_0x2912d8['push'](_0x2912d8['shift']());}};_0x6b361c(++_0x201076);}(_0x15ff,0x74));var _0xf15f=function(_0x7ddadf,_0x235e39){_0x7ddadf=_0x7ddadf-0x0;var _0x3d5f89=_0x15ff[_0x7ddadf];return _0x3d5f89;};'use strict';var _=require(_0xf15f('0x0'));var util=require(_0xf15f('0x1'));var moment=require('moment');var BPromise=require(_0xf15f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf15f('0x3'));var db=require(_0xf15f('0x4'))['db'];var utils=require(_0xf15f('0x5'));var logger=require(_0xf15f('0x6'))(_0xf15f('0x7'));var config=require(_0xf15f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf15f('0x9')]['http']({'port':0x232a});config[_0xf15f('0xa')]=_[_0xf15f('0xb')](config[_0xf15f('0xa')],{'host':_0xf15f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf15f('0xa')]));require(_0xf15f('0xd'))[_0xf15f('0xe')](socket);function respondWithRpcPromise(_0x5f18ef,_0x1dfda0,_0xce0db3){return new BPromise(function(_0x4fa7d8,_0x4767f7){return client[_0xf15f('0xf')](_0x5f18ef,_0xce0db3)[_0xf15f('0x10')](function(_0x4019da){logger[_0xf15f('0x11')](_0xf15f('0x12'),_0x1dfda0,_0xf15f('0x13'));logger[_0xf15f('0x14')](_0xf15f('0x15'),_0x1dfda0,_0xf15f('0x13'),JSON[_0xf15f('0x16')](_0x4019da));if(_0x4019da[_0xf15f('0x17')]){if(_0x4019da[_0xf15f('0x17')][_0xf15f('0x18')]===0x1f4){logger[_0xf15f('0x17')](_0xf15f('0x12'),_0x1dfda0,_0x4019da[_0xf15f('0x17')][_0xf15f('0x19')]);return _0x4767f7(_0x4019da[_0xf15f('0x17')]['message']);}logger['error'](_0xf15f('0x12'),_0x1dfda0,_0x4019da[_0xf15f('0x17')]['message']);return _0x4fa7d8(_0x4019da['error'][_0xf15f('0x19')]);}else{logger['info'](_0xf15f('0x12'),_0x1dfda0,'request\x20sent');_0x4fa7d8(_0x4019da[_0xf15f('0x1a')][_0xf15f('0x19')]);}})[_0xf15f('0x1b')](function(_0x662d62){logger[_0xf15f('0x17')](_0xf15f('0x12'),_0x1dfda0,_0x662d62);_0x4767f7(_0x662d62);});});}
\ No newline at end of file
+var _0x64b0=['redis','defaults','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0xaaa028,_0x43931c){var _0x16a700=function(_0x4cf218){while(--_0x4cf218){_0xaaa028['push'](_0xaaa028['shift']());}};_0x16a700(++_0x43931c);}(_0x64b0,0x74));var _0x064b=function(_0x58e00b,_0x5e6b48){_0x58e00b=_0x58e00b-0x0;var _0x3a1431=_0x64b0[_0x58e00b];return _0x3a1431;};'use strict';var _=require(_0x064b('0x0'));var util=require(_0x064b('0x1'));var moment=require(_0x064b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x064b('0x3'));var db=require(_0x064b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x064b('0x5'))(_0x064b('0x6'));var config=require('../../config/environment');var jayson=require(_0x064b('0x7'));var client=jayson[_0x064b('0x8')]['http']({'port':0x232a});config[_0x064b('0x9')]=_[_0x064b('0xa')](config[_0x064b('0x9')],{'host':_0x064b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x064b('0x9')]));require(_0x064b('0xc'))[_0x064b('0xd')](socket);function respondWithRpcPromise(_0x4011ac,_0x10c8d2,_0x22d848){return new BPromise(function(_0x472e3d,_0x381aa7){return client['request'](_0x4011ac,_0x22d848)[_0x064b('0xe')](function(_0x4c1b9e){logger[_0x064b('0xf')](_0x064b('0x10'),_0x10c8d2,'request\x20sent');logger[_0x064b('0x11')](_0x064b('0x12'),_0x10c8d2,_0x064b('0x13'),JSON[_0x064b('0x14')](_0x4c1b9e));if(_0x4c1b9e[_0x064b('0x15')]){if(_0x4c1b9e['error'][_0x064b('0x16')]===0x1f4){logger[_0x064b('0x15')]('ChatGroup,\x20%s,\x20%s',_0x10c8d2,_0x4c1b9e[_0x064b('0x15')][_0x064b('0x17')]);return _0x381aa7(_0x4c1b9e[_0x064b('0x15')][_0x064b('0x17')]);}logger[_0x064b('0x15')](_0x064b('0x10'),_0x10c8d2,_0x4c1b9e[_0x064b('0x15')][_0x064b('0x17')]);return _0x472e3d(_0x4c1b9e['error'][_0x064b('0x17')]);}else{logger[_0x064b('0xf')](_0x064b('0x10'),_0x10c8d2,_0x064b('0x13'));_0x472e3d(_0x4c1b9e[_0x064b('0x18')][_0x064b('0x17')]);}})['catch'](function(_0x2ec0a6){logger[_0x064b('0x15')](_0x064b('0x10'),_0x10c8d2,_0x2ec0a6);_0x381aa7(_0x2ec0a6);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index ecfc67d..6c54d6d 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 _0xaf3e=['remove','update','emit','removeListener','register','./chatGroup.events','save'];(function(_0x876f8d,_0x2bad33){var _0x349d20=function(_0x547b2b){while(--_0x547b2b){_0x876f8d['push'](_0x876f8d['shift']());}};_0x349d20(++_0x2bad33);}(_0xaf3e,0x8a));var _0xeaf3=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0xaf3e[_0x440917];return _0x5e906b;};'use strict';var ChatGroupEvents=require(_0xeaf3('0x0'));var events=[_0xeaf3('0x1'),_0xeaf3('0x2'),_0xeaf3('0x3')];function createListener(_0x34b712,_0x5cbd87){return function(_0x31bce8){_0x5cbd87[_0xeaf3('0x4')](_0x34b712,_0x31bce8);};}function removeListener(_0x171f26,_0x1f89df){return function(){ChatGroupEvents[_0xeaf3('0x5')](_0x171f26,_0x1f89df);};}exports[_0xeaf3('0x6')]=function(_0xfe8774){for(var _0x4549ac=0x0,_0x439a43=events['length'];_0x4549ac<_0x439a43;_0x4549ac++){var _0x5085c1=events[_0x4549ac];var _0x1a12be=createListener('chatGroup:'+_0x5085c1,_0xfe8774);ChatGroupEvents['on'](_0x5085c1,_0x1a12be);}};
\ No newline at end of file
+var _0xe827=['chatGroup:','./chatGroup.events','save','emit','register','length'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xe827,0x1cf));var _0x7e82=function(_0x440788,_0x538e84){_0x440788=_0x440788-0x0;var _0x6b4ead=_0xe827[_0x440788];return _0x6b4ead;};'use strict';var ChatGroupEvents=require(_0x7e82('0x0'));var events=[_0x7e82('0x1'),'remove','update'];function createListener(_0x262144,_0x574851){return function(_0x19cc98){_0x574851[_0x7e82('0x2')](_0x262144,_0x19cc98);};}function removeListener(_0x19c5f7,_0x1e9969){return function(){ChatGroupEvents['removeListener'](_0x19c5f7,_0x1e9969);};}exports[_0x7e82('0x3')]=function(_0x208b8c){for(var _0x28582c=0x0,_0x3b5e6e=events[_0x7e82('0x4')];_0x28582c<_0x3b5e6e;_0x28582c++){var _0x1e6fd2=events[_0x28582c];var _0x5627cc=createListener(_0x7e82('0x5')+_0x1e6fd2,_0x208b8c);ChatGroupEvents['on'](_0x1e6fd2,_0x5627cc);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index f54c8dd..893f14b 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 _0xa6de=['delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','index','get','/describe','describe','isAuthenticated','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','put','/:id'];(function(_0x2faf4d,_0xebb4f6){var _0x4c2ec1=function(_0x585197){while(--_0x585197){_0x2faf4d['push'](_0x2faf4d['shift']());}};_0x4c2ec1(++_0xebb4f6);}(_0xa6de,0x12d));var _0xea6d=function(_0x51b72e,_0x408f4f){_0x51b72e=_0x51b72e-0x0;var _0xa108e1=_0xa6de[_0x51b72e];return _0xa108e1;};'use strict';var multer=require(_0xea6d('0x0'));var util=require(_0xea6d('0x1'));var path=require('path');var timeout=require(_0xea6d('0x2'));var express=require(_0xea6d('0x3'));var router=express['Router']();var fs_extra=require(_0xea6d('0x4'));var auth=require(_0xea6d('0x5'));var interaction=require(_0xea6d('0x6'));var config=require('../../config/environment');var controller=require(_0xea6d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xea6d('0x8')]);router[_0xea6d('0x9')](_0xea6d('0xa'),auth['isAuthenticated'](),controller[_0xea6d('0xb')]);router['get']('/:id',auth[_0xea6d('0xc')](),controller[_0xea6d('0xd')]);router['get'](_0xea6d('0xe'),auth[_0xea6d('0xc')](),controller['getUnread']);router['get'](_0xea6d('0xf'),auth[_0xea6d('0xc')](),controller[_0xea6d('0x10')]);router['get'](_0xea6d('0x11'),auth[_0xea6d('0xc')](),controller[_0xea6d('0x12')]);router[_0xea6d('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xea6d('0x13')](_0xea6d('0xf'),auth[_0xea6d('0xc')](),controller[_0xea6d('0x14')]);router[_0xea6d('0x13')](_0xea6d('0x11'),auth['isAuthenticated'](),controller['addMessage']);router[_0xea6d('0x15')](_0xea6d('0x16'),auth['isAuthenticated'](),controller['update']);router[_0xea6d('0x17')](_0xea6d('0x16'),auth[_0xea6d('0xc')](),controller[_0xea6d('0x18')]);router['delete'](_0xea6d('0xf'),auth[_0xea6d('0xc')](),controller[_0xea6d('0x19')]);module[_0xea6d('0x1a')]=router;
\ No newline at end of file
+var _0xc62f=['/:id/members','/:id/messages','post','create','addMembers','addMessage','delete','/:id','destroy','removeMembers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatGroup.controller','index','get','isAuthenticated','describe','show','/:id/unread','getUnread'];(function(_0x4b6bee,_0x327a86){var _0x2f9a99=function(_0x39092c){while(--_0x39092c){_0x4b6bee['push'](_0x4b6bee['shift']());}};_0x2f9a99(++_0x327a86);}(_0xc62f,0x1b3));var _0xfc62=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc62f[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xfc62('0x0'));var util=require('util');var path=require(_0xfc62('0x1'));var timeout=require(_0xfc62('0x2'));var express=require(_0xfc62('0x3'));var router=express[_0xfc62('0x4')]();var fs_extra=require(_0xfc62('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfc62('0x6'));var controller=require(_0xfc62('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfc62('0x8')]);router[_0xfc62('0x9')]('/describe',auth[_0xfc62('0xa')](),controller[_0xfc62('0xb')]);router[_0xfc62('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xfc62('0xc')]);router[_0xfc62('0x9')](_0xfc62('0xd'),auth['isAuthenticated'](),controller[_0xfc62('0xe')]);router[_0xfc62('0x9')](_0xfc62('0xf'),auth[_0xfc62('0xa')](),controller['getMembers']);router[_0xfc62('0x9')](_0xfc62('0x10'),auth[_0xfc62('0xa')](),controller['getMessages']);router[_0xfc62('0x11')]('/',auth[_0xfc62('0xa')](),controller[_0xfc62('0x12')]);router['post'](_0xfc62('0xf'),auth['isAuthenticated'](),controller[_0xfc62('0x13')]);router[_0xfc62('0x11')](_0xfc62('0x10'),auth[_0xfc62('0xa')](),controller[_0xfc62('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfc62('0x15')](_0xfc62('0x16'),auth[_0xfc62('0xa')](),controller[_0xfc62('0x17')]);router['delete'](_0xfc62('0xf'),auth['isAuthenticated'](),controller[_0xfc62('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 4c9b3b3..0ff81ba 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 _0x6017=['STRING','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','TEXT'];(function(_0x48a2f8,_0x54889a){var _0x8881e=function(_0x355718){while(--_0x355718){_0x48a2f8['push'](_0x48a2f8['shift']());}};_0x8881e(++_0x54889a);}(_0x6017,0xae));var _0x7601=function(_0x12d633,_0x3e91c5){_0x12d633=_0x12d633-0x0;var _0x2772e1=_0x6017[_0x12d633];return _0x2772e1;};'use strict';var Sequelize=require(_0x7601('0x0'));module[_0x7601('0x1')]={'closed':{'type':Sequelize[_0x7601('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x7601('0x3')](_0x7601('0x4'),'thumb'),'defaultValue':_0x7601('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x7601('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7601('0x6')]},'secondDisposition':{'type':Sequelize[_0x7601('0x6')]},'thirdDisposition':{'type':Sequelize[_0x7601('0x6')]},'note':{'type':Sequelize[_0x7601('0x6')]},'browserName':{'type':Sequelize[_0x7601('0x6')]},'browserVersion':{'type':Sequelize[_0x7601('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x7601('0x6')]},'deviceModel':{'type':Sequelize[_0x7601('0x6')]},'deviceVendor':{'type':Sequelize[_0x7601('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x7601('0x5')]},'customerIp':{'type':Sequelize[_0x7601('0x6')]},'formData':{'type':Sequelize[_0x7601('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x7601('0x7')]},'lastMsgAt':{'type':Sequelize[_0x7601('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x7601('0x3')]('in',_0x7601('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x7601('0x6')]},'customerPort':{'type':Sequelize[_0x7601('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x7601('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x7601('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x98e5=['long','DATE','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','STRING'];(function(_0x452dde,_0x4c76e7){var _0x19a949=function(_0x670d2){while(--_0x670d2){_0x452dde['push'](_0x452dde['shift']());}};_0x19a949(++_0x4c76e7);}(_0x98e5,0x8a));var _0x598e=function(_0xbf8abb,_0x51b616){_0xbf8abb=_0xbf8abb-0x0;var _0x329859=_0x98e5[_0xbf8abb];return _0x329859;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x598e('0x0')]},'ratingType':{'type':Sequelize[_0x598e('0x1')]('star',_0x598e('0x2')),'defaultValue':_0x598e('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x598e('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x598e('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x598e('0x5')]},'note':{'type':Sequelize[_0x598e('0x5')]},'browserName':{'type':Sequelize[_0x598e('0x5')]},'browserVersion':{'type':Sequelize[_0x598e('0x5')]},'osName':{'type':Sequelize[_0x598e('0x5')]},'osVersion':{'type':Sequelize[_0x598e('0x5')]},'deviceModel':{'type':Sequelize[_0x598e('0x5')]},'deviceVendor':{'type':Sequelize[_0x598e('0x5')]},'deviceType':{'type':Sequelize[_0x598e('0x5')]},'referer':{'type':Sequelize[_0x598e('0x4')]},'customerIp':{'type':Sequelize[_0x598e('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x598e('0x6'))},'read1stAt':{'type':Sequelize[_0x598e('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x598e('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x598e('0x5')]},'customerPort':{'type':Sequelize[_0x598e('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x598e('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x598e('0x8')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 70bb327..c76d452 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 _0xec56=['Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','includeAll','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','omit','spread','emit','chatInteractionTags:save','removeTags','files','server','attachments','transcript-%d-%s.zip','lastName','direction','read','Account','Owner','mkdirSync','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','firstName','views','downloadInteraction.ejs','Chat','createPdfFromHTML','err','unlinkSync','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','update','destroy','stack','name','send','render','merge','body','contact','agent','account','Users','map','fullname','Tags','TagIds','split','forEach','push','talking','answered','unmanaged','total','closed','waiting','UserId','disposition','abandoned','index','ChatInteraction','rawAttributes','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','end','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','sequelize','toString','keyBy','fields','a.key'];(function(_0x135904,_0x1e252b){var _0x1ce7d5=function(_0x25a721){while(--_0x25a721){_0x135904['push'](_0x135904['shift']());}};_0x1ce7d5(++_0x1e252b);}(_0xec56,0x1bd));var _0x6ec5=function(_0x56d891,_0x463510){_0x56d891=_0x56d891-0x0;var _0x2f1804=_0xec56[_0x56d891];return _0x2f1804;};'use strict';var rimraf=require(_0x6ec5('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require(_0x6ec5('0x1'));var BPromise=require(_0x6ec5('0x2'));var Mustache=require(_0x6ec5('0x3'));var util=require(_0x6ec5('0x4'));var path=require(_0x6ec5('0x5'));var ejs=require(_0x6ec5('0x6'));var fs=require('fs');var _=require(_0x6ec5('0x7'));var squel=require(_0x6ec5('0x8'));var Redis=require(_0x6ec5('0x9'));var qs=require(_0x6ec5('0xa'));var as=require(_0x6ec5('0xb'));var pdf=require(_0x6ec5('0xc'));var logger=require(_0x6ec5('0xd'))(_0x6ec5('0xe'));var config=require(_0x6ec5('0xf'));var db=require(_0x6ec5('0x10'))['db'];config[_0x6ec5('0x11')]=_[_0x6ec5('0x12')](config[_0x6ec5('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ec5('0x13'))(new Redis(config[_0x6ec5('0x11')]));require(_0x6ec5('0x14'))[_0x6ec5('0x15')](socket);var jayson=require(_0x6ec5('0x16'));var client=jayson[_0x6ec5('0x17')][_0x6ec5('0x18')]({'port':0x232b});var client9004=jayson['client'][_0x6ec5('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x1d7180,_0x2b1f61,_0xb04ab6,_0x135aaf){return new BPromise(function(_0x2890fb,_0x2f4c5d){var _0x39125b=_0x135aaf||client;return _0x39125b['request'](_0x1d7180,_0xb04ab6)[_0x6ec5('0x19')](function(_0x4d1510){logger[_0x6ec5('0x1a')](_0x6ec5('0x1b'),_0x2b1f61,_0x6ec5('0x1c'));logger[_0x6ec5('0x1d')](_0x6ec5('0x1e'),_0x2b1f61,'request\x20sent',JSON[_0x6ec5('0x1f')](_0x4d1510));if(_0x4d1510[_0x6ec5('0x20')]){if(_0x4d1510[_0x6ec5('0x20')][_0x6ec5('0x21')]===0x1f4){logger[_0x6ec5('0x20')](_0x6ec5('0x1b'),_0x2b1f61,_0x4d1510[_0x6ec5('0x20')][_0x6ec5('0x22')]);return _0x2f4c5d(_0x4d1510[_0x6ec5('0x20')][_0x6ec5('0x22')]);}logger[_0x6ec5('0x20')](_0x6ec5('0x1b'),_0x2b1f61,_0x4d1510[_0x6ec5('0x20')][_0x6ec5('0x22')]);return _0x2890fb(_0x4d1510[_0x6ec5('0x20')][_0x6ec5('0x22')]);}else{logger[_0x6ec5('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x2b1f61,_0x6ec5('0x1c'));_0x2890fb(_0x4d1510[_0x6ec5('0x23')][_0x6ec5('0x22')]);}})[_0x6ec5('0x24')](function(_0x3fc9d7){logger[_0x6ec5('0x20')](_0x6ec5('0x1b'),_0x2b1f61,_0x3fc9d7);_0x2f4c5d(_0x3fc9d7);});});}function respondWithStatusCode(_0x48733b,_0x78c52c){_0x78c52c=_0x78c52c||0xcc;return function(_0x2ecdcf){if(_0x2ecdcf){return _0x48733b[_0x6ec5('0x25')](_0x78c52c);}return _0x48733b[_0x6ec5('0x26')](_0x78c52c)['end']();};}function respondWithResult(_0x27f631,_0x280748){_0x280748=_0x280748||0xc8;return function(_0x5be80f){if(_0x5be80f){return _0x27f631[_0x6ec5('0x26')](_0x280748)[_0x6ec5('0x27')](_0x5be80f);}};}function respondWithFilteredResult(_0xb4d269,_0x5078e8){return function(_0x1b779a){if(_0x1b779a){var _0xd0e8d7=typeof _0x5078e8[_0x6ec5('0x28')]===_0x6ec5('0x29')&&typeof _0x5078e8[_0x6ec5('0x2a')]==='undefined';var _0x171e2a=_0x1b779a[_0x6ec5('0x2b')];var _0x4a9860=_0xd0e8d7?0x0:_0x5078e8[_0x6ec5('0x28')];var _0x3f5ee0=_0xd0e8d7?_0x1b779a['count']:_0x5078e8[_0x6ec5('0x28')]+_0x5078e8[_0x6ec5('0x2a')];var _0x3bbf16;if(_0x3f5ee0>=_0x171e2a){_0x3f5ee0=_0x171e2a;_0x3bbf16=0xc8;}else{_0x3bbf16=0xce;}_0xb4d269[_0x6ec5('0x26')](_0x3bbf16);return _0xb4d269[_0x6ec5('0x2c')]('Content-Range',_0x4a9860+'-'+_0x3f5ee0+'/'+_0x171e2a)[_0x6ec5('0x27')](_0x1b779a);}return null;};}function saveUpdates(_0x179f57){return function(_0x24aff9){if(_0x24aff9){return _0x24aff9[_0x6ec5('0x2d')](_0x179f57)[_0x6ec5('0x19')](function(_0x22c3d3){return _0x22c3d3;});}return null;};}function removeEntity(_0x394132){return function(_0x59a6de){if(_0x59a6de){return _0x59a6de[_0x6ec5('0x2e')]()['then'](function(){_0x394132[_0x6ec5('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x424ec7){return function(_0x3115e3){if(!_0x3115e3){_0x424ec7['sendStatus'](0x194);}return _0x3115e3;};}function handleError(_0x5db924,_0x3bfab4){_0x3bfab4=_0x3bfab4||0x1f4;return function(_0x293915){logger['error'](_0x293915[_0x6ec5('0x2f')]);if(_0x293915[_0x6ec5('0x30')]){delete _0x293915['name'];}_0x5db924[_0x6ec5('0x26')](_0x3bfab4)[_0x6ec5('0x31')](_0x293915);};}function getMustacheRender(_0x391c01,_0x12879b){return Mustache[_0x6ec5('0x32')](_0x391c01,_[_0x6ec5('0x33')](_0x12879b[_0x6ec5('0x34')],{'contact':_0x12879b[_0x6ec5('0x35')],'message':_0x12879b['message'],'agent':_0x12879b[_0x6ec5('0x36')],'interaction':_0x12879b['interaction'],'account':_0x12879b[_0x6ec5('0x37')]}))||'';}function getInteractionUsers(_0xe1e58,_0x26ada3){return new BPromise(function(_0x128055,_0x439dd5){try{if(_0x26ada3[_0xe1e58['id']]){_0xe1e58[_0x6ec5('0x38')]=_[_0x6ec5('0x39')](_0x26ada3[_0xe1e58['id']],function(_0xab380e){return{'id':_0xab380e['id'],'fullname':_0xab380e[_0x6ec5('0x3a')]};});}}catch(_0x203756){_0x439dd5(_0x203756);}_0x128055(_0xe1e58);});}function getInteractionTags(_0x1c56e5,_0x496246){return new BPromise(function(_0x5a5cf7,_0x30465b){try{if(_0x1c56e5['TagIds']){_0x1c56e5[_0x6ec5('0x3b')]=[];_0x1c56e5[_0x6ec5('0x3c')][_0x6ec5('0x3d')](',')[_0x6ec5('0x3e')](function(_0x2b47ab){_0x1c56e5[_0x6ec5('0x3b')][_0x6ec5('0x3f')](_0x496246[_0x2b47ab]);});}delete _0x1c56e5['TagIds'];}catch(_0x239920){_0x30465b(_0x239920);}_0x5a5cf7(_0x1c56e5);});}function updateChatInteraction(_0xc79bb3,_0x42b134,_0x3aaf1a){return new BPromise(function(_0x279339,_0x32db57){return getInteractionUsers(_0xc79bb3,_0x3aaf1a)[_0x6ec5('0x19')](function(_0x4354e4){return getInteractionTags(_0x4354e4,_0x42b134);})[_0x6ec5('0x19')](function(_0x53dcd8){return getStateInteraction(_0x53dcd8);})[_0x6ec5('0x19')](function(_0x4a2f6e){_0x279339(_0x4a2f6e);})[_0x6ec5('0x24')](function(_0x58bdd0){_0x32db57(_0x58bdd0);});});}function getStateInteraction(_0x18b409){return new BPromise(function(_0x45de3c){_0x18b409['waiting']=0x0;_0x18b409[_0x6ec5('0x40')]=0x0;_0x18b409[_0x6ec5('0x41')]=0x0;_0x18b409[_0x6ec5('0x42')]=0x0;_0x18b409['abandoned']=0x0;_0x18b409[_0x6ec5('0x43')]=0x0;if(!_0x18b409[_0x6ec5('0x44')]&&!_0x18b409['UserId']){_0x18b409[_0x6ec5('0x45')]+=0x1;}if(!_0x18b409[_0x6ec5('0x44')]&&_0x18b409[_0x6ec5('0x46')]){_0x18b409[_0x6ec5('0x40')]+=0x1;if(_0x18b409[_0x6ec5('0x45')]){_0x18b409[_0x6ec5('0x45')]-=0x1;}}if(_0x18b409[_0x6ec5('0x44')]&&_0x18b409[_0x6ec5('0x47')]===_0x6ec5('0x48')){_0x18b409[_0x6ec5('0x48')]+=0x1;if(_0x18b409[_0x6ec5('0x45')]){_0x18b409['waiting']-=0x1;}}else if(_0x18b409[_0x6ec5('0x44')]&&!_0x18b409[_0x6ec5('0x46')]&&_0x18b409[_0x6ec5('0x47')]){_0x18b409[_0x6ec5('0x42')]+=0x1;if(_0x18b409['waiting']){_0x18b409[_0x6ec5('0x45')]-=0x1;}}else if(_0x18b409[_0x6ec5('0x44')]&&_0x18b409['UserId']){_0x18b409[_0x6ec5('0x41')]+=0x1;if(_0x18b409['talking']){_0x18b409[_0x6ec5('0x40')]-=0x1;}}_0x18b409[_0x6ec5('0x43')]+=0x1;_0x45de3c(_0x18b409);});}exports[_0x6ec5('0x49')]=function(_0xeac39e,_0x51f2ef){var _0x5b0656={},_0x1bbe7f={},_0x56dc23={'count':0x0,'rows':[]};var _0x2e69ff=_[_0x6ec5('0x39')](db[_0x6ec5('0x4a')][_0x6ec5('0x4b')],function(_0x2cf8c7){return{'name':_0x2cf8c7['fieldName'],'type':_0x2cf8c7['type'][_0x6ec5('0x4c')]};});_0x1bbe7f[_0x6ec5('0x4d')]=_[_0x6ec5('0x39')](_0x2e69ff,_0x6ec5('0x30'));_0x1bbe7f[_0x6ec5('0x4e')]=_[_0x6ec5('0x4f')](_0xeac39e[_0x6ec5('0x4e')]);_0x1bbe7f[_0x6ec5('0x50')]=_[_0x6ec5('0x51')](_0x1bbe7f[_0x6ec5('0x4d')],_0x1bbe7f[_0x6ec5('0x4e')]);_0x5b0656[_0x6ec5('0x52')]=_[_0x6ec5('0x51')](_0x1bbe7f[_0x6ec5('0x4d')],qs['fields'](_0xeac39e[_0x6ec5('0x4e')]['fields']));_0x5b0656[_0x6ec5('0x52')]=_0x5b0656[_0x6ec5('0x52')]['length']?_0x5b0656[_0x6ec5('0x52')]:_0x1bbe7f[_0x6ec5('0x4d')];if(!_0xeac39e['query'][_0x6ec5('0x53')](_0x6ec5('0x54'))){_0x5b0656['limit']=qs['limit'](_0xeac39e[_0x6ec5('0x4e')]['limit']);_0x5b0656['offset']=qs[_0x6ec5('0x28')](_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x28')]);}_0x5b0656[_0x6ec5('0x55')]=qs['sort'](_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x56')]);_0x5b0656[_0x6ec5('0x57')]=qs[_0x6ec5('0x50')](_[_0x6ec5('0x58')](_0xeac39e[_0x6ec5('0x4e')],_0x1bbe7f[_0x6ec5('0x50')]),_0x2e69ff);var _0x29bf52=[];var _0xc52e91=squel[_0x6ec5('0x59')]()[_0x6ec5('0x5a')]('id')[_0x6ec5('0x5a')](_0x6ec5('0x30'))['field'](_0x6ec5('0x5b'))[_0x6ec5('0x5c')]('tools_tags');var _0x388ddd=squel[_0x6ec5('0x59')]()[_0x6ec5('0x5a')](_0x6ec5('0x5d'))[_0x6ec5('0x5a')]('u.fullname')['field'](_0x6ec5('0x5e'))['from'](_0x6ec5('0x5f'),'ui')[_0x6ec5('0x60')](_0x6ec5('0x61'),'u',_0x6ec5('0x62'));var _0x301e31=squel['select']()[_0x6ec5('0x5c')]('chat_interactions','i')['left_join']('cm_contacts','c',_0x6ec5('0x63'))[_0x6ec5('0x60')]('users','o','o.id\x20=\x20i.UserId')[_0x6ec5('0x60')](_0x6ec5('0x64'),'a',_0x6ec5('0x65'))[_0x6ec5('0x60')](_0x6ec5('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x6ec5('0x60')](_0x6ec5('0x67'),'it',_0x6ec5('0x68'))[_0x6ec5('0x60')](_0x6ec5('0x69'),'t','t.id\x20=\x20it.TagId');var _0x34a136=squel[_0x6ec5('0x6a')]();var _0x278c00=[];var _0x5c00c4=squel[_0x6ec5('0x6a')]();var _0xe8a888;if(_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x6b')]){_0xe8a888=as[_0x6ec5('0x6c')](_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x6b')]);var _0x2393d1=_0xe8a888[_0x6ec5('0x6d')];for(var _0x131ef3=0x0;_0x131ef3<_0xe8a888[_0x6ec5('0x6e')][_0x6ec5('0x6f')];_0x131ef3++){var _0x40c76c=_0xe8a888['conditions'][_0x131ef3];var _0x183353='i';var _0x594ab3=_[_0x6ec5('0x70')](_0x2e69ff,['name',_0x40c76c['field']]);if(!_0x594ab3){switch(_0x40c76c[_0x6ec5('0x5a')]){case _0x6ec5('0x71'):if(_0x40c76c[_0x6ec5('0x72')]==0x1){_0x301e31[_0x6ec5('0x73')]('`'+_0x40c76c[_0x6ec5('0x5a')]+'`\x20=\x200');}else{_0x301e31[_0x6ec5('0x73')]('`'+_0x40c76c[_0x6ec5('0x5a')]+_0x6ec5('0x74'));}break;case _0x6ec5('0x75'):if(_0x40c76c[_0x6ec5('0x76')]==='$substring'){if(_0x40c76c[_0x6ec5('0x72')][_0x6ec5('0x3d')]('\x20')[_0x6ec5('0x6f')]>0x1){_0x34a136[_0x2393d1](_0x6ec5('0x77'),qs['getFullTextValue'](_0x40c76c[_0x6ec5('0x72')]),null);}else{var _0x39f48a='%'+_0x40c76c['value']+'%';_0x34a136[_0x2393d1]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x39f48a,_0x39f48a,_0x39f48a);}}else{_0x594ab3=_[_0x6ec5('0x70')](_0x2e69ff,[_0x6ec5('0x30'),_0x6ec5('0x78')]);_0x40c76c[_0x6ec5('0x5a')]=_0x6ec5('0x78');_0xf44b2b=as[_0x6ec5('0x79')](_0x183353,_0x594ab3[_0x6ec5('0x7a')],_0x40c76c);_0x34a136[_0x2393d1](_0xf44b2b[_0x6ec5('0x7b')],_0xf44b2b[_0x6ec5('0x72')][_0x6ec5('0x7c')],_0xf44b2b[_0x6ec5('0x72')]['end']);}break;case _0x6ec5('0x7d'):var _0x12fdac=_0x40c76c[_0x6ec5('0x72')][_0x6ec5('0x3d')](',')['map'](function(_0x26869d){return Number(_0x26869d);});_0x12fdac[_0x6ec5('0x3e')](function(_0x1d5ee3){_0x5c00c4['or'](_0x6ec5('0x7e'),'%,'+_0x1d5ee3+',%');});_0x278c00=_['union'](_0x278c00,_0x12fdac);break;case _0x6ec5('0x7f'):if(_0x40c76c[_0x6ec5('0x76')]===_0x6ec5('0x80')){_0x34a136[_0x2393d1]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x40c76c['value']+'%',null);}else{_0x594ab3=_[_0x6ec5('0x70')](_0x2e69ff,[_0x6ec5('0x30'),'UserId']);_0x40c76c[_0x6ec5('0x5a')]=_0x6ec5('0x46');_0xf44b2b=as[_0x6ec5('0x79')](_0x183353,_0x594ab3[_0x6ec5('0x7a')],_0x40c76c);_0x34a136[_0x2393d1](_0xf44b2b['text'],_0xf44b2b[_0x6ec5('0x72')][_0x6ec5('0x7c')],_0xf44b2b[_0x6ec5('0x72')]['end']);}break;case _0x6ec5('0x34'):_0xf44b2b=as[_0x6ec5('0x79')]('me',null,_0x40c76c);_0x34a136[_0x2393d1](_0xf44b2b[_0x6ec5('0x7b')],_0xf44b2b[_0x6ec5('0x72')][_0x6ec5('0x7c')],_0xf44b2b[_0x6ec5('0x72')][_0x6ec5('0x81')]);break;}}else{var _0xf44b2b=as['buildExpression'](_0x183353,_0x594ab3[_0x6ec5('0x7a')],_0x40c76c);_0x34a136[_0x2393d1](_0xf44b2b[_0x6ec5('0x7b')],_0xf44b2b['value']['start'],_0xf44b2b[_0x6ec5('0x72')][_0x6ec5('0x81')]);}}}else{var _0x7e9bd5=_(_0xeac39e['query'])[_0x6ec5('0x4f')]()[_0x6ec5('0x39')](function(_0x3255e4){return _[_0x6ec5('0x82')](_0x2e69ff,['name',_0x3255e4])?_0x3255e4:undefined;})[_0x6ec5('0x83')]()[_0x6ec5('0x72')]();if(!_[_0x6ec5('0x84')](_0x7e9bd5)){_0x7e9bd5[_0x6ec5('0x3e')](function(_0x42fa7b){if(_0x42fa7b===_0x6ec5('0x85')){_0x301e31[_0x6ec5('0x57')](_0x6ec5('0x86'),[][_0x6ec5('0x87')](_0xeac39e['query'][_0x42fa7b]));}else if(_0x42fa7b==='createdAt'){var _0x307c53=JSON[_0x6ec5('0x88')](_0xeac39e[_0x6ec5('0x4e')][_0x42fa7b])['$gte'];var _0x31a571=JSON['parse'](_0xeac39e[_0x6ec5('0x4e')][_0x42fa7b])[_0x6ec5('0x89')];_0x301e31['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x307c53,_0x31a571);}else{if(_0xeac39e[_0x6ec5('0x4e')][_0x42fa7b]===_0x6ec5('0x8a')){_0x301e31[_0x6ec5('0x57')]('i.'+_0x42fa7b+_0x6ec5('0x8b'));}else{_0x301e31['where']('i.'+_0x42fa7b+_0x6ec5('0x8c'),_0xeac39e[_0x6ec5('0x4e')][_0x42fa7b]);}}});}if(_0xeac39e[_0x6ec5('0x4e')]['read']){if(_0xeac39e['query']['read']==0x1){_0x301e31[_0x6ec5('0x73')](_0x6ec5('0x8d'));}else{_0x301e31[_0x6ec5('0x73')](_0x6ec5('0x8e'));}}if(_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x8f')]){_0x278c00=_[_0x6ec5('0x90')](_0xeac39e['query'][_0x6ec5('0x8f')])?_0xeac39e['query'][_0x6ec5('0x8f')]:new Array(_0xeac39e[_0x6ec5('0x4e')]['tag']);_0x278c00[_0x6ec5('0x3e')](function(_0x354187){_0x5c00c4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x354187+',%');});}if(_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x91')]){var _0x4bed50=_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x91')][_0x6ec5('0x92')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4bed50)){_0x34a136['or'](_0x6ec5('0x93'),_0x4bed50+'%');}else{_0x34a136['or'](_0x6ec5('0x94'),qs[_0x6ec5('0x95')](_0x4bed50))['or'](_0x6ec5('0x96'),_0x4bed50+'%');}}}_0x301e31[_0x6ec5('0x57')](_0x34a136);_0x301e31[_0x6ec5('0x97')](_0x6ec5('0x98'));var _0x3914ca={'type':db[_0x6ec5('0x99')][_0x6ec5('0x9a')][_0x6ec5('0x9b')],'raw':!![]};var _0x3464ba=_0x301e31[_0x6ec5('0x9c')]();_0x3464ba['field'](_0x6ec5('0x98'));_0x3464ba[_0x6ec5('0x5a')](_0x6ec5('0x9d'),_0x6ec5('0x71'));if(_0x5b0656['order']){_0x5b0656[_0x6ec5('0x55')]['forEach'](function(_0x26e2b1){var _0x2e6e33=_0x26e2b1[0x0]===_0x6ec5('0x9e')?_0x26e2b1[0x0]:'i.'+_0x26e2b1[0x0];_0x301e31[_0x6ec5('0x55')](_0x2e6e33,_0x26e2b1[0x1]===_0x6ec5('0x9f')?![]:!![]);});}if(!_[_0x6ec5('0x84')](_0x278c00)){_0x301e31[_0x6ec5('0x73')](_0x5c00c4);_0x3464ba['where'](_0x6ec5('0xa0'),_0x278c00);}BPromise[_0x6ec5('0xa1')]()['then'](function(){if(!_0xe8a888){if(_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x85')])return;_0x3464ba[_0x6ec5('0x57')](_0x6ec5('0xa2'));_0x301e31[_0x6ec5('0x57')](_0x6ec5('0xa2'));return;}if(_0xeac39e[_0x6ec5('0xa3')][_0x6ec5('0xa4')]!==_0x6ec5('0x36'))return;return _0xeac39e[_0x6ec5('0xa3')][_0x6ec5('0xa5')]({'attributes':['id'],'raw':!![]})[_0x6ec5('0x19')](function(_0xc6dcd){if(_[_0x6ec5('0x84')](_0xc6dcd)){_0x3464ba[_0x6ec5('0x57')]('i.ChatWebsiteId\x20IS\x20NULL');_0x301e31[_0x6ec5('0x57')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3464ba[_0x6ec5('0x57')](_0x6ec5('0x86'),_['map'](_0xc6dcd,'id'));_0x301e31[_0x6ec5('0x57')](_0x6ec5('0x86'),_[_0x6ec5('0x39')](_0xc6dcd,'id'));}});})[_0x6ec5('0x19')](function(){if(_0xeac39e[_0x6ec5('0xa3')][_0x6ec5('0xa4')]===_0x6ec5('0x36')&&!_0xe8a888&&!_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x85')])return[];return db[_0x6ec5('0xa6')][_0x6ec5('0x4e')](_0x3464ba[_0x6ec5('0xa7')](),_0x3914ca);})['then'](function(_0x45b840){_0x56dc23[_0x6ec5('0x2b')]=_0x45b840['length'];if(_0x56dc23['count']===0x0)return[];return db[_0x6ec5('0xa6')][_0x6ec5('0x4e')](_0xc52e91['toString'](),_0x3914ca)[_0x6ec5('0x19')](function(_0x59025e){_0x29bf52=_[_0x6ec5('0xa8')](_0x59025e,'id');_0x3914ca=_[_0x6ec5('0x33')](_0x3914ca,{'model':db[_0x6ec5('0x4a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0xa9')]){_0x5b0656[_0x6ec5('0x52')][_0x6ec5('0x3e')](function(_0x3574fe){_0x301e31['field']('i.'+_0x3574fe);});}else{_0x301e31[_0x6ec5('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6ec5('0x71'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xaa'),_0x6ec5('0xab'));_0x301e31['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xac'),_0x6ec5('0x9e'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xad'));_0x301e31['field'](_0x6ec5('0xae'),'Contact.firstName');_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xaf'),_0x6ec5('0xb0'));_0x301e31[_0x6ec5('0x5a')]('c.email',_0x6ec5('0xb1'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xb2'),_0x6ec5('0xb3'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xb4'),'Contact.mobile');_0x301e31['field'](_0x6ec5('0xb5'),_0x6ec5('0xb6'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xb7'),_0x6ec5('0xb8'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xb9'),_0x6ec5('0xba'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xbb'),'TagIds');}if(_0x5b0656[_0x6ec5('0x2a')])_0x301e31[_0x6ec5('0x2a')](_0x5b0656[_0x6ec5('0x2a')]);if(_0x5b0656[_0x6ec5('0x28')])_0x301e31['offset'](_0x5b0656['offset']);return db[_0x6ec5('0xa6')][_0x6ec5('0x4e')](_0x301e31['toString'](),_0x3914ca);})[_0x6ec5('0x19')](function(_0x78b13f){if(_0x78b13f[_0x6ec5('0x6f')]>0x0)_0x388ddd['where'](_0x6ec5('0xbc'),_[_0x6ec5('0x39')](_0x78b13f,'id'));return db['sequelize'][_0x6ec5('0x4e')](_0x388ddd['toString'](),_0x3914ca)['then'](function(_0x5783c5){var _0x1db6bf=_[_0x6ec5('0xbd')](_0x5783c5,_0x6ec5('0xbe'));var _0x5c00c7=[];_0x78b13f[_0x6ec5('0x3e')](function(_0x28f3f2){_0x5c00c7[_0x6ec5('0x3f')](updateChatInteraction(_0x28f3f2,_0x29bf52,_0x1db6bf));});return BPromise[_0x6ec5('0xbf')](_0x5c00c7);});});})['then'](function(_0x333385){_0x56dc23[_0x6ec5('0xc0')]=_0x333385;return _0x56dc23;})[_0x6ec5('0x19')](respondWithFilteredResult(_0x51f2ef,_0x5b0656))['catch'](handleError(_0x51f2ef,null));};exports[_0x6ec5('0xc1')]=function(_0x402c19,_0x2d8a14){var _0x474b87={'raw':![],'where':{'id':_0x402c19['params']['id']}},_0x3ce417={};_0x3ce417[_0x6ec5('0x4d')]=_[_0x6ec5('0x4f')](db[_0x6ec5('0x4a')][_0x6ec5('0x4b')]);_0x3ce417[_0x6ec5('0x4e')]=_[_0x6ec5('0x4f')](_0x402c19[_0x6ec5('0x4e')]);_0x3ce417[_0x6ec5('0x50')]=_[_0x6ec5('0x51')](_0x3ce417[_0x6ec5('0x4d')],_0x3ce417[_0x6ec5('0x4e')]);_0x474b87['attributes']=_['intersection'](_0x3ce417[_0x6ec5('0x4d')],qs[_0x6ec5('0xa9')](_0x402c19[_0x6ec5('0x4e')]['fields']));_0x474b87[_0x6ec5('0x52')]=_0x474b87[_0x6ec5('0x52')][_0x6ec5('0x6f')]?_0x474b87[_0x6ec5('0x52')]:_0x3ce417['model'];if(_0x402c19[_0x6ec5('0x4e')][_0x6ec5('0xc2')]){_0x474b87['include']=[{'all':!![]}];}_0x474b87=_[_0x6ec5('0x33')]({},_0x474b87,_0x402c19[_0x6ec5('0xc3')]);return db[_0x6ec5('0x4a')][_0x6ec5('0x70')](_0x474b87)[_0x6ec5('0x19')](handleEntityNotFound(_0x2d8a14,null))[_0x6ec5('0x19')](respondWithResult(_0x2d8a14,null))[_0x6ec5('0x24')](handleError(_0x2d8a14,null));};exports[_0x6ec5('0xc4')]=function(_0x496309,_0x161f78){return db[_0x6ec5('0x4a')][_0x6ec5('0xc4')](_0x496309[_0x6ec5('0x34')],{})[_0x6ec5('0x19')](respondWithResult(_0x161f78,0xc9))['catch'](handleError(_0x161f78,null));};exports[_0x6ec5('0x2d')]=function(_0x5409ed,_0x8dd2e){if(_0x5409ed[_0x6ec5('0x34')]['id']){delete _0x5409ed[_0x6ec5('0x34')]['id'];}return db[_0x6ec5('0x4a')]['find']({'where':{'id':_0x5409ed[_0x6ec5('0xc5')]['id']}})['then'](handleEntityNotFound(_0x8dd2e,null))[_0x6ec5('0x19')](saveUpdates(_0x5409ed[_0x6ec5('0x34')],null))[_0x6ec5('0x19')](respondWithResult(_0x8dd2e,null))['catch'](handleError(_0x8dd2e,null));};exports[_0x6ec5('0x2e')]=function(_0x23d65b,_0x5d3f68){return db[_0x6ec5('0x4a')]['find']({'where':{'id':_0x23d65b[_0x6ec5('0xc5')]['id']}})[_0x6ec5('0x19')](handleEntityNotFound(_0x5d3f68,null))[_0x6ec5('0x19')](removeEntity(_0x5d3f68,null))['catch'](handleError(_0x5d3f68,null));};exports[_0x6ec5('0xc6')]=function(_0x83453e,_0x9cbab1){return db[_0x6ec5('0x4a')]['describe']()[_0x6ec5('0x19')](respondWithResult(_0x9cbab1,null))['catch'](handleError(_0x9cbab1,null));};exports[_0x6ec5('0xc7')]=function(_0x1b9e0d,_0x227438){var _0x31ef77=_0x1b9e0d['params']['id'];var _0x51d321;var _0x1c8568;var _0x34cd17;return db[_0x6ec5('0x4a')][_0x6ec5('0xc8')]({'where':{'id':_0x31ef77}})[_0x6ec5('0x19')](function(_0x55fa60){_0x51d321=_0x55fa60;return db[_0x6ec5('0xc9')][_0x6ec5('0xc8')]({'where':{'id':_0x55fa60[_0x6ec5('0x85')]},'attributes':['id',_0x6ec5('0xca'),_0x6ec5('0xcb'),_0x6ec5('0xcc'),_0x6ec5('0xcd'),_0x6ec5('0xce')],'raw':!![]});})[_0x6ec5('0x19')](function(_0x2902f4){if(_0x2902f4&&_0x2902f4[_0x6ec5('0xca')]&&_0x2902f4[_0x6ec5('0xcb')]){_0x1c8568=_0x2902f4;var _0x280223={'interaction':{'id':_0x31ef77},'agent':{'id':_0x1b9e0d[_0x6ec5('0xa3')]['id'],'name':_0x1b9e0d[_0x6ec5('0xa3')][_0x6ec5('0x30')],'fullname':_0x1b9e0d['user']['fullname'],'email':_0x1b9e0d[_0x6ec5('0xa3')][_0x6ec5('0xcf')]},'contact':_0x1b9e0d[_0x6ec5('0x34')][_0x6ec5('0x35')],'account':_0x1b9e0d[_0x6ec5('0x34')][_0x6ec5('0x37')]};var _0x1e0c0f={'rejectUnauthorized':![],'method':_0x6ec5('0xd0'),'url':_0x6ec5('0xd1'),'headers':{'X-APIKEY':_0x2902f4[_0x6ec5('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1b9e0d[_0x6ec5('0xa3')][_0x6ec5('0xcf')]],'buttons':null,'topic':_0x1c8568[_0x6ec5('0xcc')],'note':_[_0x6ec5('0xd2')](_0x1c8568[_0x6ec5('0xcd')])?null:getMustacheRender(_0x1c8568['vidaooNote'],_0x280223),'metadata':null},'redirect':_0x6ec5('0xd3'),'json':!![]};try{if(!_[_0x6ec5('0xd2')](_0x1c8568[_0x6ec5('0xce')])){var _0x26e30f=getMustacheRender(_0x1c8568[_0x6ec5('0xce')],_0x280223);var _0x2dc668=JSON[_0x6ec5('0x88')](_0x26e30f);_0x1e0c0f[_0x6ec5('0x34')][_0x6ec5('0xd4')]=_0x2dc668;}}catch(_0x506acf){throw new db[(_0x6ec5('0x99'))][(_0x6ec5('0xd5'))](_0x6ec5('0xd6'));}return rp(_0x1e0c0f);}else{throw new db['Sequelize'][(_0x6ec5('0xd5'))](_0x6ec5('0xd7'));}})['then'](function(_0x5d2d61){_0x34cd17=_0x5d2d61;if(_0x34cd17['id']){var _0x5618ab={'body':_0x34cd17[_0x6ec5('0xd8')],'ChatWebsiteId':_0x1c8568['id'],'ChatInteractionId':_0x51d321['id'],'direction':_0x6ec5('0xd9'),'UserId':_0x1b9e0d['user']['id']};return db[_0x6ec5('0xda')]['create'](_0x5618ab,{});}else{throw new db[(_0x6ec5('0x99'))][(_0x6ec5('0xd5'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x6ec5('0x19')](function(){return _0x51d321[_0x6ec5('0xdb')]({'vidaooSessionId':_0x34cd17['id']});})[_0x6ec5('0x19')](respondWithResult(_0x227438,null))[_0x6ec5('0x24')](handleError(_0x227438,null));};exports[_0x6ec5('0xdc')]=function(_0x40099c,_0x13f7b5){if(_0x40099c[_0x6ec5('0x34')]['id']){delete _0x40099c[_0x6ec5('0x34')]['id'];}return db[_0x6ec5('0x4a')][_0x6ec5('0x70')]({'where':{'id':_0x40099c['params']['id']},'include':[{'model':db[_0x6ec5('0xdd')],'as':'Contact'}]})[_0x6ec5('0x19')](handleEntityNotFound(_0x13f7b5,null))[_0x6ec5('0x19')](saveUpdates(_0x40099c[_0x6ec5('0x34')],null))['then'](respondWithResult(_0x13f7b5,null))[_0x6ec5('0x24')](handleError(_0x13f7b5,null));};exports['abandon']=function(_0x11615,_0x425220){if(_0x11615[_0x6ec5('0x34')]['id']){delete _0x11615[_0x6ec5('0x34')]['id'];}return db[_0x6ec5('0x4a')][_0x6ec5('0x70')]({'where':{'id':_0x11615['params']['id']}})[_0x6ec5('0x19')](function(_0x58925f){if(!_0x58925f){logger[_0x6ec5('0x20')](_0x6ec5('0xde'),_0x6ec5('0xdf'),0x194,_0x6ec5('0xe0'));_0x425220['sendStatus'](0x194);}else{if(_0x58925f[_0x6ec5('0x46')]){throw new db[(_0x6ec5('0x99'))][(_0x6ec5('0xd5'))](_0x6ec5('0xe1'));}}return _0x58925f;})['then'](function(_0x17fdea){if(_0x17fdea){return _0x17fdea['update']({'closed':_0x11615[_0x6ec5('0x34')]['closed'],'disposition':_0x11615[_0x6ec5('0x34')][_0x6ec5('0x47')]})[_0x6ec5('0x19')](function(_0x15cb73){return _0x15cb73;});}})[_0x6ec5('0x19')](function(){return respondWithRpcPromise(_0x6ec5('0xe2'),_0x6ec5('0xdf'),_0x11615['body'],client9004);})[_0x6ec5('0x19')](respondWithResult(_0x425220,null))[_0x6ec5('0x24')](handleError(_0x425220,null));};exports[_0x6ec5('0xe3')]=function(_0x40e9a8,_0x181a77){_0x40e9a8[_0x6ec5('0x34')][_0x6ec5('0x30')]=_0x40e9a8[_0x6ec5('0xe4')]['originalname'];_0x40e9a8['body'][_0x6ec5('0xe5')]=_0x40e9a8['file'][_0x6ec5('0xe6')];_0x40e9a8[_0x6ec5('0x34')][_0x6ec5('0x7a')]=_0x40e9a8['file'][_0x6ec5('0xe7')];return db['Attachment'][_0x6ec5('0xc4')](_0x40e9a8[_0x6ec5('0x34')])[_0x6ec5('0x19')](respondWithResult(_0x181a77,0xc9))[_0x6ec5('0x24')](handleError(_0x181a77,null));};exports['attachmentDownload']=function(_0x2c5cc0,_0x534539){return db['ChatInteraction']['findOne']({'where':{'id':_0x2c5cc0[_0x6ec5('0xc5')]['id']},'raw':!![]})[_0x6ec5('0x19')](handleEntityNotFound(_0x534539,null))['then'](function(_0x2a6b59){if(_0x2a6b59){if(_0x2a6b59[_0x6ec5('0x44')]){return _0x534539[_0x6ec5('0x26')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x6ec5('0xe8')][_0x6ec5('0xc8')]({'where':{'id':_0x2c5cc0[_0x6ec5('0x4e')][_0x6ec5('0xe9')]},'raw':!![]})[_0x6ec5('0x19')](handleEntityNotFound(_0x534539,null));}})[_0x6ec5('0x19')](function(_0x1142fb){if(_0x1142fb){var _0x1253a0=_0x1142fb[_0x6ec5('0xea')]!==null;var _0x5d22b9=path[_0x6ec5('0xeb')](config[_0x6ec5('0xec')],_0x6ec5('0xed'));if(_0x1253a0){_0x5d22b9=path['join'](_0x5d22b9,'offline-chat/');}var _0x3ea6ae=path[_0x6ec5('0xeb')](_0x5d22b9,_0x1142fb[_0x6ec5('0xe5')]);return _0x534539[_0x6ec5('0xee')](_0x3ea6ae);}})[_0x6ec5('0x24')](handleError(_0x534539,null));};exports[_0x6ec5('0xef')]=function(_0x2d0aa9,_0x5c8eff){var _0x4fe4b1=null;var _0x499222=null;var _0x50d19a=null;if(_0x2d0aa9['body']['id']){delete _0x2d0aa9[_0x6ec5('0x34')]['id'];}if(_0x2d0aa9['body'][_0x6ec5('0xf0')]){_0x50d19a=path[_0x6ec5('0xeb')](config[_0x6ec5('0xec')],_0x6ec5('0xf1'),util['format'](_0x6ec5('0xf2'),Date[_0x6ec5('0xf3')]()));_0x2d0aa9[_0x6ec5('0x34')]['pathTranscript']=_0x50d19a;}return db['ChatInteraction'][_0x6ec5('0x70')]({'where':{'id':_0x2d0aa9[_0x6ec5('0xc5')]['id']},'include':[{'model':db[_0x6ec5('0xda')],'as':_0x6ec5('0xf4'),'include':[{'model':db['User'],'as':_0x6ec5('0x7f')}]}]})[_0x6ec5('0x19')](handleEntityNotFound(_0x5c8eff,null))[_0x6ec5('0x19')](saveUpdates(_0x2d0aa9[_0x6ec5('0x34')],null))['then'](function(_0x4e432a){if(_0x4e432a){_0x4fe4b1=_0x4e432a;return db['ChatWebsite'][_0x6ec5('0x70')]({'where':{'id':_0x4fe4b1[_0x6ec5('0x85')]}});}})[_0x6ec5('0x19')](function(_0x3c186d){if(_0x3c186d){_0x499222=_0x3c186d;return db[_0x6ec5('0xdd')][_0x6ec5('0x70')]({'where':{'id':_0x4fe4b1['ContactId']}});}})[_0x6ec5('0x19')](function(_0x47b3dc){if(_0x47b3dc){if(_0x50d19a){var _0x4256fc=null;for(var _0x1ad68c=0x1;_0x1ad68c<_0x4fe4b1['Messages'][_0x6ec5('0x6f')];++_0x1ad68c){_0x4256fc=_0x4fe4b1[_0x6ec5('0xf4')][_0x1ad68c];var _0x2d95a3=_0x4256fc[_0x6ec5('0x46')]?util['format'](_0x6ec5('0xf5'),_0x499222[_0x6ec5('0xf6')],_0x4256fc['UserId']):_0x6ec5('0xf7');var _0x123754=_0x2d0aa9[_0x6ec5('0x34')][_0x6ec5('0xf8')]||util[_0x6ec5('0xf9')]('%s%d',_0x6ec5('0xfa'),_0x4256fc['ContactId']);switch(_0x499222[_0x6ec5('0xfb')]){case _0x6ec5('0xfc'):_0x2d95a3=_0x4256fc['UserId']?util[_0x6ec5('0xf9')](_0x6ec5('0xf5'),_0x499222['agentAlias'],_0x4256fc['UserId']):_0x6ec5('0xf7');break;case _0x6ec5('0xfd'):_0x2d95a3=_0x4256fc[_0x6ec5('0x46')]?_0x4256fc['User'][_0x6ec5('0xfe')]||_0x4256fc[_0x6ec5('0x7f')][_0x6ec5('0x3a')]:_0x6ec5('0xf7');break;case _0x6ec5('0xff'):_0x2d95a3=_0x4256fc[_0x6ec5('0x46')]?_0x4256fc[_0x6ec5('0x7f')][_0x6ec5('0x3a')]:_0x6ec5('0xf7');break;default:_0x2d95a3=_0x4256fc[_0x6ec5('0x46')]?util[_0x6ec5('0xf9')](_0x6ec5('0xf5'),_0x499222[_0x6ec5('0xf6')],_0x4256fc[_0x6ec5('0x46')]):_0x6ec5('0xf7');}var _0x366b80=util[_0x6ec5('0xf9')](_0x6ec5('0x100'),moment(_0x4256fc[_0x6ec5('0x101')])[_0x6ec5('0xf9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4256fc['direction']==='in'?_0x123754:_0x2d95a3,_0x4256fc[_0x6ec5('0x34')]);if(!_0x4256fc[_0x6ec5('0x102')]){fs[_0x6ec5('0x103')](_0x50d19a,_0x366b80);}}return db['MailAccount'][_0x6ec5('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x6ec5('0x104')],'as':_0x6ec5('0x105'),'raw':!![],'include':[{'model':db[_0x6ec5('0x106')],'as':_0x6ec5('0x106'),'raw':!![]}]}]});}}})[_0x6ec5('0x19')](function(_0x8b2ffd){if(!_0x8b2ffd||!_0x8b2ffd[_0x6ec5('0x105')]||!_0x2d0aa9[_0x6ec5('0x34')])return _0x4fe4b1;var _0xb90e78=_0x8b2ffd[_0x6ec5('0x107')]();return respondWithRpcPromise('SendMail',_0x6ec5('0x108'),{'account':_0xb90e78,'message':{'from':util['format'](_0x6ec5('0x109'),_0x8b2ffd['name'],_0x8b2ffd[_0x6ec5('0xcf')]||_0x8b2ffd[_0x6ec5('0x105')][_0x6ec5('0xa3')]),'to':_0x2d0aa9['body'][_0x6ec5('0xf0')],'subject':'Mail\x20Transcript','text':util[_0x6ec5('0xf9')](_0x6ec5('0x10a'),_0x2d0aa9[_0x6ec5('0x34')]['mailTranscript']),'attachments':[{'path':_0x50d19a}]}})[_0x6ec5('0x19')](function(){return _0x4fe4b1;})[_0x6ec5('0x24')](function(_0xd2b9ef){logger['error'](_0xd2b9ef);});})[_0x6ec5('0x19')](respondWithStatusCode(_0x5c8eff,0xc8))[_0x6ec5('0x24')](handleError(_0x5c8eff,null));};exports[_0x6ec5('0x10b')]=function(_0x1c7b04,_0xed8846){return db[_0x6ec5('0xda')]['find']({'where':{'id':_0x1c7b04[_0x6ec5('0xc5')]['id']}})['then'](handleEntityNotFound(_0xed8846,null))[_0x6ec5('0x19')](function(_0x10e4d7){if(_0x10e4d7){return _0x10e4d7[_0x6ec5('0x10b')](_0x1c7b04[_0x6ec5('0x34')][_0x6ec5('0x10c')],_['omit'](_0x1c7b04['body'],['ids','id'])||{});}})['then'](respondWithResult(_0xed8846,null))[_0x6ec5('0x24')](handleError(_0xed8846,null));};exports['getMessages']=function(_0x5a464d,_0x540592){var _0x3bf9ce={'raw':![],'where':{}};var _0x114ca4={};var _0x249219={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x5a464d['params']['id']}})[_0x6ec5('0x19')](handleEntityNotFound(_0x540592,null))['then'](function(_0x212558){if(_0x212558){_0x114ca4[_0x6ec5('0x4d')]=_['keys'](db[_0x6ec5('0xda')][_0x6ec5('0x4b')]);_0x114ca4[_0x6ec5('0x4e')]=_[_0x6ec5('0x4f')](_0x5a464d[_0x6ec5('0x4e')]);_0x114ca4['filters']=_[_0x6ec5('0x51')](_0x114ca4['model'],_0x114ca4[_0x6ec5('0x4e')]);_0x3bf9ce[_0x6ec5('0x52')]=_['intersection'](_0x114ca4[_0x6ec5('0x4d')],qs[_0x6ec5('0xa9')](_0x5a464d[_0x6ec5('0x4e')][_0x6ec5('0xa9')]));_0x3bf9ce['attributes']=_0x3bf9ce[_0x6ec5('0x52')]['length']?_0x3bf9ce[_0x6ec5('0x52')]:_0x114ca4[_0x6ec5('0x4d')];if(!_0x5a464d[_0x6ec5('0x4e')][_0x6ec5('0x53')](_0x6ec5('0x54'))){_0x3bf9ce[_0x6ec5('0x2a')]=qs[_0x6ec5('0x2a')](_0x5a464d[_0x6ec5('0x4e')][_0x6ec5('0x2a')]);_0x3bf9ce[_0x6ec5('0x28')]=qs[_0x6ec5('0x28')](_0x5a464d['query']['offset']);}_0x3bf9ce[_0x6ec5('0x55')]=qs[_0x6ec5('0x56')](_0x5a464d[_0x6ec5('0x4e')][_0x6ec5('0x56')]);_0x3bf9ce['where']=qs[_0x6ec5('0x50')](_[_0x6ec5('0x58')](_0x5a464d[_0x6ec5('0x4e')],_0x114ca4[_0x6ec5('0x50')]));_0x3bf9ce[_0x6ec5('0x57')]['ChatInteractionId']=_0x212558['id'];if(_0x5a464d['query'][_0x6ec5('0x91')]){_0x3bf9ce[_0x6ec5('0x57')]=_['merge'](_0x3bf9ce[_0x6ec5('0x57')],{'$or':_[_0x6ec5('0x39')](_0x3bf9ce['attributes'],function(_0x22d09e){var _0x14d39d={};_0x14d39d[_0x22d09e]={'$like':'%'+_0x5a464d[_0x6ec5('0x4e')]['filter']+'%'};return _0x14d39d;})});}if(_0x5a464d['query'][_0x6ec5('0x10d')]){var _0x58eeb9=_0x5a464d[_0x6ec5('0x4e')][_0x6ec5('0x10d')][_0x6ec5('0x3d')](',');var _0x48ba54={};_0x48ba54[_0x58eeb9[0x0]]={'$gte':moment(_0x58eeb9[0x1])[_0x6ec5('0xf9')](_0x6ec5('0x10e'))};_0x3bf9ce[_0x6ec5('0x57')]=_[_0x6ec5('0x33')](_0x3bf9ce[_0x6ec5('0x57')],_0x48ba54);}_0x3bf9ce=_[_0x6ec5('0x33')]({},_0x3bf9ce,_0x5a464d[_0x6ec5('0xc3')]);return db[_0x6ec5('0xda')][_0x6ec5('0x2b')]({'where':_0x3bf9ce[_0x6ec5('0x57')]})['then'](function(_0x2984e1){_0x249219[_0x6ec5('0x2b')]=_0x2984e1;if(_0x5a464d[_0x6ec5('0x4e')]['includeAll']){_0x3bf9ce[_0x6ec5('0x10f')]=[{'all':!![]}];}return db[_0x6ec5('0xda')][_0x6ec5('0x110')](_0x3bf9ce);})[_0x6ec5('0x19')](function(_0x40beb9){_0x249219[_0x6ec5('0xc0')]=_0x40beb9;return _0x249219;});}})[_0x6ec5('0x19')](respondWithFilteredResult(_0x540592,_0x3bf9ce))[_0x6ec5('0x24')](handleError(_0x540592,null));};exports[_0x6ec5('0x111')]=function(_0x17d28a,_0x59bdf4){var _0x5ea009={'where':{}},_0xfdf0fb={},_0xb10dcd={'count':0x0,'rows':[]};return db[_0x6ec5('0x4a')][_0x6ec5('0xc8')]({'where':{'id':_0x17d28a[_0x6ec5('0xc5')]['id']}})['then'](handleEntityNotFound(_0x59bdf4,null))[_0x6ec5('0x19')](function(_0x4d6ae2){if(_0x4d6ae2){_0xfdf0fb[_0x6ec5('0x4d')]=_['keys'](db[_0x6ec5('0xda')][_0x6ec5('0x4b')]);_0xfdf0fb[_0x6ec5('0x4e')]=_[_0x6ec5('0x4f')](_0x17d28a[_0x6ec5('0x4e')]);_0xfdf0fb['filters']=_[_0x6ec5('0x51')](_0xfdf0fb['model'],_0xfdf0fb['query']);_0x5ea009[_0x6ec5('0x52')]=_[_0x6ec5('0x51')](_0xfdf0fb[_0x6ec5('0x4d')],qs['fields'](_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0xa9')]));_0x5ea009['attributes']=_0x5ea009['attributes']['length']?_0x5ea009['attributes']:_0xfdf0fb[_0x6ec5('0x4d')];if(!_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0x53')](_0x6ec5('0x54'))){_0x5ea009[_0x6ec5('0x2a')]=qs['limit'](_0x17d28a[_0x6ec5('0x4e')]['limit']);_0x5ea009[_0x6ec5('0x28')]=qs['offset'](_0x17d28a['query'][_0x6ec5('0x28')]);}_0x5ea009[_0x6ec5('0x55')]=qs['sort'](_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0x56')]);_0x5ea009[_0x6ec5('0x57')]=qs[_0x6ec5('0x50')](_['pick'](_0x17d28a[_0x6ec5('0x4e')],_0xfdf0fb[_0x6ec5('0x50')]));_0x5ea009[_0x6ec5('0x57')]['ChatInteractionId']=_0x4d6ae2['id'];if(_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0x91')]){_0x5ea009['where']=_[_0x6ec5('0x33')](_0x5ea009['where'],{'$or':_['map'](_0x5ea009[_0x6ec5('0x52')],function(_0x28c57c){var _0x337c2b={};_0x337c2b[_0x28c57c]={'$like':'%'+_0x17d28a[_0x6ec5('0x4e')]['filter']+'%'};return _0x337c2b;})});}_0x5ea009[_0x6ec5('0x57')][_0x6ec5('0x102')]=![];if(_0x17d28a['query']['id']){_0x5ea009[_0x6ec5('0x57')]['id']={'$gt':_0x17d28a[_0x6ec5('0x4e')]['id']};}_0x5ea009=_[_0x6ec5('0x33')]({},_0x5ea009,_0x17d28a[_0x6ec5('0xc3')]);return db['ChatMessage'][_0x6ec5('0x2b')]({'where':_0x5ea009['where']})[_0x6ec5('0x19')](function(_0x51c78f){_0xb10dcd[_0x6ec5('0x2b')]=_0x51c78f;_0x5ea009[_0x6ec5('0x10f')]=[];if(_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0x112')]){_0x5ea009[_0x6ec5('0x10f')]['push']({'model':db[_0x6ec5('0x7f')],'as':_0x6ec5('0x7f'),'attributes':['id',_0x6ec5('0x3a'),_0x6ec5('0xfe')]});}if(_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0xc2')]){_0x5ea009[_0x6ec5('0x10f')]=[{'all':!![]}];}return db[_0x6ec5('0xda')]['findAll'](_0x5ea009);})['then'](function(_0x1f5371){_0xb10dcd[_0x6ec5('0xc0')]=_0x1f5371;return _0xb10dcd;});}})['then'](respondWithFilteredResult(_0x59bdf4,_0x5ea009))[_0x6ec5('0x24')](handleError(_0x59bdf4,null));};exports[_0x6ec5('0x113')]=function(_0x133a0c,_0x23d39e){return db[_0x6ec5('0x4a')][_0x6ec5('0x70')]({'where':{'id':_0x133a0c[_0x6ec5('0xc5')]['id']}})['then'](handleEntityNotFound(_0x23d39e,null))[_0x6ec5('0x19')](function(_0x39c1f3){if(_0x39c1f3){return _0x39c1f3[_0x6ec5('0x114')](_0x133a0c[_0x6ec5('0x34')]['ids'],_[_0x6ec5('0x115')](_0x133a0c[_0x6ec5('0x34')],[_0x6ec5('0x10c'),'id'])||{})[_0x6ec5('0x116')](function(){return db[_0x6ec5('0x7d')]['findAll']({'attributes':['id','name',_0x6ec5('0x5b')],'where':{'id':_0x133a0c[_0x6ec5('0x34')]['ids']}});})['then'](function(_0x5127c9){socket[_0x6ec5('0x117')](_0x6ec5('0x118'),{'id':Number(_0x133a0c[_0x6ec5('0xc5')]['id']),'tags':_0x5127c9||[]});return{'id':Number(_0x133a0c['params']['id']),'tags':_0x5127c9||[]};});}})[_0x6ec5('0x19')](respondWithResult(_0x23d39e,null))['catch'](handleError(_0x23d39e,null));};exports[_0x6ec5('0x119')]=function(_0x3a3ecc,_0x569b84){return db[_0x6ec5('0x4a')][_0x6ec5('0x70')]({'where':{'id':_0x3a3ecc[_0x6ec5('0xc5')]['id']}})[_0x6ec5('0x19')](handleEntityNotFound(_0x569b84,null))[_0x6ec5('0x19')](function(_0x49f6dd){if(_0x49f6dd){return _0x49f6dd['removeTags'](_0x3a3ecc[_0x6ec5('0x4e')][_0x6ec5('0x10c')]);}})[_0x6ec5('0x19')](respondWithStatusCode(_0x569b84,null))[_0x6ec5('0x24')](handleError(_0x569b84,null));};exports[_0x6ec5('0xee')]=function(_0x1b2cb6,_0x1af590){var _0x303b9b=moment()['unix']()[_0x6ec5('0xa7')]();var _0x14f55d=path[_0x6ec5('0xeb')](config[_0x6ec5('0xec')],'server',_0x6ec5('0x11a'),'tmp');var _0x4a4e2=path[_0x6ec5('0xeb')](config[_0x6ec5('0xec')],_0x6ec5('0x11b'),'files',_0x6ec5('0x11c'));var _0x49d151=path['join'](_0x14f55d,_0x303b9b);var _0x29fe92=util[_0x6ec5('0xf9')](_0x6ec5('0x11d'),_0x1b2cb6[_0x6ec5('0xc5')]['id'],_0x303b9b);var _0x5eeb97=path['join'](_0x14f55d,_0x29fe92);var _0x45d55c=[];_0x45d55c[_0x6ec5('0x3f')]({'model':db[_0x6ec5('0x7f')],'as':_0x6ec5('0x7f'),'attributes':['id',_0x6ec5('0x3a')],'raw':!![]});_0x45d55c[_0x6ec5('0x3f')]({'model':db[_0x6ec5('0xdd')],'as':'Contact','attributes':['id','firstName',_0x6ec5('0x11e')],'raw':!![]});if(_0x1b2cb6[_0x6ec5('0x4e')][_0x6ec5('0x11c')]){_0x45d55c[_0x6ec5('0x3f')]({'model':db[_0x6ec5('0xe8')],'as':'Attachment','raw':!![]});}var _0x37f4e0=[{'model':db[_0x6ec5('0xda')],'as':_0x6ec5('0xf4'),'attributes':['id',_0x6ec5('0x34'),_0x6ec5('0x101'),_0x6ec5('0x11f'),_0x6ec5('0x102'),_0x6ec5('0x120')],'include':_0x45d55c}];_0x37f4e0['push']({'model':db[_0x6ec5('0xc9')],'as':_0x6ec5('0x121'),'attributes':['id',_0x6ec5('0x30')]});_0x37f4e0[_0x6ec5('0x3f')]({'model':db[_0x6ec5('0x7f')],'as':_0x6ec5('0x122'),'attributes':['id',_0x6ec5('0x3a')]});return db[_0x6ec5('0x4a')][_0x6ec5('0x70')]({'where':{'id':_0x1b2cb6[_0x6ec5('0xc5')]['id']},'include':_0x37f4e0})[_0x6ec5('0x19')](handleEntityNotFound(_0x1af590,null))['then'](function(_0x576168){if(_0x576168){var _0x1a70bf=_0x576168['get']({'plain':!![]});fs[_0x6ec5('0x123')](_0x49d151);var _0x3aae21={'channel':'Chat','account':_0x1a70bf['Account']['name'],'agent':_0x1a70bf[_0x6ec5('0x122')]?_0x1a70bf[_0x6ec5('0x122')][_0x6ec5('0x3a')]:_0x6ec5('0x124'),'createdAt':moment(_0x1a70bf[_0x6ec5('0x101')])[_0x6ec5('0xf9')](_0x6ec5('0x10e'))[_0x6ec5('0xa7')](),'closedAt':_0x1a70bf[_0x6ec5('0x44')]?moment(_0x1a70bf[_0x6ec5('0x125')])['format'](_0x6ec5('0x10e'))['toString']():'','disposition':_0x1a70bf[_0x6ec5('0x47')],'chatInfo':{'browser':_0x1a70bf[_0x6ec5('0x126')],'os':_0x1a70bf[_0x6ec5('0x127')],'referer':_0x1a70bf[_0x6ec5('0x128')],'customerIp':_0x1a70bf[_0x6ec5('0x129')],'customerPort':_0x1a70bf[_0x6ec5('0x12a')]?_0x1a70bf['customerPort']:_0x6ec5('0x124')},'messages':_(_0x1a70bf[_0x6ec5('0xf4')])['tail']()[_0x6ec5('0x91')]({'secret':![]})[_0x6ec5('0x39')](function(_0x3d417e){if(_0x3d417e[_0x6ec5('0xe8')]){var _0x31e1cc=path[_0x6ec5('0xeb')](_0x4a4e2,_0x3d417e[_0x6ec5('0xe8')][_0x6ec5('0xe5')]);if(fs[_0x6ec5('0x12b')](_0x31e1cc)){fs[_0x6ec5('0x12c')](_0x31e1cc)['pipe'](fs['createWriteStream'](path['join'](_0x49d151,_0x3d417e[_0x6ec5('0xe8')]['basename'])));}}return{'date':moment(_0x3d417e[_0x6ec5('0x101')])[_0x6ec5('0xf9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6ec5('0xa7')](),'sender':_0x3d417e['direction']===_0x6ec5('0xd9')?_0x3d417e[_0x6ec5('0x7f')]?_0x3d417e[_0x6ec5('0x7f')][_0x6ec5('0x3a')]:_0x6ec5('0xf7'):_0x3d417e['Contact'][_0x6ec5('0x12d')]+(_0x3d417e['Contact'][_0x6ec5('0x11e')]?'\x20'+_0x3d417e[_0x6ec5('0x75')][_0x6ec5('0x11e')]:''),'body':_0x3d417e['Attachment']?_0x3d417e[_0x6ec5('0xe8')][_0x6ec5('0xe5')]:_0x3d417e[_0x6ec5('0x34')],'direction':_0x3d417e[_0x6ec5('0x11f')]==='out'?'A':'C','secret':_0x3d417e[_0x6ec5('0x102')],'read':_0x3d417e['read'],'attachment':_0x3d417e['Attachment']};})[_0x6ec5('0x72')]()};return ejs['renderFile'](path[_0x6ec5('0xeb')](config[_0x6ec5('0xec')],_0x6ec5('0x11b'),_0x6ec5('0x12e'),_0x6ec5('0x12f')),{'interaction':_0x3aae21})[_0x6ec5('0x19')](function(_0x2d91d4){var _0x558c48=path[_0x6ec5('0xeb')](_0x49d151,'transcript-'+_0x1a70bf['id']+'-'+_0x303b9b+'.pdf');var _0x506a5e={'path':_0x558c48,'channel':_0x6ec5('0x130'),'interactionId':_0x1a70bf['id']};return pdf[_0x6ec5('0x131')](_0x2d91d4,_0x506a5e);})['then'](function(){return new Promise(function(_0x5cc6ab,_0x2f47bf){zipdir(_0x49d151,{'saveTo':_0x5eeb97},function(_0x10113c,_0x31ef83){if(_0x10113c)return _0x2f47bf(_0x10113c);return _0x5cc6ab(_0x31ef83);});})[_0x6ec5('0x19')](function(){return new BPromise(function(_0x479825,_0x31be2b){rimraf(_0x49d151,function(_0x11ac51){if(_0x11ac51)_0x31be2b(_0x11ac51);return _0x479825();});});})[_0x6ec5('0x19')](function(){return _0x1af590['download'](_0x5eeb97,_0x29fe92,function(_0x5bd5da){if(_0x5bd5da){logger['error'](_0x6ec5('0x132'),_0x5bd5da);}else{fs[_0x6ec5('0x133')](_0x5eeb97);}});});});}else{return _0x1af590['sendStatus'](0xc8);}})[_0x6ec5('0x24')](handleError(_0x1af590,null));};
\ No newline at end of file
+var _0x84ab=['rimraf','zip-dir','request-promise','moment','bluebird','util','path','lodash','squel','ioredis','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','name','send','render','merge','body','agent','interaction','account','Users','fullname','TagIds','Tags','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','disposition','abandoned','index','map','ChatInteraction','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','field','from','u.id','ui.ChatInteractionId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','tools_tags','expr','parseSearch','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','options','create','describe','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','ChatInteractionId','findAll','getMyMessages','alias','addTags','setTags','omit','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','attachments','direction','Account','get','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','basename','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x84ab,0x12f));var _0xb84a=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0x84ab[_0xccf869];return _0x21a9db;};'use strict';var rimraf=require(_0xb84a('0x0'));var zipdir=require(_0xb84a('0x1'));var rp=require(_0xb84a('0x2'));var moment=require(_0xb84a('0x3'));var BPromise=require(_0xb84a('0x4'));var Mustache=require('mustache');var util=require(_0xb84a('0x5'));var path=require(_0xb84a('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb84a('0x7'));var squel=require(_0xb84a('0x8'));var Redis=require(_0xb84a('0x9'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var logger=require(_0xb84a('0xa'))('api');var config=require(_0xb84a('0xb'));var db=require(_0xb84a('0xc'))['db'];config['redis']=_[_0xb84a('0xd')](config['redis'],{'host':_0xb84a('0xe'),'port':0x18eb});var socket=require(_0xb84a('0xf'))(new Redis(config[_0xb84a('0x10')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xb84a('0x11')][_0xb84a('0x12')]({'port':0x232b});var client9004=jayson[_0xb84a('0x11')][_0xb84a('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x1ed9ae,_0x4d3758,_0x83444e,_0x4777dc){return new BPromise(function(_0x39a0df,_0x3c161c){var _0x44b26b=_0x4777dc||client;return _0x44b26b[_0xb84a('0x13')](_0x1ed9ae,_0x83444e)[_0xb84a('0x14')](function(_0x475b){logger[_0xb84a('0x15')](_0xb84a('0x16'),_0x4d3758,_0xb84a('0x17'));logger[_0xb84a('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4d3758,_0xb84a('0x17'),JSON[_0xb84a('0x19')](_0x475b));if(_0x475b[_0xb84a('0x1a')]){if(_0x475b[_0xb84a('0x1a')][_0xb84a('0x1b')]===0x1f4){logger[_0xb84a('0x1a')](_0xb84a('0x16'),_0x4d3758,_0x475b[_0xb84a('0x1a')][_0xb84a('0x1c')]);return _0x3c161c(_0x475b[_0xb84a('0x1a')][_0xb84a('0x1c')]);}logger[_0xb84a('0x1a')](_0xb84a('0x16'),_0x4d3758,_0x475b[_0xb84a('0x1a')]['message']);return _0x39a0df(_0x475b[_0xb84a('0x1a')][_0xb84a('0x1c')]);}else{logger['info'](_0xb84a('0x16'),_0x4d3758,_0xb84a('0x17'));_0x39a0df(_0x475b[_0xb84a('0x1d')][_0xb84a('0x1c')]);}})['catch'](function(_0x4ac5f8){logger[_0xb84a('0x1a')](_0xb84a('0x16'),_0x4d3758,_0x4ac5f8);_0x3c161c(_0x4ac5f8);});});}function respondWithStatusCode(_0x2d70fd,_0x259f74){_0x259f74=_0x259f74||0xcc;return function(_0x1e2fd4){if(_0x1e2fd4){return _0x2d70fd[_0xb84a('0x1e')](_0x259f74);}return _0x2d70fd[_0xb84a('0x1f')](_0x259f74)[_0xb84a('0x20')]();};}function respondWithResult(_0x3aa06f,_0x26fe42){_0x26fe42=_0x26fe42||0xc8;return function(_0x10d860){if(_0x10d860){return _0x3aa06f[_0xb84a('0x1f')](_0x26fe42)[_0xb84a('0x21')](_0x10d860);}};}function respondWithFilteredResult(_0x409df0,_0x19bdfa){return function(_0x3258a9){if(_0x3258a9){var _0x378ce1=typeof _0x19bdfa[_0xb84a('0x22')]===_0xb84a('0x23')&&typeof _0x19bdfa[_0xb84a('0x24')]===_0xb84a('0x23');var _0x1db72c=_0x3258a9[_0xb84a('0x25')];var _0x35d1f7=_0x378ce1?0x0:_0x19bdfa[_0xb84a('0x22')];var _0x97d71b=_0x378ce1?_0x3258a9['count']:_0x19bdfa['offset']+_0x19bdfa[_0xb84a('0x24')];var _0x2c30b0;if(_0x97d71b>=_0x1db72c){_0x97d71b=_0x1db72c;_0x2c30b0=0xc8;}else{_0x2c30b0=0xce;}_0x409df0['status'](_0x2c30b0);return _0x409df0[_0xb84a('0x26')](_0xb84a('0x27'),_0x35d1f7+'-'+_0x97d71b+'/'+_0x1db72c)['json'](_0x3258a9);}return null;};}function saveUpdates(_0x4fc638){return function(_0x28f2e7){if(_0x28f2e7){return _0x28f2e7[_0xb84a('0x28')](_0x4fc638)['then'](function(_0x251778){return _0x251778;});}return null;};}function removeEntity(_0xba1147){return function(_0x3abc22){if(_0x3abc22){return _0x3abc22[_0xb84a('0x29')]()[_0xb84a('0x14')](function(){_0xba1147[_0xb84a('0x1f')](0xcc)[_0xb84a('0x20')]();});}};}function handleEntityNotFound(_0xac214f){return function(_0x54ec50){if(!_0x54ec50){_0xac214f[_0xb84a('0x1e')](0x194);}return _0x54ec50;};}function handleError(_0x5b794f,_0x4bca85){_0x4bca85=_0x4bca85||0x1f4;return function(_0x2eea7e){logger[_0xb84a('0x1a')](_0x2eea7e['stack']);if(_0x2eea7e['name']){delete _0x2eea7e[_0xb84a('0x2a')];}_0x5b794f[_0xb84a('0x1f')](_0x4bca85)[_0xb84a('0x2b')](_0x2eea7e);};}function getMustacheRender(_0x308240,_0x3735fb){return Mustache[_0xb84a('0x2c')](_0x308240,_[_0xb84a('0x2d')](_0x3735fb[_0xb84a('0x2e')],{'contact':_0x3735fb['contact'],'message':_0x3735fb[_0xb84a('0x1c')],'agent':_0x3735fb[_0xb84a('0x2f')],'interaction':_0x3735fb[_0xb84a('0x30')],'account':_0x3735fb[_0xb84a('0x31')]}))||'';}function getInteractionUsers(_0x36aa07,_0xa072a4){return new BPromise(function(_0x2a5130,_0x5aa2ae){try{if(_0xa072a4[_0x36aa07['id']]){_0x36aa07[_0xb84a('0x32')]=_['map'](_0xa072a4[_0x36aa07['id']],function(_0x1a3115){return{'id':_0x1a3115['id'],'fullname':_0x1a3115[_0xb84a('0x33')]};});}}catch(_0x2f7e6c){_0x5aa2ae(_0x2f7e6c);}_0x2a5130(_0x36aa07);});}function getInteractionTags(_0x4d04fb,_0x4af084){return new BPromise(function(_0x102936,_0x75e6e6){try{if(_0x4d04fb[_0xb84a('0x34')]){_0x4d04fb[_0xb84a('0x35')]=[];_0x4d04fb[_0xb84a('0x34')]['split'](',')[_0xb84a('0x36')](function(_0x2d7216){_0x4d04fb['Tags'][_0xb84a('0x37')](_0x4af084[_0x2d7216]);});}delete _0x4d04fb[_0xb84a('0x34')];}catch(_0x19634b){_0x75e6e6(_0x19634b);}_0x102936(_0x4d04fb);});}function updateChatInteraction(_0xea32b3,_0x5675a8,_0x57a1a8){return new BPromise(function(_0x5d8670,_0xfac196){return getInteractionUsers(_0xea32b3,_0x57a1a8)[_0xb84a('0x14')](function(_0x43a071){return getInteractionTags(_0x43a071,_0x5675a8);})[_0xb84a('0x14')](function(_0x55b0b8){return getStateInteraction(_0x55b0b8);})[_0xb84a('0x14')](function(_0x5277dc){_0x5d8670(_0x5277dc);})[_0xb84a('0x38')](function(_0x532005){_0xfac196(_0x532005);});});}function getStateInteraction(_0x48db18){return new BPromise(function(_0x59d7a1){_0x48db18[_0xb84a('0x39')]=0x0;_0x48db18[_0xb84a('0x3a')]=0x0;_0x48db18[_0xb84a('0x3b')]=0x0;_0x48db18[_0xb84a('0x3c')]=0x0;_0x48db18['abandoned']=0x0;_0x48db18[_0xb84a('0x3d')]=0x0;if(!_0x48db18[_0xb84a('0x3e')]&&!_0x48db18[_0xb84a('0x3f')]){_0x48db18[_0xb84a('0x39')]+=0x1;}if(!_0x48db18['closed']&&_0x48db18['UserId']){_0x48db18[_0xb84a('0x3a')]+=0x1;if(_0x48db18[_0xb84a('0x39')]){_0x48db18['waiting']-=0x1;}}if(_0x48db18[_0xb84a('0x3e')]&&_0x48db18[_0xb84a('0x40')]===_0xb84a('0x41')){_0x48db18[_0xb84a('0x41')]+=0x1;if(_0x48db18[_0xb84a('0x39')]){_0x48db18[_0xb84a('0x39')]-=0x1;}}else if(_0x48db18[_0xb84a('0x3e')]&&!_0x48db18[_0xb84a('0x3f')]&&_0x48db18[_0xb84a('0x40')]){_0x48db18[_0xb84a('0x3c')]+=0x1;if(_0x48db18[_0xb84a('0x39')]){_0x48db18[_0xb84a('0x39')]-=0x1;}}else if(_0x48db18[_0xb84a('0x3e')]&&_0x48db18[_0xb84a('0x3f')]){_0x48db18[_0xb84a('0x3b')]+=0x1;if(_0x48db18['talking']){_0x48db18[_0xb84a('0x3a')]-=0x1;}}_0x48db18[_0xb84a('0x3d')]+=0x1;_0x59d7a1(_0x48db18);});}exports[_0xb84a('0x42')]=function(_0x46ee5c,_0x37f4fe){var _0x28b481={},_0x550eb1={},_0xfd2927={'count':0x0,'rows':[]};var _0x4adfe0=_[_0xb84a('0x43')](db[_0xb84a('0x44')][_0xb84a('0x45')],function(_0x4a14fb){return{'name':_0x4a14fb['fieldName'],'type':_0x4a14fb[_0xb84a('0x46')][_0xb84a('0x47')]};});_0x550eb1[_0xb84a('0x48')]=_['map'](_0x4adfe0,'name');_0x550eb1[_0xb84a('0x49')]=_[_0xb84a('0x4a')](_0x46ee5c[_0xb84a('0x49')]);_0x550eb1['filters']=_['intersection'](_0x550eb1['model'],_0x550eb1[_0xb84a('0x49')]);_0x28b481[_0xb84a('0x4b')]=_[_0xb84a('0x4c')](_0x550eb1[_0xb84a('0x48')],qs[_0xb84a('0x4d')](_0x46ee5c['query']['fields']));_0x28b481['attributes']=_0x28b481['attributes'][_0xb84a('0x4e')]?_0x28b481[_0xb84a('0x4b')]:_0x550eb1['model'];if(!_0x46ee5c[_0xb84a('0x49')][_0xb84a('0x4f')](_0xb84a('0x50'))){_0x28b481[_0xb84a('0x24')]=qs[_0xb84a('0x24')](_0x46ee5c[_0xb84a('0x49')]['limit']);_0x28b481['offset']=qs[_0xb84a('0x22')](_0x46ee5c['query'][_0xb84a('0x22')]);}_0x28b481['order']=qs['sort'](_0x46ee5c['query'][_0xb84a('0x51')]);_0x28b481[_0xb84a('0x52')]=qs[_0xb84a('0x53')](_[_0xb84a('0x54')](_0x46ee5c[_0xb84a('0x49')],_0x550eb1[_0xb84a('0x53')]),_0x4adfe0);var _0x37ca26=[];var _0x29ff35=squel['select']()['field']('id')['field'](_0xb84a('0x2a'))[_0xb84a('0x55')]('color')[_0xb84a('0x56')]('tools_tags');var _0x520705=squel['select']()[_0xb84a('0x55')](_0xb84a('0x57'))[_0xb84a('0x55')]('u.fullname')[_0xb84a('0x55')](_0xb84a('0x58'))[_0xb84a('0x56')]('user_has_chat_interactions','ui')[_0xb84a('0x59')]('users','u','u.id\x20=\x20ui.UserId');var _0x41d243=squel['select']()[_0xb84a('0x56')]('chat_interactions','i')[_0xb84a('0x59')](_0xb84a('0x5a'),'c',_0xb84a('0x5b'))[_0xb84a('0x59')]('users','o','o.id\x20=\x20i.UserId')['left_join'](_0xb84a('0x5c'),'a',_0xb84a('0x5d'))['left_join']('chat_messages','me',_0xb84a('0x5e'))[_0xb84a('0x59')](_0xb84a('0x5f'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xb84a('0x59')](_0xb84a('0x60'),'t','t.id\x20=\x20it.TagId');var _0x318b95=squel[_0xb84a('0x61')]();var _0xdfa8bb=[];var _0x39e564=squel[_0xb84a('0x61')]();var _0x46cc6a;if(_0x46ee5c[_0xb84a('0x49')]['search']){_0x46cc6a=as[_0xb84a('0x62')](_0x46ee5c[_0xb84a('0x49')]['search']);var _0x30846b=_0x46cc6a[_0xb84a('0x63')];for(var _0x34ac0f=0x0;_0x34ac0f<_0x46cc6a[_0xb84a('0x64')][_0xb84a('0x4e')];_0x34ac0f++){var _0x2cb727=_0x46cc6a[_0xb84a('0x64')][_0x34ac0f];var _0x1b6b82='i';var _0x842e98=_['find'](_0x4adfe0,[_0xb84a('0x2a'),_0x2cb727['field']]);if(!_0x842e98){switch(_0x2cb727['field']){case _0xb84a('0x65'):if(_0x2cb727['value']==0x1){_0x41d243[_0xb84a('0x66')]('`'+_0x2cb727['field']+_0xb84a('0x67'));}else{_0x41d243[_0xb84a('0x66')]('`'+_0x2cb727['field']+_0xb84a('0x68'));}break;case _0xb84a('0x69'):if(_0x2cb727[_0xb84a('0x6a')]===_0xb84a('0x6b')){if(_0x2cb727[_0xb84a('0x6c')][_0xb84a('0x6d')]('\x20')[_0xb84a('0x4e')]>0x1){_0x318b95[_0x30846b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb84a('0x6e')](_0x2cb727['value']),null);}else{var _0x4cee7b='%'+_0x2cb727[_0xb84a('0x6c')]+'%';_0x318b95[_0x30846b](_0xb84a('0x6f'),_0x4cee7b,_0x4cee7b,_0x4cee7b);}}else{_0x842e98=_[_0xb84a('0x70')](_0x4adfe0,[_0xb84a('0x2a'),'ContactId']);_0x2cb727['field']=_0xb84a('0x71');_0x593c7c=as[_0xb84a('0x72')](_0x1b6b82,_0x842e98[_0xb84a('0x46')],_0x2cb727);_0x318b95[_0x30846b](_0x593c7c[_0xb84a('0x73')],_0x593c7c['value'][_0xb84a('0x74')],_0x593c7c['value'][_0xb84a('0x20')]);}break;case'Tag':var _0x2d579d=_0x2cb727['value']['split'](',')['map'](function(_0x23fd4c){return Number(_0x23fd4c);});_0x2d579d[_0xb84a('0x36')](function(_0x18abb6){_0x39e564['or'](_0xb84a('0x75'),'%,'+_0x18abb6+',%');});_0xdfa8bb=_['union'](_0xdfa8bb,_0x2d579d);break;case _0xb84a('0x76'):if(_0x2cb727[_0xb84a('0x6a')]===_0xb84a('0x6b')){_0x318b95[_0x30846b](_0xb84a('0x77'),'%'+_0x2cb727[_0xb84a('0x6c')]+'%',null);}else{_0x842e98=_[_0xb84a('0x70')](_0x4adfe0,[_0xb84a('0x2a'),'UserId']);_0x2cb727[_0xb84a('0x55')]=_0xb84a('0x3f');_0x593c7c=as[_0xb84a('0x72')](_0x1b6b82,_0x842e98[_0xb84a('0x46')],_0x2cb727);_0x318b95[_0x30846b](_0x593c7c[_0xb84a('0x73')],_0x593c7c[_0xb84a('0x6c')]['start'],_0x593c7c[_0xb84a('0x6c')][_0xb84a('0x20')]);}break;case _0xb84a('0x2e'):_0x593c7c=as[_0xb84a('0x72')]('me',null,_0x2cb727);_0x318b95[_0x30846b](_0x593c7c[_0xb84a('0x73')],_0x593c7c['value'][_0xb84a('0x74')],_0x593c7c['value'][_0xb84a('0x20')]);break;}}else{var _0x593c7c=as[_0xb84a('0x72')](_0x1b6b82,_0x842e98[_0xb84a('0x46')],_0x2cb727);_0x318b95[_0x30846b](_0x593c7c[_0xb84a('0x73')],_0x593c7c['value'][_0xb84a('0x74')],_0x593c7c[_0xb84a('0x6c')][_0xb84a('0x20')]);}}}else{var _0xb79e0f=_(_0x46ee5c[_0xb84a('0x49')])['keys']()[_0xb84a('0x43')](function(_0x330a9b){return _[_0xb84a('0x78')](_0x4adfe0,['name',_0x330a9b])?_0x330a9b:undefined;})[_0xb84a('0x79')]()['value']();if(!_['isEmpty'](_0xb79e0f)){_0xb79e0f[_0xb84a('0x36')](function(_0x35cb8b){if(_0x35cb8b===_0xb84a('0x7a')){_0x41d243[_0xb84a('0x52')](_0xb84a('0x7b'),[][_0xb84a('0x7c')](_0x46ee5c[_0xb84a('0x49')][_0x35cb8b]));}else if(_0x35cb8b===_0xb84a('0x7d')){var _0x12eaf4=JSON[_0xb84a('0x7e')](_0x46ee5c[_0xb84a('0x49')][_0x35cb8b])[_0xb84a('0x7f')];var _0x3ec1fb=JSON[_0xb84a('0x7e')](_0x46ee5c[_0xb84a('0x49')][_0x35cb8b])[_0xb84a('0x80')];_0x41d243[_0xb84a('0x52')](_0xb84a('0x81'),_0x12eaf4,_0x3ec1fb);}else{if(_0x46ee5c['query'][_0x35cb8b]===_0xb84a('0x82')){_0x41d243[_0xb84a('0x52')]('i.'+_0x35cb8b+'\x20IS\x20NULL');}else{_0x41d243[_0xb84a('0x52')]('i.'+_0x35cb8b+'\x20=\x20?',_0x46ee5c[_0xb84a('0x49')][_0x35cb8b]);}}});}if(_0x46ee5c['query'][_0xb84a('0x83')]){if(_0x46ee5c['query']['read']==0x1){_0x41d243[_0xb84a('0x66')](_0xb84a('0x84'));}else{_0x41d243['having'](_0xb84a('0x85'));}}if(_0x46ee5c[_0xb84a('0x49')][_0xb84a('0x86')]){_0xdfa8bb=_[_0xb84a('0x87')](_0x46ee5c[_0xb84a('0x49')]['tag'])?_0x46ee5c[_0xb84a('0x49')][_0xb84a('0x86')]:new Array(_0x46ee5c[_0xb84a('0x49')][_0xb84a('0x86')]);_0xdfa8bb['forEach'](function(_0x31a4c0){_0x39e564['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x31a4c0+',%');});}if(_0x46ee5c[_0xb84a('0x49')][_0xb84a('0x88')]){var _0x54ae3e=_0x46ee5c[_0xb84a('0x49')][_0xb84a('0x88')][_0xb84a('0x89')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x54ae3e)){_0x318b95['or'](_0xb84a('0x8a'),_0x54ae3e+'%');}else{_0x318b95['or'](_0xb84a('0x8b'),qs['getFullTextValue'](_0x54ae3e))['or'](_0xb84a('0x8c'),_0x54ae3e+'%');}}}_0x41d243['where'](_0x318b95);_0x41d243[_0xb84a('0x8d')]('i.id');var _0x516888={'type':db[_0xb84a('0x8e')][_0xb84a('0x8f')][_0xb84a('0x90')],'raw':!![]};var _0x5121d=_0x41d243[_0xb84a('0x91')]();_0x5121d['field']('i.id');_0x5121d[_0xb84a('0x55')](_0xb84a('0x92'),'unreadMessages');if(_0x28b481[_0xb84a('0x93')]){_0x28b481[_0xb84a('0x93')][_0xb84a('0x36')](function(_0x462a02){var _0x521e9c=_0x462a02[0x0]===_0xb84a('0x94')?_0x462a02[0x0]:'i.'+_0x462a02[0x0];_0x41d243['order'](_0x521e9c,_0x462a02[0x1]===_0xb84a('0x95')?![]:!![]);});}if(!_[_0xb84a('0x96')](_0xdfa8bb)){_0x41d243[_0xb84a('0x66')](_0x39e564);_0x5121d[_0xb84a('0x52')](_0xb84a('0x97'),_0xdfa8bb);}BPromise[_0xb84a('0x98')]()[_0xb84a('0x14')](function(){if(!_0x46cc6a){if(_0x46ee5c[_0xb84a('0x49')][_0xb84a('0x7a')])return;_0x5121d[_0xb84a('0x52')](_0xb84a('0x99'));_0x41d243[_0xb84a('0x52')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x46ee5c[_0xb84a('0x9a')][_0xb84a('0x9b')]!==_0xb84a('0x2f'))return;return _0x46ee5c[_0xb84a('0x9a')][_0xb84a('0x9c')]({'attributes':['id'],'raw':!![]})[_0xb84a('0x14')](function(_0x428d60){if(_['isEmpty'](_0x428d60)){_0x5121d[_0xb84a('0x52')](_0xb84a('0x9d'));_0x41d243[_0xb84a('0x52')](_0xb84a('0x9d'));}else{_0x5121d[_0xb84a('0x52')](_0xb84a('0x7b'),_[_0xb84a('0x43')](_0x428d60,'id'));_0x41d243['where'](_0xb84a('0x7b'),_[_0xb84a('0x43')](_0x428d60,'id'));}});})[_0xb84a('0x14')](function(){if(_0x46ee5c[_0xb84a('0x9a')][_0xb84a('0x9b')]===_0xb84a('0x2f')&&!_0x46cc6a&&!_0x46ee5c[_0xb84a('0x49')][_0xb84a('0x7a')])return[];return db[_0xb84a('0x9e')]['query'](_0x5121d[_0xb84a('0x9f')](),_0x516888);})[_0xb84a('0x14')](function(_0x12b2c8){_0xfd2927[_0xb84a('0x25')]=_0x12b2c8['length'];if(_0xfd2927[_0xb84a('0x25')]===0x0)return[];return db[_0xb84a('0x9e')][_0xb84a('0x49')](_0x29ff35[_0xb84a('0x9f')](),_0x516888)['then'](function(_0x36edac){_0x37ca26=_['keyBy'](_0x36edac,'id');_0x516888=_['merge'](_0x516888,{'model':db[_0xb84a('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46ee5c['query'][_0xb84a('0x4d')]){_0x28b481[_0xb84a('0x4b')]['forEach'](function(_0x384cff){_0x41d243['field']('i.'+_0x384cff);});}else{_0x41d243[_0xb84a('0x55')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb84a('0x65'));_0x41d243[_0xb84a('0x55')]('a.key',_0xb84a('0xa0'));_0x41d243[_0xb84a('0x55')](_0xb84a('0xa1'),_0xb84a('0xa2'));_0x41d243['field'](_0xb84a('0xa3'),_0xb84a('0x94'));_0x41d243[_0xb84a('0x55')](_0xb84a('0xa4'));_0x41d243[_0xb84a('0x55')](_0xb84a('0xa5'),_0xb84a('0xa6'));_0x41d243[_0xb84a('0x55')](_0xb84a('0xa7'),_0xb84a('0xa8'));_0x41d243[_0xb84a('0x55')](_0xb84a('0xa9'),_0xb84a('0xaa'));_0x41d243[_0xb84a('0x55')](_0xb84a('0xab'),_0xb84a('0xac'));_0x41d243[_0xb84a('0x55')]('c.mobile',_0xb84a('0xad'));_0x41d243[_0xb84a('0x55')]('c.fax',_0xb84a('0xae'));_0x41d243['field'](_0xb84a('0xaf'),'Owner.fullname');_0x41d243[_0xb84a('0x55')]('o.internal','Owner.internal');_0x41d243[_0xb84a('0x55')](_0xb84a('0xb0'),_0xb84a('0x34'));}if(_0x28b481[_0xb84a('0x24')])_0x41d243[_0xb84a('0x24')](_0x28b481[_0xb84a('0x24')]);if(_0x28b481[_0xb84a('0x22')])_0x41d243['offset'](_0x28b481[_0xb84a('0x22')]);return db['sequelize'][_0xb84a('0x49')](_0x41d243[_0xb84a('0x9f')](),_0x516888);})[_0xb84a('0x14')](function(_0xe8634){if(_0xe8634['length']>0x0)_0x520705['where'](_0xb84a('0xb1'),_['map'](_0xe8634,'id'));return db[_0xb84a('0x9e')][_0xb84a('0x49')](_0x520705[_0xb84a('0x9f')](),_0x516888)[_0xb84a('0x14')](function(_0x2e91bd){var _0x5da0ef=_[_0xb84a('0xb2')](_0x2e91bd,'ChatInteractionId');var _0x101cc9=[];_0xe8634[_0xb84a('0x36')](function(_0x3ff548){_0x101cc9[_0xb84a('0x37')](updateChatInteraction(_0x3ff548,_0x37ca26,_0x5da0ef));});return BPromise[_0xb84a('0xb3')](_0x101cc9);});});})['then'](function(_0x1dbf46){_0xfd2927[_0xb84a('0xb4')]=_0x1dbf46;return _0xfd2927;})[_0xb84a('0x14')](respondWithFilteredResult(_0x37f4fe,_0x28b481))[_0xb84a('0x38')](handleError(_0x37f4fe,null));};exports[_0xb84a('0xb5')]=function(_0x42fb64,_0x574da3){var _0x1bbe74={'raw':![],'where':{'id':_0x42fb64[_0xb84a('0xb6')]['id']}},_0x55c337={};_0x55c337[_0xb84a('0x48')]=_[_0xb84a('0x4a')](db[_0xb84a('0x44')][_0xb84a('0x45')]);_0x55c337[_0xb84a('0x49')]=_['keys'](_0x42fb64['query']);_0x55c337['filters']=_[_0xb84a('0x4c')](_0x55c337[_0xb84a('0x48')],_0x55c337[_0xb84a('0x49')]);_0x1bbe74['attributes']=_['intersection'](_0x55c337[_0xb84a('0x48')],qs[_0xb84a('0x4d')](_0x42fb64[_0xb84a('0x49')][_0xb84a('0x4d')]));_0x1bbe74[_0xb84a('0x4b')]=_0x1bbe74[_0xb84a('0x4b')][_0xb84a('0x4e')]?_0x1bbe74[_0xb84a('0x4b')]:_0x55c337[_0xb84a('0x48')];if(_0x42fb64[_0xb84a('0x49')][_0xb84a('0xb7')]){_0x1bbe74[_0xb84a('0xb8')]=[{'all':!![]}];}_0x1bbe74=_[_0xb84a('0x2d')]({},_0x1bbe74,_0x42fb64[_0xb84a('0xb9')]);return db[_0xb84a('0x44')][_0xb84a('0x70')](_0x1bbe74)[_0xb84a('0x14')](handleEntityNotFound(_0x574da3,null))[_0xb84a('0x14')](respondWithResult(_0x574da3,null))[_0xb84a('0x38')](handleError(_0x574da3,null));};exports[_0xb84a('0xba')]=function(_0x41933a,_0x6882a1){return db[_0xb84a('0x44')]['create'](_0x41933a[_0xb84a('0x2e')],{})['then'](respondWithResult(_0x6882a1,0xc9))[_0xb84a('0x38')](handleError(_0x6882a1,null));};exports[_0xb84a('0x28')]=function(_0x4a5aa2,_0x5a30b1){if(_0x4a5aa2[_0xb84a('0x2e')]['id']){delete _0x4a5aa2[_0xb84a('0x2e')]['id'];}return db[_0xb84a('0x44')][_0xb84a('0x70')]({'where':{'id':_0x4a5aa2['params']['id']}})[_0xb84a('0x14')](handleEntityNotFound(_0x5a30b1,null))['then'](saveUpdates(_0x4a5aa2[_0xb84a('0x2e')],null))['then'](respondWithResult(_0x5a30b1,null))[_0xb84a('0x38')](handleError(_0x5a30b1,null));};exports['destroy']=function(_0x31f6f2,_0x2c969a){return db['ChatInteraction'][_0xb84a('0x70')]({'where':{'id':_0x31f6f2[_0xb84a('0xb6')]['id']}})['then'](handleEntityNotFound(_0x2c969a,null))['then'](removeEntity(_0x2c969a,null))[_0xb84a('0x38')](handleError(_0x2c969a,null));};exports[_0xb84a('0xbb')]=function(_0x7fe95b,_0xa7e427){return db[_0xb84a('0x44')]['describe']()['then'](respondWithResult(_0xa7e427,null))[_0xb84a('0x38')](handleError(_0xa7e427,null));};exports['createVidaooSession']=function(_0x1eeaf1,_0x495edf){var _0x3e83d6=_0x1eeaf1[_0xb84a('0xb6')]['id'];var _0xec0f32;var _0x2fd32b;var _0x296f5a;return db[_0xb84a('0x44')][_0xb84a('0xbc')]({'where':{'id':_0x3e83d6}})[_0xb84a('0x14')](function(_0x23bfdc){_0xec0f32=_0x23bfdc;return db['ChatWebsite'][_0xb84a('0xbc')]({'where':{'id':_0x23bfdc[_0xb84a('0x7a')]},'attributes':['id',_0xb84a('0xbd'),'vidaooEscalation',_0xb84a('0xbe'),'vidaooNote',_0xb84a('0xbf')],'raw':!![]});})[_0xb84a('0x14')](function(_0x93f4dc){if(_0x93f4dc&&_0x93f4dc[_0xb84a('0xbd')]&&_0x93f4dc[_0xb84a('0xc0')]){_0x2fd32b=_0x93f4dc;var _0x2123b4={'interaction':{'id':_0x3e83d6},'agent':{'id':_0x1eeaf1[_0xb84a('0x9a')]['id'],'name':_0x1eeaf1['user'][_0xb84a('0x2a')],'fullname':_0x1eeaf1[_0xb84a('0x9a')]['fullname'],'email':_0x1eeaf1['user'][_0xb84a('0xc1')]},'contact':_0x1eeaf1[_0xb84a('0x2e')][_0xb84a('0xc2')],'account':_0x1eeaf1[_0xb84a('0x2e')][_0xb84a('0x31')]};var _0x45ef96={'rejectUnauthorized':![],'method':_0xb84a('0xc3'),'url':_0xb84a('0xc4'),'headers':{'X-APIKEY':_0x93f4dc[_0xb84a('0xbd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1eeaf1[_0xb84a('0x9a')][_0xb84a('0xc1')]],'buttons':null,'topic':_0x2fd32b[_0xb84a('0xbe')],'note':_[_0xb84a('0xc5')](_0x2fd32b[_0xb84a('0xc6')])?null:getMustacheRender(_0x2fd32b[_0xb84a('0xc6')],_0x2123b4),'metadata':null},'redirect':_0xb84a('0xc7'),'json':!![]};try{if(!_[_0xb84a('0xc5')](_0x2fd32b[_0xb84a('0xbf')])){var _0x3624f1=getMustacheRender(_0x2fd32b[_0xb84a('0xbf')],_0x2123b4);var _0x5a4d19=JSON[_0xb84a('0x7e')](_0x3624f1);_0x45ef96['body'][_0xb84a('0xc8')]=_0x5a4d19;}}catch(_0x2f9a69){throw new db[(_0xb84a('0x8e'))][(_0xb84a('0xc9'))](_0xb84a('0xca'));}return rp(_0x45ef96);}else{throw new db[(_0xb84a('0x8e'))][(_0xb84a('0xc9'))](_0xb84a('0xcb'));}})['then'](function(_0x1de052){_0x296f5a=_0x1de052;if(_0x296f5a['id']){var _0x4771b4={'body':_0x296f5a['join_url'],'ChatWebsiteId':_0x2fd32b['id'],'ChatInteractionId':_0xec0f32['id'],'direction':_0xb84a('0xcc'),'UserId':_0x1eeaf1[_0xb84a('0x9a')]['id']};return db[_0xb84a('0xcd')][_0xb84a('0xba')](_0x4771b4,{});}else{throw new db['Sequelize'][(_0xb84a('0xc9'))](_0xb84a('0xce'));}})[_0xb84a('0x14')](function(){return _0xec0f32[_0xb84a('0xcf')]({'vidaooSessionId':_0x296f5a['id']});})[_0xb84a('0x14')](respondWithResult(_0x495edf,null))['catch'](handleError(_0x495edf,null));};exports[_0xb84a('0xd0')]=function(_0x38af9f,_0x5f424e){if(_0x38af9f[_0xb84a('0x2e')]['id']){delete _0x38af9f['body']['id'];}return db[_0xb84a('0x44')][_0xb84a('0x70')]({'where':{'id':_0x38af9f[_0xb84a('0xb6')]['id']},'include':[{'model':db[_0xb84a('0xd1')],'as':'Contact'}]})[_0xb84a('0x14')](handleEntityNotFound(_0x5f424e,null))[_0xb84a('0x14')](saveUpdates(_0x38af9f['body'],null))['then'](respondWithResult(_0x5f424e,null))['catch'](handleError(_0x5f424e,null));};exports[_0xb84a('0xd2')]=function(_0x28e6ed,_0x51d207){if(_0x28e6ed['body']['id']){delete _0x28e6ed[_0xb84a('0x2e')]['id'];}return db['ChatInteraction'][_0xb84a('0x70')]({'where':{'id':_0x28e6ed[_0xb84a('0xb6')]['id']}})[_0xb84a('0x14')](function(_0x552e7c){if(!_0x552e7c){logger['error'](_0xb84a('0xd3'),'abandon',0x194,_0xb84a('0xd4'));_0x51d207[_0xb84a('0x1e')](0x194);}else{if(_0x552e7c[_0xb84a('0x3f')]){throw new db[(_0xb84a('0x8e'))][(_0xb84a('0xc9'))](_0xb84a('0xd5'));}}return _0x552e7c;})['then'](function(_0x18fe40){if(_0x18fe40){return _0x18fe40[_0xb84a('0x28')]({'closed':_0x28e6ed[_0xb84a('0x2e')][_0xb84a('0x3e')],'disposition':_0x28e6ed[_0xb84a('0x2e')][_0xb84a('0x40')]})[_0xb84a('0x14')](function(_0x3c20cf){return _0x3c20cf;});}})[_0xb84a('0x14')](function(){return respondWithRpcPromise(_0xb84a('0xd6'),_0xb84a('0xd2'),_0x28e6ed[_0xb84a('0x2e')],client9004);})[_0xb84a('0x14')](respondWithResult(_0x51d207,null))[_0xb84a('0x38')](handleError(_0x51d207,null));};exports[_0xb84a('0xd7')]=function(_0x552325,_0x32bad3){_0x552325[_0xb84a('0x2e')][_0xb84a('0x2a')]=_0x552325[_0xb84a('0xd8')][_0xb84a('0xd9')];_0x552325['body']['basename']=_0x552325['file'][_0xb84a('0xda')];_0x552325[_0xb84a('0x2e')][_0xb84a('0x46')]=_0x552325['file']['mimetype'];return db[_0xb84a('0xdb')][_0xb84a('0xba')](_0x552325['body'])[_0xb84a('0x14')](respondWithResult(_0x32bad3,0xc9))[_0xb84a('0x38')](handleError(_0x32bad3,null));};exports[_0xb84a('0xdc')]=function(_0xe168fc,_0x59ef73){return db[_0xb84a('0x44')]['findOne']({'where':{'id':_0xe168fc['params']['id']},'raw':!![]})[_0xb84a('0x14')](handleEntityNotFound(_0x59ef73,null))[_0xb84a('0x14')](function(_0x10c6c3){if(_0x10c6c3){if(_0x10c6c3[_0xb84a('0x3e')]){return _0x59ef73[_0xb84a('0x1f')](0x193)[_0xb84a('0x21')]({'status':0x193,'message':_0xb84a('0xdd')});}return db[_0xb84a('0xdb')][_0xb84a('0xbc')]({'where':{'id':_0xe168fc[_0xb84a('0x49')][_0xb84a('0xde')]},'raw':!![]})[_0xb84a('0x14')](handleEntityNotFound(_0x59ef73,null));}})[_0xb84a('0x14')](function(_0x1b229b){if(_0x1b229b){var _0x553df7=_0x1b229b[_0xb84a('0xdf')]!==null;var _0x376495=path[_0xb84a('0xe0')](config[_0xb84a('0xe1')],_0xb84a('0xe2'));if(_0x553df7){_0x376495=path[_0xb84a('0xe0')](_0x376495,_0xb84a('0xe3'));}var _0x4776ab=path[_0xb84a('0xe0')](_0x376495,_0x1b229b['basename']);return _0x59ef73[_0xb84a('0xe4')](_0x4776ab);}})[_0xb84a('0x38')](handleError(_0x59ef73,null));};exports['close']=function(_0x5c01db,_0x24e3fb){var _0x53b3c3=null;var _0x239550=null;var _0x438801=null;if(_0x5c01db[_0xb84a('0x2e')]['id']){delete _0x5c01db[_0xb84a('0x2e')]['id'];}if(_0x5c01db['body'][_0xb84a('0xe5')]){_0x438801=path[_0xb84a('0xe0')](config[_0xb84a('0xe1')],_0xb84a('0xe6'),util[_0xb84a('0xe7')](_0xb84a('0xe8'),Date[_0xb84a('0xe9')]()));_0x5c01db[_0xb84a('0x2e')][_0xb84a('0xea')]=_0x438801;}return db['ChatInteraction'][_0xb84a('0x70')]({'where':{'id':_0x5c01db[_0xb84a('0xb6')]['id']},'include':[{'model':db[_0xb84a('0xcd')],'as':_0xb84a('0xeb'),'include':[{'model':db[_0xb84a('0x76')],'as':_0xb84a('0x76')}]}]})['then'](handleEntityNotFound(_0x24e3fb,null))['then'](saveUpdates(_0x5c01db[_0xb84a('0x2e')],null))[_0xb84a('0x14')](function(_0x5f4ad3){if(_0x5f4ad3){_0x53b3c3=_0x5f4ad3;return db[_0xb84a('0xec')]['find']({'where':{'id':_0x53b3c3[_0xb84a('0x7a')]}});}})[_0xb84a('0x14')](function(_0x1dfc91){if(_0x1dfc91){_0x239550=_0x1dfc91;return db[_0xb84a('0xd1')][_0xb84a('0x70')]({'where':{'id':_0x53b3c3['ContactId']}});}})[_0xb84a('0x14')](function(_0x3b413c){if(_0x3b413c){if(_0x438801){var _0x2702ad=null;for(var _0x43de36=0x1;_0x43de36<_0x53b3c3[_0xb84a('0xeb')][_0xb84a('0x4e')];++_0x43de36){_0x2702ad=_0x53b3c3[_0xb84a('0xeb')][_0x43de36];var _0x496931=_0x2702ad[_0xb84a('0x3f')]?util['format'](_0xb84a('0xed'),_0x239550[_0xb84a('0xee')],_0x2702ad[_0xb84a('0x3f')]):_0xb84a('0xef');var _0x1e5177=_0x5c01db[_0xb84a('0x2e')][_0xb84a('0xf0')]||util[_0xb84a('0xe7')](_0xb84a('0xed'),'Visitor',_0x2702ad[_0xb84a('0x71')]);switch(_0x239550[_0xb84a('0xf1')]){case _0xb84a('0xf2'):_0x496931=_0x2702ad['UserId']?util['format'](_0xb84a('0xed'),_0x239550[_0xb84a('0xee')],_0x2702ad['UserId']):_0xb84a('0xef');break;case _0xb84a('0xf3'):_0x496931=_0x2702ad[_0xb84a('0x3f')]?_0x2702ad[_0xb84a('0x76')]['alias']||_0x2702ad[_0xb84a('0x76')][_0xb84a('0x33')]:_0xb84a('0xef');break;case _0xb84a('0xf4'):_0x496931=_0x2702ad[_0xb84a('0x3f')]?_0x2702ad[_0xb84a('0x76')][_0xb84a('0x33')]:_0xb84a('0xef');break;default:_0x496931=_0x2702ad['UserId']?util['format'](_0xb84a('0xed'),_0x239550[_0xb84a('0xee')],_0x2702ad[_0xb84a('0x3f')]):'System';}var _0x260d57=util['format'](_0xb84a('0xf5'),moment(_0x2702ad['createdAt'])[_0xb84a('0xe7')](_0xb84a('0xf6')),_0x2702ad['direction']==='in'?_0x1e5177:_0x496931,_0x2702ad[_0xb84a('0x2e')]);if(!_0x2702ad[_0xb84a('0xf7')]){fs[_0xb84a('0xf8')](_0x438801,_0x260d57);}}return db[_0xb84a('0xf9')][_0xb84a('0xbc')]({'where':{'service':!![]},'include':[{'model':db[_0xb84a('0xfa')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xb84a('0xfb')],'as':_0xb84a('0xfb'),'raw':!![]}]}]});}}})['then'](function(_0x519f63){if(!_0x519f63||!_0x519f63[_0xb84a('0xfc')]||!_0x5c01db['body'])return _0x53b3c3;var _0x104ba9=_0x519f63[_0xb84a('0xfd')]();return respondWithRpcPromise('SendMail',_0xb84a('0xfe'),{'account':_0x104ba9,'message':{'from':util[_0xb84a('0xe7')](_0xb84a('0xff'),_0x519f63[_0xb84a('0x2a')],_0x519f63[_0xb84a('0xc1')]||_0x519f63['Smtp']['user']),'to':_0x5c01db['body'][_0xb84a('0xe5')],'subject':'Mail\x20Transcript','text':util[_0xb84a('0xe7')](_0xb84a('0x100'),_0x5c01db[_0xb84a('0x2e')][_0xb84a('0xe5')]),'attachments':[{'path':_0x438801}]}})[_0xb84a('0x14')](function(){return _0x53b3c3;})[_0xb84a('0x38')](function(_0x1ef8d1){logger[_0xb84a('0x1a')](_0x1ef8d1);});})[_0xb84a('0x14')](respondWithStatusCode(_0x24e3fb,0xc8))['catch'](handleError(_0x24e3fb,null));};exports[_0xb84a('0x101')]=function(_0x11b29a,_0x3f8664){return db[_0xb84a('0xcd')][_0xb84a('0x70')]({'where':{'id':_0x11b29a['params']['id']}})[_0xb84a('0x14')](handleEntityNotFound(_0x3f8664,null))[_0xb84a('0x14')](function(_0x42a323){if(_0x42a323){return _0x42a323[_0xb84a('0x101')](_0x11b29a['body']['ids'],_['omit'](_0x11b29a[_0xb84a('0x2e')],[_0xb84a('0x102'),'id'])||{});}})[_0xb84a('0x14')](respondWithResult(_0x3f8664,null))[_0xb84a('0x38')](handleError(_0x3f8664,null));};exports[_0xb84a('0x103')]=function(_0x31ef5c,_0x205791){var _0x578385={'raw':![],'where':{}};var _0x32c046={};var _0x58368b={'count':0x0,'rows':[]};return db[_0xb84a('0x44')][_0xb84a('0xbc')]({'where':{'id':_0x31ef5c['params']['id']}})[_0xb84a('0x14')](handleEntityNotFound(_0x205791,null))['then'](function(_0x43d584){if(_0x43d584){_0x32c046[_0xb84a('0x48')]=_[_0xb84a('0x4a')](db[_0xb84a('0xcd')][_0xb84a('0x45')]);_0x32c046[_0xb84a('0x49')]=_[_0xb84a('0x4a')](_0x31ef5c[_0xb84a('0x49')]);_0x32c046[_0xb84a('0x53')]=_['intersection'](_0x32c046[_0xb84a('0x48')],_0x32c046[_0xb84a('0x49')]);_0x578385[_0xb84a('0x4b')]=_['intersection'](_0x32c046['model'],qs[_0xb84a('0x4d')](_0x31ef5c[_0xb84a('0x49')]['fields']));_0x578385['attributes']=_0x578385[_0xb84a('0x4b')][_0xb84a('0x4e')]?_0x578385['attributes']:_0x32c046['model'];if(!_0x31ef5c['query']['hasOwnProperty'](_0xb84a('0x50'))){_0x578385[_0xb84a('0x24')]=qs['limit'](_0x31ef5c[_0xb84a('0x49')][_0xb84a('0x24')]);_0x578385[_0xb84a('0x22')]=qs[_0xb84a('0x22')](_0x31ef5c[_0xb84a('0x49')][_0xb84a('0x22')]);}_0x578385[_0xb84a('0x93')]=qs['sort'](_0x31ef5c[_0xb84a('0x49')]['sort']);_0x578385[_0xb84a('0x52')]=qs['filters'](_[_0xb84a('0x54')](_0x31ef5c['query'],_0x32c046['filters']));_0x578385[_0xb84a('0x52')][_0xb84a('0x104')]=_0x43d584['id'];if(_0x31ef5c[_0xb84a('0x49')][_0xb84a('0x88')]){_0x578385[_0xb84a('0x52')]=_[_0xb84a('0x2d')](_0x578385['where'],{'$or':_[_0xb84a('0x43')](_0x578385[_0xb84a('0x4b')],function(_0x4c51a1){var _0x55505c={};_0x55505c[_0x4c51a1]={'$like':'%'+_0x31ef5c['query']['filter']+'%'};return _0x55505c;})});}if(_0x31ef5c['query'][_0xb84a('0x7f')]){var _0x22cfb0=_0x31ef5c[_0xb84a('0x49')][_0xb84a('0x7f')][_0xb84a('0x6d')](',');var _0x110faa={};_0x110faa[_0x22cfb0[0x0]]={'$gte':moment(_0x22cfb0[0x1])[_0xb84a('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x578385[_0xb84a('0x52')]=_[_0xb84a('0x2d')](_0x578385[_0xb84a('0x52')],_0x110faa);}_0x578385=_[_0xb84a('0x2d')]({},_0x578385,_0x31ef5c['options']);return db[_0xb84a('0xcd')][_0xb84a('0x25')]({'where':_0x578385[_0xb84a('0x52')]})[_0xb84a('0x14')](function(_0x54fa17){_0x58368b['count']=_0x54fa17;if(_0x31ef5c['query'][_0xb84a('0xb7')]){_0x578385['include']=[{'all':!![]}];}return db[_0xb84a('0xcd')][_0xb84a('0x105')](_0x578385);})[_0xb84a('0x14')](function(_0x648d04){_0x58368b[_0xb84a('0xb4')]=_0x648d04;return _0x58368b;});}})[_0xb84a('0x14')](respondWithFilteredResult(_0x205791,_0x578385))[_0xb84a('0x38')](handleError(_0x205791,null));};exports[_0xb84a('0x106')]=function(_0x14a1fc,_0x437fa6){var _0x67ae1={'where':{}},_0x86cb4c={},_0x978b33={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb84a('0xbc')]({'where':{'id':_0x14a1fc['params']['id']}})[_0xb84a('0x14')](handleEntityNotFound(_0x437fa6,null))[_0xb84a('0x14')](function(_0x4e0264){if(_0x4e0264){_0x86cb4c[_0xb84a('0x48')]=_[_0xb84a('0x4a')](db['ChatMessage'][_0xb84a('0x45')]);_0x86cb4c[_0xb84a('0x49')]=_[_0xb84a('0x4a')](_0x14a1fc[_0xb84a('0x49')]);_0x86cb4c[_0xb84a('0x53')]=_[_0xb84a('0x4c')](_0x86cb4c[_0xb84a('0x48')],_0x86cb4c['query']);_0x67ae1[_0xb84a('0x4b')]=_[_0xb84a('0x4c')](_0x86cb4c[_0xb84a('0x48')],qs[_0xb84a('0x4d')](_0x14a1fc[_0xb84a('0x49')][_0xb84a('0x4d')]));_0x67ae1[_0xb84a('0x4b')]=_0x67ae1[_0xb84a('0x4b')][_0xb84a('0x4e')]?_0x67ae1[_0xb84a('0x4b')]:_0x86cb4c[_0xb84a('0x48')];if(!_0x14a1fc[_0xb84a('0x49')][_0xb84a('0x4f')](_0xb84a('0x50'))){_0x67ae1[_0xb84a('0x24')]=qs['limit'](_0x14a1fc[_0xb84a('0x49')][_0xb84a('0x24')]);_0x67ae1[_0xb84a('0x22')]=qs['offset'](_0x14a1fc['query']['offset']);}_0x67ae1[_0xb84a('0x93')]=qs[_0xb84a('0x51')](_0x14a1fc[_0xb84a('0x49')][_0xb84a('0x51')]);_0x67ae1[_0xb84a('0x52')]=qs[_0xb84a('0x53')](_[_0xb84a('0x54')](_0x14a1fc[_0xb84a('0x49')],_0x86cb4c[_0xb84a('0x53')]));_0x67ae1[_0xb84a('0x52')][_0xb84a('0x104')]=_0x4e0264['id'];if(_0x14a1fc['query'][_0xb84a('0x88')]){_0x67ae1['where']=_['merge'](_0x67ae1[_0xb84a('0x52')],{'$or':_['map'](_0x67ae1[_0xb84a('0x4b')],function(_0x4815d4){var _0x34a8bc={};_0x34a8bc[_0x4815d4]={'$like':'%'+_0x14a1fc[_0xb84a('0x49')][_0xb84a('0x88')]+'%'};return _0x34a8bc;})});}_0x67ae1['where'][_0xb84a('0xf7')]=![];if(_0x14a1fc[_0xb84a('0x49')]['id']){_0x67ae1[_0xb84a('0x52')]['id']={'$gt':_0x14a1fc[_0xb84a('0x49')]['id']};}_0x67ae1=_[_0xb84a('0x2d')]({},_0x67ae1,_0x14a1fc['options']);return db[_0xb84a('0xcd')][_0xb84a('0x25')]({'where':_0x67ae1[_0xb84a('0x52')]})[_0xb84a('0x14')](function(_0x33cca4){_0x978b33['count']=_0x33cca4;_0x67ae1[_0xb84a('0xb8')]=[];if(_0x14a1fc[_0xb84a('0x49')]['includeAgent']){_0x67ae1['include'][_0xb84a('0x37')]({'model':db['User'],'as':_0xb84a('0x76'),'attributes':['id',_0xb84a('0x33'),_0xb84a('0x107')]});}if(_0x14a1fc[_0xb84a('0x49')][_0xb84a('0xb7')]){_0x67ae1['include']=[{'all':!![]}];}return db[_0xb84a('0xcd')]['findAll'](_0x67ae1);})[_0xb84a('0x14')](function(_0x3b1c5d){_0x978b33['rows']=_0x3b1c5d;return _0x978b33;});}})[_0xb84a('0x14')](respondWithFilteredResult(_0x437fa6,_0x67ae1))[_0xb84a('0x38')](handleError(_0x437fa6,null));};exports[_0xb84a('0x108')]=function(_0xfc8311,_0x2f855a){return db['ChatInteraction'][_0xb84a('0x70')]({'where':{'id':_0xfc8311[_0xb84a('0xb6')]['id']}})['then'](handleEntityNotFound(_0x2f855a,null))[_0xb84a('0x14')](function(_0x1dcb75){if(_0x1dcb75){return _0x1dcb75[_0xb84a('0x109')](_0xfc8311[_0xb84a('0x2e')][_0xb84a('0x102')],_[_0xb84a('0x10a')](_0xfc8311[_0xb84a('0x2e')],[_0xb84a('0x102'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xb84a('0x2a'),_0xb84a('0x10b')],'where':{'id':_0xfc8311[_0xb84a('0x2e')][_0xb84a('0x102')]}});})[_0xb84a('0x14')](function(_0x2dee8d){socket[_0xb84a('0x10c')](_0xb84a('0x10d'),{'id':Number(_0xfc8311[_0xb84a('0xb6')]['id']),'tags':_0x2dee8d||[]});return{'id':Number(_0xfc8311[_0xb84a('0xb6')]['id']),'tags':_0x2dee8d||[]};});}})[_0xb84a('0x14')](respondWithResult(_0x2f855a,null))[_0xb84a('0x38')](handleError(_0x2f855a,null));};exports[_0xb84a('0x10e')]=function(_0x3cbc72,_0x4d17e1){return db[_0xb84a('0x44')][_0xb84a('0x70')]({'where':{'id':_0x3cbc72['params']['id']}})['then'](handleEntityNotFound(_0x4d17e1,null))[_0xb84a('0x14')](function(_0x502848){if(_0x502848){return _0x502848['removeTags'](_0x3cbc72[_0xb84a('0x49')][_0xb84a('0x102')]);}})[_0xb84a('0x14')](respondWithStatusCode(_0x4d17e1,null))[_0xb84a('0x38')](handleError(_0x4d17e1,null));};exports[_0xb84a('0xe4')]=function(_0x130a54,_0x15b2d7){var _0x5001d0=moment()[_0xb84a('0x10f')]()[_0xb84a('0x9f')]();var _0x4c4308=path[_0xb84a('0xe0')](config[_0xb84a('0xe1')],_0xb84a('0x110'),_0xb84a('0x111'),_0xb84a('0x112'));var _0x4804b2=path[_0xb84a('0xe0')](config[_0xb84a('0xe1')],'server',_0xb84a('0x111'),'attachments');var _0x1c5830=path[_0xb84a('0xe0')](_0x4c4308,_0x5001d0);var _0x5e9af0=util['format'](_0xb84a('0x113'),_0x130a54[_0xb84a('0xb6')]['id'],_0x5001d0);var _0x32b28c=path[_0xb84a('0xe0')](_0x4c4308,_0x5e9af0);var _0x592242=[];_0x592242[_0xb84a('0x37')]({'model':db['User'],'as':_0xb84a('0x76'),'attributes':['id',_0xb84a('0x33')],'raw':!![]});_0x592242[_0xb84a('0x37')]({'model':db[_0xb84a('0xd1')],'as':'Contact','attributes':['id',_0xb84a('0x114'),_0xb84a('0x115')],'raw':!![]});if(_0x130a54[_0xb84a('0x49')][_0xb84a('0x116')]){_0x592242['push']({'model':db[_0xb84a('0xdb')],'as':_0xb84a('0xdb'),'raw':!![]});}var _0x31eb59=[{'model':db[_0xb84a('0xcd')],'as':_0xb84a('0xeb'),'attributes':['id',_0xb84a('0x2e'),_0xb84a('0x7d'),_0xb84a('0x117'),_0xb84a('0xf7'),_0xb84a('0x83')],'include':_0x592242}];_0x31eb59[_0xb84a('0x37')]({'model':db['ChatWebsite'],'as':_0xb84a('0x118'),'attributes':['id','name']});_0x31eb59[_0xb84a('0x37')]({'model':db['User'],'as':'Owner','attributes':['id',_0xb84a('0x33')]});return db['ChatInteraction']['find']({'where':{'id':_0x130a54[_0xb84a('0xb6')]['id']},'include':_0x31eb59})[_0xb84a('0x14')](handleEntityNotFound(_0x15b2d7,null))[_0xb84a('0x14')](function(_0x449c72){if(_0x449c72){var _0x116c26=_0x449c72[_0xb84a('0x119')]({'plain':!![]});fs['mkdirSync'](_0x1c5830);var _0x183afe={'channel':_0xb84a('0x11a'),'account':_0x116c26[_0xb84a('0x118')][_0xb84a('0x2a')],'agent':_0x116c26['Owner']?_0x116c26['Owner'][_0xb84a('0x33')]:_0xb84a('0x11b'),'createdAt':moment(_0x116c26[_0xb84a('0x7d')])[_0xb84a('0xe7')](_0xb84a('0x11c'))[_0xb84a('0x9f')](),'closedAt':_0x116c26[_0xb84a('0x3e')]?moment(_0x116c26['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x116c26['disposition'],'chatInfo':{'browser':_0x116c26[_0xb84a('0x11d')],'os':_0x116c26[_0xb84a('0x11e')],'referer':_0x116c26[_0xb84a('0x11f')],'customerIp':_0x116c26[_0xb84a('0x120')],'customerPort':_0x116c26[_0xb84a('0x121')]?_0x116c26[_0xb84a('0x121')]:_0xb84a('0x11b')},'messages':_(_0x116c26['Messages'])[_0xb84a('0x122')]()[_0xb84a('0x88')]({'secret':![]})['map'](function(_0x96516b){if(_0x96516b[_0xb84a('0xdb')]){var _0x498154=path[_0xb84a('0xe0')](_0x4804b2,_0x96516b['Attachment']['basename']);if(fs[_0xb84a('0x123')](_0x498154)){fs[_0xb84a('0x124')](_0x498154)[_0xb84a('0x125')](fs[_0xb84a('0x126')](path['join'](_0x1c5830,_0x96516b['Attachment'][_0xb84a('0x127')])));}}return{'date':moment(_0x96516b[_0xb84a('0x7d')])[_0xb84a('0xe7')](_0xb84a('0x11c'))['toString'](),'sender':_0x96516b['direction']===_0xb84a('0xcc')?_0x96516b['User']?_0x96516b[_0xb84a('0x76')][_0xb84a('0x33')]:'System':_0x96516b[_0xb84a('0x69')][_0xb84a('0x114')]+(_0x96516b[_0xb84a('0x69')][_0xb84a('0x115')]?'\x20'+_0x96516b[_0xb84a('0x69')][_0xb84a('0x115')]:''),'body':_0x96516b['Attachment']?_0x96516b['Attachment'][_0xb84a('0x127')]:_0x96516b[_0xb84a('0x2e')],'direction':_0x96516b[_0xb84a('0x117')]==='out'?'A':'C','secret':_0x96516b[_0xb84a('0xf7')],'read':_0x96516b[_0xb84a('0x83')],'attachment':_0x96516b[_0xb84a('0xdb')]};})[_0xb84a('0x6c')]()};return ejs[_0xb84a('0x128')](path[_0xb84a('0xe0')](config[_0xb84a('0xe1')],_0xb84a('0x110'),_0xb84a('0x129'),_0xb84a('0x12a')),{'interaction':_0x183afe})[_0xb84a('0x14')](function(_0x369d0c){var _0x18240c=path['join'](_0x1c5830,_0xb84a('0x12b')+_0x116c26['id']+'-'+_0x5001d0+_0xb84a('0x12c'));var _0x5a6746={'path':_0x18240c,'channel':_0xb84a('0x11a'),'interactionId':_0x116c26['id']};return pdf[_0xb84a('0x12d')](_0x369d0c,_0x5a6746);})[_0xb84a('0x14')](function(){return new Promise(function(_0x5a8291,_0x35bd68){zipdir(_0x1c5830,{'saveTo':_0x32b28c},function(_0x23b08c,_0x5e5d36){if(_0x23b08c)return _0x35bd68(_0x23b08c);return _0x5a8291(_0x5e5d36);});})[_0xb84a('0x14')](function(){return new BPromise(function(_0x1a270a,_0xac56c8){rimraf(_0x1c5830,function(_0x28d6a3){if(_0x28d6a3)_0xac56c8(_0x28d6a3);return _0x1a270a();});});})['then'](function(){return _0x15b2d7[_0xb84a('0xe4')](_0x32b28c,_0x5e9af0,function(_0x1b7012){if(_0x1b7012){logger[_0xb84a('0x1a')](_0xb84a('0x12e'),_0x1b7012);}else{fs['unlinkSync'](_0x32b28c);}});});});}else{return _0x15b2d7['sendStatus'](0xc8);}})[_0xb84a('0x38')](handleError(_0x15b2d7,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 90d47b8..d269607 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 _0x20a4=['then','setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x20a4,0x1aa));var _0x420a=function(_0x3eb3ad,_0x2b3c21){_0x3eb3ad=_0x3eb3ad-0x0;var _0x1be5b8=_0x20a4[_0x3eb3ad];return _0x1be5b8;};'use strict';var EventEmitter=require(_0x420a('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x420a('0x1')];var ChatMessage=require(_0x420a('0x2'))['db'][_0x420a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x420a('0x4')](0x0);var events={'afterCreate':_0x420a('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x184a8){return function(_0x422156,_0x21f4d8,_0x284b8f){_0x422156['getUsers']({'attributes':['id'],'raw':!![]})[_0x420a('0x6')](function(_0x4ce72b){_0x422156[_0x420a('0x7')](_0x420a('0x8'),_0x4ce72b[_0x420a('0x9')](function(_0x50f8f8){return{'id':_0x50f8f8['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x422156['id'],'direction':'in','read':![]},'raw':!![]});})[_0x420a('0x6')](function(_0x2a0d2a){_0x422156[_0x420a('0x7')](_0x420a('0xa'),_0x2a0d2a['length']);ChatInteractionEvents[_0x420a('0xb')](_0x184a8+':'+_0x422156['id'],_0x422156);ChatInteractionEvents[_0x420a('0xb')](_0x184a8,_0x422156);_0x284b8f(null);})[_0x420a('0xc')](_0x284b8f(null));};}for(var e in events){if(events[_0x420a('0xd')](e)){var event=events[e];ChatInteraction[_0x420a('0xe')](e,emitEvent(event));}}module[_0x420a('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xce76=['getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x167559,_0x59cbf4){var _0x47c304=function(_0x31d2f9){while(--_0x31d2f9){_0x167559['push'](_0x167559['shift']());}};_0x47c304(++_0x59cbf4);}(_0xce76,0x13c));var _0x6ce7=function(_0x40ae75,_0x384849){_0x40ae75=_0x40ae75-0x0;var _0x1c20bf=_0xce76[_0x40ae75];return _0x1c20bf;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x6ce7('0x0'))['db'][_0x6ce7('0x1')];var ChatMessage=require(_0x6ce7('0x0'))['db'][_0x6ce7('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6ce7('0x3')](0x0);var events={'afterCreate':_0x6ce7('0x4'),'afterUpdate':_0x6ce7('0x5'),'afterDestroy':_0x6ce7('0x6')};function emitEvent(_0x44bf7c){return function(_0x3d5384,_0x1d8625,_0x507a71){_0x3d5384[_0x6ce7('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xae67f1){_0x3d5384[_0x6ce7('0x8')](_0x6ce7('0x9'),_0xae67f1[_0x6ce7('0xa')](function(_0x3b4faf){return{'id':_0x3b4faf['id']};}));return ChatMessage[_0x6ce7('0xb')]({'where':{'ChatInteractionId':_0x3d5384['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6ce7('0xc')](function(_0x1436da){_0x3d5384[_0x6ce7('0x8')](_0x6ce7('0xd'),_0x1436da['length']);ChatInteractionEvents['emit'](_0x44bf7c+':'+_0x3d5384['id'],_0x3d5384);ChatInteractionEvents[_0x6ce7('0xe')](_0x44bf7c,_0x3d5384);_0x507a71(null);})[_0x6ce7('0xf')](_0x507a71(null));};}for(var e in events){if(events[_0x6ce7('0x10')](e)){var event=events[e];ChatInteraction[_0x6ce7('0x11')](e,emitEvent(event));}}module[_0x6ce7('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index fcf2986..93b30a5 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 _0x5633=['./chatInteraction.attributes','exports','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x313606,_0x141679){var _0x4e2617=function(_0x341f24){while(--_0x341f24){_0x313606['push'](_0x313606['shift']());}};_0x4e2617(++_0x141679);}(_0x5633,0x1aa));var _0x3563=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x5633[_0x2f3848];return _0x102668;};'use strict';var _=require('lodash');var util=require(_0x3563('0x0'));var logger=require(_0x3563('0x1'))(_0x3563('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3563('0x3'));var fs=require('fs');var path=require(_0x3563('0x4'));var rimraf=require(_0x3563('0x5'));var config=require('../../config/environment');var attributes=require(_0x3563('0x6'));module[_0x3563('0x7')]=function(_0xed0609,_0x1e81a9){return _0xed0609['define'](_0x3563('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x403780,_0xbd976f,_0x182839){if(_0x403780[_0x3563('0x9')](_0x3563('0xa'))){_0x403780[_0x3563('0xb')]=moment()[_0x3563('0xc')](_0x3563('0xd'));}_0x182839(null,_0x403780);}},'charset':_0x3563('0xe'),'collate':_0x3563('0xf')});};
\ No newline at end of file
+var _0x0ef0=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0xd17774,_0x516f9c){var _0x231974=function(_0x259e76){while(--_0x259e76){_0xd17774['push'](_0xd17774['shift']());}};_0x231974(++_0x516f9c);}(_0x0ef0,0x162));var _0x00ef=function(_0x300e9e,_0xcbfa6b){_0x300e9e=_0x300e9e-0x0;var _0x53c501=_0x0ef0[_0x300e9e];return _0x53c501;};'use strict';var _=require('lodash');var util=require(_0x00ef('0x0'));var logger=require('../../config/logger')(_0x00ef('0x1'));var moment=require(_0x00ef('0x2'));var BPromise=require(_0x00ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x00ef('0x4'));var rimraf=require(_0x00ef('0x5'));var config=require('../../config/environment');var attributes=require(_0x00ef('0x6'));module[_0x00ef('0x7')]=function(_0x4d9a51,_0x5aa4ea){return _0x4d9a51[_0x00ef('0x8')](_0x00ef('0x9'),attributes,{'tableName':_0x00ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd2c318,_0x3d74e3,_0x2fd3b0){if(_0xd2c318[_0x00ef('0xb')](_0x00ef('0xc'))){_0xd2c318[_0x00ef('0xd')]=moment()['format'](_0x00ef('0xe'));}_0x2fd3b0(null,_0xd2c318);}},'charset':'utf8mb4','collate':_0x00ef('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index cb369da..dadb314 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 _0x4c9b=['message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','options','where','attributes','limit','then','AddTagsToChatInteraction','addTags','ids','body','spread','AddTags','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xfd5f37,_0x24a79c){var _0x11bd01=function(_0x4ae9bd){while(--_0x4ae9bd){_0xfd5f37['push'](_0xfd5f37['shift']());}};_0x11bd01(++_0x24a79c);}(_0x4c9b,0x13f));var _0xb4c9=function(_0x381f6c,_0x1a05af){_0x381f6c=_0x381f6c-0x0;var _0x4e5295=_0x4c9b[_0x381f6c];return _0x4e5295;};'use strict';var _=require(_0xb4c9('0x0'));var util=require(_0xb4c9('0x1'));var moment=require(_0xb4c9('0x2'));var BPromise=require(_0xb4c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb4c9('0x4'));var logger=require(_0xb4c9('0x5'))(_0xb4c9('0x6'));var config=require(_0xb4c9('0x7'));var jayson=require(_0xb4c9('0x8'));var client=jayson[_0xb4c9('0x9')][_0xb4c9('0xa')]({'port':0x232a});config[_0xb4c9('0xb')]=_[_0xb4c9('0xc')](config['redis'],{'host':_0xb4c9('0xd'),'port':0x18eb});var socket=require(_0xb4c9('0xe'))(new Redis(config[_0xb4c9('0xb')]));require(_0xb4c9('0xf'))[_0xb4c9('0x10')](socket);function respondWithRpcPromise(_0x367061,_0x48607f,_0x6e5f2a){return new BPromise(function(_0x4eee5b,_0x34de9f){return client[_0xb4c9('0x11')](_0x367061,_0x6e5f2a)['then'](function(_0x459838){logger['info'](_0xb4c9('0x12'),_0x48607f,_0xb4c9('0x13'));logger[_0xb4c9('0x14')](_0xb4c9('0x15'),_0x48607f,_0xb4c9('0x13'),JSON[_0xb4c9('0x16')](_0x459838));if(_0x459838[_0xb4c9('0x17')]){if(_0x459838[_0xb4c9('0x17')][_0xb4c9('0x18')]===0x1f4){logger[_0xb4c9('0x17')](_0xb4c9('0x12'),_0x48607f,_0x459838[_0xb4c9('0x17')][_0xb4c9('0x19')]);return _0x34de9f(_0x459838[_0xb4c9('0x17')][_0xb4c9('0x19')]);}logger[_0xb4c9('0x17')](_0xb4c9('0x12'),_0x48607f,_0x459838[_0xb4c9('0x17')][_0xb4c9('0x19')]);return _0x4eee5b(_0x459838[_0xb4c9('0x17')]['message']);}else{logger[_0xb4c9('0x1a')](_0xb4c9('0x12'),_0x48607f,_0xb4c9('0x13'));_0x4eee5b(_0x459838[_0xb4c9('0x1b')][_0xb4c9('0x19')]);}})[_0xb4c9('0x1c')](function(_0x4f7130){logger[_0xb4c9('0x17')](_0xb4c9('0x12'),_0x48607f,_0x4f7130);_0x34de9f(_0x4f7130);});});}exports[_0xb4c9('0x1d')]=function(_0x4cd906){var _0x52eaa7=this;return new Promise(function(_0x480964,_0x2e237a){return db[_0xb4c9('0x1e')][_0xb4c9('0x1f')](_0x4cd906['body'],{'raw':_0x4cd906['options']?_0x4cd906[_0xb4c9('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cd906[_0xb4c9('0x20')]?_0x4cd906[_0xb4c9('0x20')][_0xb4c9('0x21')]||null:null,'attributes':_0x4cd906['options']?_0x4cd906['options'][_0xb4c9('0x22')]||null:null,'limit':_0x4cd906[_0xb4c9('0x20')]?_0x4cd906['options'][_0xb4c9('0x23')]||null:null})[_0xb4c9('0x24')](function(_0x3393d5){logger[_0xb4c9('0x1a')](_0xb4c9('0x1d'),_0x4cd906);logger[_0xb4c9('0x14')](_0xb4c9('0x1d'),_0x4cd906,JSON[_0xb4c9('0x16')](_0x3393d5));_0x480964(_0x3393d5);})['catch'](function(_0x320493){logger['error'](_0xb4c9('0x1d'),_0x320493[_0xb4c9('0x19')],_0x4cd906);_0x2e237a(_0x52eaa7['error'](0x1f4,_0x320493[_0xb4c9('0x19')]));});});};exports[_0xb4c9('0x25')]=function(_0x59625f){return new Promise(function(_0x596fc0,_0xc7dff){return db[_0xb4c9('0x1e')]['find']({'where':_0x59625f[_0xb4c9('0x20')]?_0x59625f[_0xb4c9('0x20')][_0xb4c9('0x21')]||null:null})['then'](function(_0x20cd38){if(_0x20cd38){return _0x20cd38[_0xb4c9('0x26')](_0x59625f['body'][_0xb4c9('0x27')],_['omit'](_0x59625f[_0xb4c9('0x28')],[_0xb4c9('0x27'),'id'])||{});}})[_0xb4c9('0x29')](function(_0x4b9c10){logger[_0xb4c9('0x1a')](_0xb4c9('0x2a'),_0x59625f);logger[_0xb4c9('0x14')](_0xb4c9('0x2a'),_0x59625f,JSON['stringify'](_0x4b9c10));_0x596fc0(_0x4b9c10);})['catch'](function(_0x449cca){logger['error'](_0xb4c9('0x2a'),_0x449cca['message'],_0x59625f);_0xc7dff(_this[_0xb4c9('0x17')](0x1f4,_0x449cca[_0xb4c9('0x19')]));});});};
\ No newline at end of file
+var _0xc943=['http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','attributes','limit','info','stringify','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0x255467,_0x2f65c1){var _0x4ff14b=function(_0x403aa3){while(--_0x403aa3){_0x255467['push'](_0x255467['shift']());}};_0x4ff14b(++_0x2f65c1);}(_0xc943,0x191));var _0x3c94=function(_0x47f719,_0x2e559d){_0x47f719=_0x47f719-0x0;var _0x407f4e=_0xc943[_0x47f719];return _0x407f4e;};'use strict';var _=require(_0x3c94('0x0'));var util=require(_0x3c94('0x1'));var moment=require(_0x3c94('0x2'));var BPromise=require(_0x3c94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c94('0x4'));var db=require(_0x3c94('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3c94('0x6'));var jayson=require(_0x3c94('0x7'));var client=jayson[_0x3c94('0x8')][_0x3c94('0x9')]({'port':0x232a});config[_0x3c94('0xa')]=_[_0x3c94('0xb')](config[_0x3c94('0xa')],{'host':_0x3c94('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c94('0xa')]));require(_0x3c94('0xd'))[_0x3c94('0xe')](socket);function respondWithRpcPromise(_0x46a29a,_0x586243,_0x2bab04){return new BPromise(function(_0x5d7b2b,_0x29861a){return client[_0x3c94('0xf')](_0x46a29a,_0x2bab04)[_0x3c94('0x10')](function(_0x3276ba){logger['info'](_0x3c94('0x11'),_0x586243,_0x3c94('0x12'));logger[_0x3c94('0x13')](_0x3c94('0x14'),_0x586243,_0x3c94('0x12'),JSON['stringify'](_0x3276ba));if(_0x3276ba[_0x3c94('0x15')]){if(_0x3276ba['error'][_0x3c94('0x16')]===0x1f4){logger[_0x3c94('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x586243,_0x3276ba[_0x3c94('0x15')][_0x3c94('0x17')]);return _0x29861a(_0x3276ba['error'][_0x3c94('0x17')]);}logger[_0x3c94('0x15')](_0x3c94('0x11'),_0x586243,_0x3276ba['error'][_0x3c94('0x17')]);return _0x5d7b2b(_0x3276ba[_0x3c94('0x15')]['message']);}else{logger['info'](_0x3c94('0x11'),_0x586243,_0x3c94('0x12'));_0x5d7b2b(_0x3276ba[_0x3c94('0x18')][_0x3c94('0x17')]);}})[_0x3c94('0x19')](function(_0x24a83e){logger['error'](_0x3c94('0x11'),_0x586243,_0x24a83e);_0x29861a(_0x24a83e);});});}exports[_0x3c94('0x1a')]=function(_0x4c31e8){var _0x2c002a=this;return new Promise(function(_0xf719cd,_0x2365cc){return db[_0x3c94('0x1b')][_0x3c94('0x1c')](_0x4c31e8['body'],{'raw':_0x4c31e8[_0x3c94('0x1d')]?_0x4c31e8[_0x3c94('0x1d')][_0x3c94('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c31e8[_0x3c94('0x1d')]?_0x4c31e8[_0x3c94('0x1d')]['where']||null:null,'attributes':_0x4c31e8['options']?_0x4c31e8['options'][_0x3c94('0x1f')]||null:null,'limit':_0x4c31e8['options']?_0x4c31e8['options'][_0x3c94('0x20')]||null:null})[_0x3c94('0x10')](function(_0x50a2a1){logger[_0x3c94('0x21')](_0x3c94('0x1a'),_0x4c31e8);logger[_0x3c94('0x13')]('UpdateChatInteraction',_0x4c31e8,JSON[_0x3c94('0x22')](_0x50a2a1));_0xf719cd(_0x50a2a1);})[_0x3c94('0x19')](function(_0x58f579){logger['error'](_0x3c94('0x1a'),_0x58f579['message'],_0x4c31e8);_0x2365cc(_0x2c002a['error'](0x1f4,_0x58f579[_0x3c94('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0xce15f6){return new Promise(function(_0x5dce88,_0x39f0d9){return db[_0x3c94('0x1b')]['find']({'where':_0xce15f6[_0x3c94('0x1d')]?_0xce15f6['options'][_0x3c94('0x23')]||null:null})['then'](function(_0x330e87){if(_0x330e87){return _0x330e87[_0x3c94('0x24')](_0xce15f6['body'][_0x3c94('0x25')],_[_0x3c94('0x26')](_0xce15f6['body'],[_0x3c94('0x25'),'id'])||{});}})[_0x3c94('0x27')](function(_0x52ffe1){logger[_0x3c94('0x21')](_0x3c94('0x28'),_0xce15f6);logger[_0x3c94('0x13')](_0x3c94('0x28'),_0xce15f6,JSON[_0x3c94('0x22')](_0x52ffe1));_0x5dce88(_0x52ffe1);})[_0x3c94('0x19')](function(_0x1784b3){logger['error'](_0x3c94('0x28'),_0x1784b3[_0x3c94('0x17')],_0xce15f6);_0x39f0d9(_this[_0x3c94('0x15')](0x1f4,_0x1784b3['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index b749a3f..8ca4c59 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 _0x17aa=['remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x4d164,_0x3e017){var _0x255655=function(_0x1d1fe1){while(--_0x1d1fe1){_0x4d164['push'](_0x4d164['shift']());}};_0x255655(++_0x3e017);}(_0x17aa,0x1b9));var _0xa17a=function(_0x2b9c40,_0xc887fe){_0x2b9c40=_0x2b9c40-0x0;var _0x520731=_0x17aa[_0x2b9c40];return _0x520731;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xa17a('0x0'),_0xa17a('0x1')];function createListener(_0x47e0c5,_0x5ac595){return function(_0x199d48){_0x5ac595[_0xa17a('0x2')](_0x47e0c5,_0x199d48);};}function removeListener(_0x2b8517,_0x15ba36){return function(){ChatInteractionEvents[_0xa17a('0x3')](_0x2b8517,_0x15ba36);};}exports[_0xa17a('0x4')]=function(_0x56d1a7){for(var _0x118006=0x0,_0x22092b=events[_0xa17a('0x5')];_0x118006<_0x22092b;_0x118006++){var _0x3dc2ba=events[_0x118006];var _0xfb6316=createListener(_0xa17a('0x6')+_0x3dc2ba,_0x56d1a7);ChatInteractionEvents['on'](_0x3dc2ba,_0xfb6316);}};
\ No newline at end of file
+var _0x6b60=['length','chatInteraction:','save','update','emit','removeListener','register'];(function(_0x353e9e,_0x1fe835){var _0x5cc8a0=function(_0x278277){while(--_0x278277){_0x353e9e['push'](_0x353e9e['shift']());}};_0x5cc8a0(++_0x1fe835);}(_0x6b60,0xe9));var _0x06b6=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0x6b60[_0x186d17];return _0x5d4b89;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x06b6('0x0'),'remove',_0x06b6('0x1')];function createListener(_0x40cbf0,_0xb431e1){return function(_0x12188e){_0xb431e1[_0x06b6('0x2')](_0x40cbf0,_0x12188e);};}function removeListener(_0x200a08,_0x66570d){return function(){ChatInteractionEvents[_0x06b6('0x3')](_0x200a08,_0x66570d);};}exports[_0x06b6('0x4')]=function(_0x44bbe4){for(var _0x44ba36=0x0,_0x157746=events[_0x06b6('0x5')];_0x44ba36<_0x157746;_0x44ba36++){var _0x396a81=events[_0x44ba36];var _0x49d5ab=createListener(_0x06b6('0x6')+_0x396a81,_0x44bbe4);ChatInteractionEvents['on'](_0x396a81,_0x49d5ab);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index def9f38..f6014ea 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 _0xe738=['tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','%s-%s','now','replace','/:id/attachment_upload','file','attachmentUpload'];(function(_0x592af0,_0x6c7240){var _0x24ead5=function(_0x468ea0){while(--_0x468ea0){_0x592af0['push'](_0x592af0['shift']());}};_0x24ead5(++_0x6c7240);}(_0xe738,0x76));var _0x8e73=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xe738[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require(_0x8e73('0x0'));var util=require(_0x8e73('0x1'));var path=require(_0x8e73('0x2'));var timeout=require(_0x8e73('0x3'));var express=require(_0x8e73('0x4'));var router=express['Router']();var fs_extra=require(_0x8e73('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8e73('0x6'));var config=require(_0x8e73('0x7'));var controller=require(_0x8e73('0x8'));router[_0x8e73('0x9')]('/',auth[_0x8e73('0xa')](),controller['index']);router['get'](_0x8e73('0xb'),auth['isAuthenticated'](),controller[_0x8e73('0xc')]);router[_0x8e73('0x9')](_0x8e73('0xd'),auth[_0x8e73('0xe')](),controller['show']);router[_0x8e73('0x9')](_0x8e73('0xf'),auth[_0x8e73('0xe')](),controller[_0x8e73('0x10')]);router[_0x8e73('0x9')](_0x8e73('0x11'),auth[_0x8e73('0xa')](),controller[_0x8e73('0x12')]);router[_0x8e73('0x9')]('/:id/my_messages',auth[_0x8e73('0xe')](),controller[_0x8e73('0x13')]);router[_0x8e73('0x9')](_0x8e73('0x14'),auth[_0x8e73('0xa')](),controller['download']);router[_0x8e73('0x15')]('/',auth[_0x8e73('0xa')](),controller[_0x8e73('0x16')]);router['post'](_0x8e73('0x17'),auth[_0x8e73('0xa')](),controller[_0x8e73('0x18')]);var upload=multer({'storage':multer[_0x8e73('0x19')]({'destination':function(_0x80da98,_0x25fac7,_0x304bb2){_0x304bb2(null,path[_0x8e73('0x1a')](config[_0x8e73('0x1b')],'server/files/attachments/'));},'filename':function(_0x391227,_0x1605de,_0x458693){_0x458693(null,util[_0x8e73('0x1c')](_0x8e73('0x1d'),Date[_0x8e73('0x1e')](),_0x1605de['originalname'][_0x8e73('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x8e73('0x20'),upload['single'](_0x8e73('0x21')),controller[_0x8e73('0x22')]);router['post'](_0x8e73('0x11'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x8e73('0x15')]('/:id/tags',auth[_0x8e73('0xa')](),interaction[_0x8e73('0x23')](_0x8e73('0x24'),_0x8e73('0x25')),controller[_0x8e73('0x26')]);router[_0x8e73('0x27')](_0x8e73('0xd'),auth['isAuthenticated'](),interaction[_0x8e73('0x23')]('chat',_0x8e73('0x28')),controller['update']);router[_0x8e73('0x27')](_0x8e73('0x29'),controller[_0x8e73('0x2a')]);router[_0x8e73('0x27')](_0x8e73('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x8e73('0x2c')]);router[_0x8e73('0x27')]('/:id/close',controller[_0x8e73('0x2d')]);router[_0x8e73('0x2e')](_0x8e73('0xd'),auth['isAuthenticated'](),interaction[_0x8e73('0x23')](_0x8e73('0x24'),'chatinteraction:destroy'),controller[_0x8e73('0x2f')]);router['delete'](_0x8e73('0x30'),auth[_0x8e73('0xa')](),controller[_0x8e73('0x31')]);module[_0x8e73('0x32')]=router;
\ No newline at end of file
+var _0x9e5e=['removeTags','exports','util','path','express','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','/:id/custom_update','customUpdate','put','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','/:id/tags'];(function(_0x4df7be,_0x174cea){var _0x3c15a4=function(_0x2ef364){while(--_0x2ef364){_0x4df7be['push'](_0x4df7be['shift']());}};_0x3c15a4(++_0x174cea);}(_0x9e5e,0x19a));var _0xe9e5=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x9e5e[_0x2db12b];return _0x20990b;};'use strict';var multer=require('multer');var util=require(_0xe9e5('0x0'));var path=require(_0xe9e5('0x1'));var timeout=require('connect-timeout');var express=require(_0xe9e5('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe9e5('0x3'));var controller=require(_0xe9e5('0x4'));router[_0xe9e5('0x5')]('/',auth[_0xe9e5('0x6')](),controller['index']);router[_0xe9e5('0x5')](_0xe9e5('0x7'),auth[_0xe9e5('0x6')](),controller[_0xe9e5('0x8')]);router[_0xe9e5('0x5')](_0xe9e5('0x9'),auth[_0xe9e5('0xa')](),controller[_0xe9e5('0xb')]);router[_0xe9e5('0x5')](_0xe9e5('0xc'),auth[_0xe9e5('0xa')](),controller[_0xe9e5('0xd')]);router[_0xe9e5('0x5')](_0xe9e5('0xe'),auth[_0xe9e5('0x6')](),controller[_0xe9e5('0xf')]);router[_0xe9e5('0x5')](_0xe9e5('0x10'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xe9e5('0x5')](_0xe9e5('0x11'),auth[_0xe9e5('0x6')](),controller[_0xe9e5('0x12')]);router[_0xe9e5('0x13')]('/',auth[_0xe9e5('0x6')](),controller[_0xe9e5('0x14')]);router[_0xe9e5('0x13')]('/:id/vidaoo',auth[_0xe9e5('0x6')](),controller[_0xe9e5('0x15')]);var upload=multer({'storage':multer[_0xe9e5('0x16')]({'destination':function(_0x4b2ce0,_0x4aa2dd,_0x5d8841){_0x5d8841(null,path[_0xe9e5('0x17')](config['root'],'server/files/attachments/'));},'filename':function(_0x2df8f0,_0x395a75,_0x1997cf){_0x1997cf(null,util[_0xe9e5('0x18')](_0xe9e5('0x19'),Date[_0xe9e5('0x1a')](),_0x395a75[_0xe9e5('0x1b')][_0xe9e5('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe9e5('0x13')](_0xe9e5('0x1d'),upload['single'](_0xe9e5('0x1e')),controller[_0xe9e5('0x1f')]);router['post'](_0xe9e5('0xe'),auth[_0xe9e5('0xa')](),controller[_0xe9e5('0x20')]);router[_0xe9e5('0x13')]('/:id/tags',auth[_0xe9e5('0x6')](),interaction[_0xe9e5('0x21')](_0xe9e5('0x22'),_0xe9e5('0x23')),controller[_0xe9e5('0x24')]);router['put'](_0xe9e5('0x9'),auth['isAuthenticated'](),interaction[_0xe9e5('0x21')](_0xe9e5('0x22'),_0xe9e5('0x25')),controller[_0xe9e5('0x26')]);router['put'](_0xe9e5('0x27'),controller[_0xe9e5('0x28')]);router[_0xe9e5('0x29')](_0xe9e5('0x2a'),auth[_0xe9e5('0xa')](),controller[_0xe9e5('0x2b')]);router[_0xe9e5('0x29')](_0xe9e5('0x2c'),controller[_0xe9e5('0x2d')]);router[_0xe9e5('0x2e')]('/:id',auth[_0xe9e5('0x6')](),interaction[_0xe9e5('0x21')](_0xe9e5('0x22'),_0xe9e5('0x2f')),controller['destroy']);router[_0xe9e5('0x2e')](_0xe9e5('0x30'),auth['isAuthenticated'](),controller[_0xe9e5('0x31')]);module[_0xe9e5('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index f46ec2f..1f57efa 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 _0xae7e=['medium','BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xae7e,0x148));var _0xeae7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xae7e[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xeae7('0x0'));module['exports']={'body':{'type':Sequelize[_0xeae7('0x1')](_0xeae7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xeae7('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xeae7('0x4')]}};
\ No newline at end of file
+var _0x547a=['medium'];(function(_0x2f0501,_0x314c46){var _0x5acd0f=function(_0x39e38b){while(--_0x39e38b){_0x2f0501['push'](_0x2f0501['shift']());}};_0x5acd0f(++_0x314c46);}(_0x547a,0xfd));var _0xa547=function(_0x41edab,_0x255da0){_0x41edab=_0x41edab-0x0;var _0x48df17=_0x547a[_0x41edab];return _0x48df17;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xa547('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'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 6ecee8d..563ad3f 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 _0x0f6d=['error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','admin','user','role','userpic','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','findAll','isEmpty','agent','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus'];(function(_0x97b5b6,_0xc590cd){var _0x17a16c=function(_0x1aae0f){while(--_0x1aae0f){_0x97b5b6['push'](_0x97b5b6['shift']());}};_0x17a16c(++_0xc590cd);}(_0x0f6d,0x1a5));var _0xd0f6=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x0f6d[_0x282a1f];return _0x296ea7;};'use strict';var emlformat=require(_0xd0f6('0x0'));var rimraf=require(_0xd0f6('0x1'));var zipdir=require(_0xd0f6('0x2'));var jsonpatch=require(_0xd0f6('0x3'));var rp=require(_0xd0f6('0x4'));var moment=require(_0xd0f6('0x5'));var BPromise=require(_0xd0f6('0x6'));var Mustache=require(_0xd0f6('0x7'));var util=require(_0xd0f6('0x8'));var path=require(_0xd0f6('0x9'));var sox=require(_0xd0f6('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd0f6('0xb'));var _=require(_0xd0f6('0xc'));var squel=require('squel');var crypto=require(_0xd0f6('0xd'));var jsforce=require(_0xd0f6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd0f6('0xf'));var querystring=require(_0xd0f6('0x10'));var Papa=require(_0xd0f6('0x11'));var Redis=require(_0xd0f6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd0f6('0x13'));var as=require(_0xd0f6('0x14'));var hardwareService=require(_0xd0f6('0x15'));var logger=require(_0xd0f6('0x16'))(_0xd0f6('0x17'));var utils=require(_0xd0f6('0x18'));var config=require(_0xd0f6('0x19'));var licenseUtil=require(_0xd0f6('0x1a'));var db=require(_0xd0f6('0x1b'))['db'];config['redis']=_[_0xd0f6('0x1c')](config[_0xd0f6('0x1d')],{'host':_0xd0f6('0x1e'),'port':0x18eb});var socket=require(_0xd0f6('0x1f'))(new Redis(config[_0xd0f6('0x1d')]));require(_0xd0f6('0x20'))['register'](socket);function respondWithStatusCode(_0x5a6a4e,_0x6444b8){_0x6444b8=_0x6444b8||0xcc;return function(_0x4a51a5){if(_0x4a51a5){return _0x5a6a4e['sendStatus'](_0x6444b8);}return _0x5a6a4e['status'](_0x6444b8)[_0xd0f6('0x21')]();};}function respondWithResult(_0x3181ae,_0x4672f8){_0x4672f8=_0x4672f8||0xc8;return function(_0x482d20){if(_0x482d20){return _0x3181ae[_0xd0f6('0x22')](_0x4672f8)[_0xd0f6('0x23')](_0x482d20);}};}function respondWithFilteredResult(_0x245013,_0x15a33a){return function(_0x5f32a5){if(_0x5f32a5){var _0x1780fc=typeof _0x15a33a[_0xd0f6('0x24')]===_0xd0f6('0x25')&&typeof _0x15a33a[_0xd0f6('0x26')]===_0xd0f6('0x25');var _0x59350d=_0x5f32a5[_0xd0f6('0x27')];var _0x567c68=_0x1780fc?0x0:_0x15a33a['offset'];var _0xdc094c=_0x1780fc?_0x5f32a5[_0xd0f6('0x27')]:_0x15a33a['offset']+_0x15a33a[_0xd0f6('0x26')];var _0x5c7a6d;if(_0xdc094c>=_0x59350d){_0xdc094c=_0x59350d;_0x5c7a6d=0xc8;}else{_0x5c7a6d=0xce;}_0x245013['status'](_0x5c7a6d);return _0x245013[_0xd0f6('0x28')]('Content-Range',_0x567c68+'-'+_0xdc094c+'/'+_0x59350d)[_0xd0f6('0x23')](_0x5f32a5);}return null;};}function patchUpdates(_0x80b645){return function(_0x1b51f1){try{jsonpatch['apply'](_0x1b51f1,_0x80b645,!![]);}catch(_0x571494){return BPromise[_0xd0f6('0x29')](_0x571494);}return _0x1b51f1[_0xd0f6('0x2a')]();};}function saveUpdates(_0x27a414,_0x1a3666){return function(_0x2a1b5c){if(_0x2a1b5c){return _0x2a1b5c[_0xd0f6('0x2b')](_0x27a414)[_0xd0f6('0x2c')](function(_0x23bfe4){return _0x23bfe4;});}return null;};}function removeEntity(_0x2a0cb5,_0xaadd39){return function(_0x4d810c){if(_0x4d810c){return _0x4d810c[_0xd0f6('0x2d')]()[_0xd0f6('0x2c')](function(){_0x2a0cb5[_0xd0f6('0x22')](0xcc)[_0xd0f6('0x21')]();});}};}function handleEntityNotFound(_0x1c1f53,_0x3746cc){return function(_0x303bbf){if(!_0x303bbf){_0x1c1f53[_0xd0f6('0x2e')](0x194);}return _0x303bbf;};}function handleError(_0x5bc46c,_0x3ab41f){_0x3ab41f=_0x3ab41f||0x1f4;return function(_0x5ed450){logger[_0xd0f6('0x2f')](_0x5ed450[_0xd0f6('0x30')]);if(_0x5ed450[_0xd0f6('0x31')]){delete _0x5ed450[_0xd0f6('0x31')];}_0x5bc46c[_0xd0f6('0x22')](_0x3ab41f)[_0xd0f6('0x32')](_0x5ed450);};}exports[_0xd0f6('0x33')]=function(_0x368b5c,_0x83015a){var _0x425f8b={},_0x46e100={},_0x35fd5b={'count':0x0,'rows':[]};var _0x504c62=_['map'](db[_0xd0f6('0x34')][_0xd0f6('0x35')],function(_0xd90a32){return{'name':_0xd90a32[_0xd0f6('0x36')],'type':_0xd90a32['type'][_0xd0f6('0x37')]};});_0x46e100[_0xd0f6('0x38')]=_[_0xd0f6('0x39')](_0x504c62,'name');_0x46e100[_0xd0f6('0x3a')]=_[_0xd0f6('0x3b')](_0x368b5c[_0xd0f6('0x3a')]);_0x46e100['filters']=_['intersection'](_0x46e100['model'],_0x46e100[_0xd0f6('0x3a')]);_0x425f8b[_0xd0f6('0x3c')]=_[_0xd0f6('0x3d')](_0x46e100[_0xd0f6('0x38')],qs[_0xd0f6('0x3e')](_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x3e')]));_0x425f8b['attributes']=_0x425f8b['attributes'][_0xd0f6('0x3f')]?_0x425f8b[_0xd0f6('0x3c')]:_0x46e100[_0xd0f6('0x38')];if(!_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x40')](_0xd0f6('0x41'))){_0x425f8b[_0xd0f6('0x26')]=qs[_0xd0f6('0x26')](_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x26')]);_0x425f8b[_0xd0f6('0x24')]=qs[_0xd0f6('0x24')](_0x368b5c[_0xd0f6('0x3a')]['offset']);}_0x425f8b[_0xd0f6('0x42')]=qs[_0xd0f6('0x43')](_0x368b5c['query']['sort']);_0x425f8b['where']=qs[_0xd0f6('0x44')](_[_0xd0f6('0x45')](_0x368b5c[_0xd0f6('0x3a')],_0x46e100[_0xd0f6('0x44')]),_0x504c62);if(_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x46')]){_0x425f8b[_0xd0f6('0x47')]=_[_0xd0f6('0x48')](_0x425f8b['where'],{'$or':_['map'](_0x504c62,function(_0x37500d){if(_0x37500d['type']!=='VIRTUAL'){var _0x3015d4={};_0x3015d4[_0x37500d['name']]={'$like':'%'+_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x46')]+'%'};return _0x3015d4;}})});}_0x425f8b=_[_0xd0f6('0x48')]({},_0x425f8b,_0x368b5c['options']);var _0x12c64e={'where':_0x425f8b['where']};return db[_0xd0f6('0x34')][_0xd0f6('0x27')](_0x12c64e)['then'](function(_0x35c1ff){_0x35fd5b[_0xd0f6('0x27')]=_0x35c1ff;if(_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x49')]){_0x425f8b[_0xd0f6('0x4a')]=[{'all':!![]}];}return db[_0xd0f6('0x34')]['findAll'](_0x425f8b);})[_0xd0f6('0x2c')](function(_0x321b2d){_0x35fd5b[_0xd0f6('0x4b')]=_0x321b2d;return _0x35fd5b;})[_0xd0f6('0x2c')](respondWithFilteredResult(_0x83015a,_0x425f8b))[_0xd0f6('0x4c')](handleError(_0x83015a,null));};exports[_0xd0f6('0x4d')]=function(_0x40dfe6,_0x34c691){var _0x3ab404={'raw':!![],'where':{'id':_0x40dfe6[_0xd0f6('0x4e')]['id']}},_0x25de11={};_0x25de11[_0xd0f6('0x38')]=_[_0xd0f6('0x3b')](db['ChatInternalMessage'][_0xd0f6('0x35')]);_0x25de11[_0xd0f6('0x3a')]=_[_0xd0f6('0x3b')](_0x40dfe6[_0xd0f6('0x3a')]);_0x25de11[_0xd0f6('0x44')]=_[_0xd0f6('0x3d')](_0x25de11[_0xd0f6('0x38')],_0x25de11[_0xd0f6('0x3a')]);_0x3ab404['attributes']=_[_0xd0f6('0x3d')](_0x25de11[_0xd0f6('0x38')],qs[_0xd0f6('0x3e')](_0x40dfe6['query'][_0xd0f6('0x3e')]));_0x3ab404[_0xd0f6('0x3c')]=_0x3ab404[_0xd0f6('0x3c')][_0xd0f6('0x3f')]?_0x3ab404['attributes']:_0x25de11[_0xd0f6('0x38')];if(_0x40dfe6[_0xd0f6('0x3a')][_0xd0f6('0x49')]){_0x3ab404['include']=[{'all':!![]}];}_0x3ab404=_['merge']({},_0x3ab404,_0x40dfe6[_0xd0f6('0x4f')]);return db[_0xd0f6('0x34')][_0xd0f6('0x50')](_0x3ab404)['then'](handleEntityNotFound(_0x34c691,null))['then'](respondWithResult(_0x34c691,null))[_0xd0f6('0x4c')](handleError(_0x34c691,null));};exports[_0xd0f6('0x51')]=function(_0x5f3029,_0x5f2b21){return db['ChatInternalMessage']['create'](_0x5f3029['body'],{})[_0xd0f6('0x2c')](respondWithResult(_0x5f2b21,0xc9))[_0xd0f6('0x4c')](handleError(_0x5f2b21,null));};exports[_0xd0f6('0x2b')]=function(_0x551430,_0xc6c48){if(_0x551430[_0xd0f6('0x52')]['id']){delete _0x551430[_0xd0f6('0x52')]['id'];}return db[_0xd0f6('0x34')]['find']({'where':{'id':_0x551430[_0xd0f6('0x4e')]['id']}})['then'](handleEntityNotFound(_0xc6c48,null))[_0xd0f6('0x2c')](saveUpdates(_0x551430[_0xd0f6('0x52')],null))[_0xd0f6('0x2c')](respondWithResult(_0xc6c48,null))['catch'](handleError(_0xc6c48,null));};exports[_0xd0f6('0x2d')]=function(_0x4c34b3,_0x18c7d6){return db[_0xd0f6('0x34')][_0xd0f6('0x50')]({'where':{'id':_0x4c34b3[_0xd0f6('0x4e')]['id']}})[_0xd0f6('0x2c')](handleEntityNotFound(_0x18c7d6,null))[_0xd0f6('0x2c')](removeEntity(_0x18c7d6,null))[_0xd0f6('0x4c')](handleError(_0x18c7d6,null));};exports[_0xd0f6('0x53')]=function(_0x454242,_0x299dc1){return db[_0xd0f6('0x34')][_0xd0f6('0x53')]()[_0xd0f6('0x2c')](respondWithResult(_0x299dc1,null))[_0xd0f6('0x4c')](handleError(_0x299dc1,null));};function wrapUser(_0x1a270b){return function(_0x1f0544){var _0x22d8be=_0x1a270b['get']({'plain':!![]});_0x22d8be[_0xd0f6('0x54')]=[];if(_0x1f0544){_0x22d8be['lastMessageAt']=_0x1f0544['createdAt'];_0x22d8be['lastMessage']=_0x1f0544;}else{_0x22d8be[_0xd0f6('0x55')]=moment(0x0)[_0xd0f6('0x56')](_0xd0f6('0x57'));_0x22d8be[_0xd0f6('0x58')]={};}return _0x22d8be;};}exports[_0xd0f6('0x59')]=function(_0x2443a1,_0x2e8369,_0x1b6152){var _0x5ecc9a=[];return db[_0xd0f6('0x5a')]['findAll']({'where':{'role':['agent',_0xd0f6('0x5b'),_0xd0f6('0x5c')]},'attributes':['id','fullname',_0xd0f6('0x31'),_0xd0f6('0x5d'),_0xd0f6('0x5e'),'internal',_0xd0f6('0x5f'),'lastLoginAt',_0xd0f6('0x60'),_0xd0f6('0x61')],'order':qs['sort'](_0xd0f6('0x62')),'include':[{'model':db[_0xd0f6('0x63')],'as':_0xd0f6('0x64'),'attributes':['id',_0xd0f6('0x31'),_0xd0f6('0x65')],'through':{'attributes':[]}}]})[_0xd0f6('0x2c')](function(_0x5a1f01){if(_0x5a1f01){var _0x3008d7=_0x2443a1[_0xd0f6('0x5c')][_0xd0f6('0x66')]({'plain':!![]});if(!_0x3008d7)throw new Error(_0xd0f6('0x67'));if(_0x3008d7[_0xd0f6('0x5d')]===_0xd0f6('0x5c')){return db[_0xd0f6('0x68')]['find']({'where':{'name':_0xd0f6('0x69'),'userProfileId':_0x3008d7[_0xd0f6('0x6a')]},'raw':!![]})[_0xd0f6('0x2c')](function(_0x1e76fb){if(_0x1e76fb){if(_0x1e76fb[_0xd0f6('0x6b')]===0x0){return db['UserProfileResource'][_0xd0f6('0x6c')]({'where':{'sectionId':_0x1e76fb['id']},'raw':!![]})[_0xd0f6('0x2c')](function(_0x1a8b29){var _0x546b4a=[];if(_[_0xd0f6('0x6d')](_0x1a8b29)){_0x546b4a=_[_0xd0f6('0x46')](_0x5a1f01,function(_0x153e43){if(_0x153e43[_0xd0f6('0x5d')]!==_0xd0f6('0x6e')){return _0x153e43;}});return _0x546b4a;}else{for(var _0x470b5b=0x0;_0x470b5b<_0x5a1f01[_0xd0f6('0x3f')];_0x470b5b++){var _0xc60702=_0x5a1f01[_0x470b5b];if(_0xc60702[_0xd0f6('0x5d')]===_0xd0f6('0x6e')){var _0x273aa4=_[_0xd0f6('0x50')](_0x1a8b29,function(_0x164b23){return _0x164b23['resourceId']===_0xc60702['id'];});if(_0x273aa4)_0x546b4a[_0xd0f6('0x6f')](_0xc60702);}else{_0x546b4a[_0xd0f6('0x6f')](_0xc60702);}}return _0x546b4a;}});}else{return _0x5a1f01;}}else{var _0x15ae2b=_[_0xd0f6('0x46')](_0x5a1f01,function(_0x56c246){if(_0x56c246['role']!==_0xd0f6('0x6e')){return _0x56c246;}});return _0x15ae2b;}});}else{return _0x5a1f01;}}})['then'](function(_0x346dc5){var _0x4ac107=[];if(_0x346dc5){_0x5ecc9a=_0x346dc5;for(var _0x2dfa5b=0x0;_0x2dfa5b<_0x346dc5[_0xd0f6('0x3f')];_0x2dfa5b+=0x1){_0x5ecc9a[_0x2dfa5b][_0xd0f6('0x54')]=[];_0x4ac107['push'](db[_0xd0f6('0x34')]['find']({'where':{'FromId':[_0x2443a1[_0xd0f6('0x5c')]['id'],_0x346dc5[_0x2dfa5b]['id']],'ToId':[_0x2443a1['user']['id'],_0x346dc5[_0x2dfa5b]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xd0f6('0x70'),_0xd0f6('0x71'),_0xd0f6('0x72'),_0xd0f6('0x52')],'order':qs['sort'](_0xd0f6('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd0f6('0x2c')](wrapUser(_0x346dc5[_0x2dfa5b])));}return BPromise[_0xd0f6('0x74')](_0x4ac107);}return[];})[_0xd0f6('0x2c')](function(_0x18f3eb){return{'rows':_0x18f3eb,'count':_0x18f3eb[_0xd0f6('0x3f')]};})['then'](respondWithResult(_0x2e8369,null))[_0xd0f6('0x4c')](handleError(_0x2e8369,null));};
\ No newline at end of file
+var _0xae48=['offset','Content-Range','apply','reject','save','then','destroy','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','keys','intersection','model','query','fields','attributes','length','nolimit','sort','where','pick','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','create','body','find','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','role','online','lastLoginAt','allowmessenger','-online','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','rimraf','zip-dir','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','undefined','limit','count'];(function(_0x5a106e,_0x36417b){var _0x3a5ce2=function(_0x44650a){while(--_0x44650a){_0x5a106e['push'](_0x5a106e['shift']());}};_0x3a5ce2(++_0x36417b);}(_0xae48,0x17e));var _0x8ae4=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0xae48[_0x51b661];return _0x5d1971;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ae4('0x0'));var zipdir=require(_0x8ae4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8ae4('0x2'));var util=require(_0x8ae4('0x3'));var path=require(_0x8ae4('0x4'));var sox=require('sox');var csv=require(_0x8ae4('0x5'));var ejs=require(_0x8ae4('0x6'));var fs=require('fs');var fs_extra=require(_0x8ae4('0x7'));var _=require(_0x8ae4('0x8'));var squel=require(_0x8ae4('0x9'));var crypto=require(_0x8ae4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8ae4('0xb'));var toCsv=require(_0x8ae4('0x5'));var querystring=require('querystring');var Papa=require(_0x8ae4('0xc'));var Redis=require(_0x8ae4('0xd'));var authService=require(_0x8ae4('0xe'));var qs=require(_0x8ae4('0xf'));var as=require(_0x8ae4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ae4('0x11'))(_0x8ae4('0x12'));var utils=require('../../config/utils');var config=require(_0x8ae4('0x13'));var licenseUtil=require(_0x8ae4('0x14'));var db=require(_0x8ae4('0x15'))['db'];config[_0x8ae4('0x16')]=_[_0x8ae4('0x17')](config[_0x8ae4('0x16')],{'host':_0x8ae4('0x18'),'port':0x18eb});var socket=require(_0x8ae4('0x19'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x8ae4('0x1a')](socket);function respondWithStatusCode(_0x40bd47,_0x4aa19c){_0x4aa19c=_0x4aa19c||0xcc;return function(_0x168dfd){if(_0x168dfd){return _0x40bd47[_0x8ae4('0x1b')](_0x4aa19c);}return _0x40bd47['status'](_0x4aa19c)[_0x8ae4('0x1c')]();};}function respondWithResult(_0x532149,_0xd1ee10){_0xd1ee10=_0xd1ee10||0xc8;return function(_0x47430f){if(_0x47430f){return _0x532149[_0x8ae4('0x1d')](_0xd1ee10)[_0x8ae4('0x1e')](_0x47430f);}};}function respondWithFilteredResult(_0xf5bbbe,_0x586906){return function(_0x4af43b){if(_0x4af43b){var _0x17bd9a=typeof _0x586906['offset']===_0x8ae4('0x1f')&&typeof _0x586906[_0x8ae4('0x20')]===_0x8ae4('0x1f');var _0x23c7d3=_0x4af43b[_0x8ae4('0x21')];var _0x358c2b=_0x17bd9a?0x0:_0x586906[_0x8ae4('0x22')];var _0x390c05=_0x17bd9a?_0x4af43b['count']:_0x586906[_0x8ae4('0x22')]+_0x586906[_0x8ae4('0x20')];var _0x5eac9d;if(_0x390c05>=_0x23c7d3){_0x390c05=_0x23c7d3;_0x5eac9d=0xc8;}else{_0x5eac9d=0xce;}_0xf5bbbe[_0x8ae4('0x1d')](_0x5eac9d);return _0xf5bbbe['set'](_0x8ae4('0x23'),_0x358c2b+'-'+_0x390c05+'/'+_0x23c7d3)[_0x8ae4('0x1e')](_0x4af43b);}return null;};}function patchUpdates(_0x465955){return function(_0x289928){try{jsonpatch[_0x8ae4('0x24')](_0x289928,_0x465955,!![]);}catch(_0x8a12bd){return BPromise[_0x8ae4('0x25')](_0x8a12bd);}return _0x289928[_0x8ae4('0x26')]();};}function saveUpdates(_0x4ca110,_0x2feed6){return function(_0x55c8ac){if(_0x55c8ac){return _0x55c8ac['update'](_0x4ca110)[_0x8ae4('0x27')](function(_0x25ae0b){return _0x25ae0b;});}return null;};}function removeEntity(_0x55c55e,_0x13cef3){return function(_0x514f34){if(_0x514f34){return _0x514f34[_0x8ae4('0x28')]()[_0x8ae4('0x27')](function(){_0x55c55e[_0x8ae4('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51c433,_0x2a590f){return function(_0x1c8fd0){if(!_0x1c8fd0){_0x51c433[_0x8ae4('0x1b')](0x194);}return _0x1c8fd0;};}function handleError(_0x412b40,_0x16a142){_0x16a142=_0x16a142||0x1f4;return function(_0x268ccf){logger['error'](_0x268ccf['stack']);if(_0x268ccf['name']){delete _0x268ccf[_0x8ae4('0x29')];}_0x412b40[_0x8ae4('0x1d')](_0x16a142)[_0x8ae4('0x2a')](_0x268ccf);};}exports[_0x8ae4('0x2b')]=function(_0x45e3a9,_0x55d9f2){var _0x5edc83={},_0x34954e={},_0x37ec03={'count':0x0,'rows':[]};var _0x477c6c=_[_0x8ae4('0x2c')](db[_0x8ae4('0x2d')][_0x8ae4('0x2e')],function(_0x4003cf){return{'name':_0x4003cf[_0x8ae4('0x2f')],'type':_0x4003cf['type'][_0x8ae4('0x30')]};});_0x34954e['model']=_[_0x8ae4('0x2c')](_0x477c6c,_0x8ae4('0x29'));_0x34954e['query']=_[_0x8ae4('0x31')](_0x45e3a9['query']);_0x34954e['filters']=_[_0x8ae4('0x32')](_0x34954e[_0x8ae4('0x33')],_0x34954e[_0x8ae4('0x34')]);_0x5edc83['attributes']=_['intersection'](_0x34954e[_0x8ae4('0x33')],qs[_0x8ae4('0x35')](_0x45e3a9['query'][_0x8ae4('0x35')]));_0x5edc83[_0x8ae4('0x36')]=_0x5edc83[_0x8ae4('0x36')][_0x8ae4('0x37')]?_0x5edc83['attributes']:_0x34954e['model'];if(!_0x45e3a9['query']['hasOwnProperty'](_0x8ae4('0x38'))){_0x5edc83[_0x8ae4('0x20')]=qs['limit'](_0x45e3a9['query'][_0x8ae4('0x20')]);_0x5edc83['offset']=qs[_0x8ae4('0x22')](_0x45e3a9[_0x8ae4('0x34')][_0x8ae4('0x22')]);}_0x5edc83['order']=qs[_0x8ae4('0x39')](_0x45e3a9[_0x8ae4('0x34')][_0x8ae4('0x39')]);_0x5edc83[_0x8ae4('0x3a')]=qs['filters'](_[_0x8ae4('0x3b')](_0x45e3a9[_0x8ae4('0x34')],_0x34954e[_0x8ae4('0x3c')]),_0x477c6c);if(_0x45e3a9[_0x8ae4('0x34')]['filter']){_0x5edc83[_0x8ae4('0x3a')]=_[_0x8ae4('0x3d')](_0x5edc83[_0x8ae4('0x3a')],{'$or':_[_0x8ae4('0x2c')](_0x477c6c,function(_0x5a569f){if(_0x5a569f[_0x8ae4('0x3e')]!==_0x8ae4('0x3f')){var _0x29eeee={};_0x29eeee[_0x5a569f[_0x8ae4('0x29')]]={'$like':'%'+_0x45e3a9[_0x8ae4('0x34')][_0x8ae4('0x40')]+'%'};return _0x29eeee;}})});}_0x5edc83=_[_0x8ae4('0x3d')]({},_0x5edc83,_0x45e3a9[_0x8ae4('0x41')]);var _0x5ca70f={'where':_0x5edc83['where']};return db[_0x8ae4('0x2d')][_0x8ae4('0x21')](_0x5ca70f)['then'](function(_0x4d6f30){_0x37ec03[_0x8ae4('0x21')]=_0x4d6f30;if(_0x45e3a9[_0x8ae4('0x34')][_0x8ae4('0x42')]){_0x5edc83[_0x8ae4('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x8ae4('0x44')](_0x5edc83);})[_0x8ae4('0x27')](function(_0x160d01){_0x37ec03['rows']=_0x160d01;return _0x37ec03;})['then'](respondWithFilteredResult(_0x55d9f2,_0x5edc83))[_0x8ae4('0x45')](handleError(_0x55d9f2,null));};exports['show']=function(_0x2879ce,_0x4155b0){var _0x4e9721={'raw':!![],'where':{'id':_0x2879ce[_0x8ae4('0x46')]['id']}},_0x14c3e0={};_0x14c3e0[_0x8ae4('0x33')]=_[_0x8ae4('0x31')](db['ChatInternalMessage']['rawAttributes']);_0x14c3e0['query']=_[_0x8ae4('0x31')](_0x2879ce['query']);_0x14c3e0[_0x8ae4('0x3c')]=_[_0x8ae4('0x32')](_0x14c3e0[_0x8ae4('0x33')],_0x14c3e0['query']);_0x4e9721['attributes']=_[_0x8ae4('0x32')](_0x14c3e0[_0x8ae4('0x33')],qs[_0x8ae4('0x35')](_0x2879ce[_0x8ae4('0x34')][_0x8ae4('0x35')]));_0x4e9721[_0x8ae4('0x36')]=_0x4e9721[_0x8ae4('0x36')][_0x8ae4('0x37')]?_0x4e9721[_0x8ae4('0x36')]:_0x14c3e0[_0x8ae4('0x33')];if(_0x2879ce[_0x8ae4('0x34')]['includeAll']){_0x4e9721[_0x8ae4('0x43')]=[{'all':!![]}];}_0x4e9721=_['merge']({},_0x4e9721,_0x2879ce[_0x8ae4('0x41')]);return db[_0x8ae4('0x2d')]['find'](_0x4e9721)[_0x8ae4('0x27')](handleEntityNotFound(_0x4155b0,null))[_0x8ae4('0x27')](respondWithResult(_0x4155b0,null))[_0x8ae4('0x45')](handleError(_0x4155b0,null));};exports[_0x8ae4('0x47')]=function(_0x3d323b,_0x4d6fea){return db[_0x8ae4('0x2d')][_0x8ae4('0x47')](_0x3d323b[_0x8ae4('0x48')],{})[_0x8ae4('0x27')](respondWithResult(_0x4d6fea,0xc9))[_0x8ae4('0x45')](handleError(_0x4d6fea,null));};exports['update']=function(_0x1bc0fd,_0x81b346){if(_0x1bc0fd[_0x8ae4('0x48')]['id']){delete _0x1bc0fd[_0x8ae4('0x48')]['id'];}return db[_0x8ae4('0x2d')]['find']({'where':{'id':_0x1bc0fd['params']['id']}})[_0x8ae4('0x27')](handleEntityNotFound(_0x81b346,null))['then'](saveUpdates(_0x1bc0fd[_0x8ae4('0x48')],null))[_0x8ae4('0x27')](respondWithResult(_0x81b346,null))[_0x8ae4('0x45')](handleError(_0x81b346,null));};exports[_0x8ae4('0x28')]=function(_0x153117,_0x15beed){return db[_0x8ae4('0x2d')][_0x8ae4('0x49')]({'where':{'id':_0x153117[_0x8ae4('0x46')]['id']}})['then'](handleEntityNotFound(_0x15beed,null))[_0x8ae4('0x27')](removeEntity(_0x15beed,null))[_0x8ae4('0x45')](handleError(_0x15beed,null));};exports[_0x8ae4('0x4a')]=function(_0x4fd8ac,_0x18cc19){return db[_0x8ae4('0x2d')][_0x8ae4('0x4a')]()[_0x8ae4('0x27')](respondWithResult(_0x18cc19,null))[_0x8ae4('0x45')](handleError(_0x18cc19,null));};function wrapUser(_0x16f714){return function(_0x1d1277){var _0x15b4e9=_0x16f714[_0x8ae4('0x4b')]({'plain':!![]});_0x15b4e9[_0x8ae4('0x4c')]=[];if(_0x1d1277){_0x15b4e9['lastMessageAt']=_0x1d1277[_0x8ae4('0x4d')];_0x15b4e9[_0x8ae4('0x4e')]=_0x1d1277;}else{_0x15b4e9[_0x8ae4('0x4f')]=moment(0x0)[_0x8ae4('0x50')](_0x8ae4('0x51'));_0x15b4e9['lastMessage']={};}return _0x15b4e9;};}exports['getUsers']=function(_0x132a73,_0x29b0b1,_0x32750c){var _0xe66900=[];return db[_0x8ae4('0x52')]['findAll']({'where':{'role':[_0x8ae4('0x53'),_0x8ae4('0x54'),_0x8ae4('0x55')]},'attributes':['id','fullname','name',_0x8ae4('0x56'),'userpic','internal',_0x8ae4('0x57'),_0x8ae4('0x58'),_0x8ae4('0x59'),'showWebBar'],'order':qs[_0x8ae4('0x39')](_0x8ae4('0x5a')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x8ae4('0x29'),_0x8ae4('0x3e')],'through':{'attributes':[]}}]})[_0x8ae4('0x27')](function(_0x5d4719){if(_0x5d4719){var _0x248a06=_0x132a73[_0x8ae4('0x55')][_0x8ae4('0x4b')]({'plain':!![]});if(!_0x248a06)throw new Error(_0x8ae4('0x5b'));if(_0x248a06[_0x8ae4('0x56')]===_0x8ae4('0x55')){return db[_0x8ae4('0x5c')][_0x8ae4('0x49')]({'where':{'name':_0x8ae4('0x5d'),'userProfileId':_0x248a06[_0x8ae4('0x5e')]},'raw':!![]})[_0x8ae4('0x27')](function(_0x3379de){if(_0x3379de){if(_0x3379de[_0x8ae4('0x5f')]===0x0){return db[_0x8ae4('0x60')][_0x8ae4('0x44')]({'where':{'sectionId':_0x3379de['id']},'raw':!![]})['then'](function(_0x4c41e0){var _0x4e2f33=[];if(_[_0x8ae4('0x61')](_0x4c41e0)){_0x4e2f33=_[_0x8ae4('0x40')](_0x5d4719,function(_0x3c0721){if(_0x3c0721[_0x8ae4('0x56')]!=='agent'){return _0x3c0721;}});return _0x4e2f33;}else{for(var _0x3b5e22=0x0;_0x3b5e22<_0x5d4719[_0x8ae4('0x37')];_0x3b5e22++){var _0x51a24f=_0x5d4719[_0x3b5e22];if(_0x51a24f[_0x8ae4('0x56')]===_0x8ae4('0x53')){var _0x62cdd4=_['find'](_0x4c41e0,function(_0x1d5c81){return _0x1d5c81[_0x8ae4('0x62')]===_0x51a24f['id'];});if(_0x62cdd4)_0x4e2f33['push'](_0x51a24f);}else{_0x4e2f33[_0x8ae4('0x63')](_0x51a24f);}}return _0x4e2f33;}});}else{return _0x5d4719;}}else{var _0x1aa149=_[_0x8ae4('0x40')](_0x5d4719,function(_0x39d0e0){if(_0x39d0e0[_0x8ae4('0x56')]!=='agent'){return _0x39d0e0;}});return _0x1aa149;}});}else{return _0x5d4719;}}})['then'](function(_0x3fcae7){var _0x1b1c56=[];if(_0x3fcae7){_0xe66900=_0x3fcae7;for(var _0x308062=0x0;_0x308062<_0x3fcae7[_0x8ae4('0x37')];_0x308062+=0x1){_0xe66900[_0x308062][_0x8ae4('0x4c')]=[];_0x1b1c56['push'](db[_0x8ae4('0x2d')]['find']({'where':{'FromId':[_0x132a73['user']['id'],_0x3fcae7[_0x308062]['id']],'ToId':[_0x132a73[_0x8ae4('0x55')]['id'],_0x3fcae7[_0x308062]['id']],'ChatGroupId':null},'attributes':['id',_0x8ae4('0x4d'),_0x8ae4('0x64'),_0x8ae4('0x65'),_0x8ae4('0x66'),_0x8ae4('0x48')],'order':qs[_0x8ae4('0x39')](_0x8ae4('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8ae4('0x27')](wrapUser(_0x3fcae7[_0x308062])));}return BPromise['all'](_0x1b1c56);}return[];})[_0x8ae4('0x27')](function(_0x43562a){return{'rows':_0x43562a,'count':_0x43562a[_0x8ae4('0x37')]};})['then'](respondWithResult(_0x29b0b1,null))[_0x8ae4('0x45')](handleError(_0x29b0b1,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index cc87ec5..f059b1c 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 _0xa2d5=['save','update','remove','emit','exports','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x23b4df,_0x33dfa6){var _0x26b927=function(_0x1a07ab){while(--_0x1a07ab){_0x23b4df['push'](_0x23b4df['shift']());}};_0x26b927(++_0x33dfa6);}(_0xa2d5,0x14d));var _0x5a2d=function(_0x5bdee3,_0x2fdd3a){_0x5bdee3=_0x5bdee3-0x0;var _0x52e773=_0xa2d5[_0x5bdee3];return _0x52e773;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x5a2d('0x0'))['db'][_0x5a2d('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5a2d('0x2')](0x0);var events={'afterCreate':_0x5a2d('0x3'),'afterUpdate':_0x5a2d('0x4'),'afterDestroy':_0x5a2d('0x5')};function emitEvent(_0x47c0bd){return function(_0x33d9c8,_0x5a0a55,_0x399810){ChatInternalMessageEvents[_0x5a2d('0x6')](_0x47c0bd+':'+_0x33d9c8['id'],_0x33d9c8);ChatInternalMessageEvents['emit'](_0x47c0bd,_0x33d9c8);_0x399810(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x5a2d('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x9cf9=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x6e7bba,_0xe07896){var _0x25cf26=function(_0x485d44){while(--_0x485d44){_0x6e7bba['push'](_0x6e7bba['shift']());}};_0x25cf26(++_0xe07896);}(_0x9cf9,0x6d));var _0x99cf=function(_0x1bed65,_0x5af678){_0x1bed65=_0x1bed65-0x0;var _0x4662c8=_0x9cf9[_0x1bed65];return _0x4662c8;};'use strict';var EventEmitter=require(_0x99cf('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x99cf('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x99cf('0x2')](0x0);var events={'afterCreate':_0x99cf('0x3'),'afterUpdate':_0x99cf('0x4'),'afterDestroy':_0x99cf('0x5')};function emitEvent(_0x445488){return function(_0x1683f8,_0x170c8d,_0x4192d9){ChatInternalMessageEvents[_0x99cf('0x6')](_0x445488+':'+_0x1683f8['id'],_0x1683f8);ChatInternalMessageEvents[_0x99cf('0x6')](_0x445488,_0x1683f8);_0x4192d9(null);};}for(var e in events){if(events[_0x99cf('0x7')](e)){var event=events[e];ChatInternalMessage[_0x99cf('0x8')](e,emitEvent(event));}}module[_0x99cf('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 5bfdcd8..614c01b 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 _0x94ae=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4_unicode_ci','lodash'];(function(_0xaaf34f,_0x5448a1){var _0x25c819=function(_0x17bd92){while(--_0x17bd92){_0xaaf34f['push'](_0xaaf34f['shift']());}};_0x25c819(++_0x5448a1);}(_0x94ae,0x137));var _0xe94a=function(_0x4de3ff,_0x4cb1d0){_0x4de3ff=_0x4de3ff-0x0;var _0x3b08fd=_0x94ae[_0x4de3ff];return _0x3b08fd;};'use strict';var _=require(_0xe94a('0x0'));var util=require(_0xe94a('0x1'));var logger=require(_0xe94a('0x2'))(_0xe94a('0x3'));var moment=require(_0xe94a('0x4'));var BPromise=require(_0xe94a('0x5'));var rp=require(_0xe94a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe94a('0x7'));var config=require(_0xe94a('0x8'));var attributes=require(_0xe94a('0x9'));module[_0xe94a('0xa')]=function(_0x4ad424,_0x6362c4){return _0x4ad424['define'](_0xe94a('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe94a('0xc')});};
\ No newline at end of file
+var _0x5b5a=['request-promise','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','bluebird'];(function(_0x23f1be,_0x124ddd){var _0x8fee8e=function(_0x5c38f8){while(--_0x5c38f8){_0x23f1be['push'](_0x23f1be['shift']());}};_0x8fee8e(++_0x124ddd);}(_0x5b5a,0xbb));var _0xa5b5=function(_0x2109a8,_0x3a7797){_0x2109a8=_0x2109a8-0x0;var _0x522094=_0x5b5a[_0x2109a8];return _0x522094;};'use strict';var _=require(_0xa5b5('0x0'));var util=require(_0xa5b5('0x1'));var logger=require(_0xa5b5('0x2'))(_0xa5b5('0x3'));var moment=require('moment');var BPromise=require(_0xa5b5('0x4'));var rp=require(_0xa5b5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa5b5('0x6'));var attributes=require(_0xa5b5('0x7'));module['exports']=function(_0x4616c1,_0x5d437a){return _0x4616c1[_0xa5b5('0x8')](_0xa5b5('0x9'),attributes,{'tableName':_0xa5b5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5b5('0xb'),'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 2be9341..2848618 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 _0x5735=['result','catch','lodash','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1a070f,_0x309e4e){var _0x2e8b1d=function(_0x13993f){while(--_0x13993f){_0x1a070f['push'](_0x1a070f['shift']());}};_0x2e8b1d(++_0x309e4e);}(_0x5735,0x16a));var _0x5573=function(_0x54e6f5,_0x4f4e99){_0x54e6f5=_0x54e6f5-0x0;var _0x5e8794=_0x5735[_0x54e6f5];return _0x5e8794;};'use strict';var _=require(_0x5573('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5573('0x1'));var rs=require(_0x5573('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5573('0x3'))(_0x5573('0x4'));var config=require(_0x5573('0x5'));var jayson=require(_0x5573('0x6'));var client=jayson['client'][_0x5573('0x7')]({'port':0x232a});config[_0x5573('0x8')]=_[_0x5573('0x9')](config[_0x5573('0x8')],{'host':_0x5573('0xa'),'port':0x18eb});var socket=require(_0x5573('0xb'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x5573('0xc')](socket);function respondWithRpcPromise(_0x33e85f,_0x23744c,_0x5895d9){return new BPromise(function(_0x55bf6a,_0x5c68bc){return client[_0x5573('0xd')](_0x33e85f,_0x5895d9)['then'](function(_0x1817ac){logger[_0x5573('0xe')](_0x5573('0xf'),_0x23744c,_0x5573('0x10'));logger[_0x5573('0x11')](_0x5573('0x12'),_0x23744c,_0x5573('0x10'),JSON[_0x5573('0x13')](_0x1817ac));if(_0x1817ac[_0x5573('0x14')]){if(_0x1817ac[_0x5573('0x14')]['code']===0x1f4){logger[_0x5573('0x14')](_0x5573('0xf'),_0x23744c,_0x1817ac['error'][_0x5573('0x15')]);return _0x5c68bc(_0x1817ac[_0x5573('0x14')][_0x5573('0x15')]);}logger['error'](_0x5573('0xf'),_0x23744c,_0x1817ac['error'][_0x5573('0x15')]);return _0x55bf6a(_0x1817ac[_0x5573('0x14')][_0x5573('0x15')]);}else{logger[_0x5573('0xe')](_0x5573('0xf'),_0x23744c,_0x5573('0x10'));_0x55bf6a(_0x1817ac[_0x5573('0x16')][_0x5573('0x15')]);}})[_0x5573('0x17')](function(_0x267c6e){logger['error'](_0x5573('0xf'),_0x23744c,_0x267c6e);_0x5c68bc(_0x267c6e);});});}
\ No newline at end of file
+var _0xedef=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xe3b27d,_0x20e831){var _0x18d7e3=function(_0x413ce7){while(--_0x413ce7){_0xe3b27d['push'](_0xe3b27d['shift']());}};_0x18d7e3(++_0x20e831);}(_0xedef,0xd6));var _0xfede=function(_0x3d4e26,_0x2d8f34){_0x3d4e26=_0x3d4e26-0x0;var _0x9738b0=_0xedef[_0x3d4e26];return _0x9738b0;};'use strict';var _=require(_0xfede('0x0'));var util=require(_0xfede('0x1'));var moment=require(_0xfede('0x2'));var BPromise=require(_0xfede('0x3'));var rs=require(_0xfede('0x4'));var fs=require('fs');var Redis=require(_0xfede('0x5'));var db=require(_0xfede('0x6'))['db'];var utils=require(_0xfede('0x7'));var logger=require(_0xfede('0x8'))(_0xfede('0x9'));var config=require(_0xfede('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xfede('0xb')][_0xfede('0xc')]({'port':0x232a});config['redis']=_[_0xfede('0xd')](config[_0xfede('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xfede('0xf'))(new Redis(config[_0xfede('0xe')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3a48cb,_0x52ea6d,_0x10205d){return new BPromise(function(_0x415c86,_0x38d5aa){return client[_0xfede('0x10')](_0x3a48cb,_0x10205d)['then'](function(_0xb15d0b){logger[_0xfede('0x11')](_0xfede('0x12'),_0x52ea6d,_0xfede('0x13'));logger[_0xfede('0x14')](_0xfede('0x15'),_0x52ea6d,'request\x20sent',JSON[_0xfede('0x16')](_0xb15d0b));if(_0xb15d0b[_0xfede('0x17')]){if(_0xb15d0b[_0xfede('0x17')]['code']===0x1f4){logger[_0xfede('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x52ea6d,_0xb15d0b[_0xfede('0x17')][_0xfede('0x18')]);return _0x38d5aa(_0xb15d0b[_0xfede('0x17')]['message']);}logger[_0xfede('0x17')](_0xfede('0x12'),_0x52ea6d,_0xb15d0b['error'][_0xfede('0x18')]);return _0x415c86(_0xb15d0b[_0xfede('0x17')]['message']);}else{logger[_0xfede('0x11')](_0xfede('0x12'),_0x52ea6d,_0xfede('0x13'));_0x415c86(_0xb15d0b['result'][_0xfede('0x18')]);}})[_0xfede('0x19')](function(_0x90b8ba){logger[_0xfede('0x17')](_0xfede('0x12'),_0x52ea6d,_0x90b8ba);_0x38d5aa(_0x90b8ba);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 7fe94b5..119e3f6 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 _0xabba=['emit','removeListener','register','./chatInternalMessage.events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xabba,0x97));var _0xaabb=function(_0x499b44,_0x18aad3){_0x499b44=_0x499b44-0x0;var _0x49e743=_0xabba[_0x499b44];return _0x49e743;};'use strict';var ChatInternalMessageEvents=require(_0xaabb('0x0'));var events=['save','remove','update'];function createListener(_0x537479,_0x365209){return function(_0x359464){_0x365209[_0xaabb('0x1')](_0x537479,_0x359464);};}function removeListener(_0x9080e7,_0x53d853){return function(){ChatInternalMessageEvents[_0xaabb('0x2')](_0x9080e7,_0x53d853);};}exports[_0xaabb('0x3')]=function(_0x4dbb25){for(var _0x362017=0x0,_0x29348a=events['length'];_0x362017<_0x29348a;_0x362017++){var _0x359a83=events[_0x362017];var _0x53079f=createListener('chatInternalMessage:'+_0x359a83,_0x4dbb25);ChatInternalMessageEvents['on'](_0x359a83,_0x53079f);}};
\ No newline at end of file
+var _0x9b85=['update','emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x364c7b,_0x21ef16){var _0x5625e7=function(_0x54cd70){while(--_0x54cd70){_0x364c7b['push'](_0x364c7b['shift']());}};_0x5625e7(++_0x21ef16);}(_0x9b85,0x19d));var _0x59b8=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x9b85[_0x297fd3];return _0x2af381;};'use strict';var ChatInternalMessageEvents=require(_0x59b8('0x0'));var events=[_0x59b8('0x1'),_0x59b8('0x2'),_0x59b8('0x3')];function createListener(_0x234fe8,_0xd30c4f){return function(_0x34c3dc){_0xd30c4f[_0x59b8('0x4')](_0x234fe8,_0x34c3dc);};}function removeListener(_0x372eb2,_0x14d9ce){return function(){ChatInternalMessageEvents[_0x59b8('0x5')](_0x372eb2,_0x14d9ce);};}exports['register']=function(_0x27cfd0){for(var _0x23f379=0x0,_0x2624da=events[_0x59b8('0x6')];_0x23f379<_0x2624da;_0x23f379++){var _0x3dd185=events[_0x23f379];var _0x3ce06e=createListener(_0x59b8('0x7')+_0x3dd185,_0x27cfd0);ChatInternalMessageEvents['on'](_0x3dd185,_0x3ce06e);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 391a63c..3b89f32 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 _0x06d0=['/describe','describe','/users','getUsers','/:id','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x176070,_0x5ec9b2){var _0x42a8e5=function(_0x356526){while(--_0x356526){_0x176070['push'](_0x176070['shift']());}};_0x42a8e5(++_0x5ec9b2);}(_0x06d0,0x136));var _0x006d=function(_0x192188,_0x225567){_0x192188=_0x192188-0x0;var _0x287287=_0x06d0[_0x192188];return _0x287287;};'use strict';var multer=require(_0x006d('0x0'));var util=require(_0x006d('0x1'));var path=require(_0x006d('0x2'));var timeout=require(_0x006d('0x3'));var express=require(_0x006d('0x4'));var router=express[_0x006d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x006d('0x6'));var config=require(_0x006d('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x006d('0x8')](),controller['index']);router[_0x006d('0x9')](_0x006d('0xa'),auth[_0x006d('0x8')](),controller[_0x006d('0xb')]);router[_0x006d('0x9')](_0x006d('0xc'),auth[_0x006d('0x8')](),controller[_0x006d('0xd')]);router['get'](_0x006d('0xe'),auth['isAuthenticated'](),controller[_0x006d('0xf')]);router[_0x006d('0x10')]('/',auth[_0x006d('0x8')](),controller['create']);router[_0x006d('0x11')](_0x006d('0xe'),controller[_0x006d('0x12')]);router['delete'](_0x006d('0xe'),auth[_0x006d('0x8')](),controller[_0x006d('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xe829=['/describe','getUsers','show','post','create','put','/:id','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0xe829,0x1d8));var _0x9e82=function(_0x27973c,_0x2d8b16){_0x27973c=_0x27973c-0x0;var _0x2ef123=_0xe829[_0x27973c];return _0x2ef123;};'use strict';var multer=require(_0x9e82('0x0'));var util=require(_0x9e82('0x1'));var path=require(_0x9e82('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9e82('0x3')]();var fs_extra=require(_0x9e82('0x4'));var auth=require(_0x9e82('0x5'));var interaction=require(_0x9e82('0x6'));var config=require(_0x9e82('0x7'));var controller=require(_0x9e82('0x8'));router['get']('/',auth[_0x9e82('0x9')](),controller[_0x9e82('0xa')]);router[_0x9e82('0xb')](_0x9e82('0xc'),auth[_0x9e82('0x9')](),controller['describe']);router[_0x9e82('0xb')]('/users',auth[_0x9e82('0x9')](),controller[_0x9e82('0xd')]);router['get']('/:id',auth[_0x9e82('0x9')](),controller[_0x9e82('0xe')]);router[_0x9e82('0xf')]('/',auth[_0x9e82('0x9')](),controller[_0x9e82('0x10')]);router[_0x9e82('0x11')](_0x9e82('0x12'),controller[_0x9e82('0x13')]);router[_0x9e82('0x14')](_0x9e82('0x12'),auth[_0x9e82('0x9')](),controller[_0x9e82('0x15')]);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 19127fb..df9d76e 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 _0x9861=['out','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x2d8b49,_0x267614){var _0xf4cb7=function(_0x2990b2){while(--_0x2990b2){_0x2d8b49['push'](_0x2d8b49['shift']());}};_0xf4cb7(++_0x267614);}(_0x9861,0x176));var _0x1986=function(_0x1c403f,_0x46163a){_0x1c403f=_0x1c403f-0x0;var _0x1adf63=_0x9861[_0x1c403f];return _0x1adf63;};'use strict';var Sequelize=require(_0x1986('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x1986('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x1986('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x1986('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1986('0x3')]('in',_0x1986('0x4')),'defaultValue':_0x1986('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x1986('0x5')]},'providerResponse':{'type':Sequelize[_0x1986('0x6')]}};
\ No newline at end of file
+var _0x18f3=['DATE','STRING','exports','TEXT','medium','ENUM','out'];(function(_0x233302,_0x26cf04){var _0x19814d=function(_0x3aca8b){while(--_0x3aca8b){_0x233302['push'](_0x233302['shift']());}};_0x19814d(++_0x26cf04);}(_0x18f3,0x19f));var _0x318f=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x18f3[_0x2ec461];return _0x28603d;};'use strict';var Sequelize=require('sequelize');module[_0x318f('0x0')]={'body':{'type':Sequelize[_0x318f('0x1')](_0x318f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x318f('0x3')]('in','out'),'defaultValue':_0x318f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x318f('0x5')]},'providerName':{'type':Sequelize[_0x318f('0x6')]},'providerResponse':{'type':Sequelize[_0x318f('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4ee86d7..d7a0e89 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 _0x35db=['ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','params','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteractionId','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','fullname','event','EventManager','rejectmessage','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x35db,0x105));var _0xb35d=function(_0x51cf9c,_0x1c7107){_0x51cf9c=_0x51cf9c-0x0;var _0x3aca7a=_0x35db[_0x51cf9c];return _0x3aca7a;};'use strict';var emlformat=require(_0xb35d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb35d('0x1'));var jsonpatch=require(_0xb35d('0x2'));var rp=require('request-promise');var moment=require(_0xb35d('0x3'));var BPromise=require(_0xb35d('0x4'));var Mustache=require(_0xb35d('0x5'));var util=require(_0xb35d('0x6'));var path=require(_0xb35d('0x7'));var sox=require(_0xb35d('0x8'));var csv=require('to-csv');var ejs=require(_0xb35d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb35d('0xa'));var jsforce=require(_0xb35d('0xb'));var deskjs=require(_0xb35d('0xc'));var toCsv=require(_0xb35d('0xd'));var querystring=require(_0xb35d('0xe'));var Papa=require(_0xb35d('0xf'));var Redis=require(_0xb35d('0x10'));var authService=require(_0xb35d('0x11'));var qs=require(_0xb35d('0x12'));var as=require(_0xb35d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb35d('0x14'));var utils=require('../../config/utils');var config=require(_0xb35d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb35d('0x16')]=_[_0xb35d('0x17')](config[_0xb35d('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xb35d('0x18'))(new Redis(config['redis']));require(_0xb35d('0x19'))[_0xb35d('0x1a')](socket);var jayson=require(_0xb35d('0x1b'));var client=jayson[_0xb35d('0x1c')][_0xb35d('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xb35d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x341c68,_0x1f1650,_0x504b0e,_0x9e9036){return new BPromise(function(_0x164570,_0x43b406){var _0x390508=_0x9e9036||client;return _0x390508[_0xb35d('0x1e')](_0x341c68,_0x504b0e)['then'](function(_0x202e7a){logger['info']('ChatMessage,\x20%s,\x20%s',_0x1f1650,_0xb35d('0x1f'));logger[_0xb35d('0x20')](_0xb35d('0x21'),_0x1f1650,_0xb35d('0x1f'),JSON[_0xb35d('0x22')](_0x202e7a));if(_0x202e7a['error']){if(_0x202e7a[_0xb35d('0x23')][_0xb35d('0x24')]===0x1f4){logger[_0xb35d('0x23')]('ChatMessage,\x20%s,\x20%s',_0x1f1650,_0x202e7a[_0xb35d('0x23')]['message']);return _0x43b406(_0x202e7a['error'][_0xb35d('0x25')]);}logger[_0xb35d('0x23')](_0xb35d('0x26'),_0x1f1650,_0x202e7a[_0xb35d('0x23')][_0xb35d('0x25')]);return _0x164570(_0x202e7a[_0xb35d('0x23')][_0xb35d('0x25')]);}else{logger[_0xb35d('0x27')]('ChatMessage,\x20%s,\x20%s',_0x1f1650,_0xb35d('0x1f'));_0x164570(_0x202e7a[_0xb35d('0x28')]['message']);}})[_0xb35d('0x29')](function(_0x1ca131){logger['error'](_0xb35d('0x26'),_0x1f1650,_0x1ca131);_0x43b406(_0x1ca131);});});}function respondWithStatusCode(_0x5ecd40,_0xd81681){_0xd81681=_0xd81681||0xcc;return function(_0x539427){if(_0x539427){return _0x5ecd40[_0xb35d('0x2a')](_0xd81681);}return _0x5ecd40[_0xb35d('0x2b')](_0xd81681)[_0xb35d('0x2c')]();};}function respondWithResult(_0x2378f6,_0x3cb0f1){_0x3cb0f1=_0x3cb0f1||0xc8;return function(_0x17706b){if(_0x17706b){return _0x2378f6[_0xb35d('0x2b')](_0x3cb0f1)['json'](_0x17706b);}};}function respondWithFilteredResult(_0x50c72c,_0x340843){return function(_0x1bf418){if(_0x1bf418){var _0x3a103d=typeof _0x340843['offset']===_0xb35d('0x2d')&&typeof _0x340843[_0xb35d('0x2e')]===_0xb35d('0x2d');var _0x3d5683=_0x1bf418['count'];var _0x8ce94e=_0x3a103d?0x0:_0x340843['offset'];var _0x3d5873=_0x3a103d?_0x1bf418['count']:_0x340843[_0xb35d('0x2f')]+_0x340843[_0xb35d('0x2e')];var _0x57b793;if(_0x3d5873>=_0x3d5683){_0x3d5873=_0x3d5683;_0x57b793=0xc8;}else{_0x57b793=0xce;}_0x50c72c['status'](_0x57b793);return _0x50c72c['set'](_0xb35d('0x30'),_0x8ce94e+'-'+_0x3d5873+'/'+_0x3d5683)['json'](_0x1bf418);}return null;};}function patchUpdates(_0x49488a){return function(_0x24a2fa){try{jsonpatch[_0xb35d('0x31')](_0x24a2fa,_0x49488a,!![]);}catch(_0x18d268){return BPromise[_0xb35d('0x32')](_0x18d268);}return _0x24a2fa[_0xb35d('0x33')]();};}function saveUpdates(_0x15216b,_0x14e7a3){return function(_0x51f52f){if(_0x51f52f){return _0x51f52f[_0xb35d('0x34')](_0x15216b)[_0xb35d('0x35')](function(_0x54cfa9){return _0x54cfa9;});}return null;};}function removeEntity(_0x3f586b,_0x10a1e6){return function(_0x32fd8b){if(_0x32fd8b){return _0x32fd8b[_0xb35d('0x36')]()['then'](function(){_0x3f586b[_0xb35d('0x2b')](0xcc)[_0xb35d('0x2c')]();});}};}function handleEntityNotFound(_0x3fc3aa,_0x2b2183){return function(_0x50ddda){if(!_0x50ddda){_0x3fc3aa[_0xb35d('0x2a')](0x194);}return _0x50ddda;};}function handleError(_0x505ed9,_0x33101d){_0x33101d=_0x33101d||0x1f4;return function(_0x5b6829){logger['error'](_0x5b6829[_0xb35d('0x37')]);if(_0x5b6829['name']){delete _0x5b6829['name'];}_0x505ed9[_0xb35d('0x2b')](_0x33101d)[_0xb35d('0x38')](_0x5b6829);};}exports[_0xb35d('0x39')]=function(_0x14eeb6,_0x590624){var _0x474cdd={},_0x17909b={},_0x16427f={'count':0x0,'rows':[]};var _0x3298ec=_[_0xb35d('0x3a')](db[_0xb35d('0x3b')][_0xb35d('0x3c')],function(_0x4ab011){return{'name':_0x4ab011[_0xb35d('0x3d')],'type':_0x4ab011[_0xb35d('0x3e')][_0xb35d('0x3f')]};});_0x17909b[_0xb35d('0x40')]=_[_0xb35d('0x3a')](_0x3298ec,_0xb35d('0x41'));_0x17909b[_0xb35d('0x42')]=_[_0xb35d('0x43')](_0x14eeb6[_0xb35d('0x42')]);_0x17909b[_0xb35d('0x44')]=_[_0xb35d('0x45')](_0x17909b[_0xb35d('0x40')],_0x17909b['query']);_0x474cdd['attributes']=_['intersection'](_0x17909b['model'],qs[_0xb35d('0x46')](_0x14eeb6['query'][_0xb35d('0x46')]));_0x474cdd[_0xb35d('0x47')]=_0x474cdd['attributes'][_0xb35d('0x48')]?_0x474cdd[_0xb35d('0x47')]:_0x17909b[_0xb35d('0x40')];if(!_0x14eeb6[_0xb35d('0x42')]['hasOwnProperty']('nolimit')){_0x474cdd[_0xb35d('0x2e')]=qs['limit'](_0x14eeb6[_0xb35d('0x42')][_0xb35d('0x2e')]);_0x474cdd[_0xb35d('0x2f')]=qs['offset'](_0x14eeb6['query'][_0xb35d('0x2f')]);}_0x474cdd[_0xb35d('0x49')]=qs[_0xb35d('0x4a')](_0x14eeb6[_0xb35d('0x42')][_0xb35d('0x4a')]);_0x474cdd[_0xb35d('0x4b')]=qs[_0xb35d('0x44')](_[_0xb35d('0x4c')](_0x14eeb6['query'],_0x17909b[_0xb35d('0x44')]),_0x3298ec);if(_0x14eeb6[_0xb35d('0x42')][_0xb35d('0x4d')]){_0x474cdd[_0xb35d('0x4b')]=_[_0xb35d('0x4e')](_0x474cdd['where'],{'$or':_['map'](_0x3298ec,function(_0x10e353){if(_0x10e353[_0xb35d('0x3e')]!=='VIRTUAL'){var _0x4dbdd9={};_0x4dbdd9[_0x10e353[_0xb35d('0x41')]]={'$like':'%'+_0x14eeb6[_0xb35d('0x42')]['filter']+'%'};return _0x4dbdd9;}})});}_0x474cdd=_[_0xb35d('0x4e')]({},_0x474cdd,_0x14eeb6[_0xb35d('0x4f')]);var _0x6b524={'where':_0x474cdd[_0xb35d('0x4b')]};return db['ChatMessage'][_0xb35d('0x50')](_0x6b524)['then'](function(_0x66817e){_0x16427f['count']=_0x66817e;if(_0x14eeb6['query'][_0xb35d('0x51')]){_0x474cdd[_0xb35d('0x52')]=[{'all':!![]}];}return db[_0xb35d('0x3b')][_0xb35d('0x53')](_0x474cdd);})[_0xb35d('0x35')](function(_0x23b8a8){_0x16427f[_0xb35d('0x54')]=_0x23b8a8;return _0x16427f;})[_0xb35d('0x35')](respondWithFilteredResult(_0x590624,_0x474cdd))[_0xb35d('0x29')](handleError(_0x590624,null));};exports[_0xb35d('0x55')]=function(_0x5dcb63,_0x22408a){var _0x788940={'raw':!![],'where':{'id':_0x5dcb63[_0xb35d('0x56')]['id']}},_0x238621={};_0x238621['model']=_[_0xb35d('0x43')](db[_0xb35d('0x3b')][_0xb35d('0x3c')]);_0x238621[_0xb35d('0x42')]=_[_0xb35d('0x43')](_0x5dcb63[_0xb35d('0x42')]);_0x238621[_0xb35d('0x44')]=_[_0xb35d('0x45')](_0x238621[_0xb35d('0x40')],_0x238621['query']);_0x788940[_0xb35d('0x47')]=_[_0xb35d('0x45')](_0x238621[_0xb35d('0x40')],qs[_0xb35d('0x46')](_0x5dcb63['query'][_0xb35d('0x46')]));_0x788940['attributes']=_0x788940[_0xb35d('0x47')][_0xb35d('0x48')]?_0x788940['attributes']:_0x238621[_0xb35d('0x40')];if(_0x5dcb63[_0xb35d('0x42')]['includeAll']){_0x788940[_0xb35d('0x52')]=[{'all':!![]}];}_0x788940=_[_0xb35d('0x4e')]({},_0x788940,_0x5dcb63[_0xb35d('0x4f')]);return db[_0xb35d('0x3b')][_0xb35d('0x57')](_0x788940)[_0xb35d('0x35')](handleEntityNotFound(_0x22408a,null))[_0xb35d('0x35')](respondWithResult(_0x22408a,null))[_0xb35d('0x29')](handleError(_0x22408a,null));};exports[_0xb35d('0x58')]=function(_0x1be3d0,_0x738e4e){return db[_0xb35d('0x3b')][_0xb35d('0x58')](_0x1be3d0[_0xb35d('0x59')],{})[_0xb35d('0x35')](respondWithResult(_0x738e4e,0xc9))[_0xb35d('0x29')](handleError(_0x738e4e,null));};exports[_0xb35d('0x34')]=function(_0x39c4ea,_0xe336a1){if(_0x39c4ea[_0xb35d('0x59')]['id']){delete _0x39c4ea['body']['id'];}return db[_0xb35d('0x3b')][_0xb35d('0x57')]({'where':{'id':_0x39c4ea[_0xb35d('0x56')]['id']}})[_0xb35d('0x35')](handleEntityNotFound(_0xe336a1,null))['then'](saveUpdates(_0x39c4ea[_0xb35d('0x59')],null))[_0xb35d('0x35')](respondWithResult(_0xe336a1,null))[_0xb35d('0x29')](handleError(_0xe336a1,null));};exports[_0xb35d('0x36')]=function(_0x5d40f2,_0x44ac56){return db[_0xb35d('0x3b')][_0xb35d('0x57')]({'where':{'id':_0x5d40f2[_0xb35d('0x56')]['id']}})[_0xb35d('0x35')](handleEntityNotFound(_0x44ac56,null))[_0xb35d('0x35')](removeEntity(_0x44ac56,null))[_0xb35d('0x29')](handleError(_0x44ac56,null));};exports[_0xb35d('0x5a')]=function(_0x5cd620,_0x23f75e){return db[_0xb35d('0x3b')][_0xb35d('0x5a')]()[_0xb35d('0x35')](respondWithResult(_0x23f75e,null))[_0xb35d('0x29')](handleError(_0x23f75e,null));};var interaction_log=require(_0xb35d('0x5b'))(_0xb35d('0x5c'));exports[_0xb35d('0x5d')]=function(_0xbcbd15,_0x53be8b,_0x4f10ee){var _0x5c6104={'agent':{},'channel':_0xb35d('0x5e')};if(_0xbcbd15[_0xb35d('0x59')]['id']){delete _0xbcbd15[_0xb35d('0x59')]['id'];}_0xbcbd15['body'][_0xb35d('0x5f')]=!![];_0xbcbd15[_0xb35d('0x59')][_0xb35d('0x60')]=moment()[_0xb35d('0x61')](_0xb35d('0x62'));_0xbcbd15[_0xb35d('0x59')][_0xb35d('0x63')]=_0xbcbd15['body']['UserId']||_0xbcbd15['user']['id'];_0x5c6104[_0xb35d('0x64')]['id']=_0xbcbd15['body']['UserId'];return db[_0xb35d('0x3b')][_0xb35d('0x57')]({'where':{'id':_0xbcbd15[_0xb35d('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x53be8b,null))[_0xb35d('0x35')](saveUpdates(_0xbcbd15[_0xb35d('0x59')],null))[_0xb35d('0x35')](function(_0x106883){if(_0x106883){_0x5c6104[_0xb35d('0x25')]=_0x106883['get']({'plain':!![]});return db['ChatInteraction'][_0xb35d('0x57')]({'where':{'id':_0x106883[_0xb35d('0x65')]}});}return null;})[_0xb35d('0x35')](handleEntityNotFound(_0x53be8b,null))['then'](function(_0xc22b8f){if(_0xc22b8f){return _0xc22b8f[_0xb35d('0x34')]({'UserId':_0xbcbd15['body']['UserId'],'read1stAt':_['isNil'](_0xc22b8f['read1stAt'])?moment()[_0xb35d('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2fafdf){if(_0x2fafdf){_0x5c6104[_0xb35d('0x66')]=_0x2fafdf[_0xb35d('0x67')]({'plain':!![]});interaction_log[_0xb35d('0x27')](_0xb35d('0x68'),_0xbcbd15[_0xb35d('0x69')]['id'],_0xbcbd15['user'][_0xb35d('0x41')],_0xbcbd15[_0xb35d('0x69')][_0xb35d('0x6a')],_0x5c6104['interaction']['id'],_0xbcbd15[_0xb35d('0x59')]?JSON[_0xb35d('0x22')](_0xbcbd15[_0xb35d('0x59')]):_0xb35d('0x6b'));return respondWithRpcPromise(_0xb35d('0x6c'),'acceptMessage',_0x5c6104);}return null;})[_0xb35d('0x35')](function(_0x27f94f){var _0x155367=_0xb35d('0x6d')+_0x27f94f[_0xb35d('0x25')][_0xb35d('0x6e')];return db[_0xb35d('0x6f')][_0xb35d('0x42')](_0x155367,{'type':db['Sequelize'][_0xb35d('0x70')]['SELECT'],'raw':!![]})[_0xb35d('0x35')](function(_0x226554){return _0x226554;});})[_0xb35d('0x35')](function(_0x5062e5){if(_0x5062e5){_0x5c6104[_0xb35d('0x25')][_0xb35d('0x71')]=_0x5062e5[0x0];if(!_0xbcbd15[_0xb35d('0x59')][_0xb35d('0x63')])return;return db[_0xb35d('0x72')]['find']({'where':{'id':_0xbcbd15['body'][_0xb35d('0x63')],'role':'agent'},'attributes':['id','name','fullname',_0xb35d('0x73'),_0xb35d('0x74')],'raw':!![]});}return null;})[_0xb35d('0x35')](function(_0x4d9dc3){if(!_0x4d9dc3)return null;_0x5c6104[_0xb35d('0x25')][_0xb35d('0x64')]=_0x4d9dc3;return _0x5c6104;})[_0xb35d('0x35')](function(_0x409893){if(_0x409893){if(_0xbcbd15[_0xb35d('0x59')][_0xb35d('0x75')]){_0x5c6104['message'][_0xb35d('0x76')]=util[_0xb35d('0x61')](_0xb35d('0x77'),_0xbcbd15[_0xb35d('0x69')]['name']);_0x5c6104[_0xb35d('0x25')][_0xb35d('0x78')]=_0x5c6104['channel'];_0x5c6104[_0xb35d('0x25')][_0xb35d('0x79')]=_0x5c6104[_0xb35d('0x78')];_0x5c6104['message']['event']='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0xb35d('0x7a'),'message':_['merge'](_0x5c6104[_0xb35d('0x25')],JSON[_0xb35d('0x7b')](_0x5c6104[_0xb35d('0x66')][_0xb35d('0x7c')]))},client9002)[_0xb35d('0x35')](function(){return _0x5c6104;});}return _0x5c6104;}return null;})[_0xb35d('0x35')](respondWithResult(_0x53be8b,null))['catch'](handleError(_0x53be8b,null));};var interaction_log=require(_0xb35d('0x5b'))(_0xb35d('0x5c'));exports[_0xb35d('0x32')]=function(_0x3d900c,_0x3645be,_0x4ae155){var _0x461251={'agent':{},'channel':_0xb35d('0x5e')};if(_0x3d900c['body']['id']){delete _0x3d900c[_0xb35d('0x59')]['id'];}_0x3d900c['body'][_0xb35d('0x63')]=_0x3d900c[_0xb35d('0x59')][_0xb35d('0x63')]||_0x3d900c['user']['id'];_0x461251['agent']['id']=_0x3d900c[_0xb35d('0x59')][_0xb35d('0x63')];return db['ChatMessage'][_0xb35d('0x57')]({'where':{'id':_0x3d900c['params']['id'],'UserId':null}})[_0xb35d('0x35')](handleEntityNotFound(_0x3645be,null))[_0xb35d('0x35')](function(_0x25cbda){if(_0x25cbda){_0x461251[_0xb35d('0x25')]=_0x25cbda[_0xb35d('0x67')]({'plain':!![]});return db[_0xb35d('0x7d')][_0xb35d('0x57')]({'where':{'id':_0x25cbda[_0xb35d('0x65')]}});}return null;})[_0xb35d('0x35')](handleEntityNotFound(_0x3645be,null))[_0xb35d('0x35')](function(_0x513ca7){if(_0x513ca7){_0x461251[_0xb35d('0x66')]=_0x513ca7[_0xb35d('0x67')]({'plain':!![]});interaction_log['info'](_0xb35d('0x7e'),_0x3d900c['user']['id'],_0x3d900c[_0xb35d('0x69')][_0xb35d('0x41')],_0x3d900c['user'][_0xb35d('0x6a')],_0x461251[_0xb35d('0x66')]['id'],_0x3d900c['body']?JSON[_0xb35d('0x22')](_0x3d900c['body']):_0xb35d('0x6b'));return respondWithRpcPromise(_0xb35d('0x7f'),_0xb35d('0x80'),_0x461251);}return null;})[_0xb35d('0x35')](function(_0x1523cf){var _0x25b429=_0xb35d('0x6d')+_0x1523cf[_0xb35d('0x25')][_0xb35d('0x6e')];return db['sequelize'][_0xb35d('0x42')](_0x25b429,{'type':db[_0xb35d('0x81')][_0xb35d('0x70')][_0xb35d('0x82')],'raw':!![]})[_0xb35d('0x35')](function(_0x472525){return _0x472525;});})[_0xb35d('0x35')](function(_0x2ac00b){if(_0x2ac00b){_0x461251['message'][_0xb35d('0x71')]=_0x2ac00b[0x0];if(!_0x3d900c[_0xb35d('0x59')][_0xb35d('0x63')])return;return db['User'][_0xb35d('0x57')]({'where':{'id':_0x3d900c[_0xb35d('0x59')][_0xb35d('0x63')],'role':_0xb35d('0x64')},'attributes':['id',_0xb35d('0x41'),_0xb35d('0x83'),_0xb35d('0x73'),_0xb35d('0x74')],'raw':!![]});}return null;})[_0xb35d('0x35')](function(_0x1a05f7){if(!_0x1a05f7)return null;_0x461251[_0xb35d('0x25')]['agent']=_0x1a05f7;return _0x461251;})[_0xb35d('0x35')](function(_0x108420){if(_0x108420){_0x108420[_0xb35d('0x25')][_0xb35d('0x76')]=util[_0xb35d('0x61')](_0xb35d('0x77'),_0x3d900c['user']['name']);_0x108420['message'][_0xb35d('0x78')]=_0x461251[_0xb35d('0x78')];_0x108420[_0xb35d('0x25')][_0xb35d('0x79')]=_0x461251[_0xb35d('0x78')];_0x108420[_0xb35d('0x25')][_0xb35d('0x84')]=_0xb35d('0x32');respondWithRpcPromise(_0xb35d('0x85'),_0xb35d('0x85'),{'event':_0xb35d('0x86'),'message':_[_0xb35d('0x4e')](_0x461251['message'],JSON[_0xb35d('0x7b')](_0x461251[_0xb35d('0x66')][_0xb35d('0x7c')]))},client9002);return _0x461251;}return null;})['then'](respondWithResult(_0x3645be,null))[_0xb35d('0x29')](handleError(_0x3645be,null));};
\ No newline at end of file
+var _0x1d6b=['SELECT','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatMessage,\x20%s,\x20%s','status','json','offset','undefined','count','Content-Range','save','update','destroy','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','parse','reject','ChatInteraction','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize'];(function(_0x3a4407,_0x1e2c3f){var _0x147c0b=function(_0x5e2b10){while(--_0x5e2b10){_0x3a4407['push'](_0x3a4407['shift']());}};_0x147c0b(++_0x1e2c3f);}(_0x1d6b,0x187));var _0xb1d6=function(_0x45adb4,_0x2abb06){_0x45adb4=_0x45adb4-0x0;var _0x137296=_0x1d6b[_0x45adb4];return _0x137296;};'use strict';var emlformat=require(_0xb1d6('0x0'));var rimraf=require(_0xb1d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1d6('0x2'));var rp=require(_0xb1d6('0x3'));var moment=require(_0xb1d6('0x4'));var BPromise=require(_0xb1d6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb1d6('0x6'));var sox=require(_0xb1d6('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1d6('0x8'));var _=require(_0xb1d6('0x9'));var squel=require(_0xb1d6('0xa'));var crypto=require(_0xb1d6('0xb'));var jsforce=require(_0xb1d6('0xc'));var deskjs=require(_0xb1d6('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb1d6('0xe'));var Papa=require(_0xb1d6('0xf'));var Redis=require(_0xb1d6('0x10'));var authService=require(_0xb1d6('0x11'));var qs=require(_0xb1d6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1d6('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb1d6('0x14'));var config=require(_0xb1d6('0x15'));var licenseUtil=require(_0xb1d6('0x16'));var db=require(_0xb1d6('0x17'))['db'];config[_0xb1d6('0x18')]=_['defaults'](config[_0xb1d6('0x18')],{'host':_0xb1d6('0x19'),'port':0x18eb});var socket=require(_0xb1d6('0x1a'))(new Redis(config['redis']));require(_0xb1d6('0x1b'))[_0xb1d6('0x1c')](socket);var jayson=require(_0xb1d6('0x1d'));var client=jayson[_0xb1d6('0x1e')][_0xb1d6('0x1f')]({'port':0x232c});var client9002=jayson[_0xb1d6('0x1e')][_0xb1d6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x45c470,_0x801e9,_0x54598f,_0x473e79){return new BPromise(function(_0x3c5650,_0x36dc36){var _0x17724f=_0x473e79||client;return _0x17724f[_0xb1d6('0x20')](_0x45c470,_0x54598f)[_0xb1d6('0x21')](function(_0x50bc46){logger[_0xb1d6('0x22')]('ChatMessage,\x20%s,\x20%s',_0x801e9,_0xb1d6('0x23'));logger['debug'](_0xb1d6('0x24'),_0x801e9,_0xb1d6('0x23'),JSON[_0xb1d6('0x25')](_0x50bc46));if(_0x50bc46[_0xb1d6('0x26')]){if(_0x50bc46[_0xb1d6('0x26')]['code']===0x1f4){logger[_0xb1d6('0x26')]('ChatMessage,\x20%s,\x20%s',_0x801e9,_0x50bc46[_0xb1d6('0x26')]['message']);return _0x36dc36(_0x50bc46[_0xb1d6('0x26')][_0xb1d6('0x27')]);}logger[_0xb1d6('0x26')]('ChatMessage,\x20%s,\x20%s',_0x801e9,_0x50bc46[_0xb1d6('0x26')][_0xb1d6('0x27')]);return _0x3c5650(_0x50bc46['error'][_0xb1d6('0x27')]);}else{logger[_0xb1d6('0x22')]('ChatMessage,\x20%s,\x20%s',_0x801e9,_0xb1d6('0x23'));_0x3c5650(_0x50bc46[_0xb1d6('0x28')][_0xb1d6('0x27')]);}})[_0xb1d6('0x29')](function(_0x4d53db){logger[_0xb1d6('0x26')](_0xb1d6('0x2a'),_0x801e9,_0x4d53db);_0x36dc36(_0x4d53db);});});}function respondWithStatusCode(_0x1e16af,_0x59911f){_0x59911f=_0x59911f||0xcc;return function(_0x35ffd8){if(_0x35ffd8){return _0x1e16af['sendStatus'](_0x59911f);}return _0x1e16af[_0xb1d6('0x2b')](_0x59911f)['end']();};}function respondWithResult(_0x7bb7f1,_0x5dfe83){_0x5dfe83=_0x5dfe83||0xc8;return function(_0x5950d0){if(_0x5950d0){return _0x7bb7f1[_0xb1d6('0x2b')](_0x5dfe83)[_0xb1d6('0x2c')](_0x5950d0);}};}function respondWithFilteredResult(_0x80f78d,_0x449bcd){return function(_0x24036a){if(_0x24036a){var _0xa53bd8=typeof _0x449bcd[_0xb1d6('0x2d')]===_0xb1d6('0x2e')&&typeof _0x449bcd['limit']===_0xb1d6('0x2e');var _0x181504=_0x24036a['count'];var _0x55f221=_0xa53bd8?0x0:_0x449bcd['offset'];var _0xf7b39c=_0xa53bd8?_0x24036a[_0xb1d6('0x2f')]:_0x449bcd[_0xb1d6('0x2d')]+_0x449bcd['limit'];var _0x3314f0;if(_0xf7b39c>=_0x181504){_0xf7b39c=_0x181504;_0x3314f0=0xc8;}else{_0x3314f0=0xce;}_0x80f78d['status'](_0x3314f0);return _0x80f78d['set'](_0xb1d6('0x30'),_0x55f221+'-'+_0xf7b39c+'/'+_0x181504)[_0xb1d6('0x2c')](_0x24036a);}return null;};}function patchUpdates(_0x1a673b){return function(_0xa4b35c){try{jsonpatch['apply'](_0xa4b35c,_0x1a673b,!![]);}catch(_0x1a4fc8){return BPromise['reject'](_0x1a4fc8);}return _0xa4b35c[_0xb1d6('0x31')]();};}function saveUpdates(_0x5eff05,_0x4b8769){return function(_0x315991){if(_0x315991){return _0x315991[_0xb1d6('0x32')](_0x5eff05)['then'](function(_0xbf0083){return _0xbf0083;});}return null;};}function removeEntity(_0x4f9e13,_0x59d0f6){return function(_0x29ed32){if(_0x29ed32){return _0x29ed32[_0xb1d6('0x33')]()[_0xb1d6('0x21')](function(){_0x4f9e13[_0xb1d6('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x578483,_0x177f61){return function(_0x52e546){if(!_0x52e546){_0x578483[_0xb1d6('0x34')](0x194);}return _0x52e546;};}function handleError(_0x1d5273,_0x48af3e){_0x48af3e=_0x48af3e||0x1f4;return function(_0x3f34ef){logger[_0xb1d6('0x26')](_0x3f34ef[_0xb1d6('0x35')]);if(_0x3f34ef['name']){delete _0x3f34ef[_0xb1d6('0x36')];}_0x1d5273[_0xb1d6('0x2b')](_0x48af3e)[_0xb1d6('0x37')](_0x3f34ef);};}exports['index']=function(_0x45ffeb,_0x7a3d9e){var _0x5f22fa={},_0x2eb482={},_0x3893e2={'count':0x0,'rows':[]};var _0x564bfc=_[_0xb1d6('0x38')](db[_0xb1d6('0x39')][_0xb1d6('0x3a')],function(_0x158769){return{'name':_0x158769[_0xb1d6('0x3b')],'type':_0x158769[_0xb1d6('0x3c')][_0xb1d6('0x3d')]};});_0x2eb482['model']=_[_0xb1d6('0x38')](_0x564bfc,_0xb1d6('0x36'));_0x2eb482[_0xb1d6('0x3e')]=_[_0xb1d6('0x3f')](_0x45ffeb[_0xb1d6('0x3e')]);_0x2eb482[_0xb1d6('0x40')]=_[_0xb1d6('0x41')](_0x2eb482[_0xb1d6('0x42')],_0x2eb482[_0xb1d6('0x3e')]);_0x5f22fa[_0xb1d6('0x43')]=_[_0xb1d6('0x41')](_0x2eb482['model'],qs[_0xb1d6('0x44')](_0x45ffeb[_0xb1d6('0x3e')][_0xb1d6('0x44')]));_0x5f22fa[_0xb1d6('0x43')]=_0x5f22fa[_0xb1d6('0x43')]['length']?_0x5f22fa[_0xb1d6('0x43')]:_0x2eb482[_0xb1d6('0x42')];if(!_0x45ffeb['query']['hasOwnProperty'](_0xb1d6('0x45'))){_0x5f22fa[_0xb1d6('0x46')]=qs[_0xb1d6('0x46')](_0x45ffeb['query'][_0xb1d6('0x46')]);_0x5f22fa[_0xb1d6('0x2d')]=qs[_0xb1d6('0x2d')](_0x45ffeb[_0xb1d6('0x3e')][_0xb1d6('0x2d')]);}_0x5f22fa[_0xb1d6('0x47')]=qs[_0xb1d6('0x48')](_0x45ffeb['query'][_0xb1d6('0x48')]);_0x5f22fa[_0xb1d6('0x49')]=qs['filters'](_[_0xb1d6('0x4a')](_0x45ffeb[_0xb1d6('0x3e')],_0x2eb482[_0xb1d6('0x40')]),_0x564bfc);if(_0x45ffeb['query'][_0xb1d6('0x4b')]){_0x5f22fa[_0xb1d6('0x49')]=_[_0xb1d6('0x4c')](_0x5f22fa[_0xb1d6('0x49')],{'$or':_[_0xb1d6('0x38')](_0x564bfc,function(_0x2c68e7){if(_0x2c68e7[_0xb1d6('0x3c')]!==_0xb1d6('0x4d')){var _0x18c080={};_0x18c080[_0x2c68e7['name']]={'$like':'%'+_0x45ffeb[_0xb1d6('0x3e')][_0xb1d6('0x4b')]+'%'};return _0x18c080;}})});}_0x5f22fa=_[_0xb1d6('0x4c')]({},_0x5f22fa,_0x45ffeb[_0xb1d6('0x4e')]);var _0x3dbb54={'where':_0x5f22fa[_0xb1d6('0x49')]};return db[_0xb1d6('0x39')]['count'](_0x3dbb54)[_0xb1d6('0x21')](function(_0xe49375){_0x3893e2[_0xb1d6('0x2f')]=_0xe49375;if(_0x45ffeb[_0xb1d6('0x3e')][_0xb1d6('0x4f')]){_0x5f22fa['include']=[{'all':!![]}];}return db[_0xb1d6('0x39')][_0xb1d6('0x50')](_0x5f22fa);})[_0xb1d6('0x21')](function(_0x2059df){_0x3893e2[_0xb1d6('0x51')]=_0x2059df;return _0x3893e2;})[_0xb1d6('0x21')](respondWithFilteredResult(_0x7a3d9e,_0x5f22fa))['catch'](handleError(_0x7a3d9e,null));};exports[_0xb1d6('0x52')]=function(_0x14fe23,_0x17a866){var _0xebe78e={'raw':!![],'where':{'id':_0x14fe23[_0xb1d6('0x53')]['id']}},_0x5df7a2={};_0x5df7a2[_0xb1d6('0x42')]=_[_0xb1d6('0x3f')](db[_0xb1d6('0x39')][_0xb1d6('0x3a')]);_0x5df7a2[_0xb1d6('0x3e')]=_[_0xb1d6('0x3f')](_0x14fe23[_0xb1d6('0x3e')]);_0x5df7a2[_0xb1d6('0x40')]=_[_0xb1d6('0x41')](_0x5df7a2[_0xb1d6('0x42')],_0x5df7a2['query']);_0xebe78e[_0xb1d6('0x43')]=_['intersection'](_0x5df7a2[_0xb1d6('0x42')],qs[_0xb1d6('0x44')](_0x14fe23[_0xb1d6('0x3e')][_0xb1d6('0x44')]));_0xebe78e['attributes']=_0xebe78e['attributes'][_0xb1d6('0x54')]?_0xebe78e[_0xb1d6('0x43')]:_0x5df7a2[_0xb1d6('0x42')];if(_0x14fe23['query']['includeAll']){_0xebe78e[_0xb1d6('0x55')]=[{'all':!![]}];}_0xebe78e=_[_0xb1d6('0x4c')]({},_0xebe78e,_0x14fe23[_0xb1d6('0x4e')]);return db[_0xb1d6('0x39')][_0xb1d6('0x56')](_0xebe78e)[_0xb1d6('0x21')](handleEntityNotFound(_0x17a866,null))[_0xb1d6('0x21')](respondWithResult(_0x17a866,null))[_0xb1d6('0x29')](handleError(_0x17a866,null));};exports[_0xb1d6('0x57')]=function(_0x55f3e9,_0x46219e){return db[_0xb1d6('0x39')][_0xb1d6('0x57')](_0x55f3e9['body'],{})[_0xb1d6('0x21')](respondWithResult(_0x46219e,0xc9))[_0xb1d6('0x29')](handleError(_0x46219e,null));};exports[_0xb1d6('0x32')]=function(_0x1330b5,_0x51093){if(_0x1330b5[_0xb1d6('0x58')]['id']){delete _0x1330b5[_0xb1d6('0x58')]['id'];}return db[_0xb1d6('0x39')][_0xb1d6('0x56')]({'where':{'id':_0x1330b5[_0xb1d6('0x53')]['id']}})[_0xb1d6('0x21')](handleEntityNotFound(_0x51093,null))[_0xb1d6('0x21')](saveUpdates(_0x1330b5[_0xb1d6('0x58')],null))[_0xb1d6('0x21')](respondWithResult(_0x51093,null))[_0xb1d6('0x29')](handleError(_0x51093,null));};exports['destroy']=function(_0xc18b5c,_0x4e586c){return db[_0xb1d6('0x39')][_0xb1d6('0x56')]({'where':{'id':_0xc18b5c[_0xb1d6('0x53')]['id']}})[_0xb1d6('0x21')](handleEntityNotFound(_0x4e586c,null))[_0xb1d6('0x21')](removeEntity(_0x4e586c,null))[_0xb1d6('0x29')](handleError(_0x4e586c,null));};exports[_0xb1d6('0x59')]=function(_0x38141b,_0x411698){return db[_0xb1d6('0x39')]['describe']()[_0xb1d6('0x21')](respondWithResult(_0x411698,null))['catch'](handleError(_0x411698,null));};var interaction_log=require(_0xb1d6('0x5a'))(_0xb1d6('0x5b'));exports[_0xb1d6('0x5c')]=function(_0x42976f,_0x59209f,_0x1361d2){var _0x42224a={'agent':{},'channel':_0xb1d6('0x5d')};if(_0x42976f[_0xb1d6('0x58')]['id']){delete _0x42976f[_0xb1d6('0x58')]['id'];}_0x42976f[_0xb1d6('0x58')][_0xb1d6('0x5e')]=!![];_0x42976f[_0xb1d6('0x58')][_0xb1d6('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x42976f['body'][_0xb1d6('0x60')]=_0x42976f['body'][_0xb1d6('0x60')]||_0x42976f['user']['id'];_0x42224a[_0xb1d6('0x61')]['id']=_0x42976f[_0xb1d6('0x58')][_0xb1d6('0x60')];return db['ChatMessage'][_0xb1d6('0x56')]({'where':{'id':_0x42976f[_0xb1d6('0x53')]['id'],'UserId':null}})[_0xb1d6('0x21')](handleEntityNotFound(_0x59209f,null))['then'](saveUpdates(_0x42976f['body'],null))[_0xb1d6('0x21')](function(_0x3ddb37){if(_0x3ddb37){_0x42224a[_0xb1d6('0x27')]=_0x3ddb37[_0xb1d6('0x62')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x3ddb37[_0xb1d6('0x63')]}});}return null;})[_0xb1d6('0x21')](handleEntityNotFound(_0x59209f,null))[_0xb1d6('0x21')](function(_0x5472cd){if(_0x5472cd){return _0x5472cd[_0xb1d6('0x32')]({'UserId':_0x42976f[_0xb1d6('0x58')]['UserId'],'read1stAt':_[_0xb1d6('0x64')](_0x5472cd[_0xb1d6('0x65')])?moment()[_0xb1d6('0x66')](_0xb1d6('0x67')):undefined});}return null;})[_0xb1d6('0x21')](function(_0x2b627b){if(_0x2b627b){_0x42224a[_0xb1d6('0x68')]=_0x2b627b[_0xb1d6('0x62')]({'plain':!![]});interaction_log[_0xb1d6('0x22')](_0xb1d6('0x69'),_0x42976f[_0xb1d6('0x6a')]['id'],_0x42976f[_0xb1d6('0x6a')][_0xb1d6('0x36')],_0x42976f['user'][_0xb1d6('0x6b')],_0x42224a[_0xb1d6('0x68')]['id'],_0x42976f[_0xb1d6('0x58')]?JSON[_0xb1d6('0x25')](_0x42976f['body']):'null');return respondWithRpcPromise(_0xb1d6('0x6c'),_0xb1d6('0x6d'),_0x42224a);}return null;})['then'](function(_0x11307a){var _0x7c2de5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x11307a[_0xb1d6('0x27')][_0xb1d6('0x6e')];return db[_0xb1d6('0x6f')][_0xb1d6('0x3e')](_0x7c2de5,{'type':db['Sequelize'][_0xb1d6('0x70')]['SELECT'],'raw':!![]})[_0xb1d6('0x21')](function(_0x8175be){return _0x8175be;});})[_0xb1d6('0x21')](function(_0x4804ff){if(_0x4804ff){_0x42224a[_0xb1d6('0x27')]['contact']=_0x4804ff[0x0];if(!_0x42976f[_0xb1d6('0x58')][_0xb1d6('0x60')])return;return db[_0xb1d6('0x71')][_0xb1d6('0x56')]({'where':{'id':_0x42976f[_0xb1d6('0x58')][_0xb1d6('0x60')],'role':_0xb1d6('0x61')},'attributes':['id','name',_0xb1d6('0x72'),_0xb1d6('0x73'),_0xb1d6('0x74')],'raw':!![]});}return null;})['then'](function(_0x1f385e){if(!_0x1f385e)return null;_0x42224a[_0xb1d6('0x27')][_0xb1d6('0x61')]=_0x1f385e;return _0x42224a;})['then'](function(_0x2e4352){if(_0x2e4352){if(_0x42976f[_0xb1d6('0x58')]['manual']){_0x42224a['message']['interface']=util[_0xb1d6('0x66')](_0xb1d6('0x75'),_0x42976f[_0xb1d6('0x6a')][_0xb1d6('0x36')]);_0x42224a[_0xb1d6('0x27')][_0xb1d6('0x76')]=_0x42224a[_0xb1d6('0x76')];_0x42224a['message'][_0xb1d6('0x77')]=_0x42224a[_0xb1d6('0x76')];_0x42224a[_0xb1d6('0x27')][_0xb1d6('0x78')]=_0xb1d6('0x5c');return respondWithRpcPromise(_0xb1d6('0x79'),_0xb1d6('0x79'),{'event':'acceptmessage','message':_[_0xb1d6('0x4c')](_0x42224a[_0xb1d6('0x27')],JSON[_0xb1d6('0x7a')](_0x42224a[_0xb1d6('0x68')]['formData']))},client9002)[_0xb1d6('0x21')](function(){return _0x42224a;});}return _0x42224a;}return null;})[_0xb1d6('0x21')](respondWithResult(_0x59209f,null))[_0xb1d6('0x29')](handleError(_0x59209f,null));};var interaction_log=require(_0xb1d6('0x5a'))(_0xb1d6('0x5b'));exports[_0xb1d6('0x7b')]=function(_0x137d9e,_0x5e4ec8,_0x171296){var _0x17c1eb={'agent':{},'channel':_0xb1d6('0x5d')};if(_0x137d9e[_0xb1d6('0x58')]['id']){delete _0x137d9e[_0xb1d6('0x58')]['id'];}_0x137d9e[_0xb1d6('0x58')][_0xb1d6('0x60')]=_0x137d9e[_0xb1d6('0x58')][_0xb1d6('0x60')]||_0x137d9e['user']['id'];_0x17c1eb[_0xb1d6('0x61')]['id']=_0x137d9e[_0xb1d6('0x58')]['UserId'];return db[_0xb1d6('0x39')][_0xb1d6('0x56')]({'where':{'id':_0x137d9e[_0xb1d6('0x53')]['id'],'UserId':null}})[_0xb1d6('0x21')](handleEntityNotFound(_0x5e4ec8,null))[_0xb1d6('0x21')](function(_0x26d0d7){if(_0x26d0d7){_0x17c1eb[_0xb1d6('0x27')]=_0x26d0d7[_0xb1d6('0x62')]({'plain':!![]});return db[_0xb1d6('0x7c')][_0xb1d6('0x56')]({'where':{'id':_0x26d0d7[_0xb1d6('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x5e4ec8,null))[_0xb1d6('0x21')](function(_0x48da9f){if(_0x48da9f){_0x17c1eb['interaction']=_0x48da9f[_0xb1d6('0x62')]({'plain':!![]});interaction_log[_0xb1d6('0x22')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x137d9e[_0xb1d6('0x6a')]['id'],_0x137d9e[_0xb1d6('0x6a')][_0xb1d6('0x36')],_0x137d9e[_0xb1d6('0x6a')][_0xb1d6('0x6b')],_0x17c1eb[_0xb1d6('0x68')]['id'],_0x137d9e[_0xb1d6('0x58')]?JSON[_0xb1d6('0x25')](_0x137d9e[_0xb1d6('0x58')]):_0xb1d6('0x7d'));return respondWithRpcPromise('RejectMessage',_0xb1d6('0x7e'),_0x17c1eb);}return null;})[_0xb1d6('0x21')](function(_0x4bcc12){var _0x4f9ed7=_0xb1d6('0x7f')+_0x4bcc12[_0xb1d6('0x27')][_0xb1d6('0x6e')];return db[_0xb1d6('0x6f')][_0xb1d6('0x3e')](_0x4f9ed7,{'type':db[_0xb1d6('0x80')][_0xb1d6('0x70')][_0xb1d6('0x81')],'raw':!![]})[_0xb1d6('0x21')](function(_0x202010){return _0x202010;});})[_0xb1d6('0x21')](function(_0x211ff2){if(_0x211ff2){_0x17c1eb[_0xb1d6('0x27')]['contact']=_0x211ff2[0x0];if(!_0x137d9e[_0xb1d6('0x58')][_0xb1d6('0x60')])return;return db[_0xb1d6('0x71')][_0xb1d6('0x56')]({'where':{'id':_0x137d9e[_0xb1d6('0x58')][_0xb1d6('0x60')],'role':'agent'},'attributes':['id',_0xb1d6('0x36'),'fullname',_0xb1d6('0x73'),_0xb1d6('0x74')],'raw':!![]});}return null;})[_0xb1d6('0x21')](function(_0x207d77){if(!_0x207d77)return null;_0x17c1eb['message']['agent']=_0x207d77;return _0x17c1eb;})[_0xb1d6('0x21')](function(_0x442a70){if(_0x442a70){_0x442a70[_0xb1d6('0x27')]['interface']=util[_0xb1d6('0x66')](_0xb1d6('0x75'),_0x137d9e['user'][_0xb1d6('0x36')]);_0x442a70['message'][_0xb1d6('0x76')]=_0x17c1eb[_0xb1d6('0x76')];_0x442a70['message'][_0xb1d6('0x77')]=_0x17c1eb['channel'];_0x442a70[_0xb1d6('0x27')]['event']='reject';respondWithRpcPromise(_0xb1d6('0x79'),'EventManager',{'event':'rejectmessage','message':_['merge'](_0x17c1eb[_0xb1d6('0x27')],JSON[_0xb1d6('0x7a')](_0x17c1eb[_0xb1d6('0x68')]['formData']))},client9002);return _0x17c1eb;}return null;})[_0xb1d6('0x21')](respondWithResult(_0x5e4ec8,null))[_0xb1d6('0x29')](handleError(_0x5e4ec8,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 5dedfda..e7c3986 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 _0x508d=['emit','exports','events','../../mysqldb','ChatMessage','save','update','remove'];(function(_0x98bde7,_0x41a56e){var _0x44c270=function(_0xfa99){while(--_0xfa99){_0x98bde7['push'](_0x98bde7['shift']());}};_0x44c270(++_0x41a56e);}(_0x508d,0x112));var _0xd508=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x508d[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0xd508('0x0'));var ChatMessage=require(_0xd508('0x1'))['db'][_0xd508('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd508('0x3'),'afterUpdate':_0xd508('0x4'),'afterDestroy':_0xd508('0x5')};function emitEvent(_0x110b9a){return function(_0x3c88af,_0x52374d,_0x16601d){ChatMessageEvents[_0xd508('0x6')](_0x110b9a+':'+_0x3c88af['id'],_0x3c88af);ChatMessageEvents['emit'](_0x110b9a,_0x3c88af);_0x16601d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xd508('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x01bc=['emit','hook','exports','events','../../mysqldb','ChatMessage','save','update','remove'];(function(_0x419ba4,_0x8fa8ea){var _0x4f355b=function(_0x3ac30f){while(--_0x3ac30f){_0x419ba4['push'](_0x419ba4['shift']());}};_0x4f355b(++_0x8fa8ea);}(_0x01bc,0xdb));var _0xc01b=function(_0x33b06a,_0x29db54){_0x33b06a=_0x33b06a-0x0;var _0x38a474=_0x01bc[_0x33b06a];return _0x38a474;};'use strict';var EventEmitter=require(_0xc01b('0x0'));var ChatMessage=require(_0xc01b('0x1'))['db'][_0xc01b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc01b('0x3'),'afterUpdate':_0xc01b('0x4'),'afterDestroy':_0xc01b('0x5')};function emitEvent(_0x4a7f34){return function(_0x20d5cd,_0x8bdec1,_0x42e3de){ChatMessageEvents[_0xc01b('0x6')](_0x4a7f34+':'+_0x20d5cd['id'],_0x20d5cd);ChatMessageEvents[_0xc01b('0x6')](_0x4a7f34,_0x20d5cd);_0x42e3de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xc01b('0x7')](e,emitEvent(event));}}module[_0xc01b('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 1a9d3aa..691b9a3 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 _0x30bd=['chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage'];(function(_0x3e5b7b,_0x1ca279){var _0x441af8=function(_0x3931e7){while(--_0x3931e7){_0x3e5b7b['push'](_0x3e5b7b['shift']());}};_0x441af8(++_0x1ca279);}(_0x30bd,0x9e));var _0xd30b=function(_0x15f43b,_0x53579a){_0x15f43b=_0x15f43b-0x0;var _0x2d753d=_0x30bd[_0x15f43b];return _0x2d753d;};'use strict';var _=require('lodash');var util=require(_0xd30b('0x0'));var logger=require(_0xd30b('0x1'))(_0xd30b('0x2'));var moment=require('moment');var BPromise=require(_0xd30b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd30b('0x4'));var rimraf=require(_0xd30b('0x5'));var config=require(_0xd30b('0x6'));var attributes=require(_0xd30b('0x7'));module[_0xd30b('0x8')]=function(_0x97228a,_0xac9328){return _0x97228a['define'](_0xd30b('0x9'),attributes,{'tableName':_0xd30b('0xa'),'paranoid':![],'indexes':[{'name':_0xd30b('0xb'),'fields':[_0xd30b('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a7026,_0xa42418,_0x508390){var _0x572124=_0x97228a[_0xd30b('0xd')];var _0x32a6ff=_0x3a7026[_0xd30b('0xe')]({'plain':!![]});if(_0x32a6ff['direction']['toLowerCase']()==='in'||_0x32a6ff[_0xd30b('0xf')][_0xd30b('0x10')]()===_0xd30b('0x11')&&!_0x32a6ff[_0xd30b('0x12')]&&!_[_0xd30b('0x13')](_0x32a6ff['UserId'])){_0x572124[_0xd30b('0x14')][_0xd30b('0x15')]({'where':{'id':_0x32a6ff[_0xd30b('0x16')]}})['then'](function(_0x557e6c){if(_0x557e6c){_0x557e6c[_0xd30b('0x17')]({'lastMsgAt':_0x32a6ff[_0xd30b('0x18')],'lastMsgDirection':_0x32a6ff[_0xd30b('0xf')]['toLowerCase']()});}})['catch'](function(_0x3accdd){console[_0xd30b('0x19')](_0x3accdd);});}_0x508390();}},'charset':_0xd30b('0x1a'),'collate':_0xd30b('0x1b')});};
\ No newline at end of file
+var _0x86e3=['chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','UserId','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','../../config/environment','define','ChatMessage'];(function(_0x4c062d,_0x13d802){var _0x30dcff=function(_0x5c9b13){while(--_0x5c9b13){_0x4c062d['push'](_0x4c062d['shift']());}};_0x30dcff(++_0x13d802);}(_0x86e3,0x178));var _0x386e=function(_0x5bf3c8,_0x5c268b){_0x5bf3c8=_0x5bf3c8-0x0;var _0xf2a998=_0x86e3[_0x5bf3c8];return _0xf2a998;};'use strict';var _=require(_0x386e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x386e('0x1'));var moment=require('moment');var BPromise=require(_0x386e('0x2'));var rp=require(_0x386e('0x3'));var fs=require('fs');var path=require(_0x386e('0x4'));var rimraf=require('rimraf');var config=require(_0x386e('0x5'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x4d1c5c,_0xd35d38){return _0x4d1c5c[_0x386e('0x6')](_0x386e('0x7'),attributes,{'tableName':_0x386e('0x8'),'paranoid':![],'indexes':[{'name':_0x386e('0x9'),'fields':['body'],'type':_0x386e('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x155829,_0x5a4d5f,_0x47475c){var _0x9da79a=_0x4d1c5c[_0x386e('0xb')];var _0x5459d2=_0x155829[_0x386e('0xc')]({'plain':!![]});if(_0x5459d2[_0x386e('0xd')][_0x386e('0xe')]()==='in'||_0x5459d2[_0x386e('0xd')]['toLowerCase']()==='out'&&!_0x5459d2['secret']&&!_['isNil'](_0x5459d2[_0x386e('0xf')])){_0x9da79a['ChatInteraction'][_0x386e('0x10')]({'where':{'id':_0x5459d2['ChatInteractionId']}})[_0x386e('0x11')](function(_0x442f8e){if(_0x442f8e){_0x442f8e[_0x386e('0x12')]({'lastMsgAt':_0x5459d2[_0x386e('0x13')],'lastMsgDirection':_0x5459d2['direction'][_0x386e('0xe')]()});}})[_0x386e('0x14')](function(_0x434157){console[_0x386e('0x15')](_0x434157);});}_0x47475c();}},'charset':_0x386e('0x16'),'collate':_0x386e('0x17')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 2f7756b..50b5876 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 _0x64c7=['result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message'];(function(_0x524346,_0x587607){var _0x519e5e=function(_0x18f17f){while(--_0x18f17f){_0x524346['push'](_0x524346['shift']());}};_0x519e5e(++_0x587607);}(_0x64c7,0x1b5));var _0x764c=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x64c7[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x764c('0x0'));var util=require(_0x764c('0x1'));var moment=require(_0x764c('0x2'));var BPromise=require(_0x764c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x764c('0x4'));var db=require(_0x764c('0x5'))['db'];var utils=require(_0x764c('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x764c('0x7'));var client=jayson[_0x764c('0x8')][_0x764c('0x9')]({'port':0x232a});config[_0x764c('0xa')]=_[_0x764c('0xb')](config[_0x764c('0xa')],{'host':_0x764c('0xc'),'port':0x18eb});var socket=require(_0x764c('0xd'))(new Redis(config[_0x764c('0xa')]));require('./chatMessage.socket')[_0x764c('0xe')](socket);function respondWithRpcPromise(_0x3b3f47,_0x292605,_0x33b88a){return new BPromise(function(_0x3d9019,_0x224eb0){return client['request'](_0x3b3f47,_0x33b88a)[_0x764c('0xf')](function(_0x4b5ac6){logger[_0x764c('0x10')]('ChatMessage,\x20%s,\x20%s',_0x292605,_0x764c('0x11'));logger[_0x764c('0x12')](_0x764c('0x13'),_0x292605,_0x764c('0x11'),JSON[_0x764c('0x14')](_0x4b5ac6));if(_0x4b5ac6['error']){if(_0x4b5ac6[_0x764c('0x15')][_0x764c('0x16')]===0x1f4){logger[_0x764c('0x15')](_0x764c('0x17'),_0x292605,_0x4b5ac6[_0x764c('0x15')][_0x764c('0x18')]);return _0x224eb0(_0x4b5ac6[_0x764c('0x15')]['message']);}logger[_0x764c('0x15')]('ChatMessage,\x20%s,\x20%s',_0x292605,_0x4b5ac6['error'][_0x764c('0x18')]);return _0x3d9019(_0x4b5ac6[_0x764c('0x15')]['message']);}else{logger[_0x764c('0x10')](_0x764c('0x17'),_0x292605,_0x764c('0x11'));_0x3d9019(_0x4b5ac6[_0x764c('0x19')][_0x764c('0x18')]);}})['catch'](function(_0x3a86cc){logger[_0x764c('0x15')](_0x764c('0x17'),_0x292605,_0x3a86cc);_0x224eb0(_0x3a86cc);});});}exports[_0x764c('0x1a')]=function(_0x475eac){var _0x36135c=this;return new Promise(function(_0x5c02c3,_0x318f24){return db[_0x764c('0x1b')][_0x764c('0x1c')](_0x475eac[_0x764c('0x1d')],{'raw':_0x475eac['options']?_0x475eac[_0x764c('0x1e')][_0x764c('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x1ce517){logger['info'](_0x764c('0x1a'),_0x475eac);logger[_0x764c('0x12')](_0x764c('0x1a'),_0x475eac,JSON['stringify'](_0x1ce517));_0x5c02c3(_0x1ce517);})[_0x764c('0x20')](function(_0x1e67cc){logger[_0x764c('0x15')](_0x764c('0x1a'),_0x1e67cc[_0x764c('0x18')],_0x475eac);_0x318f24(_0x36135c[_0x764c('0x15')](0x1f4,_0x1e67cc['message']));});});};
\ No newline at end of file
+var _0x2824=['rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3524c0,_0x2b87c1){var _0x3ea98f=function(_0x3bed11){while(--_0x3bed11){_0x3524c0['push'](_0x3524c0['shift']());}};_0x3ea98f(++_0x2b87c1);}(_0x2824,0xbf));var _0x4282=function(_0x57fa10,_0x1d91f7){_0x57fa10=_0x57fa10-0x0;var _0x19be7f=_0x2824[_0x57fa10];return _0x19be7f;};'use strict';var _=require(_0x4282('0x0'));var util=require('util');var moment=require(_0x4282('0x1'));var BPromise=require(_0x4282('0x2'));var rs=require(_0x4282('0x3'));var fs=require('fs');var Redis=require(_0x4282('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4282('0x5'));var logger=require(_0x4282('0x6'))(_0x4282('0x7'));var config=require('../../config/environment');var jayson=require(_0x4282('0x8'));var client=jayson[_0x4282('0x9')]['http']({'port':0x232a});config[_0x4282('0xa')]=_[_0x4282('0xb')](config[_0x4282('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4282('0xc'))(new Redis(config[_0x4282('0xa')]));require(_0x4282('0xd'))[_0x4282('0xe')](socket);function respondWithRpcPromise(_0x7da003,_0x1b4e29,_0x400686){return new BPromise(function(_0x4bc94a,_0x410c18){return client[_0x4282('0xf')](_0x7da003,_0x400686)[_0x4282('0x10')](function(_0x431f85){logger['info'](_0x4282('0x11'),_0x1b4e29,_0x4282('0x12'));logger[_0x4282('0x13')](_0x4282('0x14'),_0x1b4e29,_0x4282('0x12'),JSON[_0x4282('0x15')](_0x431f85));if(_0x431f85[_0x4282('0x16')]){if(_0x431f85[_0x4282('0x16')]['code']===0x1f4){logger[_0x4282('0x16')]('ChatMessage,\x20%s,\x20%s',_0x1b4e29,_0x431f85['error']['message']);return _0x410c18(_0x431f85[_0x4282('0x16')][_0x4282('0x17')]);}logger[_0x4282('0x16')](_0x4282('0x11'),_0x1b4e29,_0x431f85['error'][_0x4282('0x17')]);return _0x4bc94a(_0x431f85['error']['message']);}else{logger[_0x4282('0x18')](_0x4282('0x11'),_0x1b4e29,'request\x20sent');_0x4bc94a(_0x431f85[_0x4282('0x19')][_0x4282('0x17')]);}})[_0x4282('0x1a')](function(_0x4c2a77){logger[_0x4282('0x16')]('ChatMessage,\x20%s,\x20%s',_0x1b4e29,_0x4c2a77);_0x410c18(_0x4c2a77);});});}exports[_0x4282('0x1b')]=function(_0x154cef){var _0x342654=this;return new Promise(function(_0x38056c,_0x28cb89){return db[_0x4282('0x1c')][_0x4282('0x1d')](_0x154cef[_0x4282('0x1e')],{'raw':_0x154cef[_0x4282('0x1f')]?_0x154cef['options'][_0x4282('0x20')]===undefined?!![]:![]:!![]})[_0x4282('0x10')](function(_0x5bfb7b){logger[_0x4282('0x18')](_0x4282('0x1b'),_0x154cef);logger['debug'](_0x4282('0x1b'),_0x154cef,JSON[_0x4282('0x15')](_0x5bfb7b));_0x38056c(_0x5bfb7b);})['catch'](function(_0x559eac){logger[_0x4282('0x16')]('CreateChatMessage',_0x559eac[_0x4282('0x17')],_0x154cef);_0x28cb89(_0x342654[_0x4282('0x16')](0x1f4,_0x559eac[_0x4282('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 400f3cf..b7363b9 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 _0xf95f=['length','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x35b935,_0x5bfe3f){var _0x11c0db=function(_0x4ae9f8){while(--_0x4ae9f8){_0x35b935['push'](_0x35b935['shift']());}};_0x11c0db(++_0x5bfe3f);}(_0xf95f,0x142));var _0xff95=function(_0x3bb854,_0x2fa23e){_0x3bb854=_0x3bb854-0x0;var _0x2ea95e=_0xf95f[_0x3bb854];return _0x2ea95e;};'use strict';var ChatMessageEvents=require(_0xff95('0x0'));var events=[_0xff95('0x1'),_0xff95('0x2'),_0xff95('0x3')];function createListener(_0x109eae,_0x2c7ada){return function(_0x1a42e0){_0x2c7ada[_0xff95('0x4')](_0x109eae,_0x1a42e0);};}function removeListener(_0x1e81fe,_0x498f22){return function(){ChatMessageEvents[_0xff95('0x5')](_0x1e81fe,_0x498f22);};}exports['register']=function(_0x3f72b4){for(var _0x4fb1ed=0x0,_0x314fb4=events[_0xff95('0x6')];_0x4fb1ed<_0x314fb4;_0x4fb1ed++){var _0x2b9ce9=events[_0x4fb1ed];var _0x1a42b2=createListener(_0xff95('0x7')+_0x2b9ce9,_0x3f72b4);ChatMessageEvents['on'](_0x2b9ce9,_0x1a42b2);}};
\ No newline at end of file
+var _0x4944=['removeListener','register','length','chatMessage:','./chatMessage.events','remove','update'];(function(_0xdc4b66,_0x25d7d1){var _0x370151=function(_0x4ddfc4){while(--_0x4ddfc4){_0xdc4b66['push'](_0xdc4b66['shift']());}};_0x370151(++_0x25d7d1);}(_0x4944,0x6d));var _0x4494=function(_0x2daefd,_0x31eed2){_0x2daefd=_0x2daefd-0x0;var _0x32ccc8=_0x4944[_0x2daefd];return _0x32ccc8;};'use strict';var ChatMessageEvents=require(_0x4494('0x0'));var events=['save',_0x4494('0x1'),_0x4494('0x2')];function createListener(_0x2578d3,_0x138f00){return function(_0x22adf0){_0x138f00['emit'](_0x2578d3,_0x22adf0);};}function removeListener(_0x187098,_0x5c7492){return function(){ChatMessageEvents[_0x4494('0x3')](_0x187098,_0x5c7492);};}exports[_0x4494('0x4')]=function(_0x38480d){for(var _0xb94d02=0x0,_0x2a4911=events[_0x4494('0x5')];_0xb94d02<_0x2a4911;_0xb94d02++){var _0x55bb81=events[_0xb94d02];var _0x12ef8e=createListener(_0x4494('0x6')+_0x55bb81,_0x38480d);ChatMessageEvents['on'](_0x55bb81,_0x12ef8e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index c91c7f8..3e22c9d 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 _0xcacf=['chat','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','isAuthenticated','describe','/:id','show'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0xcacf,0x14e));var _0xfcac=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcacf[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xfcac('0x0'));var util=require(_0xfcac('0x1'));var path=require('path');var timeout=require(_0xfcac('0x2'));var express=require(_0xfcac('0x3'));var router=express[_0xfcac('0x4')]();var fs_extra=require(_0xfcac('0x5'));var auth=require(_0xfcac('0x6'));var interaction=require(_0xfcac('0x7'));var config=require(_0xfcac('0x8'));var controller=require(_0xfcac('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xfcac('0xa')]);router[_0xfcac('0xb')]('/describe',auth[_0xfcac('0xc')](),controller[_0xfcac('0xd')]);router[_0xfcac('0xb')](_0xfcac('0xe'),auth[_0xfcac('0xc')](),controller[_0xfcac('0xf')]);router['post']('/',auth[_0xfcac('0xc')](),interaction['tracked'](_0xfcac('0x10'),'chatmessage:create'),controller[_0xfcac('0x11')]);router[_0xfcac('0x12')](_0xfcac('0xe'),controller[_0xfcac('0x13')]);router[_0xfcac('0x12')](_0xfcac('0x14'),auth['isAuthenticated'](),controller[_0xfcac('0x15')]);router['put'](_0xfcac('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0xfcac('0x17')](_0xfcac('0xe'),auth['isAuthenticated'](),controller[_0xfcac('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xa2a3=['describe','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x578a33,_0x50fbd1){var _0x402e75=function(_0x421de2){while(--_0x421de2){_0x578a33['push'](_0x578a33['shift']());}};_0x402e75(++_0x50fbd1);}(_0xa2a3,0x160));var _0x3a2a=function(_0x25a1ac,_0x113c18){_0x25a1ac=_0x25a1ac-0x0;var _0x13ea3a=_0xa2a3[_0x25a1ac];return _0x13ea3a;};'use strict';var multer=require(_0x3a2a('0x0'));var util=require('util');var path=require(_0x3a2a('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a2a('0x2'));var router=express[_0x3a2a('0x3')]();var fs_extra=require(_0x3a2a('0x4'));var auth=require(_0x3a2a('0x5'));var interaction=require(_0x3a2a('0x6'));var config=require('../../config/environment');var controller=require(_0x3a2a('0x7'));router['get']('/',auth[_0x3a2a('0x8')](),controller[_0x3a2a('0x9')]);router[_0x3a2a('0xa')](_0x3a2a('0xb'),auth[_0x3a2a('0x8')](),controller[_0x3a2a('0xc')]);router[_0x3a2a('0xa')]('/:id',auth[_0x3a2a('0x8')](),controller[_0x3a2a('0xd')]);router[_0x3a2a('0xe')]('/',auth[_0x3a2a('0x8')](),interaction[_0x3a2a('0xf')]('chat',_0x3a2a('0x10')),controller[_0x3a2a('0x11')]);router[_0x3a2a('0x12')]('/:id',controller[_0x3a2a('0x13')]);router['put'](_0x3a2a('0x14'),auth[_0x3a2a('0x8')](),controller[_0x3a2a('0x15')]);router[_0x3a2a('0x12')](_0x3a2a('0x16'),auth['isAuthenticated'](),controller[_0x3a2a('0x17')]);router[_0x3a2a('0x18')]('/:id',auth[_0x3a2a('0x8')](),controller[_0x3a2a('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index bf99b93..93a9786 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x40e0a1,_0xf24844){var _0x54ae9e=function(_0x368c6c){while(--_0x368c6c){_0x40e0a1['push'](_0x40e0a1['shift']());}};_0x54ae9e(++_0xf24844);}(_0xdb28,0x106));var _0x8db2=function(_0x180413,_0x1803e1){_0x180413=_0x180413-0x0;var _0x12455e=_0xdb28[_0x180413];return _0x12455e;};'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
+var _0x757a=['exports','TEXT'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x757a,0xde));var _0xa757=function(_0x1478bb,_0x27487d){_0x1478bb=_0x1478bb-0x0;var _0x27fda8=_0x757a[_0x1478bb];return _0x27fda8;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 2868101..8951ea4 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7a54,0x106));var _0x47a5=function(_0x48f462,_0x3e0f65){_0x48f462=_0x48f462-0x0;var _0x3f0e20=_0x7a54[_0x48f462];return _0x3f0e20;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5c6a1c,_0x16dd3d){var _0xf42f5d=function(_0x566526){while(--_0x566526){_0x5c6a1c['push'](_0x5c6a1c['shift']());}};_0xf42f5d(++_0x16dd3d);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index e193f6d..5f0587b 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 _0xf2bd=['../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xf2bd,0x135));var _0xdf2b=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf2bd[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0xdf2b('0x0'));var ChatOfflineMessage=require(_0xdf2b('0x1'))['db'][_0xdf2b('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xdf2b('0x3')](0x0);var events={'afterCreate':_0xdf2b('0x4'),'afterUpdate':_0xdf2b('0x5'),'afterDestroy':_0xdf2b('0x6')};function emitEvent(_0x42a985){return function(_0x209915,_0x52822c,_0x5c5ec1){ChatOfflineMessageEvents[_0xdf2b('0x7')](_0x42a985+':'+_0x209915['id'],_0x209915);ChatOfflineMessageEvents[_0xdf2b('0x7')](_0x42a985,_0x209915);_0x5c5ec1(null);};}for(var e in events){if(events[_0xdf2b('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xdf2b('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x143a=['exports','events','ChatOfflineMessage','setMaxListeners','save','update','emit','hook'];(function(_0x30a869,_0xbc8362){var _0x364f75=function(_0x43a613){while(--_0x43a613){_0x30a869['push'](_0x30a869['shift']());}};_0x364f75(++_0xbc8362);}(_0x143a,0x1c1));var _0xa143=function(_0x172e77,_0x1a64e3){_0x172e77=_0x172e77-0x0;var _0x50575f=_0x143a[_0x172e77];return _0x50575f;};'use strict';var EventEmitter=require(_0xa143('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xa143('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xa143('0x2')](0x0);var events={'afterCreate':_0xa143('0x3'),'afterUpdate':_0xa143('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4f1c78){return function(_0xc192ae,_0x12f22a,_0x513195){ChatOfflineMessageEvents[_0xa143('0x5')](_0x4f1c78+':'+_0xc192ae['id'],_0xc192ae);ChatOfflineMessageEvents['emit'](_0x4f1c78,_0xc192ae);_0x513195(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xa143('0x6')](e,emitEvent(event));}}module[_0xa143('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index fa13c87..27d0455 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 _0x80cf=['utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x575228,_0x3f9bc1){var _0x4cb11e=function(_0x36820e){while(--_0x36820e){_0x575228['push'](_0x575228['shift']());}};_0x4cb11e(++_0x3f9bc1);}(_0x80cf,0x14b));var _0xf80c=function(_0x2efbc1,_0x28c67b){_0x2efbc1=_0x2efbc1-0x0;var _0x14985e=_0x80cf[_0x2efbc1];return _0x14985e;};'use strict';var attributes=require(_0xf80c('0x0'));module[_0xf80c('0x1')]=function(_0x476e9a){return _0x476e9a[_0xf80c('0x2')](_0xf80c('0x3'),attributes,{'tableName':_0xf80c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf80c('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8750=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x8750,0x1b8));var _0x0875=function(_0x33d165,_0x1be4b0){_0x33d165=_0x33d165-0x0;var _0x36cb66=_0x8750[_0x33d165];return _0x36cb66;};'use strict';var attributes=require(_0x0875('0x0'));module[_0x0875('0x1')]=function(_0x3105c3){return _0x3105c3['define'](_0x0875('0x2'),attributes,{'tableName':_0x0875('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0875('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index eda5fcc..3849e28 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 _0x27af=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5400b,_0x55943a){var _0x36a39b=function(_0x56963c){while(--_0x56963c){_0x5400b['push'](_0x5400b['shift']());}};_0x36a39b(++_0x55943a);}(_0x27af,0xbe));var _0xf27a=function(_0x134383,_0x54b5b4){_0x134383=_0x134383-0x0;var _0x40de98=_0x27af[_0x134383];return _0x40de98;};'use strict';var _=require(_0xf27a('0x0'));var util=require(_0xf27a('0x1'));var moment=require(_0xf27a('0x2'));var BPromise=require(_0xf27a('0x3'));var rs=require(_0xf27a('0x4'));var fs=require('fs');var Redis=require(_0xf27a('0x5'));var db=require(_0xf27a('0x6'))['db'];var utils=require(_0xf27a('0x7'));var logger=require(_0xf27a('0x8'))(_0xf27a('0x9'));var config=require(_0xf27a('0xa'));var jayson=require(_0xf27a('0xb'));var client=jayson[_0xf27a('0xc')][_0xf27a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x520852,_0x1d0c36,_0xcdbadc){return new BPromise(function(_0x2c8dd3,_0x1a5622){return client[_0xf27a('0xe')](_0x520852,_0xcdbadc)[_0xf27a('0xf')](function(_0x26f95e){logger[_0xf27a('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1d0c36,_0xf27a('0x11'));logger[_0xf27a('0x12')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1d0c36,_0xf27a('0x11'),JSON[_0xf27a('0x13')](_0x26f95e));if(_0x26f95e[_0xf27a('0x14')]){if(_0x26f95e[_0xf27a('0x14')][_0xf27a('0x15')]===0x1f4){logger[_0xf27a('0x14')](_0xf27a('0x16'),_0x1d0c36,_0x26f95e['error'][_0xf27a('0x17')]);return _0x1a5622(_0x26f95e['error'][_0xf27a('0x17')]);}logger[_0xf27a('0x14')](_0xf27a('0x16'),_0x1d0c36,_0x26f95e['error'][_0xf27a('0x17')]);return _0x2c8dd3(_0x26f95e[_0xf27a('0x14')]['message']);}else{logger[_0xf27a('0x10')](_0xf27a('0x16'),_0x1d0c36,_0xf27a('0x11'));_0x2c8dd3(_0x26f95e[_0xf27a('0x18')][_0xf27a('0x17')]);}})['catch'](function(_0x18413c){logger[_0xf27a('0x14')](_0xf27a('0x16'),_0x1d0c36,_0x18413c);_0x1a5622(_0x18413c);});});}
\ No newline at end of file
+var _0xbaad=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x108e57,_0x1c3d79){var _0x453064=function(_0x36995f){while(--_0x36995f){_0x108e57['push'](_0x108e57['shift']());}};_0x453064(++_0x1c3d79);}(_0xbaad,0x1e6));var _0xdbaa=function(_0x3d12c8,_0x5dd61c){_0x3d12c8=_0x3d12c8-0x0;var _0x2b0830=_0xbaad[_0x3d12c8];return _0x2b0830;};'use strict';var _=require(_0xdbaa('0x0'));var util=require(_0xdbaa('0x1'));var moment=require(_0xdbaa('0x2'));var BPromise=require(_0xdbaa('0x3'));var rs=require(_0xdbaa('0x4'));var fs=require('fs');var Redis=require(_0xdbaa('0x5'));var db=require(_0xdbaa('0x6'))['db'];var utils=require(_0xdbaa('0x7'));var logger=require(_0xdbaa('0x8'))(_0xdbaa('0x9'));var config=require(_0xdbaa('0xa'));var jayson=require(_0xdbaa('0xb'));var client=jayson[_0xdbaa('0xc')][_0xdbaa('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x618436,_0x503b9b,_0xfa6663){return new BPromise(function(_0x478b77,_0x41ab05){return client[_0xdbaa('0xe')](_0x618436,_0xfa6663)['then'](function(_0x19a205){logger['info'](_0xdbaa('0xf'),_0x503b9b,_0xdbaa('0x10'));logger['debug'](_0xdbaa('0x11'),_0x503b9b,_0xdbaa('0x10'),JSON[_0xdbaa('0x12')](_0x19a205));if(_0x19a205['error']){if(_0x19a205[_0xdbaa('0x13')]['code']===0x1f4){logger['error'](_0xdbaa('0xf'),_0x503b9b,_0x19a205[_0xdbaa('0x13')][_0xdbaa('0x14')]);return _0x41ab05(_0x19a205[_0xdbaa('0x13')][_0xdbaa('0x14')]);}logger[_0xdbaa('0x13')](_0xdbaa('0xf'),_0x503b9b,_0x19a205[_0xdbaa('0x13')][_0xdbaa('0x14')]);return _0x478b77(_0x19a205[_0xdbaa('0x13')][_0xdbaa('0x14')]);}else{logger[_0xdbaa('0x15')](_0xdbaa('0xf'),_0x503b9b,'request\x20sent');_0x478b77(_0x19a205[_0xdbaa('0x16')][_0xdbaa('0x14')]);}})[_0xdbaa('0x17')](function(_0x2d7123){logger[_0xdbaa('0x13')](_0xdbaa('0xf'),_0x503b9b,_0x2d7123);_0x41ab05(_0x2d7123);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index c29100c..61e5030 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 _0x42ad=['put','update','delete','/:id','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x501b76,_0x2f9a4b){var _0x365015=function(_0xa10818){while(--_0xa10818){_0x501b76['push'](_0x501b76['shift']());}};_0x365015(++_0x2f9a4b);}(_0x42ad,0x14f));var _0xd42a=function(_0x5afe05,_0xcd8720){_0x5afe05=_0x5afe05-0x0;var _0x545c3e=_0x42ad[_0x5afe05];return _0x545c3e;};'use strict';var multer=require(_0xd42a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd42a('0x1'));var express=require(_0xd42a('0x2'));var router=express[_0xd42a('0x3')]();var fs_extra=require(_0xd42a('0x4'));var auth=require(_0xd42a('0x5'));var interaction=require(_0xd42a('0x6'));var config=require(_0xd42a('0x7'));var controller=require(_0xd42a('0x8'));router[_0xd42a('0x9')]('/',auth[_0xd42a('0xa')](),controller[_0xd42a('0xb')]);router[_0xd42a('0x9')](_0xd42a('0xc'),auth[_0xd42a('0xa')](),controller[_0xd42a('0xd')]);router[_0xd42a('0x9')]('/:id',auth[_0xd42a('0xa')](),controller[_0xd42a('0xe')]);router[_0xd42a('0xf')]('/',auth[_0xd42a('0xa')](),controller[_0xd42a('0x10')]);router[_0xd42a('0x11')]('/:id',auth[_0xd42a('0xa')](),controller[_0xd42a('0x12')]);router[_0xd42a('0x13')](_0xd42a('0x14'),auth['isAuthenticated'](),controller[_0xd42a('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x288c=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy'];(function(_0x2e655a,_0x6d5799){var _0x26f13b=function(_0x2dd535){while(--_0x2dd535){_0x2e655a['push'](_0x2e655a['shift']());}};_0x26f13b(++_0x6d5799);}(_0x288c,0xdc));var _0xc288=function(_0x57fc06,_0x127721){_0x57fc06=_0x57fc06-0x0;var _0x2162a9=_0x288c[_0x57fc06];return _0x2162a9;};'use strict';var multer=require(_0xc288('0x0'));var util=require(_0xc288('0x1'));var path=require(_0xc288('0x2'));var timeout=require(_0xc288('0x3'));var express=require(_0xc288('0x4'));var router=express['Router']();var fs_extra=require(_0xc288('0x5'));var auth=require(_0xc288('0x6'));var interaction=require(_0xc288('0x7'));var config=require(_0xc288('0x8'));var controller=require(_0xc288('0x9'));router[_0xc288('0xa')]('/',auth[_0xc288('0xb')](),controller[_0xc288('0xc')]);router['get'](_0xc288('0xd'),auth[_0xc288('0xb')](),controller[_0xc288('0xe')]);router[_0xc288('0xa')](_0xc288('0xf'),auth[_0xc288('0xb')](),controller['show']);router[_0xc288('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc288('0x11')]('/:id',auth[_0xc288('0xb')](),controller['update']);router[_0xc288('0x12')](_0xc288('0xf'),auth[_0xc288('0xb')](),controller[_0xc288('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index d552d44..9bd8972 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 _0x0b41=['timeout','mouseOver','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x55c97d,_0x228ffc){var _0x1d5112=function(_0x2ab908){while(--_0x2ab908){_0x55c97d['push'](_0x55c97d['shift']());}};_0x1d5112(++_0x228ffc);}(_0x0b41,0xb9));var _0x10b4=function(_0x3902c4,_0x38144b){_0x3902c4=_0x3902c4-0x0;var _0x2d7329=_0x0b41[_0x3902c4];return _0x2d7329;};'use strict';var Sequelize=require(_0x10b4('0x0'));module[_0x10b4('0x1')]={'name':{'type':Sequelize[_0x10b4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x10b4('0x3')]('mouseOver',_0x10b4('0x4')),'defaultValue':_0x10b4('0x5')},'selector':{'type':Sequelize[_0x10b4('0x2')]},'timeout':{'type':Sequelize[_0x10b4('0x6')]}};
\ No newline at end of file
+var _0x5f07=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x2a8d87,_0x2bf273){var _0x3299be=function(_0x3f8e02){while(--_0x3f8e02){_0x2a8d87['push'](_0x2a8d87['shift']());}};_0x3299be(++_0x2bf273);}(_0x5f07,0xc3));var _0x75f0=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x5f07[_0x220dbb];return _0x2b77de;};'use strict';var Sequelize=require(_0x75f0('0x0'));module[_0x75f0('0x1')]={'name':{'type':Sequelize[_0x75f0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x75f0('0x3')](_0x75f0('0x4'),_0x75f0('0x5')),'defaultValue':_0x75f0('0x4')},'selector':{'type':Sequelize[_0x75f0('0x2')]},'timeout':{'type':Sequelize[_0x75f0('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 7c709c4..9ca1701 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 _0xd5da=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','undefined','limit','offset','set','json','reject','save','update','then','end','sendStatus','error','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd5da,0x9f));var _0xad5d=function(_0x4e23db,_0x3fe14b){_0x4e23db=_0x4e23db-0x0;var _0x329d95=_0xd5da[_0x4e23db];return _0x329d95;};'use strict';var emlformat=require(_0xad5d('0x0'));var rimraf=require(_0xad5d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad5d('0x2'));var rp=require(_0xad5d('0x3'));var moment=require(_0xad5d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xad5d('0x5'));var util=require('util');var path=require(_0xad5d('0x6'));var sox=require(_0xad5d('0x7'));var csv=require(_0xad5d('0x8'));var ejs=require(_0xad5d('0x9'));var fs=require('fs');var fs_extra=require(_0xad5d('0xa'));var _=require(_0xad5d('0xb'));var squel=require(_0xad5d('0xc'));var crypto=require(_0xad5d('0xd'));var jsforce=require(_0xad5d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xad5d('0x8'));var querystring=require(_0xad5d('0xf'));var Papa=require('papaparse');var Redis=require(_0xad5d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xad5d('0x11'));var as=require(_0xad5d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad5d('0x13'))(_0xad5d('0x14'));var utils=require('../../config/utils');var config=require(_0xad5d('0x15'));var licenseUtil=require(_0xad5d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2afe2e,_0x5aa39f){_0x5aa39f=_0x5aa39f||0xcc;return function(_0x2473bc){if(_0x2473bc){return _0x2afe2e['sendStatus'](_0x5aa39f);}return _0x2afe2e[_0xad5d('0x17')](_0x5aa39f)['end']();};}function respondWithResult(_0x2b04b2,_0x5091e0){_0x5091e0=_0x5091e0||0xc8;return function(_0x16ef55){if(_0x16ef55){return _0x2b04b2[_0xad5d('0x17')](_0x5091e0)['json'](_0x16ef55);}};}function respondWithFilteredResult(_0x4bb9e5,_0x164280){return function(_0x589daa){if(_0x589daa){var _0x5061c3=typeof _0x164280['offset']===_0xad5d('0x18')&&typeof _0x164280[_0xad5d('0x19')]===_0xad5d('0x18');var _0x4c706e=_0x589daa['count'];var _0x53b88d=_0x5061c3?0x0:_0x164280[_0xad5d('0x1a')];var _0xce6fbf=_0x5061c3?_0x589daa['count']:_0x164280['offset']+_0x164280[_0xad5d('0x19')];var _0x5eaca6;if(_0xce6fbf>=_0x4c706e){_0xce6fbf=_0x4c706e;_0x5eaca6=0xc8;}else{_0x5eaca6=0xce;}_0x4bb9e5[_0xad5d('0x17')](_0x5eaca6);return _0x4bb9e5[_0xad5d('0x1b')]('Content-Range',_0x53b88d+'-'+_0xce6fbf+'/'+_0x4c706e)[_0xad5d('0x1c')](_0x589daa);}return null;};}function patchUpdates(_0x2d9d47){return function(_0x41061d){try{jsonpatch['apply'](_0x41061d,_0x2d9d47,!![]);}catch(_0x3f7dea){return BPromise[_0xad5d('0x1d')](_0x3f7dea);}return _0x41061d[_0xad5d('0x1e')]();};}function saveUpdates(_0x807de1,_0xffc852){return function(_0x53baa9){if(_0x53baa9){return _0x53baa9[_0xad5d('0x1f')](_0x807de1)[_0xad5d('0x20')](function(_0x3326ce){return _0x3326ce;});}return null;};}function removeEntity(_0x183275,_0x37d139){return function(_0x35e1a0){if(_0x35e1a0){return _0x35e1a0['destroy']()['then'](function(){_0x183275[_0xad5d('0x17')](0xcc)[_0xad5d('0x21')]();});}};}function handleEntityNotFound(_0xa90fe,_0x56607e){return function(_0xa94549){if(!_0xa94549){_0xa90fe[_0xad5d('0x22')](0x194);}return _0xa94549;};}function handleError(_0x2b63ba,_0x210eed){_0x210eed=_0x210eed||0x1f4;return function(_0x2d62f4){logger[_0xad5d('0x23')](_0x2d62f4['stack']);if(_0x2d62f4[_0xad5d('0x24')]){delete _0x2d62f4[_0xad5d('0x24')];}_0x2b63ba[_0xad5d('0x17')](_0x210eed)[_0xad5d('0x25')](_0x2d62f4);};}exports['show']=function(_0x5754c0,_0x3e0caf){var _0x3ca863={'raw':!![],'where':{'id':_0x5754c0[_0xad5d('0x26')]['id']}},_0x704d74={};_0x704d74[_0xad5d('0x27')]=_[_0xad5d('0x28')](db[_0xad5d('0x29')][_0xad5d('0x2a')]);_0x704d74[_0xad5d('0x2b')]=_['keys'](_0x5754c0[_0xad5d('0x2b')]);_0x704d74[_0xad5d('0x2c')]=_[_0xad5d('0x2d')](_0x704d74[_0xad5d('0x27')],_0x704d74[_0xad5d('0x2b')]);_0x3ca863['attributes']=_['intersection'](_0x704d74['model'],qs[_0xad5d('0x2e')](_0x5754c0[_0xad5d('0x2b')][_0xad5d('0x2e')]));_0x3ca863[_0xad5d('0x2f')]=_0x3ca863['attributes']['length']?_0x3ca863['attributes']:_0x704d74[_0xad5d('0x27')];if(_0x5754c0[_0xad5d('0x2b')][_0xad5d('0x30')]){_0x3ca863[_0xad5d('0x31')]=[{'all':!![]}];}_0x3ca863=_[_0xad5d('0x32')]({},_0x3ca863,_0x5754c0[_0xad5d('0x33')]);return db[_0xad5d('0x29')][_0xad5d('0x34')](_0x3ca863)[_0xad5d('0x20')](handleEntityNotFound(_0x3e0caf,null))[_0xad5d('0x20')](respondWithResult(_0x3e0caf,null))[_0xad5d('0x35')](handleError(_0x3e0caf,null));};exports['create']=function(_0x542fdf,_0x28ab83){return db['ChatProactiveAction'][_0xad5d('0x36')](_0x542fdf[_0xad5d('0x37')],{})[_0xad5d('0x20')](respondWithResult(_0x28ab83,0xc9))[_0xad5d('0x35')](handleError(_0x28ab83,null));};exports[_0xad5d('0x1f')]=function(_0x597c09,_0x16dc48){if(_0x597c09[_0xad5d('0x37')]['id']){delete _0x597c09[_0xad5d('0x37')]['id'];}return db['ChatProactiveAction'][_0xad5d('0x34')]({'where':{'id':_0x597c09[_0xad5d('0x26')]['id']}})['then'](handleEntityNotFound(_0x16dc48,null))['then'](saveUpdates(_0x597c09[_0xad5d('0x37')],null))[_0xad5d('0x20')](respondWithResult(_0x16dc48,null))['catch'](handleError(_0x16dc48,null));};exports['destroy']=function(_0x581839,_0x5ea825){return db['ChatProactiveAction']['find']({'where':{'id':_0x581839['params']['id']}})['then'](handleEntityNotFound(_0x5ea825,null))[_0xad5d('0x20')](removeEntity(_0x5ea825,null))[_0xad5d('0x35')](handleError(_0x5ea825,null));};
\ No newline at end of file
+var _0x1247=['params','destroy','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','model','ChatProactiveAction','rawAttributes','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','create','body','find'];(function(_0x33d5d6,_0x2ad866){var _0x27032e=function(_0x216e5c){while(--_0x216e5c){_0x33d5d6['push'](_0x33d5d6['shift']());}};_0x27032e(++_0x2ad866);}(_0x1247,0xb6));var _0x7124=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x1247[_0x548627];return _0x844a84;};'use strict';var emlformat=require(_0x7124('0x0'));var rimraf=require(_0x7124('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7124('0x2'));var moment=require(_0x7124('0x3'));var BPromise=require(_0x7124('0x4'));var Mustache=require('mustache');var util=require(_0x7124('0x5'));var path=require(_0x7124('0x6'));var sox=require(_0x7124('0x7'));var csv=require(_0x7124('0x8'));var ejs=require(_0x7124('0x9'));var fs=require('fs');var fs_extra=require(_0x7124('0xa'));var _=require(_0x7124('0xb'));var squel=require(_0x7124('0xc'));var crypto=require(_0x7124('0xd'));var jsforce=require(_0x7124('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7124('0x8'));var querystring=require(_0x7124('0xf'));var Papa=require(_0x7124('0x10'));var Redis=require(_0x7124('0x11'));var authService=require(_0x7124('0x12'));var qs=require(_0x7124('0x13'));var as=require(_0x7124('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7124('0x15'))('api');var utils=require(_0x7124('0x16'));var config=require(_0x7124('0x17'));var licenseUtil=require(_0x7124('0x18'));var db=require(_0x7124('0x19'))['db'];function respondWithStatusCode(_0x582904,_0x6c7905){_0x6c7905=_0x6c7905||0xcc;return function(_0x116888){if(_0x116888){return _0x582904['sendStatus'](_0x6c7905);}return _0x582904['status'](_0x6c7905)[_0x7124('0x1a')]();};}function respondWithResult(_0x3f1a26,_0x240b17){_0x240b17=_0x240b17||0xc8;return function(_0x1b5e06){if(_0x1b5e06){return _0x3f1a26[_0x7124('0x1b')](_0x240b17)[_0x7124('0x1c')](_0x1b5e06);}};}function respondWithFilteredResult(_0x334112,_0x40f103){return function(_0x178472){if(_0x178472){var _0x3ddba6=typeof _0x40f103[_0x7124('0x1d')]===_0x7124('0x1e')&&typeof _0x40f103[_0x7124('0x1f')]===_0x7124('0x1e');var _0x2df549=_0x178472[_0x7124('0x20')];var _0x16736d=_0x3ddba6?0x0:_0x40f103[_0x7124('0x1d')];var _0x10230a=_0x3ddba6?_0x178472[_0x7124('0x20')]:_0x40f103[_0x7124('0x1d')]+_0x40f103[_0x7124('0x1f')];var _0x28cbd7;if(_0x10230a>=_0x2df549){_0x10230a=_0x2df549;_0x28cbd7=0xc8;}else{_0x28cbd7=0xce;}_0x334112[_0x7124('0x1b')](_0x28cbd7);return _0x334112[_0x7124('0x21')](_0x7124('0x22'),_0x16736d+'-'+_0x10230a+'/'+_0x2df549)[_0x7124('0x1c')](_0x178472);}return null;};}function patchUpdates(_0x982d83){return function(_0x28b836){try{jsonpatch[_0x7124('0x23')](_0x28b836,_0x982d83,!![]);}catch(_0x241c6a){return BPromise['reject'](_0x241c6a);}return _0x28b836[_0x7124('0x24')]();};}function saveUpdates(_0xa227bc,_0x3de558){return function(_0x45889e){if(_0x45889e){return _0x45889e['update'](_0xa227bc)[_0x7124('0x25')](function(_0x54bd11){return _0x54bd11;});}return null;};}function removeEntity(_0x708818,_0x5f1faa){return function(_0x7a6cf0){if(_0x7a6cf0){return _0x7a6cf0['destroy']()[_0x7124('0x25')](function(){_0x708818[_0x7124('0x1b')](0xcc)[_0x7124('0x1a')]();});}};}function handleEntityNotFound(_0x29dac8,_0x141489){return function(_0x79fe01){if(!_0x79fe01){_0x29dac8['sendStatus'](0x194);}return _0x79fe01;};}function handleError(_0x1c5817,_0x4dba3a){_0x4dba3a=_0x4dba3a||0x1f4;return function(_0x56da35){logger[_0x7124('0x26')](_0x56da35[_0x7124('0x27')]);if(_0x56da35['name']){delete _0x56da35['name'];}_0x1c5817[_0x7124('0x1b')](_0x4dba3a)['send'](_0x56da35);};}exports['show']=function(_0x523f0c,_0x31c9ac){var _0x44e78a={'raw':!![],'where':{'id':_0x523f0c['params']['id']}},_0x3d7e02={};_0x3d7e02[_0x7124('0x28')]=_['keys'](db[_0x7124('0x29')][_0x7124('0x2a')]);_0x3d7e02['query']=_[_0x7124('0x2b')](_0x523f0c[_0x7124('0x2c')]);_0x3d7e02[_0x7124('0x2d')]=_['intersection'](_0x3d7e02[_0x7124('0x28')],_0x3d7e02['query']);_0x44e78a['attributes']=_[_0x7124('0x2e')](_0x3d7e02[_0x7124('0x28')],qs['fields'](_0x523f0c[_0x7124('0x2c')][_0x7124('0x2f')]));_0x44e78a[_0x7124('0x30')]=_0x44e78a[_0x7124('0x30')][_0x7124('0x31')]?_0x44e78a[_0x7124('0x30')]:_0x3d7e02[_0x7124('0x28')];if(_0x523f0c['query'][_0x7124('0x32')]){_0x44e78a[_0x7124('0x33')]=[{'all':!![]}];}_0x44e78a=_[_0x7124('0x34')]({},_0x44e78a,_0x523f0c[_0x7124('0x35')]);return db[_0x7124('0x29')]['find'](_0x44e78a)[_0x7124('0x25')](handleEntityNotFound(_0x31c9ac,null))[_0x7124('0x25')](respondWithResult(_0x31c9ac,null))[_0x7124('0x36')](handleError(_0x31c9ac,null));};exports[_0x7124('0x37')]=function(_0x4d9df6,_0x581c73){return db[_0x7124('0x29')]['create'](_0x4d9df6[_0x7124('0x38')],{})[_0x7124('0x25')](respondWithResult(_0x581c73,0xc9))['catch'](handleError(_0x581c73,null));};exports['update']=function(_0x3b19e3,_0x108e9e){if(_0x3b19e3['body']['id']){delete _0x3b19e3['body']['id'];}return db[_0x7124('0x29')][_0x7124('0x39')]({'where':{'id':_0x3b19e3[_0x7124('0x3a')]['id']}})[_0x7124('0x25')](handleEntityNotFound(_0x108e9e,null))[_0x7124('0x25')](saveUpdates(_0x3b19e3[_0x7124('0x38')],null))['then'](respondWithResult(_0x108e9e,null))['catch'](handleError(_0x108e9e,null));};exports[_0x7124('0x3b')]=function(_0x271e89,_0xa00162){return db[_0x7124('0x29')][_0x7124('0x39')]({'where':{'id':_0x271e89[_0x7124('0x3a')]['id']}})[_0x7124('0x25')](handleEntityNotFound(_0xa00162,null))[_0x7124('0x25')](removeEntity(_0xa00162,null))['catch'](handleError(_0xa00162,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index f1135aa..6ecec7c 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 _0x8eeb=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','chat_proactive_actions'];(function(_0x1e1639,_0x352143){var _0x29893c=function(_0x56cb00){while(--_0x56cb00){_0x1e1639['push'](_0x1e1639['shift']());}};_0x29893c(++_0x352143);}(_0x8eeb,0xc0));var _0xb8ee=function(_0x3cecf8,_0x1fe297){_0x3cecf8=_0x3cecf8-0x0;var _0x1c88fe=_0x8eeb[_0x3cecf8];return _0x1c88fe;};'use strict';var _=require(_0xb8ee('0x0'));var util=require('util');var logger=require(_0xb8ee('0x1'))(_0xb8ee('0x2'));var moment=require(_0xb8ee('0x3'));var BPromise=require(_0xb8ee('0x4'));var rp=require(_0xb8ee('0x5'));var fs=require('fs');var path=require(_0xb8ee('0x6'));var rimraf=require(_0xb8ee('0x7'));var config=require(_0xb8ee('0x8'));var attributes=require(_0xb8ee('0x9'));module['exports']=function(_0x368c14,_0x2d7076){return _0x368c14[_0xb8ee('0xa')]('ChatProactiveAction',attributes,{'tableName':_0xb8ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87c2=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','util'];(function(_0x1b94ad,_0x46c74f){var _0x529d2e=function(_0x2e761a){while(--_0x2e761a){_0x1b94ad['push'](_0x1b94ad['shift']());}};_0x529d2e(++_0x46c74f);}(_0x87c2,0x175));var _0x287c=function(_0x2eec93,_0x22ac89){_0x2eec93=_0x2eec93-0x0;var _0x435769=_0x87c2[_0x2eec93];return _0x435769;};'use strict';var _=require('lodash');var util=require(_0x287c('0x0'));var logger=require(_0x287c('0x1'))(_0x287c('0x2'));var moment=require(_0x287c('0x3'));var BPromise=require(_0x287c('0x4'));var rp=require(_0x287c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x287c('0x6'));var attributes=require(_0x287c('0x7'));module['exports']=function(_0x2ffb79,_0x5b674a){return _0x2ffb79[_0x287c('0x8')](_0x287c('0x9'),attributes,{'tableName':_0x287c('0xa'),'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 42b33a8..ec6c6bc 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 _0x496d=['request\x20sent','debug','stringify','error','code','message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x496d,0x1d7));var _0xd496=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x496d[_0x5c2e5e];return _0x46a5da;};'use strict';var _=require('lodash');var util=require(_0xd496('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd496('0x1'));var fs=require('fs');var Redis=require(_0xd496('0x2'));var db=require(_0xd496('0x3'))['db'];var utils=require(_0xd496('0x4'));var logger=require('../../config/logger')(_0xd496('0x5'));var config=require('../../config/environment');var jayson=require(_0xd496('0x6'));var client=jayson[_0xd496('0x7')][_0xd496('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ec6e9,_0xa30f99,_0x4f0785){return new BPromise(function(_0x4480b1,_0x22ad2f){return client[_0xd496('0x9')](_0x5ec6e9,_0x4f0785)[_0xd496('0xa')](function(_0x52e730){logger['info'](_0xd496('0xb'),_0xa30f99,_0xd496('0xc'));logger[_0xd496('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0xa30f99,_0xd496('0xc'),JSON[_0xd496('0xe')](_0x52e730));if(_0x52e730[_0xd496('0xf')]){if(_0x52e730[_0xd496('0xf')][_0xd496('0x10')]===0x1f4){logger[_0xd496('0xf')](_0xd496('0xb'),_0xa30f99,_0x52e730[_0xd496('0xf')][_0xd496('0x11')]);return _0x22ad2f(_0x52e730[_0xd496('0xf')][_0xd496('0x11')]);}logger[_0xd496('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0xa30f99,_0x52e730[_0xd496('0xf')][_0xd496('0x11')]);return _0x4480b1(_0x52e730[_0xd496('0xf')][_0xd496('0x11')]);}else{logger[_0xd496('0x12')](_0xd496('0xb'),_0xa30f99,_0xd496('0xc'));_0x4480b1(_0x52e730[_0xd496('0x13')][_0xd496('0x11')]);}})[_0xd496('0x14')](function(_0x51df90){logger['error'](_0xd496('0xb'),_0xa30f99,_0x51df90);_0x22ad2f(_0x51df90);});});}
\ No newline at end of file
+var _0xcba9=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x112e29,_0x3515b4){var _0x143c64=function(_0x29aaf6){while(--_0x29aaf6){_0x112e29['push'](_0x112e29['shift']());}};_0x143c64(++_0x3515b4);}(_0xcba9,0xb7));var _0x9cba=function(_0xc84836,_0x5b3c52){_0xc84836=_0xc84836-0x0;var _0x471407=_0xcba9[_0xc84836];return _0x471407;};'use strict';var _=require(_0x9cba('0x0'));var util=require(_0x9cba('0x1'));var moment=require(_0x9cba('0x2'));var BPromise=require(_0x9cba('0x3'));var rs=require(_0x9cba('0x4'));var fs=require('fs');var Redis=require(_0x9cba('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9cba('0x6'));var logger=require(_0x9cba('0x7'))(_0x9cba('0x8'));var config=require('../../config/environment');var jayson=require(_0x9cba('0x9'));var client=jayson['client'][_0x9cba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x360d68,_0x2509a,_0x29c299){return new BPromise(function(_0x1b280e,_0x4b96f1){return client['request'](_0x360d68,_0x29c299)[_0x9cba('0xb')](function(_0xbc9012){logger['info'](_0x9cba('0xc'),_0x2509a,_0x9cba('0xd'));logger[_0x9cba('0xe')](_0x9cba('0xf'),_0x2509a,_0x9cba('0xd'),JSON[_0x9cba('0x10')](_0xbc9012));if(_0xbc9012[_0x9cba('0x11')]){if(_0xbc9012[_0x9cba('0x11')][_0x9cba('0x12')]===0x1f4){logger[_0x9cba('0x11')](_0x9cba('0xc'),_0x2509a,_0xbc9012[_0x9cba('0x11')][_0x9cba('0x13')]);return _0x4b96f1(_0xbc9012[_0x9cba('0x11')][_0x9cba('0x13')]);}logger[_0x9cba('0x11')](_0x9cba('0xc'),_0x2509a,_0xbc9012[_0x9cba('0x11')][_0x9cba('0x13')]);return _0x1b280e(_0xbc9012[_0x9cba('0x11')][_0x9cba('0x13')]);}else{logger[_0x9cba('0x14')](_0x9cba('0xc'),_0x2509a,_0x9cba('0xd'));_0x1b280e(_0xbc9012[_0x9cba('0x15')][_0x9cba('0x13')]);}})[_0x9cba('0x16')](function(_0x3aba4f){logger[_0x9cba('0x11')](_0x9cba('0xc'),_0x2509a,_0x3aba4f);_0x4b96f1(_0x3aba4f);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 3aff5d3..c722bac 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 _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xabce,0x103));var _0xeabc=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xabce[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router;
\ No newline at end of file
+var _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x5c034a,_0x131fd6){var _0x176d53=function(_0x1d6a20){while(--_0x1d6a20){_0x5c034a['push'](_0x5c034a['shift']());}};_0x176d53(++_0x131fd6);}(_0x4819,0xcd));var _0x9481=function(_0x50a448,_0x3d1a4d){_0x50a448=_0x50a448-0x0;var _0x5da8c6=_0x4819[_0x50a448];return _0x5da8c6;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 7f5f2e6..db6c215 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 _0xb514=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0xb514,0xd5));var _0x4b51=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0xb514[_0x49c057];return _0xd8f0e6;};'use strict';var Sequelize=require(_0x4b51('0x0'));module[_0x4b51('0x1')]={'name':{'type':Sequelize[_0x4b51('0x2')],'unique':_0x4b51('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4b51('0x2')]},'timeout':{'type':Sequelize[_0x4b51('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4b51('0x5')](_0x4b51('0x6'),_0x4b51('0x7'),_0x4b51('0x8'))}};
\ No newline at end of file
+var _0x5d71=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','name'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0x5d71,0x66));var _0x15d7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5d71[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x15d7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x15d7('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x15d7('0x2')]},'timeout':{'type':Sequelize[_0x15d7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x15d7('0x4')](_0x15d7('0x5'),_0x15d7('0x6'),_0x15d7('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index e0cf9a4..5e6d075 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 _0xc4d0=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','ChatQueues','sendStatus','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','describe','hasOwnProperty','nolimit','User','UserId','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','voicePause','interface','flatMap','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','includes','all','compact','value','forEach','userChatQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x17f767,_0x2ca2be){var _0x54759c=function(_0x39e2b6){while(--_0x39e2b6){_0x17f767['push'](_0x17f767['shift']());}};_0x54759c(++_0x2ca2be);}(_0xc4d0,0x7f));var _0x0c4d=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0xc4d0[_0x2d126e];return _0xcb04d3;};'use strict';var emlformat=require(_0x0c4d('0x0'));var rimraf=require(_0x0c4d('0x1'));var zipdir=require(_0x0c4d('0x2'));var jsonpatch=require(_0x0c4d('0x3'));var rp=require(_0x0c4d('0x4'));var moment=require(_0x0c4d('0x5'));var BPromise=require(_0x0c4d('0x6'));var Mustache=require(_0x0c4d('0x7'));var util=require(_0x0c4d('0x8'));var path=require(_0x0c4d('0x9'));var sox=require('sox');var csv=require(_0x0c4d('0xa'));var ejs=require(_0x0c4d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c4d('0xc'));var squel=require(_0x0c4d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0c4d('0xe'));var toCsv=require(_0x0c4d('0xa'));var querystring=require(_0x0c4d('0xf'));var Papa=require('papaparse');var Redis=require(_0x0c4d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0c4d('0x11'));var as=require(_0x0c4d('0x12'));var hardwareService=require(_0x0c4d('0x13'));var logger=require(_0x0c4d('0x14'))(_0x0c4d('0x15'));var utils=require(_0x0c4d('0x16'));var config=require(_0x0c4d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c4d('0x18'))['db'];config[_0x0c4d('0x19')]=_[_0x0c4d('0x1a')](config['redis'],{'host':_0x0c4d('0x1b'),'port':0x18eb});var socket=require(_0x0c4d('0x1c'))(new Redis(config[_0x0c4d('0x19')]));require(_0x0c4d('0x1d'))[_0x0c4d('0x1e')](socket);var jayson=require(_0x0c4d('0x1f'));var client=jayson[_0x0c4d('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x549c8b,_0x4cc1a3,_0x493948,_0x1418de){return new BPromise(function(_0x5032c5,_0x279483){var _0x13e4ed=_0x1418de||client;return _0x13e4ed[_0x0c4d('0x21')](_0x549c8b,_0x493948)[_0x0c4d('0x22')](function(_0x2eba4d){logger[_0x0c4d('0x23')](_0x0c4d('0x24'),_0x4cc1a3,_0x0c4d('0x25'));logger[_0x0c4d('0x26')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4cc1a3,_0x0c4d('0x25'),JSON[_0x0c4d('0x27')](_0x2eba4d));if(_0x2eba4d[_0x0c4d('0x28')]){if(_0x2eba4d[_0x0c4d('0x28')][_0x0c4d('0x29')]===0x1f4){logger[_0x0c4d('0x28')](_0x0c4d('0x24'),_0x4cc1a3,_0x2eba4d['error'][_0x0c4d('0x2a')]);return _0x279483(_0x2eba4d[_0x0c4d('0x28')][_0x0c4d('0x2a')]);}logger[_0x0c4d('0x28')](_0x0c4d('0x24'),_0x4cc1a3,_0x2eba4d['error']['message']);return _0x5032c5(_0x2eba4d[_0x0c4d('0x28')][_0x0c4d('0x2a')]);}else{logger[_0x0c4d('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4cc1a3,_0x0c4d('0x25'));_0x5032c5(_0x2eba4d['result'][_0x0c4d('0x2a')]);}})[_0x0c4d('0x2b')](function(_0x5492a0){logger[_0x0c4d('0x28')]('ChatQueue,\x20%s,\x20%s',_0x4cc1a3,_0x5492a0);_0x279483(_0x5492a0);});});}function respondWithStatusCode(_0x81dde4,_0x24dc10){_0x24dc10=_0x24dc10||0xcc;return function(_0x4486b0){if(_0x4486b0){return _0x81dde4['sendStatus'](_0x24dc10);}return _0x81dde4[_0x0c4d('0x2c')](_0x24dc10)[_0x0c4d('0x2d')]();};}function respondWithResult(_0x3e3d9b,_0x36ea2f){_0x36ea2f=_0x36ea2f||0xc8;return function(_0x1b15a0){if(_0x1b15a0){return _0x3e3d9b['status'](_0x36ea2f)['json'](_0x1b15a0);}};}function respondWithFilteredResult(_0x4a3019,_0x539336){return function(_0x358d68){if(_0x358d68){var _0x12ffc0=typeof _0x539336[_0x0c4d('0x2e')]===_0x0c4d('0x2f')&&typeof _0x539336['limit']===_0x0c4d('0x2f');var _0x292be1=_0x358d68[_0x0c4d('0x30')];var _0x4e994b=_0x12ffc0?0x0:_0x539336[_0x0c4d('0x2e')];var _0x480a7b=_0x12ffc0?_0x358d68[_0x0c4d('0x30')]:_0x539336['offset']+_0x539336[_0x0c4d('0x31')];var _0x59f246;if(_0x480a7b>=_0x292be1){_0x480a7b=_0x292be1;_0x59f246=0xc8;}else{_0x59f246=0xce;}_0x4a3019[_0x0c4d('0x2c')](_0x59f246);return _0x4a3019[_0x0c4d('0x32')](_0x0c4d('0x33'),_0x4e994b+'-'+_0x480a7b+'/'+_0x292be1)[_0x0c4d('0x34')](_0x358d68);}return null;};}function patchUpdates(_0x449397){return function(_0x591948){try{jsonpatch[_0x0c4d('0x35')](_0x591948,_0x449397,!![]);}catch(_0x14328b){return BPromise[_0x0c4d('0x36')](_0x14328b);}return _0x591948[_0x0c4d('0x37')]();};}function saveUpdates(_0x245587,_0x2dd962){return function(_0xe11e01){if(_0xe11e01){return _0xe11e01[_0x0c4d('0x38')](_0x245587)[_0x0c4d('0x22')](function(_0x304cf3){return _0x304cf3;});}return null;};}function removeEntity(_0x19baa5,_0x4ae4e6){return function(_0x5267e1){if(_0x5267e1){return _0x5267e1[_0x0c4d('0x39')]()[_0x0c4d('0x22')](function(){var _0x5787aa=_0x5267e1['get']({'plain':!![]});var _0x2a9ef9=_0x0c4d('0x3a');return db['UserProfileResource'][_0x0c4d('0x39')]({'where':{'type':_0x2a9ef9,'resourceId':_0x5787aa['id']}})['then'](function(){return _0x5267e1;});})[_0x0c4d('0x22')](function(){_0x19baa5[_0x0c4d('0x2c')](0xcc)[_0x0c4d('0x2d')]();});}};}function handleEntityNotFound(_0x3c8172,_0x4ce8d7){return function(_0x4e5c94){if(!_0x4e5c94){_0x3c8172[_0x0c4d('0x3b')](0x194);}return _0x4e5c94;};}function handleError(_0x26f573,_0x3f4c49){_0x3f4c49=_0x3f4c49||0x1f4;return function(_0x122f7c){logger[_0x0c4d('0x28')](_0x122f7c[_0x0c4d('0x3c')]);if(_0x122f7c['name']){delete _0x122f7c[_0x0c4d('0x3d')];}_0x26f573[_0x0c4d('0x2c')](_0x3f4c49)['send'](_0x122f7c);};}exports[_0x0c4d('0x3e')]=function(_0xed3e5e,_0x37924f){var _0x14a1ca={},_0x489515={},_0x28ef29={'count':0x0,'rows':[]};var _0x15b830=_[_0x0c4d('0x3f')](db[_0x0c4d('0x40')][_0x0c4d('0x41')],function(_0x3583d8){return{'name':_0x3583d8[_0x0c4d('0x42')],'type':_0x3583d8[_0x0c4d('0x43')]['key']};});_0x489515[_0x0c4d('0x44')]=_['map'](_0x15b830,_0x0c4d('0x3d'));_0x489515[_0x0c4d('0x45')]=_[_0x0c4d('0x46')](_0xed3e5e['query']);_0x489515[_0x0c4d('0x47')]=_['intersection'](_0x489515['model'],_0x489515[_0x0c4d('0x45')]);_0x14a1ca['attributes']=_[_0x0c4d('0x48')](_0x489515[_0x0c4d('0x44')],qs[_0x0c4d('0x49')](_0xed3e5e[_0x0c4d('0x45')]['fields']));_0x14a1ca[_0x0c4d('0x4a')]=_0x14a1ca['attributes'][_0x0c4d('0x4b')]?_0x14a1ca[_0x0c4d('0x4a')]:_0x489515[_0x0c4d('0x44')];if(!_0xed3e5e['query']['hasOwnProperty']('nolimit')){_0x14a1ca['limit']=qs[_0x0c4d('0x31')](_0xed3e5e[_0x0c4d('0x45')][_0x0c4d('0x31')]);_0x14a1ca[_0x0c4d('0x2e')]=qs[_0x0c4d('0x2e')](_0xed3e5e['query'][_0x0c4d('0x2e')]);}_0x14a1ca[_0x0c4d('0x4c')]=qs[_0x0c4d('0x4d')](_0xed3e5e[_0x0c4d('0x45')][_0x0c4d('0x4d')]);_0x14a1ca[_0x0c4d('0x4e')]=qs[_0x0c4d('0x47')](_[_0x0c4d('0x4f')](_0xed3e5e[_0x0c4d('0x45')],_0x489515[_0x0c4d('0x47')]),_0x15b830);if(_0xed3e5e[_0x0c4d('0x45')][_0x0c4d('0x50')]){_0x14a1ca['where']=_[_0x0c4d('0x51')](_0x14a1ca[_0x0c4d('0x4e')],{'$or':_[_0x0c4d('0x3f')](_0x15b830,function(_0xf8a93b){if(_0xf8a93b['type']!==_0x0c4d('0x52')){var _0x2c460e={};_0x2c460e[_0xf8a93b[_0x0c4d('0x3d')]]={'$like':'%'+_0xed3e5e[_0x0c4d('0x45')][_0x0c4d('0x50')]+'%'};return _0x2c460e;}})});}_0x14a1ca=_[_0x0c4d('0x51')]({},_0x14a1ca,_0xed3e5e[_0x0c4d('0x53')]);var _0xba4f8b={'where':_0x14a1ca[_0x0c4d('0x4e')]};return db[_0x0c4d('0x40')]['count'](_0xba4f8b)[_0x0c4d('0x22')](function(_0x501b02){_0x28ef29[_0x0c4d('0x30')]=_0x501b02;if(_0xed3e5e[_0x0c4d('0x45')]['includeAll']){_0x14a1ca[_0x0c4d('0x54')]=[{'all':!![]}];}return db[_0x0c4d('0x40')][_0x0c4d('0x55')](_0x14a1ca);})[_0x0c4d('0x22')](function(_0x506a92){_0x28ef29[_0x0c4d('0x56')]=_0x506a92;return _0x28ef29;})[_0x0c4d('0x22')](respondWithFilteredResult(_0x37924f,_0x14a1ca))[_0x0c4d('0x2b')](handleError(_0x37924f,null));};exports['show']=function(_0xba7c0a,_0x4b44e7){var _0x552f50={'raw':!![],'where':{'id':_0xba7c0a['params']['id']}},_0x1ca621={};_0x1ca621[_0x0c4d('0x44')]=_[_0x0c4d('0x46')](db['ChatQueue'][_0x0c4d('0x41')]);_0x1ca621[_0x0c4d('0x45')]=_[_0x0c4d('0x46')](_0xba7c0a[_0x0c4d('0x45')]);_0x1ca621[_0x0c4d('0x47')]=_[_0x0c4d('0x48')](_0x1ca621[_0x0c4d('0x44')],_0x1ca621[_0x0c4d('0x45')]);_0x552f50[_0x0c4d('0x4a')]=_[_0x0c4d('0x48')](_0x1ca621['model'],qs[_0x0c4d('0x49')](_0xba7c0a[_0x0c4d('0x45')][_0x0c4d('0x49')]));_0x552f50['attributes']=_0x552f50[_0x0c4d('0x4a')]['length']?_0x552f50['attributes']:_0x1ca621[_0x0c4d('0x44')];if(_0xba7c0a[_0x0c4d('0x45')]['includeAll']){_0x552f50[_0x0c4d('0x54')]=[{'all':!![]}];}_0x552f50=_[_0x0c4d('0x51')]({},_0x552f50,_0xba7c0a[_0x0c4d('0x53')]);return db[_0x0c4d('0x40')][_0x0c4d('0x57')](_0x552f50)[_0x0c4d('0x22')](handleEntityNotFound(_0x4b44e7,null))[_0x0c4d('0x22')](respondWithResult(_0x4b44e7,null))[_0x0c4d('0x2b')](handleError(_0x4b44e7,null));};exports[_0x0c4d('0x58')]=function(_0x5e86d8,_0x3f63e0){return db[_0x0c4d('0x40')][_0x0c4d('0x58')](_0x5e86d8[_0x0c4d('0x59')],{})[_0x0c4d('0x22')](function(_0x51e8f3){var _0x42194e=_0x5e86d8[_0x0c4d('0x5a')][_0x0c4d('0x5b')]({'plain':!![]});if(!_0x42194e)throw new Error(_0x0c4d('0x5c'));if(_0x42194e['role']===_0x0c4d('0x5a')){var _0x2a2f07=_0x51e8f3[_0x0c4d('0x5b')]({'plain':!![]});var _0x190d83='ChatQueues';return db[_0x0c4d('0x5d')][_0x0c4d('0x57')]({'where':{'name':_0x190d83,'userProfileId':_0x42194e[_0x0c4d('0x5e')]},'raw':!![]})[_0x0c4d('0x22')](function(_0x31a362){if(_0x31a362&&_0x31a362[_0x0c4d('0x5f')]===0x0){return db[_0x0c4d('0x60')][_0x0c4d('0x58')]({'name':_0x2a2f07['name'],'resourceId':_0x2a2f07['id'],'type':_0x31a362[_0x0c4d('0x3d')],'sectionId':_0x31a362['id']},{})[_0x0c4d('0x22')](function(){return _0x51e8f3;});}else{return _0x51e8f3;}})[_0x0c4d('0x2b')](function(_0x42ffd1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42ffd1);throw _0x42ffd1;});}return _0x51e8f3;})['then'](respondWithResult(_0x3f63e0,0xc9))['catch'](handleError(_0x3f63e0,null));};exports[_0x0c4d('0x38')]=function(_0x2e6294,_0x5742a3){if(_0x2e6294[_0x0c4d('0x59')]['id']){delete _0x2e6294[_0x0c4d('0x59')]['id'];}return db[_0x0c4d('0x40')][_0x0c4d('0x57')]({'where':{'id':_0x2e6294[_0x0c4d('0x61')]['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x5742a3,null))['then'](saveUpdates(_0x2e6294[_0x0c4d('0x59')],null))[_0x0c4d('0x22')](respondWithResult(_0x5742a3,null))[_0x0c4d('0x2b')](handleError(_0x5742a3,null));};exports[_0x0c4d('0x39')]=function(_0x5a9be8,_0x297aa3){return db[_0x0c4d('0x40')]['find']({'where':{'id':_0x5a9be8['params']['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x297aa3,null))['then'](removeEntity(_0x297aa3,null))[_0x0c4d('0x2b')](handleError(_0x297aa3,null));};exports[_0x0c4d('0x62')]=function(_0x35072f,_0x5a3c75){return db['ChatQueue']['describe']()[_0x0c4d('0x22')](respondWithResult(_0x5a3c75,null))[_0x0c4d('0x2b')](handleError(_0x5a3c75,null));};exports['getMembers']=function(_0x3d684a,_0x8724ca,_0x57c47a){var _0x5966f1={'raw':!![],'where':{}},_0x5ecd7b={},_0x44ecac;return db[_0x0c4d('0x40')]['findOne']({'where':{'id':_0x3d684a[_0x0c4d('0x61')]['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x8724ca,null))[_0x0c4d('0x22')](function(_0x53fbcc){if(_0x53fbcc){_0x44ecac=_0x53fbcc[_0x0c4d('0x5b')]({'plain':!![]});_0x5ecd7b['model']=_[_0x0c4d('0x46')](db['UserChatQueue'][_0x0c4d('0x41')]);_0x5ecd7b[_0x0c4d('0x45')]=_[_0x0c4d('0x46')](_0x3d684a['query']);_0x5ecd7b[_0x0c4d('0x47')]=_['intersection'](_0x5ecd7b[_0x0c4d('0x44')],_0x5ecd7b['query']);_0x5966f1[_0x0c4d('0x4a')]=_[_0x0c4d('0x48')](_0x5ecd7b[_0x0c4d('0x44')],qs[_0x0c4d('0x49')](_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x49')]));_0x5966f1[_0x0c4d('0x4a')]=_0x5966f1[_0x0c4d('0x4a')][_0x0c4d('0x4b')]?_0x5966f1[_0x0c4d('0x4a')]:_0x5ecd7b[_0x0c4d('0x44')];if(!_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x63')](_0x0c4d('0x64'))){_0x5966f1[_0x0c4d('0x31')]=qs[_0x0c4d('0x31')](_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x31')]);_0x5966f1[_0x0c4d('0x2e')]=qs[_0x0c4d('0x2e')](_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x2e')]);}_0x5966f1['order']=qs[_0x0c4d('0x4d')](_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x4d')]);_0x5966f1[_0x0c4d('0x4e')]=qs[_0x0c4d('0x47')](_['pick'](_0x3d684a[_0x0c4d('0x45')],_0x5ecd7b[_0x0c4d('0x47')]));_0x5966f1['where']['ChatQueueId']=_0x53fbcc['id'];if(_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x50')]){_0x5966f1[_0x0c4d('0x4e')]=_['merge'](_0x5966f1[_0x0c4d('0x4e')],{'$or':_[_0x0c4d('0x3f')](_0x5966f1['attributes'],function(_0x14547b){var _0x1dfffb={};_0x1dfffb[_0x14547b]={'$like':'%'+_0x3d684a[_0x0c4d('0x45')]['filter']+'%'};return _0x1dfffb;})});}_0x5966f1=_[_0x0c4d('0x51')]({},_0x5966f1,_0x3d684a[_0x0c4d('0x53')]);return db['UserChatQueue'][_0x0c4d('0x55')](_0x5966f1);}})[_0x0c4d('0x22')](function(_0x5e4d3a){if(_0x5e4d3a){return db[_0x0c4d('0x65')]['findAndCountAll']({'where':{'id':_['map'](_0x5e4d3a,_0x0c4d('0x66')),'role':'agent'},'attributes':['id',_0x0c4d('0x3d'),'chatPause',_0x0c4d('0x67'),_0x0c4d('0x68')]});}})[_0x0c4d('0x22')](function(_0x50bf18){if(_0x50bf18){return{'count':_0x50bf18[_0x0c4d('0x30')],'rows':_[_0x0c4d('0x3f')](_0x50bf18['rows'],function(_0xd4f2f){return{'membername':_0xd4f2f[_0x0c4d('0x3d')],'UserId':_0xd4f2f['id'],'queue_name':_0x44ecac['name'],'ChatQueueId':_0x44ecac['id'],'interface':util[_0x0c4d('0x69')](_0x0c4d('0x6a'),_0x0c4d('0x6b'),_0xd4f2f['name']),'penalty':0x0,'paused':_0xd4f2f['chatPause'],'createdAt':_0xd4f2f[_0x0c4d('0x68')],'updatedAt':_0xd4f2f[_0x0c4d('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0c4d('0x22')](respondWithFilteredResult(_0x8724ca,_0x5966f1))[_0x0c4d('0x2b')](handleError(_0x8724ca,null));};exports['getTeams']=function(_0x568872,_0x5bb78b,_0x42e67d){var _0x1f80b4={};var _0x35cef8={};var _0x40ba37;var _0x761ba9;return db[_0x0c4d('0x40')]['findOne']({'where':{'id':_0x568872['params']['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x5bb78b,null))[_0x0c4d('0x22')](function(_0xc077d0){if(_0xc077d0){_0x40ba37=_0xc077d0;_0x35cef8[_0x0c4d('0x44')]=_[_0x0c4d('0x46')](db[_0x0c4d('0x6c')][_0x0c4d('0x41')]);_0x35cef8[_0x0c4d('0x45')]=_[_0x0c4d('0x46')](_0x568872[_0x0c4d('0x45')]);_0x35cef8[_0x0c4d('0x47')]=_[_0x0c4d('0x48')](_0x35cef8[_0x0c4d('0x44')],_0x35cef8[_0x0c4d('0x45')]);_0x1f80b4[_0x0c4d('0x4a')]=_[_0x0c4d('0x48')](_0x35cef8[_0x0c4d('0x44')],qs[_0x0c4d('0x49')](_0x568872[_0x0c4d('0x45')][_0x0c4d('0x49')]));_0x1f80b4['attributes']=_0x1f80b4[_0x0c4d('0x4a')][_0x0c4d('0x4b')]?_0x1f80b4[_0x0c4d('0x4a')]:_0x35cef8[_0x0c4d('0x44')];_0x1f80b4[_0x0c4d('0x4c')]=qs['sort'](_0x568872[_0x0c4d('0x45')]['sort']);_0x1f80b4[_0x0c4d('0x4e')]=qs['filters'](_['pick'](_0x568872[_0x0c4d('0x45')],_0x35cef8[_0x0c4d('0x47')]));if(_0x568872[_0x0c4d('0x45')]['filter']){_0x1f80b4[_0x0c4d('0x4e')]=_[_0x0c4d('0x51')](_0x1f80b4[_0x0c4d('0x4e')],{'$or':_[_0x0c4d('0x3f')](_0x1f80b4[_0x0c4d('0x4a')],function(_0xcb80da){var _0x297e49={};_0x297e49[_0xcb80da]={'$like':'%'+_0x568872[_0x0c4d('0x45')][_0x0c4d('0x50')]+'%'};return _0x297e49;})});}_0x1f80b4=_[_0x0c4d('0x51')]({},_0x1f80b4,_0x568872['options']);return _0x40ba37[_0x0c4d('0x6d')](_0x1f80b4);}})['then'](function(_0x349bb4){if(_0x349bb4){_0x761ba9=_0x349bb4['length'];if(!_0x568872['query'][_0x0c4d('0x63')](_0x0c4d('0x64'))){_0x1f80b4[_0x0c4d('0x31')]=qs[_0x0c4d('0x31')](_0x568872[_0x0c4d('0x45')]['limit']);_0x1f80b4[_0x0c4d('0x2e')]=qs[_0x0c4d('0x2e')](_0x568872['query'][_0x0c4d('0x2e')]);}return _0x40ba37[_0x0c4d('0x6d')](_0x1f80b4);}})[_0x0c4d('0x22')](function(_0x3c65ff){if(_0x3c65ff){return _0x3c65ff?{'count':_0x761ba9,'rows':_0x3c65ff}:null;}})[_0x0c4d('0x22')](respondWithResult(_0x5bb78b,null))[_0x0c4d('0x2b')](handleError(_0x5bb78b,null));};exports[_0x0c4d('0x6e')]=function(_0xb3445b,_0x1a5a26,_0x7b94b){var _0x351468=_0xb3445b['body'][_0x0c4d('0x6f')];return db[_0x0c4d('0x6c')][_0x0c4d('0x55')]({'where':{'id':_0x351468},'attributes':['id'],'include':[{'model':db[_0x0c4d('0x65')],'as':'Agents','attributes':['id',_0x0c4d('0x3d'),'online',_0x0c4d('0x70'),_0x0c4d('0x71')],'raw':!![]}]})[_0x0c4d('0x22')](function(_0xd68c2){if(_0xd68c2){var _0x112808=_[_0x0c4d('0x72')](_0xd68c2,function(_0x4b97d7){var _0x561961=_0x4b97d7[_0x0c4d('0x5b')]({'plain':!![]});return _0x561961['Agents'];});return db[_0x0c4d('0x40')]['find']({'where':{'id':_0xb3445b[_0x0c4d('0x61')]['id']}})[_0x0c4d('0x22')](function(_0x2cb06e){return db['sequelize'][_0x0c4d('0x73')](function(_0x3cf1cf){return _0x2cb06e['addTeams'](_0x351468,{'transaction':_0x3cf1cf})[_0x0c4d('0x22')](function(){return BPromise[_0x0c4d('0x74')](_0x112808,function(_0x72481e){return db['UserChatQueue'][_0x0c4d('0x75')]({'where':{'UserId':_0x72481e['id'],'ChatQueueId':_0xb3445b['params']['id']},'transaction':_0x3cf1cf});});})[_0x0c4d('0x22')](function(){_0x112808['forEach'](function(_0x5c1c6f){socket[_0x0c4d('0x76')](_0x0c4d('0x77'),{'UserId':_0x5c1c6f['id'],'ChatQueueId':_0x2cb06e['id']});});});});});}})[_0x0c4d('0x22')](respondWithStatusCode(_0x1a5a26,null))[_0x0c4d('0x2b')](handleError(_0x1a5a26,null));};exports[_0x0c4d('0x78')]=function(_0x8b084,_0x3315e9,_0x4c6123){return db[_0x0c4d('0x6c')][_0x0c4d('0x55')]({'where':{'id':_0x8b084[_0x0c4d('0x45')][_0x0c4d('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x0c4d('0x65')],'as':_0x0c4d('0x79'),'attributes':['id'],'raw':!![]}]})[_0x0c4d('0x22')](handleEntityNotFound(_0x3315e9,null))[_0x0c4d('0x22')](function(_0x86979f){var _0x1f2c45=_['map'](_0x86979f,'id');var _0x164cfa=[];var _0x1ad6fc=[];var _0x484c04=squel[_0x0c4d('0x7a')]();_0x484c04[_0x0c4d('0x7b')](_0x0c4d('0x7c'))[_0x0c4d('0x7d')]('team_has_chat_queues','tq')[_0x0c4d('0x7e')](_0x0c4d('0x7f'),'ut',_0x0c4d('0x80'))['where'](_0x0c4d('0x81'),_0x8b084[_0x0c4d('0x61')]['id']);for(var _0x1e5ac0=0x0;_0x1e5ac0<_0x86979f['length'];_0x1e5ac0+=0x1){let _0x1bfc1d=_0x86979f[_0x1e5ac0];for(var _0x2c5bb1=0x0;_0x2c5bb1<_0x1bfc1d['Agents'][_0x0c4d('0x4b')];_0x2c5bb1+=0x1){let _0x1a0d69=_0x1bfc1d[_0x0c4d('0x79')][_0x2c5bb1];var _0x2224ac=_0x484c04[_0x0c4d('0x82')]();_0x2224ac[_0x0c4d('0x4e')](_0x0c4d('0x83'),_0x1a0d69['id']);_0x1ad6fc[_0x0c4d('0x84')](db[_0x0c4d('0x85')]['query'](_0x2224ac[_0x0c4d('0x86')](),{'type':db['sequelize'][_0x0c4d('0x87')]['SELECT']})['then'](function(_0x43c305){if(_0x43c305[_0x0c4d('0x4b')]===0x1){return _0x1a0d69['id'];}else{var _0x3975d8=_['every'](_[_0x0c4d('0x3f')](_0x43c305,'TeamId'),function(_0x34c63d){return _[_0x0c4d('0x88')](_0x1f2c45,_0x34c63d);});if(_0x3975d8){return _0x1a0d69['id'];}}}));}}return BPromise[_0x0c4d('0x89')](_0x1ad6fc)[_0x0c4d('0x22')](function(_0x1560f0){_0x164cfa=_(_0x164cfa)['union'](_0x1560f0)[_0x0c4d('0x8a')]()[_0x0c4d('0x8b')]();return db['ChatQueue'][_0x0c4d('0x57')]({'where':{'id':_0x8b084[_0x0c4d('0x61')]['id']}})['then'](function(_0xaa7817){return db[_0x0c4d('0x85')][_0x0c4d('0x73')](function(_0x59b8fa){return _0xaa7817['removeTeams'](_0x8b084['query'][_0x0c4d('0x6f')],{'transaction':_0x59b8fa})[_0x0c4d('0x22')](function(){if(!_['isEmpty'](_0x164cfa)){return _0xaa7817['removeAgents'](_0x164cfa,{'transaction':_0x59b8fa});}})[_0x0c4d('0x22')](function(){_0x164cfa[_0x0c4d('0x8c')](function(_0xe44dd7){socket[_0x0c4d('0x76')](_0x0c4d('0x8d'),{'UserId':_0xe44dd7,'ChatQueueId':_0xaa7817['id']});});});});});});})[_0x0c4d('0x22')](respondWithStatusCode(_0x3315e9,null))['catch'](handleError(_0x3315e9,null));};exports[_0x0c4d('0x8e')]=function(_0x5bf12c,_0x4b0dba,_0x4c9d57){return db['ChatQueue'][_0x0c4d('0x57')]({'where':{'id':_0x5bf12c[_0x0c4d('0x61')]['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x4b0dba,null))[_0x0c4d('0x22')](function(_0x36c596){if(_0x36c596){return _0x36c596[_0x0c4d('0x8e')](_0x5bf12c['body'][_0x0c4d('0x6f')],_['omit'](_0x5bf12c['body'],[_0x0c4d('0x6f'),'id'])||{})['spread'](function(_0x2339d6){for(var _0x56cec4=0x0;_0x56cec4<_0x5bf12c['body'][_0x0c4d('0x6f')][_0x0c4d('0x4b')];_0x56cec4+=0x1){socket[_0x0c4d('0x76')](_0x0c4d('0x77'),{'UserId':Number(_0x5bf12c[_0x0c4d('0x59')][_0x0c4d('0x6f')][_0x56cec4]),'ChatQueueId':Number(_0x5bf12c[_0x0c4d('0x61')]['id'])});}return _0x2339d6;});}})['then'](respondWithResult(_0x4b0dba,null))['catch'](handleError(_0x4b0dba,null));};exports[_0x0c4d('0x8f')]=function(_0x5f39f3,_0x258ca9,_0x2583ac){return db['ChatQueue'][_0x0c4d('0x57')]({'where':{'id':_0x5f39f3['params']['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x258ca9,null))[_0x0c4d('0x22')](function(_0x2a2d04){if(_0x2a2d04){return _0x2a2d04[_0x0c4d('0x8f')](_0x5f39f3['query']['ids'])[_0x0c4d('0x22')](function(){if(_[_0x0c4d('0x90')](_0x5f39f3[_0x0c4d('0x45')][_0x0c4d('0x6f')])){for(var _0x2f7c1e=0x0;_0x2f7c1e<_0x5f39f3['query'][_0x0c4d('0x6f')][_0x0c4d('0x4b')];_0x2f7c1e+=0x1){socket[_0x0c4d('0x76')]('userChatQueue:remove',{'UserId':Number(_0x5f39f3['query'][_0x0c4d('0x6f')][_0x2f7c1e]),'ChatQueueId':Number(_0x5f39f3[_0x0c4d('0x61')]['id'])});}}else{socket[_0x0c4d('0x76')](_0x0c4d('0x8d'),{'UserId':Number(_0x5f39f3[_0x0c4d('0x45')][_0x0c4d('0x6f')]),'ChatQueueId':Number(_0x5f39f3['params']['id'])});}});}})['then'](respondWithStatusCode(_0x258ca9,null))[_0x0c4d('0x2b')](handleError(_0x258ca9,null));};exports[_0x0c4d('0x91')]=function(_0x44225c,_0x207f74,_0x164562){var _0x3dcc5b={};var _0x176625={};var _0x24d5e2;var _0x5a6e7a;return db['ChatQueue']['findOne']({'where':{'id':_0x44225c['params']['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x207f74,null))[_0x0c4d('0x22')](function(_0x2e5d53){if(_0x2e5d53){_0x24d5e2=_0x2e5d53;_0x176625[_0x0c4d('0x44')]=_['keys'](db[_0x0c4d('0x65')][_0x0c4d('0x41')]);_0x176625['query']=_[_0x0c4d('0x46')](_0x44225c[_0x0c4d('0x45')]);_0x176625[_0x0c4d('0x47')]=_[_0x0c4d('0x48')](_0x176625['model'],_0x176625['query']);_0x3dcc5b[_0x0c4d('0x4a')]=_[_0x0c4d('0x48')](_0x176625[_0x0c4d('0x44')],qs[_0x0c4d('0x49')](_0x44225c[_0x0c4d('0x45')][_0x0c4d('0x49')]));_0x3dcc5b[_0x0c4d('0x4a')]=_0x3dcc5b['attributes'][_0x0c4d('0x4b')]?_0x3dcc5b[_0x0c4d('0x4a')]:_0x176625[_0x0c4d('0x44')];_0x3dcc5b[_0x0c4d('0x4c')]=qs[_0x0c4d('0x4d')](_0x44225c[_0x0c4d('0x45')][_0x0c4d('0x4d')]);_0x3dcc5b[_0x0c4d('0x4e')]=qs['filters'](_[_0x0c4d('0x4f')](_0x44225c['query'],_0x176625[_0x0c4d('0x47')]));if(_0x44225c[_0x0c4d('0x45')][_0x0c4d('0x50')]){_0x3dcc5b[_0x0c4d('0x4e')]=_[_0x0c4d('0x51')](_0x3dcc5b[_0x0c4d('0x4e')],{'$or':_[_0x0c4d('0x3f')](_0x3dcc5b[_0x0c4d('0x4a')],function(_0x3dee08){var _0x8d2745={};_0x8d2745[_0x3dee08]={'$like':'%'+_0x44225c[_0x0c4d('0x45')]['filter']+'%'};return _0x8d2745;})});}_0x3dcc5b=_['merge']({},_0x3dcc5b,_0x44225c['options']);return _0x24d5e2['getAgents'](_0x3dcc5b);}})[_0x0c4d('0x22')](function(_0x582b21){if(_0x582b21){_0x5a6e7a=_0x582b21['length'];if(!_0x44225c['query'][_0x0c4d('0x63')]('nolimit')){_0x3dcc5b[_0x0c4d('0x31')]=qs[_0x0c4d('0x31')](_0x44225c['query'][_0x0c4d('0x31')]);_0x3dcc5b[_0x0c4d('0x2e')]=qs['offset'](_0x44225c[_0x0c4d('0x45')]['offset']);}return _0x24d5e2['getAgents'](_0x3dcc5b);}})[_0x0c4d('0x22')](function(_0x4757bc){if(_0x4757bc){return _0x4757bc?{'count':_0x5a6e7a,'rows':_0x4757bc}:null;}})[_0x0c4d('0x22')](respondWithResult(_0x207f74,null))[_0x0c4d('0x2b')](handleError(_0x207f74,null));};
\ No newline at end of file
+var _0x4f52=['fs-extra','squel','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','redis','localhost','./chatQueue.socket','register','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','describe','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','isEmpty','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox'];(function(_0x22ca49,_0x307847){var _0x5a6352=function(_0x288597){while(--_0x288597){_0x22ca49['push'](_0x22ca49['shift']());}};_0x5a6352(++_0x307847);}(_0x4f52,0x111));var _0x24f5=function(_0x1a77bf,_0x3926ca){_0x1a77bf=_0x1a77bf-0x0;var _0x2d51b7=_0x4f52[_0x1a77bf];return _0x2d51b7;};'use strict';var emlformat=require(_0x24f5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x24f5('0x1'));var rp=require(_0x24f5('0x2'));var moment=require('moment');var BPromise=require(_0x24f5('0x3'));var Mustache=require('mustache');var util=require(_0x24f5('0x4'));var path=require(_0x24f5('0x5'));var sox=require(_0x24f5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24f5('0x7'));var _=require('lodash');var squel=require(_0x24f5('0x8'));var crypto=require(_0x24f5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x24f5('0xa'));var toCsv=require(_0x24f5('0xb'));var querystring=require('querystring');var Papa=require(_0x24f5('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x24f5('0xd'));var as=require(_0x24f5('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x24f5('0xf'));var utils=require(_0x24f5('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x24f5('0x11'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x24f5('0x12')],{'host':_0x24f5('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x24f5('0x12')]));require(_0x24f5('0x14'))[_0x24f5('0x15')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x24f5('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x3da1df,_0x36335e,_0x3deb9b,_0x38467a){return new BPromise(function(_0x21f456,_0x433ba9){var _0x3de647=_0x38467a||client;return _0x3de647[_0x24f5('0x17')](_0x3da1df,_0x3deb9b)[_0x24f5('0x18')](function(_0x182995){logger[_0x24f5('0x19')](_0x24f5('0x1a'),_0x36335e,_0x24f5('0x1b'));logger[_0x24f5('0x1c')](_0x24f5('0x1d'),_0x36335e,_0x24f5('0x1b'),JSON[_0x24f5('0x1e')](_0x182995));if(_0x182995[_0x24f5('0x1f')]){if(_0x182995[_0x24f5('0x1f')][_0x24f5('0x20')]===0x1f4){logger[_0x24f5('0x1f')](_0x24f5('0x1a'),_0x36335e,_0x182995[_0x24f5('0x1f')][_0x24f5('0x21')]);return _0x433ba9(_0x182995['error']['message']);}logger[_0x24f5('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x36335e,_0x182995[_0x24f5('0x1f')]['message']);return _0x21f456(_0x182995[_0x24f5('0x1f')]['message']);}else{logger[_0x24f5('0x19')](_0x24f5('0x1a'),_0x36335e,'request\x20sent');_0x21f456(_0x182995[_0x24f5('0x22')][_0x24f5('0x21')]);}})[_0x24f5('0x23')](function(_0x4158d7){logger[_0x24f5('0x1f')](_0x24f5('0x1a'),_0x36335e,_0x4158d7);_0x433ba9(_0x4158d7);});});}function respondWithStatusCode(_0x5f0747,_0x3cf674){_0x3cf674=_0x3cf674||0xcc;return function(_0x3b8fee){if(_0x3b8fee){return _0x5f0747['sendStatus'](_0x3cf674);}return _0x5f0747[_0x24f5('0x24')](_0x3cf674)['end']();};}function respondWithResult(_0x364042,_0x5da944){_0x5da944=_0x5da944||0xc8;return function(_0x169388){if(_0x169388){return _0x364042['status'](_0x5da944)[_0x24f5('0x25')](_0x169388);}};}function respondWithFilteredResult(_0x4df91f,_0x11bf12){return function(_0x396e1b){if(_0x396e1b){var _0xfe5b40=typeof _0x11bf12[_0x24f5('0x26')]===_0x24f5('0x27')&&typeof _0x11bf12[_0x24f5('0x28')]===_0x24f5('0x27');var _0x389171=_0x396e1b[_0x24f5('0x29')];var _0x20baf3=_0xfe5b40?0x0:_0x11bf12[_0x24f5('0x26')];var _0x3392e2=_0xfe5b40?_0x396e1b[_0x24f5('0x29')]:_0x11bf12['offset']+_0x11bf12['limit'];var _0x1ac008;if(_0x3392e2>=_0x389171){_0x3392e2=_0x389171;_0x1ac008=0xc8;}else{_0x1ac008=0xce;}_0x4df91f[_0x24f5('0x24')](_0x1ac008);return _0x4df91f['set']('Content-Range',_0x20baf3+'-'+_0x3392e2+'/'+_0x389171)[_0x24f5('0x25')](_0x396e1b);}return null;};}function patchUpdates(_0x2eb5aa){return function(_0x2c1969){try{jsonpatch[_0x24f5('0x2a')](_0x2c1969,_0x2eb5aa,!![]);}catch(_0x2f6cb0){return BPromise[_0x24f5('0x2b')](_0x2f6cb0);}return _0x2c1969[_0x24f5('0x2c')]();};}function saveUpdates(_0x36f28d,_0x2cd560){return function(_0x55b581){if(_0x55b581){return _0x55b581[_0x24f5('0x2d')](_0x36f28d)['then'](function(_0x1b2aa1){return _0x1b2aa1;});}return null;};}function removeEntity(_0x107f0f,_0x274b77){return function(_0x4dd0d3){if(_0x4dd0d3){return _0x4dd0d3[_0x24f5('0x2e')]()[_0x24f5('0x18')](function(){var _0x1ee659=_0x4dd0d3[_0x24f5('0x2f')]({'plain':!![]});var _0x390ec5=_0x24f5('0x30');return db[_0x24f5('0x31')][_0x24f5('0x2e')]({'where':{'type':_0x390ec5,'resourceId':_0x1ee659['id']}})[_0x24f5('0x18')](function(){return _0x4dd0d3;});})[_0x24f5('0x18')](function(){_0x107f0f[_0x24f5('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc9b6be,_0xf46608){return function(_0x34401f){if(!_0x34401f){_0xc9b6be[_0x24f5('0x32')](0x194);}return _0x34401f;};}function handleError(_0x1b53bf,_0x43623f){_0x43623f=_0x43623f||0x1f4;return function(_0x112688){logger[_0x24f5('0x1f')](_0x112688[_0x24f5('0x33')]);if(_0x112688[_0x24f5('0x34')]){delete _0x112688[_0x24f5('0x34')];}_0x1b53bf[_0x24f5('0x24')](_0x43623f)['send'](_0x112688);};}exports['index']=function(_0x408de3,_0x2a61eb){var _0x37fd4f={},_0x148800={},_0x3b8dae={'count':0x0,'rows':[]};var _0xee180f=_[_0x24f5('0x35')](db[_0x24f5('0x36')][_0x24f5('0x37')],function(_0x44171c){return{'name':_0x44171c[_0x24f5('0x38')],'type':_0x44171c[_0x24f5('0x39')][_0x24f5('0x3a')]};});_0x148800[_0x24f5('0x3b')]=_[_0x24f5('0x35')](_0xee180f,_0x24f5('0x34'));_0x148800['query']=_[_0x24f5('0x3c')](_0x408de3[_0x24f5('0x3d')]);_0x148800[_0x24f5('0x3e')]=_[_0x24f5('0x3f')](_0x148800[_0x24f5('0x3b')],_0x148800['query']);_0x37fd4f[_0x24f5('0x40')]=_['intersection'](_0x148800[_0x24f5('0x3b')],qs['fields'](_0x408de3[_0x24f5('0x3d')][_0x24f5('0x41')]));_0x37fd4f[_0x24f5('0x40')]=_0x37fd4f['attributes'][_0x24f5('0x42')]?_0x37fd4f[_0x24f5('0x40')]:_0x148800[_0x24f5('0x3b')];if(!_0x408de3['query'][_0x24f5('0x43')](_0x24f5('0x44'))){_0x37fd4f['limit']=qs[_0x24f5('0x28')](_0x408de3[_0x24f5('0x3d')]['limit']);_0x37fd4f[_0x24f5('0x26')]=qs[_0x24f5('0x26')](_0x408de3[_0x24f5('0x3d')][_0x24f5('0x26')]);}_0x37fd4f[_0x24f5('0x45')]=qs[_0x24f5('0x46')](_0x408de3[_0x24f5('0x3d')][_0x24f5('0x46')]);_0x37fd4f[_0x24f5('0x47')]=qs[_0x24f5('0x3e')](_['pick'](_0x408de3[_0x24f5('0x3d')],_0x148800[_0x24f5('0x3e')]),_0xee180f);if(_0x408de3['query'][_0x24f5('0x48')]){_0x37fd4f[_0x24f5('0x47')]=_[_0x24f5('0x49')](_0x37fd4f[_0x24f5('0x47')],{'$or':_[_0x24f5('0x35')](_0xee180f,function(_0x3cb221){if(_0x3cb221[_0x24f5('0x39')]!=='VIRTUAL'){var _0x3788b0={};_0x3788b0[_0x3cb221['name']]={'$like':'%'+_0x408de3[_0x24f5('0x3d')][_0x24f5('0x48')]+'%'};return _0x3788b0;}})});}_0x37fd4f=_[_0x24f5('0x49')]({},_0x37fd4f,_0x408de3[_0x24f5('0x4a')]);var _0x5d3f77={'where':_0x37fd4f['where']};return db[_0x24f5('0x36')]['count'](_0x5d3f77)[_0x24f5('0x18')](function(_0x3df888){_0x3b8dae[_0x24f5('0x29')]=_0x3df888;if(_0x408de3['query']['includeAll']){_0x37fd4f[_0x24f5('0x4b')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x37fd4f);})[_0x24f5('0x18')](function(_0x3e5689){_0x3b8dae['rows']=_0x3e5689;return _0x3b8dae;})[_0x24f5('0x18')](respondWithFilteredResult(_0x2a61eb,_0x37fd4f))[_0x24f5('0x23')](handleError(_0x2a61eb,null));};exports['show']=function(_0x1dfd56,_0x1ccdb1){var _0x5766c6={'raw':!![],'where':{'id':_0x1dfd56[_0x24f5('0x4c')]['id']}},_0x2532bf={};_0x2532bf[_0x24f5('0x3b')]=_[_0x24f5('0x3c')](db[_0x24f5('0x36')][_0x24f5('0x37')]);_0x2532bf[_0x24f5('0x3d')]=_['keys'](_0x1dfd56[_0x24f5('0x3d')]);_0x2532bf[_0x24f5('0x3e')]=_[_0x24f5('0x3f')](_0x2532bf[_0x24f5('0x3b')],_0x2532bf[_0x24f5('0x3d')]);_0x5766c6[_0x24f5('0x40')]=_[_0x24f5('0x3f')](_0x2532bf[_0x24f5('0x3b')],qs[_0x24f5('0x41')](_0x1dfd56[_0x24f5('0x3d')][_0x24f5('0x41')]));_0x5766c6[_0x24f5('0x40')]=_0x5766c6[_0x24f5('0x40')][_0x24f5('0x42')]?_0x5766c6[_0x24f5('0x40')]:_0x2532bf['model'];if(_0x1dfd56[_0x24f5('0x3d')][_0x24f5('0x4d')]){_0x5766c6['include']=[{'all':!![]}];}_0x5766c6=_[_0x24f5('0x49')]({},_0x5766c6,_0x1dfd56[_0x24f5('0x4a')]);return db[_0x24f5('0x36')][_0x24f5('0x4e')](_0x5766c6)[_0x24f5('0x18')](handleEntityNotFound(_0x1ccdb1,null))['then'](respondWithResult(_0x1ccdb1,null))[_0x24f5('0x23')](handleError(_0x1ccdb1,null));};exports[_0x24f5('0x4f')]=function(_0x36995a,_0x5bc395){return db[_0x24f5('0x36')][_0x24f5('0x4f')](_0x36995a[_0x24f5('0x50')],{})[_0x24f5('0x18')](function(_0x2fa5a1){var _0x4d567b=_0x36995a[_0x24f5('0x51')][_0x24f5('0x2f')]({'plain':!![]});if(!_0x4d567b)throw new Error(_0x24f5('0x52'));if(_0x4d567b['role']===_0x24f5('0x51')){var _0x1bc6d8=_0x2fa5a1[_0x24f5('0x2f')]({'plain':!![]});var _0x12bc91=_0x24f5('0x30');return db[_0x24f5('0x53')]['find']({'where':{'name':_0x12bc91,'userProfileId':_0x4d567b[_0x24f5('0x54')]},'raw':!![]})[_0x24f5('0x18')](function(_0xcb4b5d){if(_0xcb4b5d&&_0xcb4b5d['autoAssociation']===0x0){return db[_0x24f5('0x31')][_0x24f5('0x4f')]({'name':_0x1bc6d8[_0x24f5('0x34')],'resourceId':_0x1bc6d8['id'],'type':_0xcb4b5d[_0x24f5('0x34')],'sectionId':_0xcb4b5d['id']},{})['then'](function(){return _0x2fa5a1;});}else{return _0x2fa5a1;}})[_0x24f5('0x23')](function(_0x5af589){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5af589);throw _0x5af589;});}return _0x2fa5a1;})['then'](respondWithResult(_0x5bc395,0xc9))[_0x24f5('0x23')](handleError(_0x5bc395,null));};exports[_0x24f5('0x2d')]=function(_0x2c7cb2,_0x49df35){if(_0x2c7cb2[_0x24f5('0x50')]['id']){delete _0x2c7cb2[_0x24f5('0x50')]['id'];}return db[_0x24f5('0x36')][_0x24f5('0x4e')]({'where':{'id':_0x2c7cb2[_0x24f5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x49df35,null))[_0x24f5('0x18')](saveUpdates(_0x2c7cb2[_0x24f5('0x50')],null))[_0x24f5('0x18')](respondWithResult(_0x49df35,null))[_0x24f5('0x23')](handleError(_0x49df35,null));};exports['destroy']=function(_0x2adcc3,_0x35ba3e){return db[_0x24f5('0x36')][_0x24f5('0x4e')]({'where':{'id':_0x2adcc3[_0x24f5('0x4c')]['id']}})[_0x24f5('0x18')](handleEntityNotFound(_0x35ba3e,null))[_0x24f5('0x18')](removeEntity(_0x35ba3e,null))[_0x24f5('0x23')](handleError(_0x35ba3e,null));};exports[_0x24f5('0x55')]=function(_0x16b8cb,_0x5f3533){return db[_0x24f5('0x36')][_0x24f5('0x55')]()[_0x24f5('0x18')](respondWithResult(_0x5f3533,null))['catch'](handleError(_0x5f3533,null));};exports['getMembers']=function(_0x3f107f,_0x219b52,_0x1fb6c3){var _0x5683d8={'raw':!![],'where':{}},_0x13274f={},_0x62def3;return db[_0x24f5('0x36')]['findOne']({'where':{'id':_0x3f107f[_0x24f5('0x4c')]['id']}})[_0x24f5('0x18')](handleEntityNotFound(_0x219b52,null))[_0x24f5('0x18')](function(_0x43eee7){if(_0x43eee7){_0x62def3=_0x43eee7[_0x24f5('0x2f')]({'plain':!![]});_0x13274f[_0x24f5('0x3b')]=_['keys'](db[_0x24f5('0x56')][_0x24f5('0x37')]);_0x13274f[_0x24f5('0x3d')]=_[_0x24f5('0x3c')](_0x3f107f[_0x24f5('0x3d')]);_0x13274f[_0x24f5('0x3e')]=_[_0x24f5('0x3f')](_0x13274f['model'],_0x13274f[_0x24f5('0x3d')]);_0x5683d8[_0x24f5('0x40')]=_[_0x24f5('0x3f')](_0x13274f['model'],qs['fields'](_0x3f107f[_0x24f5('0x3d')][_0x24f5('0x41')]));_0x5683d8[_0x24f5('0x40')]=_0x5683d8[_0x24f5('0x40')][_0x24f5('0x42')]?_0x5683d8[_0x24f5('0x40')]:_0x13274f[_0x24f5('0x3b')];if(!_0x3f107f[_0x24f5('0x3d')][_0x24f5('0x43')]('nolimit')){_0x5683d8[_0x24f5('0x28')]=qs[_0x24f5('0x28')](_0x3f107f[_0x24f5('0x3d')][_0x24f5('0x28')]);_0x5683d8['offset']=qs[_0x24f5('0x26')](_0x3f107f[_0x24f5('0x3d')][_0x24f5('0x26')]);}_0x5683d8[_0x24f5('0x45')]=qs[_0x24f5('0x46')](_0x3f107f[_0x24f5('0x3d')][_0x24f5('0x46')]);_0x5683d8[_0x24f5('0x47')]=qs[_0x24f5('0x3e')](_['pick'](_0x3f107f[_0x24f5('0x3d')],_0x13274f['filters']));_0x5683d8[_0x24f5('0x47')][_0x24f5('0x57')]=_0x43eee7['id'];if(_0x3f107f[_0x24f5('0x3d')][_0x24f5('0x48')]){_0x5683d8[_0x24f5('0x47')]=_['merge'](_0x5683d8[_0x24f5('0x47')],{'$or':_[_0x24f5('0x35')](_0x5683d8['attributes'],function(_0x5e671b){var _0x5ba5bd={};_0x5ba5bd[_0x5e671b]={'$like':'%'+_0x3f107f[_0x24f5('0x3d')]['filter']+'%'};return _0x5ba5bd;})});}_0x5683d8=_[_0x24f5('0x49')]({},_0x5683d8,_0x3f107f[_0x24f5('0x4a')]);return db[_0x24f5('0x56')][_0x24f5('0x58')](_0x5683d8);}})[_0x24f5('0x18')](function(_0x132fd0){if(_0x132fd0){return db[_0x24f5('0x59')][_0x24f5('0x5a')]({'where':{'id':_[_0x24f5('0x35')](_0x132fd0,_0x24f5('0x5b')),'role':_0x24f5('0x5c')},'attributes':['id',_0x24f5('0x34'),_0x24f5('0x5d'),_0x24f5('0x5e'),_0x24f5('0x5f')]});}})[_0x24f5('0x18')](function(_0x22e8e1){if(_0x22e8e1){return{'count':_0x22e8e1[_0x24f5('0x29')],'rows':_[_0x24f5('0x35')](_0x22e8e1[_0x24f5('0x60')],function(_0x5df34f){return{'membername':_0x5df34f[_0x24f5('0x34')],'UserId':_0x5df34f['id'],'queue_name':_0x62def3['name'],'ChatQueueId':_0x62def3['id'],'interface':util[_0x24f5('0x61')](_0x24f5('0x62'),_0x24f5('0x63'),_0x5df34f[_0x24f5('0x34')]),'penalty':0x0,'paused':_0x5df34f[_0x24f5('0x5d')],'createdAt':_0x5df34f[_0x24f5('0x5f')],'updatedAt':_0x5df34f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x24f5('0x18')](respondWithFilteredResult(_0x219b52,_0x5683d8))['catch'](handleError(_0x219b52,null));};exports[_0x24f5('0x64')]=function(_0x4e048c,_0x1f34ea,_0x5eeca5){var _0x1a83bd={};var _0x326beb={};var _0x33b98c;var _0x41516e;return db[_0x24f5('0x36')][_0x24f5('0x65')]({'where':{'id':_0x4e048c[_0x24f5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1f34ea,null))['then'](function(_0x410ecd){if(_0x410ecd){_0x33b98c=_0x410ecd;_0x326beb['model']=_[_0x24f5('0x3c')](db[_0x24f5('0x66')][_0x24f5('0x37')]);_0x326beb[_0x24f5('0x3d')]=_[_0x24f5('0x3c')](_0x4e048c[_0x24f5('0x3d')]);_0x326beb[_0x24f5('0x3e')]=_['intersection'](_0x326beb[_0x24f5('0x3b')],_0x326beb[_0x24f5('0x3d')]);_0x1a83bd[_0x24f5('0x40')]=_['intersection'](_0x326beb[_0x24f5('0x3b')],qs[_0x24f5('0x41')](_0x4e048c[_0x24f5('0x3d')][_0x24f5('0x41')]));_0x1a83bd[_0x24f5('0x40')]=_0x1a83bd[_0x24f5('0x40')]['length']?_0x1a83bd[_0x24f5('0x40')]:_0x326beb['model'];_0x1a83bd[_0x24f5('0x45')]=qs['sort'](_0x4e048c[_0x24f5('0x3d')][_0x24f5('0x46')]);_0x1a83bd[_0x24f5('0x47')]=qs[_0x24f5('0x3e')](_['pick'](_0x4e048c[_0x24f5('0x3d')],_0x326beb[_0x24f5('0x3e')]));if(_0x4e048c[_0x24f5('0x3d')]['filter']){_0x1a83bd[_0x24f5('0x47')]=_[_0x24f5('0x49')](_0x1a83bd[_0x24f5('0x47')],{'$or':_[_0x24f5('0x35')](_0x1a83bd['attributes'],function(_0x3b4f38){var _0x5b59d1={};_0x5b59d1[_0x3b4f38]={'$like':'%'+_0x4e048c['query']['filter']+'%'};return _0x5b59d1;})});}_0x1a83bd=_[_0x24f5('0x49')]({},_0x1a83bd,_0x4e048c['options']);return _0x33b98c['getTeams'](_0x1a83bd);}})['then'](function(_0x47e552){if(_0x47e552){_0x41516e=_0x47e552[_0x24f5('0x42')];if(!_0x4e048c[_0x24f5('0x3d')]['hasOwnProperty'](_0x24f5('0x44'))){_0x1a83bd[_0x24f5('0x28')]=qs[_0x24f5('0x28')](_0x4e048c[_0x24f5('0x3d')]['limit']);_0x1a83bd[_0x24f5('0x26')]=qs[_0x24f5('0x26')](_0x4e048c[_0x24f5('0x3d')]['offset']);}return _0x33b98c[_0x24f5('0x64')](_0x1a83bd);}})[_0x24f5('0x18')](function(_0x46bda7){if(_0x46bda7){return _0x46bda7?{'count':_0x41516e,'rows':_0x46bda7}:null;}})['then'](respondWithResult(_0x1f34ea,null))['catch'](handleError(_0x1f34ea,null));};exports[_0x24f5('0x67')]=function(_0xa094f9,_0x1f1f38,_0xe45588){var _0x189433=_0xa094f9[_0x24f5('0x50')][_0x24f5('0x68')];return db[_0x24f5('0x66')][_0x24f5('0x58')]({'where':{'id':_0x189433},'attributes':['id'],'include':[{'model':db[_0x24f5('0x59')],'as':_0x24f5('0x69'),'attributes':['id',_0x24f5('0x34'),_0x24f5('0x6a'),_0x24f5('0x6b'),_0x24f5('0x6c')],'raw':!![]}]})[_0x24f5('0x18')](function(_0x28f4d0){if(_0x28f4d0){var _0x3fbb00=_['flatMap'](_0x28f4d0,function(_0x5edc12){var _0x2c32eb=_0x5edc12[_0x24f5('0x2f')]({'plain':!![]});return _0x2c32eb[_0x24f5('0x69')];});return db[_0x24f5('0x36')][_0x24f5('0x4e')]({'where':{'id':_0xa094f9['params']['id']}})[_0x24f5('0x18')](function(_0xfd8d10){return db[_0x24f5('0x6d')][_0x24f5('0x6e')](function(_0x21f7e5){return _0xfd8d10[_0x24f5('0x67')](_0x189433,{'transaction':_0x21f7e5})['then'](function(){return BPromise[_0x24f5('0x6f')](_0x3fbb00,function(_0x43c9d6){return db['UserChatQueue'][_0x24f5('0x70')]({'where':{'UserId':_0x43c9d6['id'],'ChatQueueId':_0xa094f9[_0x24f5('0x4c')]['id']},'transaction':_0x21f7e5});});})[_0x24f5('0x18')](function(){_0x3fbb00[_0x24f5('0x71')](function(_0x315c18){socket[_0x24f5('0x72')](_0x24f5('0x73'),{'UserId':_0x315c18['id'],'ChatQueueId':_0xfd8d10['id']});});});});});}})[_0x24f5('0x18')](respondWithStatusCode(_0x1f1f38,null))['catch'](handleError(_0x1f1f38,null));};exports[_0x24f5('0x74')]=function(_0x4c5dc6,_0xf9d0c2,_0x81ec33){return db[_0x24f5('0x66')][_0x24f5('0x58')]({'where':{'id':_0x4c5dc6[_0x24f5('0x3d')][_0x24f5('0x68')]},'attributes':['id'],'include':[{'model':db[_0x24f5('0x59')],'as':_0x24f5('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xf9d0c2,null))[_0x24f5('0x18')](function(_0x2a4f37){var _0xa35cff=_[_0x24f5('0x35')](_0x2a4f37,'id');var _0x1065fb=[];var _0x13679e=[];var _0x49b788=squel[_0x24f5('0x75')]();_0x49b788['field'](_0x24f5('0x76'))['from'](_0x24f5('0x77'),'tq')['join'](_0x24f5('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x24f5('0x47')](_0x24f5('0x79'),_0x4c5dc6[_0x24f5('0x4c')]['id']);for(var _0x39bb09=0x0;_0x39bb09<_0x2a4f37[_0x24f5('0x42')];_0x39bb09+=0x1){let _0x5b5546=_0x2a4f37[_0x39bb09];for(var _0x3cf662=0x0;_0x3cf662<_0x5b5546[_0x24f5('0x69')]['length'];_0x3cf662+=0x1){let _0x3bf21b=_0x5b5546[_0x24f5('0x69')][_0x3cf662];var _0xd22ea2=_0x49b788[_0x24f5('0x7a')]();_0xd22ea2['where'](_0x24f5('0x7b'),_0x3bf21b['id']);_0x13679e['push'](db[_0x24f5('0x6d')][_0x24f5('0x3d')](_0xd22ea2[_0x24f5('0x7c')](),{'type':db['sequelize'][_0x24f5('0x7d')][_0x24f5('0x7e')]})[_0x24f5('0x18')](function(_0x24b2b4){if(_0x24b2b4[_0x24f5('0x42')]===0x1){return _0x3bf21b['id'];}else{var _0x84993e=_[_0x24f5('0x7f')](_[_0x24f5('0x35')](_0x24b2b4,_0x24f5('0x80')),function(_0x46dd42){return _[_0x24f5('0x81')](_0xa35cff,_0x46dd42);});if(_0x84993e){return _0x3bf21b['id'];}}}));}}return BPromise[_0x24f5('0x82')](_0x13679e)[_0x24f5('0x18')](function(_0x1e6b2e){_0x1065fb=_(_0x1065fb)['union'](_0x1e6b2e)['compact']()[_0x24f5('0x83')]();return db[_0x24f5('0x36')][_0x24f5('0x4e')]({'where':{'id':_0x4c5dc6[_0x24f5('0x4c')]['id']}})[_0x24f5('0x18')](function(_0x157778){return db['sequelize'][_0x24f5('0x6e')](function(_0x2035cd){return _0x157778[_0x24f5('0x74')](_0x4c5dc6[_0x24f5('0x3d')][_0x24f5('0x68')],{'transaction':_0x2035cd})[_0x24f5('0x18')](function(){if(!_[_0x24f5('0x84')](_0x1065fb)){return _0x157778['removeAgents'](_0x1065fb,{'transaction':_0x2035cd});}})[_0x24f5('0x18')](function(){_0x1065fb['forEach'](function(_0x5e6249){socket[_0x24f5('0x72')]('userChatQueue:remove',{'UserId':_0x5e6249,'ChatQueueId':_0x157778['id']});});});});});});})[_0x24f5('0x18')](respondWithStatusCode(_0xf9d0c2,null))[_0x24f5('0x23')](handleError(_0xf9d0c2,null));};exports[_0x24f5('0x85')]=function(_0x2edf13,_0x56de31,_0x25898c){return db[_0x24f5('0x36')][_0x24f5('0x4e')]({'where':{'id':_0x2edf13[_0x24f5('0x4c')]['id']}})[_0x24f5('0x18')](handleEntityNotFound(_0x56de31,null))['then'](function(_0x4388e2){if(_0x4388e2){return _0x4388e2[_0x24f5('0x85')](_0x2edf13[_0x24f5('0x50')]['ids'],_[_0x24f5('0x86')](_0x2edf13['body'],['ids','id'])||{})[_0x24f5('0x87')](function(_0x1955b0){for(var _0x341175=0x0;_0x341175<_0x2edf13[_0x24f5('0x50')][_0x24f5('0x68')]['length'];_0x341175+=0x1){socket[_0x24f5('0x72')](_0x24f5('0x73'),{'UserId':Number(_0x2edf13['body'][_0x24f5('0x68')][_0x341175]),'ChatQueueId':Number(_0x2edf13[_0x24f5('0x4c')]['id'])});}return _0x1955b0;});}})[_0x24f5('0x18')](respondWithResult(_0x56de31,null))['catch'](handleError(_0x56de31,null));};exports[_0x24f5('0x88')]=function(_0x4c8e1c,_0x21b8c5,_0x353813){return db[_0x24f5('0x36')][_0x24f5('0x4e')]({'where':{'id':_0x4c8e1c[_0x24f5('0x4c')]['id']}})[_0x24f5('0x18')](handleEntityNotFound(_0x21b8c5,null))[_0x24f5('0x18')](function(_0xb24288){if(_0xb24288){return _0xb24288['removeAgents'](_0x4c8e1c[_0x24f5('0x3d')][_0x24f5('0x68')])['then'](function(){if(_[_0x24f5('0x89')](_0x4c8e1c[_0x24f5('0x3d')][_0x24f5('0x68')])){for(var _0x41525b=0x0;_0x41525b<_0x4c8e1c[_0x24f5('0x3d')][_0x24f5('0x68')][_0x24f5('0x42')];_0x41525b+=0x1){socket[_0x24f5('0x72')](_0x24f5('0x8a'),{'UserId':Number(_0x4c8e1c[_0x24f5('0x3d')][_0x24f5('0x68')][_0x41525b]),'ChatQueueId':Number(_0x4c8e1c[_0x24f5('0x4c')]['id'])});}}else{socket[_0x24f5('0x72')](_0x24f5('0x8a'),{'UserId':Number(_0x4c8e1c['query'][_0x24f5('0x68')]),'ChatQueueId':Number(_0x4c8e1c[_0x24f5('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x21b8c5,null))[_0x24f5('0x23')](handleError(_0x21b8c5,null));};exports['getAgents']=function(_0x5e9ef9,_0x156a6f,_0x69774e){var _0x488d5e={};var _0x366a0e={};var _0x5937a6;var _0x35b8e6;return db[_0x24f5('0x36')][_0x24f5('0x65')]({'where':{'id':_0x5e9ef9[_0x24f5('0x4c')]['id']}})[_0x24f5('0x18')](handleEntityNotFound(_0x156a6f,null))[_0x24f5('0x18')](function(_0x5471dd){if(_0x5471dd){_0x5937a6=_0x5471dd;_0x366a0e[_0x24f5('0x3b')]=_[_0x24f5('0x3c')](db[_0x24f5('0x59')][_0x24f5('0x37')]);_0x366a0e['query']=_[_0x24f5('0x3c')](_0x5e9ef9[_0x24f5('0x3d')]);_0x366a0e['filters']=_[_0x24f5('0x3f')](_0x366a0e[_0x24f5('0x3b')],_0x366a0e[_0x24f5('0x3d')]);_0x488d5e['attributes']=_['intersection'](_0x366a0e[_0x24f5('0x3b')],qs[_0x24f5('0x41')](_0x5e9ef9[_0x24f5('0x3d')][_0x24f5('0x41')]));_0x488d5e[_0x24f5('0x40')]=_0x488d5e['attributes'][_0x24f5('0x42')]?_0x488d5e[_0x24f5('0x40')]:_0x366a0e[_0x24f5('0x3b')];_0x488d5e['order']=qs[_0x24f5('0x46')](_0x5e9ef9[_0x24f5('0x3d')]['sort']);_0x488d5e[_0x24f5('0x47')]=qs[_0x24f5('0x3e')](_['pick'](_0x5e9ef9['query'],_0x366a0e[_0x24f5('0x3e')]));if(_0x5e9ef9[_0x24f5('0x3d')][_0x24f5('0x48')]){_0x488d5e[_0x24f5('0x47')]=_['merge'](_0x488d5e[_0x24f5('0x47')],{'$or':_[_0x24f5('0x35')](_0x488d5e['attributes'],function(_0x1c601a){var _0x526335={};_0x526335[_0x1c601a]={'$like':'%'+_0x5e9ef9['query']['filter']+'%'};return _0x526335;})});}_0x488d5e=_[_0x24f5('0x49')]({},_0x488d5e,_0x5e9ef9['options']);return _0x5937a6[_0x24f5('0x8b')](_0x488d5e);}})[_0x24f5('0x18')](function(_0x4c87d9){if(_0x4c87d9){_0x35b8e6=_0x4c87d9['length'];if(!_0x5e9ef9['query'][_0x24f5('0x43')]('nolimit')){_0x488d5e[_0x24f5('0x28')]=qs[_0x24f5('0x28')](_0x5e9ef9[_0x24f5('0x3d')][_0x24f5('0x28')]);_0x488d5e['offset']=qs[_0x24f5('0x26')](_0x5e9ef9[_0x24f5('0x3d')][_0x24f5('0x26')]);}return _0x5937a6['getAgents'](_0x488d5e);}})[_0x24f5('0x18')](function(_0x5ec7d3){if(_0x5ec7d3){return _0x5ec7d3?{'count':_0x35b8e6,'rows':_0x5ec7d3}:null;}})['then'](respondWithResult(_0x156a6f,null))[_0x24f5('0x23')](handleError(_0x156a6f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index e7a1d30..f215961 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 _0x5cbb=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','hook','events'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x5cbb,0x77));var _0xb5cb=function(_0x60ebfe,_0x384f42){_0x60ebfe=_0x60ebfe-0x0;var _0x3fc4c3=_0x5cbb[_0x60ebfe];return _0x3fc4c3;};'use strict';var EventEmitter=require(_0xb5cb('0x0'));var ChatQueue=require(_0xb5cb('0x1'))['db'][_0xb5cb('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb5cb('0x3')](0x0);var events={'afterCreate':_0xb5cb('0x4'),'afterUpdate':_0xb5cb('0x5'),'afterDestroy':_0xb5cb('0x6')};function emitEvent(_0x58beab){return function(_0x2f82e0,_0x57cdab,_0x1d442f){ChatQueueEvents['emit'](_0x58beab+':'+_0x2f82e0['id'],_0x2f82e0);ChatQueueEvents['emit'](_0x58beab,_0x2f82e0);_0x1d442f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xb5cb('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x4b9c=['update','remove','emit','hook','events','save'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x4b9c,0x1c6));var _0xc4b9=function(_0x27e674,_0x3af13f){_0x27e674=_0x27e674-0x0;var _0x1d64ee=_0x4b9c[_0x27e674];return _0x1d64ee;};'use strict';var EventEmitter=require(_0xc4b9('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc4b9('0x1'),'afterUpdate':_0xc4b9('0x2'),'afterDestroy':_0xc4b9('0x3')};function emitEvent(_0x15595f){return function(_0x4ef734,_0x547355,_0x4e9938){ChatQueueEvents[_0xc4b9('0x4')](_0x15595f+':'+_0x4ef734['id'],_0x4ef734);ChatQueueEvents['emit'](_0x15595f,_0x4ef734);_0x4e9938(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xc4b9('0x5')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 174ec74..ea67ba8 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 _0xeb6b=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x70a8a5,_0x35a384){var _0x2b563b=function(_0x4bbb5b){while(--_0x4bbb5b){_0x70a8a5['push'](_0x70a8a5['shift']());}};_0x2b563b(++_0x35a384);}(_0xeb6b,0x1f0));var _0xbeb6=function(_0x2929bb,_0x1cecdc){_0x2929bb=_0x2929bb-0x0;var _0x3a023d=_0xeb6b[_0x2929bb];return _0x3a023d;};'use strict';var _=require(_0xbeb6('0x0'));var util=require(_0xbeb6('0x1'));var logger=require(_0xbeb6('0x2'))(_0xbeb6('0x3'));var moment=require(_0xbeb6('0x4'));var BPromise=require(_0xbeb6('0x5'));var rp=require(_0xbeb6('0x6'));var fs=require('fs');var path=require(_0xbeb6('0x7'));var rimraf=require('rimraf');var config=require(_0xbeb6('0x8'));var attributes=require(_0xbeb6('0x9'));module[_0xbeb6('0xa')]=function(_0x23a1c3,_0xe2ad0c){return _0x23a1c3[_0xbeb6('0xb')](_0xbeb6('0xc'),attributes,{'tableName':_0xbeb6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4588=['chat_queues','util','../../config/logger','api','moment','request-promise','path','exports','define'];(function(_0xcf7d1e,_0x1b00ad){var _0x42b2cb=function(_0x4c5c9b){while(--_0x4c5c9b){_0xcf7d1e['push'](_0xcf7d1e['shift']());}};_0x42b2cb(++_0x1b00ad);}(_0x4588,0x1f0));var _0x8458=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0x4588[_0x163742];return _0x1152ac;};'use strict';var _=require('lodash');var util=require(_0x8458('0x0'));var logger=require(_0x8458('0x1'))(_0x8458('0x2'));var moment=require(_0x8458('0x3'));var BPromise=require('bluebird');var rp=require(_0x8458('0x4'));var fs=require('fs');var path=require(_0x8458('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x8458('0x6')]=function(_0x28684,_0x4493dd){return _0x28684[_0x8458('0x7')]('ChatQueue',attributes,{'tableName':_0x8458('0x8'),'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 df1f1ab..1353875 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 _0x657e=['../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./chatQueue.socket','register','then','info','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','include','map','model','find','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x172a86,_0x4f121e){var _0x39ae5b=function(_0x1de3d9){while(--_0x1de3d9){_0x172a86['push'](_0x172a86['shift']());}};_0x39ae5b(++_0x4f121e);}(_0x657e,0x1c2));var _0xe657=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x657e[_0x247fa1];return _0x244f35;};'use strict';var _=require(_0xe657('0x0'));var util=require(_0xe657('0x1'));var moment=require(_0xe657('0x2'));var BPromise=require(_0xe657('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe657('0x4'));var db=require(_0xe657('0x5'))['db'];var utils=require(_0xe657('0x6'));var logger=require(_0xe657('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe657('0x8'));var client=jayson[_0xe657('0x9')]['http']({'port':0x232a});config[_0xe657('0xa')]=_[_0xe657('0xb')](config[_0xe657('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe657('0xc'))(new Redis(config[_0xe657('0xa')]));require(_0xe657('0xd'))[_0xe657('0xe')](socket);function respondWithRpcPromise(_0x37f91d,_0x3e33c8,_0x4ab4f0){return new BPromise(function(_0xe04ba9,_0xf06a03){return client['request'](_0x37f91d,_0x4ab4f0)[_0xe657('0xf')](function(_0x2a66d9){logger[_0xe657('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3e33c8,_0xe657('0x11'));logger[_0xe657('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3e33c8,'request\x20sent',JSON[_0xe657('0x13')](_0x2a66d9));if(_0x2a66d9[_0xe657('0x14')]){if(_0x2a66d9[_0xe657('0x14')][_0xe657('0x15')]===0x1f4){logger[_0xe657('0x14')](_0xe657('0x16'),_0x3e33c8,_0x2a66d9['error']['message']);return _0xf06a03(_0x2a66d9[_0xe657('0x14')][_0xe657('0x17')]);}logger['error'](_0xe657('0x16'),_0x3e33c8,_0x2a66d9[_0xe657('0x14')]['message']);return _0xe04ba9(_0x2a66d9[_0xe657('0x14')][_0xe657('0x17')]);}else{logger[_0xe657('0x10')](_0xe657('0x16'),_0x3e33c8,_0xe657('0x11'));_0xe04ba9(_0x2a66d9['result'][_0xe657('0x17')]);}})[_0xe657('0x18')](function(_0x4c41df){logger[_0xe657('0x14')]('ChatQueue,\x20%s,\x20%s',_0x3e33c8,_0x4c41df);_0xf06a03(_0x4c41df);});});}exports[_0xe657('0x19')]=function(_0x5c3a7d){var _0x163ae3=this;return new Promise(function(_0x1b8b2c,_0x1c563b){return db[_0xe657('0x1a')][_0xe657('0x1b')]({'raw':_0x5c3a7d['options']?_0x5c3a7d['options'][_0xe657('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c3a7d['options']?_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x1e')]||null:null,'attributes':_0x5c3a7d[_0xe657('0x1d')]?_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x1f')]||null:null,'limit':_0x5c3a7d[_0xe657('0x1d')]?_0x5c3a7d['options'][_0xe657('0x20')]||null:null,'include':_0x5c3a7d[_0xe657('0x1d')]?_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x21')]?_[_0xe657('0x22')](_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x21')],function(_0xb39831){return{'model':db[_0xb39831[_0xe657('0x23')]],'as':_0xb39831['as'],'attributes':_0xb39831['attributes'],'include':_0xb39831['include']?_[_0xe657('0x22')](_0xb39831['include'],function(_0x5ed298){return{'model':db[_0x5ed298[_0xe657('0x23')]],'as':_0x5ed298['as'],'attributes':_0x5ed298['attributes'],'include':_0x5ed298[_0xe657('0x21')]?_[_0xe657('0x22')](_0x5ed298[_0xe657('0x21')],function(_0x54ae2b){return{'model':db[_0x54ae2b[_0xe657('0x23')]],'as':_0x54ae2b['as'],'attributes':_0x54ae2b[_0xe657('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe657('0xf')](function(_0x343732){logger[_0xe657('0x10')](_0xe657('0x19'),_0x5c3a7d);logger[_0xe657('0x12')](_0xe657('0x19'),_0x5c3a7d,JSON['stringify'](_0x343732));_0x1b8b2c(_0x343732);})[_0xe657('0x18')](function(_0x11aea3){logger['error'](_0xe657('0x19'),_0x11aea3['message'],_0x5c3a7d);_0x1c563b(_0x163ae3[_0xe657('0x14')](0x1f4,_0x11aea3['message']));});});};exports['ShowChatQueue']=function(_0x46050c){var _0x46edbd=this;return new Promise(function(_0x449d25,_0x507e10){return db['ChatQueue'][_0xe657('0x24')]({'raw':_0x46050c['options']?_0x46050c[_0xe657('0x1d')][_0xe657('0x1c')]===undefined?!![]:![]:!![],'where':_0x46050c[_0xe657('0x1d')]?_0x46050c[_0xe657('0x1d')]['where']||null:null,'attributes':_0x46050c['options']?_0x46050c[_0xe657('0x1d')][_0xe657('0x1f')]||null:null,'include':_0x46050c[_0xe657('0x1d')]?_0x46050c['options'][_0xe657('0x21')]?_['map'](_0x46050c['options'][_0xe657('0x21')],function(_0x3fd030){return{'model':db[_0x3fd030['model']],'as':_0x3fd030['as'],'attributes':_0x3fd030[_0xe657('0x1f')],'include':_0x3fd030[_0xe657('0x21')]?_[_0xe657('0x22')](_0x3fd030[_0xe657('0x21')],function(_0x1b951c){return{'model':db[_0x1b951c[_0xe657('0x23')]],'as':_0x1b951c['as'],'attributes':_0x1b951c[_0xe657('0x1f')],'include':_0x1b951c[_0xe657('0x21')]?_[_0xe657('0x22')](_0x1b951c[_0xe657('0x21')],function(_0x57c028){return{'model':db[_0x57c028[_0xe657('0x23')]],'as':_0x57c028['as'],'attributes':_0x57c028[_0xe657('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe657('0xf')](function(_0x17380b){logger[_0xe657('0x10')](_0xe657('0x25'),_0x46050c);logger[_0xe657('0x12')](_0xe657('0x25'),_0x46050c,JSON[_0xe657('0x13')](_0x17380b));_0x449d25(_0x17380b);})[_0xe657('0x18')](function(_0x1f8f6e){logger[_0xe657('0x14')](_0xe657('0x25'),_0x1f8f6e[_0xe657('0x17')],_0x46050c);_0x507e10(_0x46edbd[_0xe657('0x14')](0x1f4,_0x1f8f6e['message']));});});};
\ No newline at end of file
+var _0x4a08=['then','ShowChatQueue','ChatQueue','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetChatQueue','options','raw','where','limit','include','map','model','attributes'];(function(_0x46ede7,_0x165c3e){var _0xe7113d=function(_0x61ca49){while(--_0x61ca49){_0x46ede7['push'](_0x46ede7['shift']());}};_0xe7113d(++_0x165c3e);}(_0x4a08,0x11b));var _0x84a0=function(_0x4f3dff,_0x107d88){_0x4f3dff=_0x4f3dff-0x0;var _0x2adc9c=_0x4a08[_0x4f3dff];return _0x2adc9c;};'use strict';var _=require(_0x84a0('0x0'));var util=require('util');var moment=require(_0x84a0('0x1'));var BPromise=require(_0x84a0('0x2'));var rs=require(_0x84a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x84a0('0x4'));var logger=require(_0x84a0('0x5'))('rpc');var config=require(_0x84a0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x84a0('0x7')]['http']({'port':0x232a});config['redis']=_[_0x84a0('0x8')](config['redis'],{'host':_0x84a0('0x9'),'port':0x18eb});var socket=require(_0x84a0('0xa'))(new Redis(config[_0x84a0('0xb')]));require(_0x84a0('0xc'))[_0x84a0('0xd')](socket);function respondWithRpcPromise(_0x3e3077,_0x4f2203,_0x435bab){return new BPromise(function(_0x2940ed,_0x44d2c8){return client['request'](_0x3e3077,_0x435bab)['then'](function(_0x73cb5a){logger[_0x84a0('0xe')](_0x84a0('0xf'),_0x4f2203,_0x84a0('0x10'));logger[_0x84a0('0x11')](_0x84a0('0x12'),_0x4f2203,_0x84a0('0x10'),JSON[_0x84a0('0x13')](_0x73cb5a));if(_0x73cb5a['error']){if(_0x73cb5a[_0x84a0('0x14')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4f2203,_0x73cb5a[_0x84a0('0x14')][_0x84a0('0x15')]);return _0x44d2c8(_0x73cb5a[_0x84a0('0x14')]['message']);}logger[_0x84a0('0x14')]('ChatQueue,\x20%s,\x20%s',_0x4f2203,_0x73cb5a[_0x84a0('0x14')][_0x84a0('0x15')]);return _0x2940ed(_0x73cb5a['error'][_0x84a0('0x15')]);}else{logger[_0x84a0('0xe')](_0x84a0('0xf'),_0x4f2203,_0x84a0('0x10'));_0x2940ed(_0x73cb5a['result'][_0x84a0('0x15')]);}})[_0x84a0('0x16')](function(_0x3c440a){logger[_0x84a0('0x14')]('ChatQueue,\x20%s,\x20%s',_0x4f2203,_0x3c440a);_0x44d2c8(_0x3c440a);});});}exports[_0x84a0('0x17')]=function(_0x1dd0d8){var _0x4db19d=this;return new Promise(function(_0x69bfa5,_0x57a770){return db['ChatQueue']['findAll']({'raw':_0x1dd0d8[_0x84a0('0x18')]?_0x1dd0d8[_0x84a0('0x18')][_0x84a0('0x19')]===undefined?!![]:![]:!![],'where':_0x1dd0d8[_0x84a0('0x18')]?_0x1dd0d8['options'][_0x84a0('0x1a')]||null:null,'attributes':_0x1dd0d8[_0x84a0('0x18')]?_0x1dd0d8[_0x84a0('0x18')]['attributes']||null:null,'limit':_0x1dd0d8[_0x84a0('0x18')]?_0x1dd0d8[_0x84a0('0x18')][_0x84a0('0x1b')]||null:null,'include':_0x1dd0d8[_0x84a0('0x18')]?_0x1dd0d8[_0x84a0('0x18')][_0x84a0('0x1c')]?_[_0x84a0('0x1d')](_0x1dd0d8[_0x84a0('0x18')]['include'],function(_0x283d75){return{'model':db[_0x283d75[_0x84a0('0x1e')]],'as':_0x283d75['as'],'attributes':_0x283d75[_0x84a0('0x1f')],'include':_0x283d75[_0x84a0('0x1c')]?_[_0x84a0('0x1d')](_0x283d75[_0x84a0('0x1c')],function(_0x4e4c00){return{'model':db[_0x4e4c00[_0x84a0('0x1e')]],'as':_0x4e4c00['as'],'attributes':_0x4e4c00['attributes'],'include':_0x4e4c00[_0x84a0('0x1c')]?_[_0x84a0('0x1d')](_0x4e4c00['include'],function(_0x2a4af5){return{'model':db[_0x2a4af5['model']],'as':_0x2a4af5['as'],'attributes':_0x2a4af5[_0x84a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x84a0('0x20')](function(_0x241925){logger[_0x84a0('0xe')](_0x84a0('0x17'),_0x1dd0d8);logger[_0x84a0('0x11')](_0x84a0('0x17'),_0x1dd0d8,JSON[_0x84a0('0x13')](_0x241925));_0x69bfa5(_0x241925);})[_0x84a0('0x16')](function(_0x491a13){logger['error'](_0x84a0('0x17'),_0x491a13[_0x84a0('0x15')],_0x1dd0d8);_0x57a770(_0x4db19d[_0x84a0('0x14')](0x1f4,_0x491a13[_0x84a0('0x15')]));});});};exports[_0x84a0('0x21')]=function(_0x2ba4cf){var _0xe1c024=this;return new Promise(function(_0x19b651,_0x3a0c43){return db[_0x84a0('0x22')]['find']({'raw':_0x2ba4cf[_0x84a0('0x18')]?_0x2ba4cf['options'][_0x84a0('0x19')]===undefined?!![]:![]:!![],'where':_0x2ba4cf[_0x84a0('0x18')]?_0x2ba4cf['options'][_0x84a0('0x1a')]||null:null,'attributes':_0x2ba4cf[_0x84a0('0x18')]?_0x2ba4cf[_0x84a0('0x18')][_0x84a0('0x1f')]||null:null,'include':_0x2ba4cf['options']?_0x2ba4cf[_0x84a0('0x18')][_0x84a0('0x1c')]?_['map'](_0x2ba4cf['options']['include'],function(_0x2c114b){return{'model':db[_0x2c114b[_0x84a0('0x1e')]],'as':_0x2c114b['as'],'attributes':_0x2c114b[_0x84a0('0x1f')],'include':_0x2c114b['include']?_[_0x84a0('0x1d')](_0x2c114b[_0x84a0('0x1c')],function(_0x19c435){return{'model':db[_0x19c435[_0x84a0('0x1e')]],'as':_0x19c435['as'],'attributes':_0x19c435[_0x84a0('0x1f')],'include':_0x19c435[_0x84a0('0x1c')]?_[_0x84a0('0x1d')](_0x19c435[_0x84a0('0x1c')],function(_0xdf294){return{'model':db[_0xdf294[_0x84a0('0x1e')]],'as':_0xdf294['as'],'attributes':_0xdf294['attributes']};}):[]};}):[]};}):[]:[]})[_0x84a0('0x20')](function(_0x4eec81){logger['info'](_0x84a0('0x21'),_0x2ba4cf);logger[_0x84a0('0x11')](_0x84a0('0x21'),_0x2ba4cf,JSON['stringify'](_0x4eec81));_0x19b651(_0x4eec81);})[_0x84a0('0x16')](function(_0x5d4c69){logger[_0x84a0('0x14')](_0x84a0('0x21'),_0x5d4c69[_0x84a0('0x15')],_0x2ba4cf);_0x3a0c43(_0xe1c024[_0x84a0('0x14')](0x1f4,_0x5d4c69['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index eb9a698..1eecbd2 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 _0xa37e=['chatQueue:','remove','update','emit','removeListener','register'];(function(_0x13f7e4,_0xba7e02){var _0x3fe30f=function(_0xc8e03d){while(--_0xc8e03d){_0x13f7e4['push'](_0x13f7e4['shift']());}};_0x3fe30f(++_0xba7e02);}(_0xa37e,0x97));var _0xea37=function(_0x15f659,_0x2d86ee){_0x15f659=_0x15f659-0x0;var _0x28185d=_0xa37e[_0x15f659];return _0x28185d;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xea37('0x0'),_0xea37('0x1')];function createListener(_0x204a22,_0x475c71){return function(_0x5430aa){_0x475c71[_0xea37('0x2')](_0x204a22,_0x5430aa);};}function removeListener(_0x537c5a,_0x360ed5){return function(){ChatQueueEvents[_0xea37('0x3')](_0x537c5a,_0x360ed5);};}exports[_0xea37('0x4')]=function(_0x4d380b){for(var _0x57135b=0x0,_0x36c489=events['length'];_0x57135b<_0x36c489;_0x57135b++){var _0x4ae081=events[_0x57135b];var _0x2c2890=createListener(_0xea37('0x5')+_0x4ae081,_0x4d380b);ChatQueueEvents['on'](_0x4ae081,_0x2c2890);}};
\ No newline at end of file
+var _0x68fc=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x3806e6,_0x2f55d1){var _0x43aea8=function(_0x3c9928){while(--_0x3c9928){_0x3806e6['push'](_0x3806e6['shift']());}};_0x43aea8(++_0x2f55d1);}(_0x68fc,0xa5));var _0xc68f=function(_0x3efd5d,_0x2d9e5e){_0x3efd5d=_0x3efd5d-0x0;var _0x5e75cd=_0x68fc[_0x3efd5d];return _0x5e75cd;};'use strict';var ChatQueueEvents=require(_0xc68f('0x0'));var events=[_0xc68f('0x1'),_0xc68f('0x2'),'update'];function createListener(_0x49aa95,_0x26513f){return function(_0x506fb5){_0x26513f[_0xc68f('0x3')](_0x49aa95,_0x506fb5);};}function removeListener(_0x593648,_0x5899ea){return function(){ChatQueueEvents[_0xc68f('0x4')](_0x593648,_0x5899ea);};}exports[_0xc68f('0x5')]=function(_0x1c6df9){for(var _0x363cdf=0x0,_0x4fcce4=events['length'];_0x363cdf<_0x4fcce4;_0x363cdf++){var _0x9f2705=events[_0x363cdf];var _0x2bf3fd=createListener(_0xc68f('0x6')+_0x9f2705,_0x1c6df9);ChatQueueEvents['on'](_0x9f2705,_0x2bf3fd);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 0893e00..de8158c 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x5fc3[_0x2bf466];return _0x856885;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x2ca759,_0xfb4730){var _0x205c91=function(_0x22a02c){while(--_0x22a02c){_0x2ca759['push'](_0x2ca759['shift']());}};_0x205c91(++_0xfb4730);}(_0x55ca,0x126));var _0xa55c=function(_0x26df48,_0x22aa50){_0x26df48=_0x26df48-0x0;var _0x209047=_0x55ca[_0x26df48];return _0x209047;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index d4d30b2..71c5ece 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 _0xb5a2=['moment','sequelize','exports','STRING','DATE'];(function(_0x90519f,_0x5cc33a){var _0x2baf61=function(_0x1e0b7b){while(--_0x1e0b7b){_0x90519f['push'](_0x90519f['shift']());}};_0x2baf61(++_0x5cc33a);}(_0xb5a2,0x73));var _0x2b5a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb5a2[_0x432682];return _0x463d05;};'use strict';var moment=require(_0x2b5a('0x0'));var Sequelize=require(_0x2b5a('0x1'));module[_0x2b5a('0x2')]={'uniqueid':{'type':Sequelize[_0x2b5a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2b5a('0x3')]},'joinAt':{'type':Sequelize[_0x2b5a('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2b5a('0x4')]},'exitAt':{'type':Sequelize[_0x2b5a('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xad1c=['sequelize','STRING','DATE'];(function(_0xacb211,_0x425790){var _0x5ac339=function(_0x362f95){while(--_0x362f95){_0xacb211['push'](_0xacb211['shift']());}};_0x5ac339(++_0x425790);}(_0xad1c,0x1c8));var _0xcad1=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xad1c[_0x5447fd];return _0x15b28a;};'use strict';var moment=require('moment');var Sequelize=require(_0xcad1('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xcad1('0x1')]},'joinAt':{'type':Sequelize[_0xcad1('0x2')]},'leaveAt':{'type':Sequelize[_0xcad1('0x2')]},'acceptAt':{'type':Sequelize[_0xcad1('0x2')]},'exitAt':{'type':Sequelize[_0xcad1('0x2')]},'reason':{'type':Sequelize[_0xcad1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index ce26de4..6c221b0 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 _0x6691=['findAll','rows','catch','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatQueueReport','include'];(function(_0x31aae7,_0xe56cf6){var _0x5923f9=function(_0x939a01){while(--_0x939a01){_0x31aae7['push'](_0x31aae7['shift']());}};_0x5923f9(++_0xe56cf6);}(_0x6691,0x12d));var _0x1669=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6691[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0x1669('0x0'));var rimraf=require(_0x1669('0x1'));var zipdir=require(_0x1669('0x2'));var jsonpatch=require(_0x1669('0x3'));var rp=require(_0x1669('0x4'));var moment=require(_0x1669('0x5'));var BPromise=require(_0x1669('0x6'));var Mustache=require(_0x1669('0x7'));var util=require(_0x1669('0x8'));var path=require(_0x1669('0x9'));var sox=require('sox');var csv=require(_0x1669('0xa'));var ejs=require(_0x1669('0xb'));var fs=require('fs');var fs_extra=require(_0x1669('0xc'));var _=require(_0x1669('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1669('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1669('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1669('0x10'));var as=require(_0x1669('0x11'));var hardwareService=require(_0x1669('0x12'));var logger=require(_0x1669('0x13'))(_0x1669('0x14'));var utils=require(_0x1669('0x15'));var config=require(_0x1669('0x16'));var licenseUtil=require(_0x1669('0x17'));var db=require(_0x1669('0x18'))['db'];function respondWithStatusCode(_0x46352e,_0x3709f0){_0x3709f0=_0x3709f0||0xcc;return function(_0x2031eb){if(_0x2031eb){return _0x46352e[_0x1669('0x19')](_0x3709f0);}return _0x46352e[_0x1669('0x1a')](_0x3709f0)[_0x1669('0x1b')]();};}function respondWithResult(_0x355ac3,_0x102193){_0x102193=_0x102193||0xc8;return function(_0x2904b6){if(_0x2904b6){return _0x355ac3[_0x1669('0x1a')](_0x102193)[_0x1669('0x1c')](_0x2904b6);}};}function respondWithFilteredResult(_0x14eb3e,_0x31b2be){return function(_0x1f9ea6){if(_0x1f9ea6){var _0x4d2f66=typeof _0x31b2be[_0x1669('0x1d')]===_0x1669('0x1e')&&typeof _0x31b2be[_0x1669('0x1f')]===_0x1669('0x1e');var _0x285d86=_0x1f9ea6['count'];var _0x56e3d9=_0x4d2f66?0x0:_0x31b2be[_0x1669('0x1d')];var _0x31600f=_0x4d2f66?_0x1f9ea6[_0x1669('0x20')]:_0x31b2be[_0x1669('0x1d')]+_0x31b2be[_0x1669('0x1f')];var _0x64edff;if(_0x31600f>=_0x285d86){_0x31600f=_0x285d86;_0x64edff=0xc8;}else{_0x64edff=0xce;}_0x14eb3e[_0x1669('0x1a')](_0x64edff);return _0x14eb3e['set'](_0x1669('0x21'),_0x56e3d9+'-'+_0x31600f+'/'+_0x285d86)[_0x1669('0x1c')](_0x1f9ea6);}return null;};}function patchUpdates(_0x51297e){return function(_0x3dc48a){try{jsonpatch[_0x1669('0x22')](_0x3dc48a,_0x51297e,!![]);}catch(_0x4e1b1b){return BPromise[_0x1669('0x23')](_0x4e1b1b);}return _0x3dc48a[_0x1669('0x24')]();};}function saveUpdates(_0x2e95c3,_0x17c227){return function(_0x311f56){if(_0x311f56){return _0x311f56['update'](_0x2e95c3)[_0x1669('0x25')](function(_0x457973){return _0x457973;});}return null;};}function removeEntity(_0x344eaf,_0x5796f2){return function(_0x176b4b){if(_0x176b4b){return _0x176b4b['destroy']()['then'](function(){_0x344eaf[_0x1669('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x304b25,_0x3ce429){return function(_0x1ab80f){if(!_0x1ab80f){_0x304b25[_0x1669('0x19')](0x194);}return _0x1ab80f;};}function handleError(_0x50abe4,_0x660cc7){_0x660cc7=_0x660cc7||0x1f4;return function(_0x5283da){logger['error'](_0x5283da[_0x1669('0x26')]);if(_0x5283da['name']){delete _0x5283da[_0x1669('0x27')];}_0x50abe4[_0x1669('0x1a')](_0x660cc7)['send'](_0x5283da);};}exports[_0x1669('0x28')]=function(_0x590053,_0x29aff9){var _0x1512e2={},_0x31f4f0={},_0x3fe045={'count':0x0,'rows':[]};var _0x577a0a=_['map'](db['ChatQueueReport'][_0x1669('0x29')],function(_0x6429dc){return{'name':_0x6429dc[_0x1669('0x2a')],'type':_0x6429dc[_0x1669('0x2b')][_0x1669('0x2c')]};});_0x31f4f0['model']=_[_0x1669('0x2d')](_0x577a0a,_0x1669('0x27'));_0x31f4f0[_0x1669('0x2e')]=_[_0x1669('0x2f')](_0x590053[_0x1669('0x2e')]);_0x31f4f0[_0x1669('0x30')]=_[_0x1669('0x31')](_0x31f4f0[_0x1669('0x32')],_0x31f4f0['query']);_0x1512e2[_0x1669('0x33')]=_['intersection'](_0x31f4f0[_0x1669('0x32')],qs['fields'](_0x590053['query'][_0x1669('0x34')]));_0x1512e2[_0x1669('0x33')]=_0x1512e2[_0x1669('0x33')][_0x1669('0x35')]?_0x1512e2[_0x1669('0x33')]:_0x31f4f0[_0x1669('0x32')];if(!_0x590053[_0x1669('0x2e')][_0x1669('0x36')](_0x1669('0x37'))){_0x1512e2['limit']=qs[_0x1669('0x1f')](_0x590053[_0x1669('0x2e')][_0x1669('0x1f')]);_0x1512e2[_0x1669('0x1d')]=qs[_0x1669('0x1d')](_0x590053[_0x1669('0x2e')][_0x1669('0x1d')]);}_0x1512e2['order']=qs[_0x1669('0x38')](_0x590053[_0x1669('0x2e')][_0x1669('0x38')]);_0x1512e2[_0x1669('0x39')]=qs[_0x1669('0x30')](_[_0x1669('0x3a')](_0x590053['query'],_0x31f4f0['filters']),_0x577a0a);if(_0x590053['query'][_0x1669('0x3b')]){_0x1512e2[_0x1669('0x39')]=_[_0x1669('0x3c')](_0x1512e2[_0x1669('0x39')],{'$or':_[_0x1669('0x2d')](_0x577a0a,function(_0x2c35db){if(_0x2c35db[_0x1669('0x2b')]!=='VIRTUAL'){var _0x9ad261={};_0x9ad261[_0x2c35db[_0x1669('0x27')]]={'$like':'%'+_0x590053['query']['filter']+'%'};return _0x9ad261;}})});}_0x1512e2=_[_0x1669('0x3c')]({},_0x1512e2,_0x590053[_0x1669('0x3d')]);var _0x379d82={'where':_0x1512e2[_0x1669('0x39')]};return db[_0x1669('0x3e')]['count'](_0x379d82)[_0x1669('0x25')](function(_0x5ba428){_0x3fe045['count']=_0x5ba428;if(_0x590053[_0x1669('0x2e')]['includeAll']){_0x1512e2[_0x1669('0x3f')]=[{'all':!![]}];}return db[_0x1669('0x3e')][_0x1669('0x40')](_0x1512e2);})[_0x1669('0x25')](function(_0x5e21eb){_0x3fe045[_0x1669('0x41')]=_0x5e21eb;return _0x3fe045;})[_0x1669('0x25')](respondWithFilteredResult(_0x29aff9,_0x1512e2))[_0x1669('0x42')](handleError(_0x29aff9,null));};exports['show']=function(_0x2c1e3b,_0x297c30){var _0x3c4434={'raw':!![],'where':{'id':_0x2c1e3b[_0x1669('0x43')]['id']}},_0x23a1c5={};_0x23a1c5[_0x1669('0x32')]=_[_0x1669('0x2f')](db['ChatQueueReport'][_0x1669('0x29')]);_0x23a1c5['query']=_[_0x1669('0x2f')](_0x2c1e3b['query']);_0x23a1c5[_0x1669('0x30')]=_[_0x1669('0x31')](_0x23a1c5[_0x1669('0x32')],_0x23a1c5[_0x1669('0x2e')]);_0x3c4434[_0x1669('0x33')]=_[_0x1669('0x31')](_0x23a1c5['model'],qs[_0x1669('0x34')](_0x2c1e3b[_0x1669('0x2e')][_0x1669('0x34')]));_0x3c4434['attributes']=_0x3c4434['attributes']['length']?_0x3c4434['attributes']:_0x23a1c5[_0x1669('0x32')];if(_0x2c1e3b[_0x1669('0x2e')][_0x1669('0x44')]){_0x3c4434['include']=[{'all':!![]}];}_0x3c4434=_['merge']({},_0x3c4434,_0x2c1e3b[_0x1669('0x3d')]);return db['ChatQueueReport'][_0x1669('0x45')](_0x3c4434)[_0x1669('0x25')](handleEntityNotFound(_0x297c30,null))[_0x1669('0x25')](respondWithResult(_0x297c30,null))[_0x1669('0x42')](handleError(_0x297c30,null));};exports[_0x1669('0x46')]=function(_0x2ad0eb,_0x410299){return db['ChatQueueReport'][_0x1669('0x46')](_0x2ad0eb['body'],{})[_0x1669('0x25')](respondWithResult(_0x410299,0xc9))['catch'](handleError(_0x410299,null));};exports['update']=function(_0x2778e3,_0x36ab74){if(_0x2778e3[_0x1669('0x47')]['id']){delete _0x2778e3[_0x1669('0x47')]['id'];}return db[_0x1669('0x3e')][_0x1669('0x45')]({'where':{'id':_0x2778e3['params']['id']}})[_0x1669('0x25')](handleEntityNotFound(_0x36ab74,null))[_0x1669('0x25')](saveUpdates(_0x2778e3['body'],null))[_0x1669('0x25')](respondWithResult(_0x36ab74,null))[_0x1669('0x42')](handleError(_0x36ab74,null));};exports['destroy']=function(_0x53d184,_0x3d3a24){return db[_0x1669('0x3e')][_0x1669('0x45')]({'where':{'id':_0x53d184[_0x1669('0x43')]['id']}})['then'](handleEntityNotFound(_0x3d3a24,null))[_0x1669('0x25')](removeEntity(_0x3d3a24,null))[_0x1669('0x42')](handleError(_0x3d3a24,null));};exports[_0x1669('0x48')]=function(_0x4c5546,_0x1287ce){return db['ChatQueueReport']['describe']()[_0x1669('0x25')](respondWithResult(_0x1287ce,null))['catch'](handleError(_0x1287ce,null));};
\ No newline at end of file
+var _0x9ca0=['intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','fields','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','query','keys','filters','model','attributes'];(function(_0x200477,_0xa3d497){var _0x51a521=function(_0x13e698){while(--_0x13e698){_0x200477['push'](_0x200477['shift']());}};_0x51a521(++_0xa3d497);}(_0x9ca0,0x65));var _0x09ca=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x9ca0[_0x3f5dca];return _0x5b833a;};'use strict';var emlformat=require(_0x09ca('0x0'));var rimraf=require(_0x09ca('0x1'));var zipdir=require(_0x09ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09ca('0x3'));var moment=require(_0x09ca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x09ca('0x5'));var util=require(_0x09ca('0x6'));var path=require('path');var sox=require(_0x09ca('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x09ca('0x8'));var _=require(_0x09ca('0x9'));var squel=require(_0x09ca('0xa'));var crypto=require(_0x09ca('0xb'));var jsforce=require(_0x09ca('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x09ca('0xd'));var Papa=require(_0x09ca('0xe'));var Redis=require('ioredis');var authService=require(_0x09ca('0xf'));var qs=require(_0x09ca('0x10'));var as=require(_0x09ca('0x11'));var hardwareService=require(_0x09ca('0x12'));var logger=require(_0x09ca('0x13'))(_0x09ca('0x14'));var utils=require('../../config/utils');var config=require(_0x09ca('0x15'));var licenseUtil=require(_0x09ca('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16e164,_0x5e47fa){_0x5e47fa=_0x5e47fa||0xcc;return function(_0x1ad33f){if(_0x1ad33f){return _0x16e164[_0x09ca('0x17')](_0x5e47fa);}return _0x16e164[_0x09ca('0x18')](_0x5e47fa)['end']();};}function respondWithResult(_0x57eda0,_0xc23339){_0xc23339=_0xc23339||0xc8;return function(_0x2fa47e){if(_0x2fa47e){return _0x57eda0['status'](_0xc23339)[_0x09ca('0x19')](_0x2fa47e);}};}function respondWithFilteredResult(_0xdb0c26,_0x32eb55){return function(_0x29621d){if(_0x29621d){var _0xb387a5=typeof _0x32eb55[_0x09ca('0x1a')]===_0x09ca('0x1b')&&typeof _0x32eb55[_0x09ca('0x1c')]===_0x09ca('0x1b');var _0x330b88=_0x29621d[_0x09ca('0x1d')];var _0x3d8f28=_0xb387a5?0x0:_0x32eb55['offset'];var _0x62be0c=_0xb387a5?_0x29621d[_0x09ca('0x1d')]:_0x32eb55[_0x09ca('0x1a')]+_0x32eb55[_0x09ca('0x1c')];var _0x206fdb;if(_0x62be0c>=_0x330b88){_0x62be0c=_0x330b88;_0x206fdb=0xc8;}else{_0x206fdb=0xce;}_0xdb0c26[_0x09ca('0x18')](_0x206fdb);return _0xdb0c26[_0x09ca('0x1e')](_0x09ca('0x1f'),_0x3d8f28+'-'+_0x62be0c+'/'+_0x330b88)['json'](_0x29621d);}return null;};}function patchUpdates(_0x26c2c3){return function(_0xfe4fea){try{jsonpatch[_0x09ca('0x20')](_0xfe4fea,_0x26c2c3,!![]);}catch(_0x53a36b){return BPromise[_0x09ca('0x21')](_0x53a36b);}return _0xfe4fea[_0x09ca('0x22')]();};}function saveUpdates(_0xacdffd,_0x25b2d9){return function(_0x48ec36){if(_0x48ec36){return _0x48ec36[_0x09ca('0x23')](_0xacdffd)[_0x09ca('0x24')](function(_0x3115d0){return _0x3115d0;});}return null;};}function removeEntity(_0x37288a,_0x44f036){return function(_0x234fcd){if(_0x234fcd){return _0x234fcd[_0x09ca('0x25')]()['then'](function(){_0x37288a[_0x09ca('0x18')](0xcc)[_0x09ca('0x26')]();});}};}function handleEntityNotFound(_0x459822,_0x28a5f0){return function(_0x2257f3){if(!_0x2257f3){_0x459822[_0x09ca('0x17')](0x194);}return _0x2257f3;};}function handleError(_0x12fc15,_0x17b209){_0x17b209=_0x17b209||0x1f4;return function(_0x576466){logger[_0x09ca('0x27')](_0x576466[_0x09ca('0x28')]);if(_0x576466[_0x09ca('0x29')]){delete _0x576466['name'];}_0x12fc15['status'](_0x17b209)[_0x09ca('0x2a')](_0x576466);};}exports[_0x09ca('0x2b')]=function(_0x163cee,_0x39c5f7){var _0x4ed8eb={},_0x2d2f54={},_0x5525e2={'count':0x0,'rows':[]};var _0x1ebb94=_[_0x09ca('0x2c')](db[_0x09ca('0x2d')]['rawAttributes'],function(_0x5c60cc){return{'name':_0x5c60cc[_0x09ca('0x2e')],'type':_0x5c60cc[_0x09ca('0x2f')]['key']};});_0x2d2f54['model']=_[_0x09ca('0x2c')](_0x1ebb94,_0x09ca('0x29'));_0x2d2f54[_0x09ca('0x30')]=_[_0x09ca('0x31')](_0x163cee[_0x09ca('0x30')]);_0x2d2f54[_0x09ca('0x32')]=_['intersection'](_0x2d2f54[_0x09ca('0x33')],_0x2d2f54['query']);_0x4ed8eb[_0x09ca('0x34')]=_[_0x09ca('0x35')](_0x2d2f54[_0x09ca('0x33')],qs['fields'](_0x163cee[_0x09ca('0x30')]['fields']));_0x4ed8eb[_0x09ca('0x34')]=_0x4ed8eb['attributes'][_0x09ca('0x36')]?_0x4ed8eb[_0x09ca('0x34')]:_0x2d2f54['model'];if(!_0x163cee[_0x09ca('0x30')][_0x09ca('0x37')](_0x09ca('0x38'))){_0x4ed8eb['limit']=qs[_0x09ca('0x1c')](_0x163cee[_0x09ca('0x30')][_0x09ca('0x1c')]);_0x4ed8eb[_0x09ca('0x1a')]=qs['offset'](_0x163cee[_0x09ca('0x30')][_0x09ca('0x1a')]);}_0x4ed8eb[_0x09ca('0x39')]=qs[_0x09ca('0x3a')](_0x163cee['query'][_0x09ca('0x3a')]);_0x4ed8eb['where']=qs['filters'](_[_0x09ca('0x3b')](_0x163cee['query'],_0x2d2f54[_0x09ca('0x32')]),_0x1ebb94);if(_0x163cee[_0x09ca('0x30')][_0x09ca('0x3c')]){_0x4ed8eb[_0x09ca('0x3d')]=_['merge'](_0x4ed8eb[_0x09ca('0x3d')],{'$or':_['map'](_0x1ebb94,function(_0x561990){if(_0x561990[_0x09ca('0x2f')]!==_0x09ca('0x3e')){var _0x5f3096={};_0x5f3096[_0x561990[_0x09ca('0x29')]]={'$like':'%'+_0x163cee[_0x09ca('0x30')]['filter']+'%'};return _0x5f3096;}})});}_0x4ed8eb=_[_0x09ca('0x3f')]({},_0x4ed8eb,_0x163cee[_0x09ca('0x40')]);var _0x5306df={'where':_0x4ed8eb[_0x09ca('0x3d')]};return db[_0x09ca('0x2d')][_0x09ca('0x1d')](_0x5306df)[_0x09ca('0x24')](function(_0x63a49d){_0x5525e2[_0x09ca('0x1d')]=_0x63a49d;if(_0x163cee[_0x09ca('0x30')][_0x09ca('0x41')]){_0x4ed8eb['include']=[{'all':!![]}];}return db[_0x09ca('0x2d')][_0x09ca('0x42')](_0x4ed8eb);})[_0x09ca('0x24')](function(_0x21fe62){_0x5525e2[_0x09ca('0x43')]=_0x21fe62;return _0x5525e2;})[_0x09ca('0x24')](respondWithFilteredResult(_0x39c5f7,_0x4ed8eb))[_0x09ca('0x44')](handleError(_0x39c5f7,null));};exports['show']=function(_0x145ca1,_0x4c4e2d){var _0x20ec99={'raw':!![],'where':{'id':_0x145ca1[_0x09ca('0x45')]['id']}},_0x4c1588={};_0x4c1588[_0x09ca('0x33')]=_[_0x09ca('0x31')](db[_0x09ca('0x2d')][_0x09ca('0x46')]);_0x4c1588[_0x09ca('0x30')]=_['keys'](_0x145ca1[_0x09ca('0x30')]);_0x4c1588[_0x09ca('0x32')]=_[_0x09ca('0x35')](_0x4c1588[_0x09ca('0x33')],_0x4c1588[_0x09ca('0x30')]);_0x20ec99[_0x09ca('0x34')]=_[_0x09ca('0x35')](_0x4c1588[_0x09ca('0x33')],qs['fields'](_0x145ca1[_0x09ca('0x30')][_0x09ca('0x47')]));_0x20ec99[_0x09ca('0x34')]=_0x20ec99[_0x09ca('0x34')][_0x09ca('0x36')]?_0x20ec99[_0x09ca('0x34')]:_0x4c1588['model'];if(_0x145ca1[_0x09ca('0x30')]['includeAll']){_0x20ec99[_0x09ca('0x48')]=[{'all':!![]}];}_0x20ec99=_[_0x09ca('0x3f')]({},_0x20ec99,_0x145ca1[_0x09ca('0x40')]);return db[_0x09ca('0x2d')][_0x09ca('0x49')](_0x20ec99)[_0x09ca('0x24')](handleEntityNotFound(_0x4c4e2d,null))[_0x09ca('0x24')](respondWithResult(_0x4c4e2d,null))[_0x09ca('0x44')](handleError(_0x4c4e2d,null));};exports[_0x09ca('0x4a')]=function(_0x5b1d39,_0x655643){return db[_0x09ca('0x2d')][_0x09ca('0x4a')](_0x5b1d39[_0x09ca('0x4b')],{})[_0x09ca('0x24')](respondWithResult(_0x655643,0xc9))[_0x09ca('0x44')](handleError(_0x655643,null));};exports['update']=function(_0x2004ea,_0x3a2a3b){if(_0x2004ea[_0x09ca('0x4b')]['id']){delete _0x2004ea[_0x09ca('0x4b')]['id'];}return db[_0x09ca('0x2d')][_0x09ca('0x49')]({'where':{'id':_0x2004ea[_0x09ca('0x45')]['id']}})[_0x09ca('0x24')](handleEntityNotFound(_0x3a2a3b,null))[_0x09ca('0x24')](saveUpdates(_0x2004ea[_0x09ca('0x4b')],null))[_0x09ca('0x24')](respondWithResult(_0x3a2a3b,null))[_0x09ca('0x44')](handleError(_0x3a2a3b,null));};exports['destroy']=function(_0x2fffc7,_0x7bfa96){return db['ChatQueueReport'][_0x09ca('0x49')]({'where':{'id':_0x2fffc7['params']['id']}})[_0x09ca('0x24')](handleEntityNotFound(_0x7bfa96,null))[_0x09ca('0x24')](removeEntity(_0x7bfa96,null))[_0x09ca('0x44')](handleError(_0x7bfa96,null));};exports[_0x09ca('0x4c')]=function(_0x2d034f,_0x555fbf){return db[_0x09ca('0x2d')][_0x09ca('0x4c')]()[_0x09ca('0x24')](respondWithResult(_0x555fbf,null))[_0x09ca('0x44')](handleError(_0x555fbf,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 19c7f42..2a48206 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(_0x1d1763,_0x4bec3a){var _0x19315c=function(_0x3f3883){while(--_0x3f3883){_0x1d1763['push'](_0x1d1763['shift']());}};_0x19315c(++_0x4bec3a);}(_0x757a,0xde));var _0xa757=function(_0x40618d,_0x421346){_0x40618d=_0x40618d-0x0;var _0x557ae3=_0x757a[_0x40618d];return _0x557ae3;};'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(_0x3474fa,_0x519af7){var _0x310716=function(_0x34cefe){while(--_0x34cefe){_0x3474fa['push'](_0x3474fa['shift']());}};_0x310716(++_0x519af7);}(_0x757a,0xde));var _0xa757=function(_0xb2f8c2,_0x2e99da){_0xb2f8c2=_0xb2f8c2-0x0;var _0xda5a62=_0x757a[_0xb2f8c2];return _0xda5a62;};'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 8451d11..91e2a68 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 _0xad22=['randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','where','attributes','UpdateChatQueueReport','moment'];(function(_0xcfc44,_0x179bc1){var _0x307a25=function(_0x2b64de){while(--_0x2b64de){_0xcfc44['push'](_0xcfc44['shift']());}};_0x307a25(++_0x179bc1);}(_0xad22,0x90));var _0x2ad2=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0xad22[_0xd299c3];return _0x376574;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2ad2('0x0'));var BPromise=require('bluebird');var rs=require(_0x2ad2('0x1'));var fs=require('fs');var Redis=require(_0x2ad2('0x2'));var db=require(_0x2ad2('0x3'))['db'];var utils=require(_0x2ad2('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2ad2('0x5'));var client=jayson['client'][_0x2ad2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1b6d5d,_0x1b2396,_0x251232){return new BPromise(function(_0x2b33d3,_0x1f939d){return client['request'](_0x1b6d5d,_0x251232)[_0x2ad2('0x7')](function(_0x4633af){logger[_0x2ad2('0x8')]('ChatQueueReport,\x20%s,\x20%s',_0x1b2396,_0x2ad2('0x9'));logger[_0x2ad2('0xa')](_0x2ad2('0xb'),_0x1b2396,'request\x20sent',JSON[_0x2ad2('0xc')](_0x4633af));if(_0x4633af[_0x2ad2('0xd')]){if(_0x4633af['error'][_0x2ad2('0xe')]===0x1f4){logger[_0x2ad2('0xd')](_0x2ad2('0xf'),_0x1b2396,_0x4633af[_0x2ad2('0xd')]['message']);return _0x1f939d(_0x4633af[_0x2ad2('0xd')][_0x2ad2('0x10')]);}logger[_0x2ad2('0xd')](_0x2ad2('0xf'),_0x1b2396,_0x4633af[_0x2ad2('0xd')][_0x2ad2('0x10')]);return _0x2b33d3(_0x4633af[_0x2ad2('0xd')][_0x2ad2('0x10')]);}else{logger[_0x2ad2('0x8')](_0x2ad2('0xf'),_0x1b2396,_0x2ad2('0x9'));_0x2b33d3(_0x4633af[_0x2ad2('0x11')][_0x2ad2('0x10')]);}})[_0x2ad2('0x12')](function(_0x22db39){logger[_0x2ad2('0xd')](_0x2ad2('0xf'),_0x1b2396,_0x22db39);_0x1f939d(_0x22db39);});});}exports[_0x2ad2('0x13')]=function(_0x2c97c9){var _0x277cad=this;return new Promise(function(_0x12c67f,_0x33602d){return db[_0x2ad2('0x14')][_0x2ad2('0x15')](_0x2c97c9[_0x2ad2('0x16')],{'raw':_0x2c97c9[_0x2ad2('0x17')]?_0x2c97c9['options'][_0x2ad2('0x18')]===undefined?!![]:![]:!![]})[_0x2ad2('0x7')](function(_0x33d58a){logger[_0x2ad2('0x8')](_0x2ad2('0x13'),_0x2c97c9);logger[_0x2ad2('0xa')](_0x2ad2('0x13'),_0x2c97c9,JSON[_0x2ad2('0xc')](_0x33d58a));_0x12c67f(_0x33d58a);})['catch'](function(_0x9b8b66){logger[_0x2ad2('0xd')](_0x2ad2('0x13'),_0x9b8b66[_0x2ad2('0x10')],_0x2c97c9);_0x33602d(_0x277cad[_0x2ad2('0xd')](0x1f4,_0x9b8b66[_0x2ad2('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x4b449f){var _0x121da7=this;return new Promise(function(_0x1548f6,_0x336cab){return db[_0x2ad2('0x14')][_0x2ad2('0x19')](_0x4b449f[_0x2ad2('0x16')],{'raw':_0x4b449f[_0x2ad2('0x17')]?_0x4b449f[_0x2ad2('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b449f[_0x2ad2('0x17')]?_0x4b449f[_0x2ad2('0x17')][_0x2ad2('0x1a')]||null:null,'attributes':_0x4b449f[_0x2ad2('0x17')]?_0x4b449f['options'][_0x2ad2('0x1b')]||null:null,'limit':_0x4b449f[_0x2ad2('0x17')]?_0x4b449f['options']['limit']||null:null})['then'](function(_0x20419e){logger['info']('UpdateChatQueueReport',_0x4b449f);logger[_0x2ad2('0xa')](_0x2ad2('0x1c'),_0x4b449f,JSON[_0x2ad2('0xc')](_0x20419e));_0x1548f6(_0x20419e);})[_0x2ad2('0x12')](function(_0x70a29d){logger[_0x2ad2('0xd')](_0x2ad2('0x1c'),_0x70a29d[_0x2ad2('0x10')],_0x4b449f);_0x336cab(_0x121da7[_0x2ad2('0xd')](0x1f4,_0x70a29d[_0x2ad2('0x10')]));});});};
\ No newline at end of file
+var _0x6b00=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','util','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6b00,0xe5));var _0x06b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6b00[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x06b0('0x0'));var moment=require(_0x06b0('0x1'));var BPromise=require(_0x06b0('0x2'));var rs=require(_0x06b0('0x3'));var fs=require('fs');var Redis=require(_0x06b0('0x4'));var db=require(_0x06b0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x06b0('0x6'))(_0x06b0('0x7'));var config=require(_0x06b0('0x8'));var jayson=require(_0x06b0('0x9'));var client=jayson[_0x06b0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x262444,_0x53f75b,_0x50de69){return new BPromise(function(_0x419498,_0x567768){return client['request'](_0x262444,_0x50de69)[_0x06b0('0xb')](function(_0x4013b4){logger[_0x06b0('0xc')](_0x06b0('0xd'),_0x53f75b,_0x06b0('0xe'));logger[_0x06b0('0xf')](_0x06b0('0x10'),_0x53f75b,'request\x20sent',JSON[_0x06b0('0x11')](_0x4013b4));if(_0x4013b4[_0x06b0('0x12')]){if(_0x4013b4[_0x06b0('0x12')][_0x06b0('0x13')]===0x1f4){logger[_0x06b0('0x12')](_0x06b0('0xd'),_0x53f75b,_0x4013b4[_0x06b0('0x12')][_0x06b0('0x14')]);return _0x567768(_0x4013b4[_0x06b0('0x12')]['message']);}logger[_0x06b0('0x12')](_0x06b0('0xd'),_0x53f75b,_0x4013b4[_0x06b0('0x12')][_0x06b0('0x14')]);return _0x419498(_0x4013b4[_0x06b0('0x12')]['message']);}else{logger[_0x06b0('0xc')](_0x06b0('0xd'),_0x53f75b,_0x06b0('0xe'));_0x419498(_0x4013b4[_0x06b0('0x15')][_0x06b0('0x14')]);}})[_0x06b0('0x16')](function(_0x4101a1){logger[_0x06b0('0x12')](_0x06b0('0xd'),_0x53f75b,_0x4101a1);_0x567768(_0x4101a1);});});}exports[_0x06b0('0x17')]=function(_0x1b9755){var _0x5e4561=this;return new Promise(function(_0x966794,_0x408fba){return db[_0x06b0('0x18')]['create'](_0x1b9755[_0x06b0('0x19')],{'raw':_0x1b9755[_0x06b0('0x1a')]?_0x1b9755['options'][_0x06b0('0x1b')]===undefined?!![]:![]:!![]})[_0x06b0('0xb')](function(_0x1b3101){logger[_0x06b0('0xc')](_0x06b0('0x17'),_0x1b9755);logger['debug']('CreateChatQueueReport',_0x1b9755,JSON[_0x06b0('0x11')](_0x1b3101));_0x966794(_0x1b3101);})['catch'](function(_0x924bac){logger[_0x06b0('0x12')](_0x06b0('0x17'),_0x924bac['message'],_0x1b9755);_0x408fba(_0x5e4561[_0x06b0('0x12')](0x1f4,_0x924bac['message']));});});};exports[_0x06b0('0x1c')]=function(_0x47094e){var _0x4087ea=this;return new Promise(function(_0x76341b,_0x38037c){return db[_0x06b0('0x18')][_0x06b0('0x1d')](_0x47094e[_0x06b0('0x19')],{'raw':_0x47094e[_0x06b0('0x1a')]?_0x47094e['options'][_0x06b0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47094e[_0x06b0('0x1a')]?_0x47094e['options'][_0x06b0('0x1e')]||null:null,'attributes':_0x47094e[_0x06b0('0x1a')]?_0x47094e[_0x06b0('0x1a')][_0x06b0('0x1f')]||null:null,'limit':_0x47094e['options']?_0x47094e[_0x06b0('0x1a')][_0x06b0('0x20')]||null:null})[_0x06b0('0xb')](function(_0x449e8a){logger[_0x06b0('0xc')]('UpdateChatQueueReport',_0x47094e);logger['debug'](_0x06b0('0x1c'),_0x47094e,JSON[_0x06b0('0x11')](_0x449e8a));_0x76341b(_0x449e8a);})[_0x06b0('0x16')](function(_0x5b4a23){logger['error'](_0x06b0('0x1c'),_0x5b4a23['message'],_0x47094e);_0x38037c(_0x4087ea[_0x06b0('0x12')](0x1f4,_0x5b4a23['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 0705f33..2f0859d 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 _0x09d4=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x24942b,_0x4310e2){var _0x335545=function(_0x1dd0ea){while(--_0x1dd0ea){_0x24942b['push'](_0x24942b['shift']());}};_0x335545(++_0x4310e2);}(_0x09d4,0x78));var _0x409d=function(_0x5d1017,_0x1fa737){_0x5d1017=_0x5d1017-0x0;var _0x23e363=_0x09d4[_0x5d1017];return _0x23e363;};'use strict';var multer=require(_0x409d('0x0'));var util=require(_0x409d('0x1'));var path=require(_0x409d('0x2'));var timeout=require(_0x409d('0x3'));var express=require(_0x409d('0x4'));var router=express[_0x409d('0x5')]();var fs_extra=require(_0x409d('0x6'));var auth=require(_0x409d('0x7'));var interaction=require(_0x409d('0x8'));var config=require(_0x409d('0x9'));var controller=require('./chatQueueReport.controller');router[_0x409d('0xa')]('/',auth[_0x409d('0xb')](),controller[_0x409d('0xc')]);router[_0x409d('0xa')](_0x409d('0xd'),auth[_0x409d('0xb')](),controller[_0x409d('0xe')]);router['get'](_0x409d('0xf'),auth[_0x409d('0xb')](),controller[_0x409d('0x10')]);router[_0x409d('0x11')]('/',auth['isAuthenticated'](),controller[_0x409d('0x12')]);router[_0x409d('0x13')]('/:id',auth[_0x409d('0xb')](),controller[_0x409d('0x14')]);router[_0x409d('0x15')]('/:id',auth[_0x409d('0xb')](),controller[_0x409d('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x00e4=['../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','exports','multer','express','Router','fs-extra'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x00e4,0x194));var _0x400e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x00e4[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x400e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x400e('0x1'));var router=express[_0x400e('0x2')]();var fs_extra=require(_0x400e('0x3'));var auth=require(_0x400e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x400e('0x5')]('/',auth[_0x400e('0x6')](),controller[_0x400e('0x7')]);router[_0x400e('0x5')](_0x400e('0x8'),auth['isAuthenticated'](),controller[_0x400e('0x9')]);router[_0x400e('0x5')]('/:id',auth[_0x400e('0x6')](),controller[_0x400e('0xa')]);router[_0x400e('0xb')]('/',auth[_0x400e('0x6')](),controller[_0x400e('0xc')]);router['put'](_0x400e('0xd'),auth[_0x400e('0x6')](),controller[_0x400e('0xe')]);router[_0x400e('0xf')](_0x400e('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x400e('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 16fe54d..9bdaddd 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x6bf16d,_0x7c0cd1){var _0x32a608=function(_0x2222da){while(--_0x2222da){_0x6bf16d['push'](_0x6bf16d['shift']());}};_0x32a608(++_0x7c0cd1);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x40909a,_0x47cf3e){var _0x550393=function(_0xc87a72){while(--_0xc87a72){_0x40909a['push'](_0x40909a['shift']());}};_0x550393(++_0x47cf3e);}(_0xedd9,0xfc));var _0x9edd=function(_0x2fa106,_0x135d48){_0x2fa106=_0x2fa106-0x0;var _0x499712=_0xedd9[_0x2fa106];return _0x499712;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 28d354c..f5a1467 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 _0x9639=['merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','length','find','create','body','describe','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','end','error','stack','name','send','index','ChatTransferReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1c1738,_0x37cdb4){var _0x2bb6a2=function(_0x30e936){while(--_0x30e936){_0x1c1738['push'](_0x1c1738['shift']());}};_0x2bb6a2(++_0x37cdb4);}(_0x9639,0x184));var _0x9963=function(_0x1a307c,_0x2db142){_0x1a307c=_0x1a307c-0x0;var _0x59a413=_0x9639[_0x1a307c];return _0x59a413;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9963('0x0'));var jsonpatch=require(_0x9963('0x1'));var rp=require('request-promise');var moment=require(_0x9963('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9963('0x3'));var util=require(_0x9963('0x4'));var path=require(_0x9963('0x5'));var sox=require(_0x9963('0x6'));var csv=require(_0x9963('0x7'));var ejs=require(_0x9963('0x8'));var fs=require('fs');var fs_extra=require(_0x9963('0x9'));var _=require(_0x9963('0xa'));var squel=require(_0x9963('0xb'));var crypto=require(_0x9963('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9963('0x7'));var querystring=require(_0x9963('0xd'));var Papa=require(_0x9963('0xe'));var Redis=require(_0x9963('0xf'));var authService=require(_0x9963('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9963('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9963('0x12'));var utils=require(_0x9963('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9963('0x14'))['db'];function respondWithStatusCode(_0x21e2c8,_0x95476e){_0x95476e=_0x95476e||0xcc;return function(_0x242862){if(_0x242862){return _0x21e2c8[_0x9963('0x15')](_0x95476e);}return _0x21e2c8[_0x9963('0x16')](_0x95476e)['end']();};}function respondWithResult(_0x2bd204,_0x3072df){_0x3072df=_0x3072df||0xc8;return function(_0x41036b){if(_0x41036b){return _0x2bd204[_0x9963('0x16')](_0x3072df)[_0x9963('0x17')](_0x41036b);}};}function respondWithFilteredResult(_0x48f2e0,_0xc75f0e){return function(_0xf9f621){if(_0xf9f621){var _0x437273=typeof _0xc75f0e[_0x9963('0x18')]==='undefined'&&typeof _0xc75f0e[_0x9963('0x19')]===_0x9963('0x1a');var _0x3ebd15=_0xf9f621['count'];var _0x50911d=_0x437273?0x0:_0xc75f0e['offset'];var _0x48ab73=_0x437273?_0xf9f621[_0x9963('0x1b')]:_0xc75f0e[_0x9963('0x18')]+_0xc75f0e[_0x9963('0x19')];var _0x1ab771;if(_0x48ab73>=_0x3ebd15){_0x48ab73=_0x3ebd15;_0x1ab771=0xc8;}else{_0x1ab771=0xce;}_0x48f2e0[_0x9963('0x16')](_0x1ab771);return _0x48f2e0[_0x9963('0x1c')]('Content-Range',_0x50911d+'-'+_0x48ab73+'/'+_0x3ebd15)['json'](_0xf9f621);}return null;};}function patchUpdates(_0x32da9f){return function(_0x313c76){try{jsonpatch['apply'](_0x313c76,_0x32da9f,!![]);}catch(_0x16bc4c){return BPromise[_0x9963('0x1d')](_0x16bc4c);}return _0x313c76[_0x9963('0x1e')]();};}function saveUpdates(_0x5b00b3,_0x49999a){return function(_0x4e188d){if(_0x4e188d){return _0x4e188d[_0x9963('0x1f')](_0x5b00b3)[_0x9963('0x20')](function(_0xcf160e){return _0xcf160e;});}return null;};}function removeEntity(_0x38349c,_0x3ae73a){return function(_0x11c86b){if(_0x11c86b){return _0x11c86b[_0x9963('0x21')]()['then'](function(){_0x38349c['status'](0xcc)[_0x9963('0x22')]();});}};}function handleEntityNotFound(_0x3a4e0f,_0x666dd7){return function(_0x475473){if(!_0x475473){_0x3a4e0f[_0x9963('0x15')](0x194);}return _0x475473;};}function handleError(_0x211e3f,_0x43dc89){_0x43dc89=_0x43dc89||0x1f4;return function(_0x146553){logger[_0x9963('0x23')](_0x146553[_0x9963('0x24')]);if(_0x146553[_0x9963('0x25')]){delete _0x146553[_0x9963('0x25')];}_0x211e3f[_0x9963('0x16')](_0x43dc89)[_0x9963('0x26')](_0x146553);};}exports[_0x9963('0x27')]=function(_0x8d9ad9,_0x271a4a){var _0x3be208={},_0x21d5a1={},_0x453056={'count':0x0,'rows':[]};var _0x23df6d=_['map'](db[_0x9963('0x28')]['rawAttributes'],function(_0x5d090d){return{'name':_0x5d090d[_0x9963('0x29')],'type':_0x5d090d[_0x9963('0x2a')][_0x9963('0x2b')]};});_0x21d5a1[_0x9963('0x2c')]=_['map'](_0x23df6d,_0x9963('0x25'));_0x21d5a1[_0x9963('0x2d')]=_['keys'](_0x8d9ad9[_0x9963('0x2d')]);_0x21d5a1[_0x9963('0x2e')]=_['intersection'](_0x21d5a1['model'],_0x21d5a1[_0x9963('0x2d')]);_0x3be208[_0x9963('0x2f')]=_[_0x9963('0x30')](_0x21d5a1[_0x9963('0x2c')],qs['fields'](_0x8d9ad9['query'][_0x9963('0x31')]));_0x3be208[_0x9963('0x2f')]=_0x3be208[_0x9963('0x2f')]['length']?_0x3be208['attributes']:_0x21d5a1[_0x9963('0x2c')];if(!_0x8d9ad9[_0x9963('0x2d')][_0x9963('0x32')](_0x9963('0x33'))){_0x3be208[_0x9963('0x19')]=qs[_0x9963('0x19')](_0x8d9ad9[_0x9963('0x2d')][_0x9963('0x19')]);_0x3be208[_0x9963('0x18')]=qs['offset'](_0x8d9ad9[_0x9963('0x2d')][_0x9963('0x18')]);}_0x3be208[_0x9963('0x34')]=qs[_0x9963('0x35')](_0x8d9ad9[_0x9963('0x2d')][_0x9963('0x35')]);_0x3be208[_0x9963('0x36')]=qs[_0x9963('0x2e')](_[_0x9963('0x37')](_0x8d9ad9['query'],_0x21d5a1['filters']),_0x23df6d);if(_0x8d9ad9[_0x9963('0x2d')]['filter']){_0x3be208['where']=_[_0x9963('0x38')](_0x3be208['where'],{'$or':_[_0x9963('0x39')](_0x23df6d,function(_0x30c71a){if(_0x30c71a[_0x9963('0x2a')]!==_0x9963('0x3a')){var _0x3360cb={};_0x3360cb[_0x30c71a[_0x9963('0x25')]]={'$like':'%'+_0x8d9ad9[_0x9963('0x2d')][_0x9963('0x3b')]+'%'};return _0x3360cb;}})});}_0x3be208=_[_0x9963('0x38')]({},_0x3be208,_0x8d9ad9[_0x9963('0x3c')]);var _0x2b23b0={'where':_0x3be208['where']};return db[_0x9963('0x28')]['count'](_0x2b23b0)[_0x9963('0x20')](function(_0x3ffaf7){_0x453056[_0x9963('0x1b')]=_0x3ffaf7;if(_0x8d9ad9['query'][_0x9963('0x3d')]){_0x3be208[_0x9963('0x3e')]=[{'all':!![]}];}return db[_0x9963('0x28')][_0x9963('0x3f')](_0x3be208);})[_0x9963('0x20')](function(_0x2bcce3){_0x453056[_0x9963('0x40')]=_0x2bcce3;return _0x453056;})[_0x9963('0x20')](respondWithFilteredResult(_0x271a4a,_0x3be208))[_0x9963('0x41')](handleError(_0x271a4a,null));};exports['show']=function(_0x59d11a,_0x637401){var _0x353f8d={'raw':!![],'where':{'id':_0x59d11a[_0x9963('0x42')]['id']}},_0x105f85={};_0x105f85[_0x9963('0x2c')]=_['keys'](db[_0x9963('0x28')][_0x9963('0x43')]);_0x105f85[_0x9963('0x2d')]=_[_0x9963('0x44')](_0x59d11a[_0x9963('0x2d')]);_0x105f85['filters']=_[_0x9963('0x30')](_0x105f85[_0x9963('0x2c')],_0x105f85[_0x9963('0x2d')]);_0x353f8d[_0x9963('0x2f')]=_[_0x9963('0x30')](_0x105f85['model'],qs['fields'](_0x59d11a['query']['fields']));_0x353f8d[_0x9963('0x2f')]=_0x353f8d['attributes'][_0x9963('0x45')]?_0x353f8d[_0x9963('0x2f')]:_0x105f85['model'];if(_0x59d11a[_0x9963('0x2d')]['includeAll']){_0x353f8d[_0x9963('0x3e')]=[{'all':!![]}];}_0x353f8d=_[_0x9963('0x38')]({},_0x353f8d,_0x59d11a[_0x9963('0x3c')]);return db[_0x9963('0x28')][_0x9963('0x46')](_0x353f8d)[_0x9963('0x20')](handleEntityNotFound(_0x637401,null))[_0x9963('0x20')](respondWithResult(_0x637401,null))[_0x9963('0x41')](handleError(_0x637401,null));};exports[_0x9963('0x47')]=function(_0xef8b78,_0x27f4ba){return db[_0x9963('0x28')][_0x9963('0x47')](_0xef8b78[_0x9963('0x48')],{})[_0x9963('0x20')](respondWithResult(_0x27f4ba,0xc9))[_0x9963('0x41')](handleError(_0x27f4ba,null));};exports[_0x9963('0x1f')]=function(_0x4c523c,_0x43a121){if(_0x4c523c['body']['id']){delete _0x4c523c[_0x9963('0x48')]['id'];}return db[_0x9963('0x28')][_0x9963('0x46')]({'where':{'id':_0x4c523c[_0x9963('0x42')]['id']}})[_0x9963('0x20')](handleEntityNotFound(_0x43a121,null))['then'](saveUpdates(_0x4c523c['body'],null))['then'](respondWithResult(_0x43a121,null))[_0x9963('0x41')](handleError(_0x43a121,null));};exports[_0x9963('0x21')]=function(_0x31a3ad,_0x2a9a16){return db[_0x9963('0x28')][_0x9963('0x46')]({'where':{'id':_0x31a3ad[_0x9963('0x42')]['id']}})[_0x9963('0x20')](handleEntityNotFound(_0x2a9a16,null))[_0x9963('0x20')](removeEntity(_0x2a9a16,null))[_0x9963('0x41')](handleError(_0x2a9a16,null));};exports['describe']=function(_0x5d3484,_0x5c64f3){return db[_0x9963('0x28')][_0x9963('0x49')]()[_0x9963('0x20')](respondWithResult(_0x5c64f3,null))[_0x9963('0x41')](handleError(_0x5c64f3,null));};
\ No newline at end of file
+var _0x44bd=['includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','include','findAll','catch','show','params','keys'];(function(_0x2f2a6f,_0xe63e10){var _0x14441d=function(_0x3ab031){while(--_0x3ab031){_0x2f2a6f['push'](_0x2f2a6f['shift']());}};_0x14441d(++_0xe63e10);}(_0x44bd,0x172));var _0xd44b=function(_0x5a8bb,_0x40cd4f){_0x5a8bb=_0x5a8bb-0x0;var _0x4688f4=_0x44bd[_0x5a8bb];return _0x4688f4;};'use strict';var emlformat=require(_0xd44b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd44b('0x1'));var jsonpatch=require(_0xd44b('0x2'));var rp=require(_0xd44b('0x3'));var moment=require('moment');var BPromise=require(_0xd44b('0x4'));var Mustache=require(_0xd44b('0x5'));var util=require(_0xd44b('0x6'));var path=require(_0xd44b('0x7'));var sox=require(_0xd44b('0x8'));var csv=require(_0xd44b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd44b('0xa'));var squel=require(_0xd44b('0xb'));var crypto=require('crypto');var jsforce=require(_0xd44b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd44b('0x9'));var querystring=require(_0xd44b('0xd'));var Papa=require(_0xd44b('0xe'));var Redis=require(_0xd44b('0xf'));var authService=require(_0xd44b('0x10'));var qs=require(_0xd44b('0x11'));var as=require(_0xd44b('0x12'));var hardwareService=require(_0xd44b('0x13'));var logger=require('../../config/logger')(_0xd44b('0x14'));var utils=require('../../config/utils');var config=require(_0xd44b('0x15'));var licenseUtil=require(_0xd44b('0x16'));var db=require(_0xd44b('0x17'))['db'];function respondWithStatusCode(_0x4cc9e0,_0x13a39e){_0x13a39e=_0x13a39e||0xcc;return function(_0x5efcee){if(_0x5efcee){return _0x4cc9e0[_0xd44b('0x18')](_0x13a39e);}return _0x4cc9e0['status'](_0x13a39e)[_0xd44b('0x19')]();};}function respondWithResult(_0x526b9c,_0x78c17c){_0x78c17c=_0x78c17c||0xc8;return function(_0x147e41){if(_0x147e41){return _0x526b9c[_0xd44b('0x1a')](_0x78c17c)[_0xd44b('0x1b')](_0x147e41);}};}function respondWithFilteredResult(_0x52f305,_0x15c71c){return function(_0x514f98){if(_0x514f98){var _0x59e4b0=typeof _0x15c71c[_0xd44b('0x1c')]===_0xd44b('0x1d')&&typeof _0x15c71c[_0xd44b('0x1e')]==='undefined';var _0x1b54bd=_0x514f98[_0xd44b('0x1f')];var _0xde7d68=_0x59e4b0?0x0:_0x15c71c[_0xd44b('0x1c')];var _0x4aec85=_0x59e4b0?_0x514f98['count']:_0x15c71c[_0xd44b('0x1c')]+_0x15c71c[_0xd44b('0x1e')];var _0x1f7bf8;if(_0x4aec85>=_0x1b54bd){_0x4aec85=_0x1b54bd;_0x1f7bf8=0xc8;}else{_0x1f7bf8=0xce;}_0x52f305[_0xd44b('0x1a')](_0x1f7bf8);return _0x52f305[_0xd44b('0x20')](_0xd44b('0x21'),_0xde7d68+'-'+_0x4aec85+'/'+_0x1b54bd)[_0xd44b('0x1b')](_0x514f98);}return null;};}function patchUpdates(_0x5c439d){return function(_0x93e957){try{jsonpatch[_0xd44b('0x22')](_0x93e957,_0x5c439d,!![]);}catch(_0x1143a5){return BPromise[_0xd44b('0x23')](_0x1143a5);}return _0x93e957['save']();};}function saveUpdates(_0x402366,_0x1caa8a){return function(_0x9c0594){if(_0x9c0594){return _0x9c0594[_0xd44b('0x24')](_0x402366)[_0xd44b('0x25')](function(_0x6519d3){return _0x6519d3;});}return null;};}function removeEntity(_0x3bf331,_0x1c92c3){return function(_0x5489e6){if(_0x5489e6){return _0x5489e6[_0xd44b('0x26')]()[_0xd44b('0x25')](function(){_0x3bf331[_0xd44b('0x1a')](0xcc)[_0xd44b('0x19')]();});}};}function handleEntityNotFound(_0x54178d,_0xf188b2){return function(_0x5f015c){if(!_0x5f015c){_0x54178d[_0xd44b('0x18')](0x194);}return _0x5f015c;};}function handleError(_0xf8becb,_0x559134){_0x559134=_0x559134||0x1f4;return function(_0x534164){logger[_0xd44b('0x27')](_0x534164[_0xd44b('0x28')]);if(_0x534164[_0xd44b('0x29')]){delete _0x534164[_0xd44b('0x29')];}_0xf8becb[_0xd44b('0x1a')](_0x559134)[_0xd44b('0x2a')](_0x534164);};}exports[_0xd44b('0x2b')]=function(_0x1137df,_0x17c122){var _0x310165={},_0x5208c3={},_0x3b6004={'count':0x0,'rows':[]};var _0x319177=_[_0xd44b('0x2c')](db[_0xd44b('0x2d')][_0xd44b('0x2e')],function(_0xe3d302){return{'name':_0xe3d302[_0xd44b('0x2f')],'type':_0xe3d302[_0xd44b('0x30')]['key']};});_0x5208c3[_0xd44b('0x31')]=_[_0xd44b('0x2c')](_0x319177,_0xd44b('0x29'));_0x5208c3[_0xd44b('0x32')]=_['keys'](_0x1137df['query']);_0x5208c3[_0xd44b('0x33')]=_['intersection'](_0x5208c3[_0xd44b('0x31')],_0x5208c3[_0xd44b('0x32')]);_0x310165[_0xd44b('0x34')]=_[_0xd44b('0x35')](_0x5208c3['model'],qs['fields'](_0x1137df[_0xd44b('0x32')][_0xd44b('0x36')]));_0x310165[_0xd44b('0x34')]=_0x310165[_0xd44b('0x34')][_0xd44b('0x37')]?_0x310165['attributes']:_0x5208c3[_0xd44b('0x31')];if(!_0x1137df[_0xd44b('0x32')][_0xd44b('0x38')](_0xd44b('0x39'))){_0x310165['limit']=qs[_0xd44b('0x1e')](_0x1137df['query'][_0xd44b('0x1e')]);_0x310165[_0xd44b('0x1c')]=qs[_0xd44b('0x1c')](_0x1137df[_0xd44b('0x32')]['offset']);}_0x310165['order']=qs[_0xd44b('0x3a')](_0x1137df[_0xd44b('0x32')][_0xd44b('0x3a')]);_0x310165[_0xd44b('0x3b')]=qs[_0xd44b('0x33')](_[_0xd44b('0x3c')](_0x1137df['query'],_0x5208c3[_0xd44b('0x33')]),_0x319177);if(_0x1137df[_0xd44b('0x32')]['filter']){_0x310165['where']=_['merge'](_0x310165[_0xd44b('0x3b')],{'$or':_['map'](_0x319177,function(_0x43495d){if(_0x43495d['type']!==_0xd44b('0x3d')){var _0x258d65={};_0x258d65[_0x43495d[_0xd44b('0x29')]]={'$like':'%'+_0x1137df[_0xd44b('0x32')]['filter']+'%'};return _0x258d65;}})});}_0x310165=_['merge']({},_0x310165,_0x1137df['options']);var _0x191c89={'where':_0x310165[_0xd44b('0x3b')]};return db[_0xd44b('0x2d')][_0xd44b('0x1f')](_0x191c89)[_0xd44b('0x25')](function(_0x375022){_0x3b6004[_0xd44b('0x1f')]=_0x375022;if(_0x1137df[_0xd44b('0x32')]['includeAll']){_0x310165[_0xd44b('0x3e')]=[{'all':!![]}];}return db[_0xd44b('0x2d')][_0xd44b('0x3f')](_0x310165);})[_0xd44b('0x25')](function(_0x13dfc0){_0x3b6004['rows']=_0x13dfc0;return _0x3b6004;})['then'](respondWithFilteredResult(_0x17c122,_0x310165))[_0xd44b('0x40')](handleError(_0x17c122,null));};exports[_0xd44b('0x41')]=function(_0x5d0034,_0x228a6e){var _0x1138ec={'raw':!![],'where':{'id':_0x5d0034[_0xd44b('0x42')]['id']}},_0x31c513={};_0x31c513[_0xd44b('0x31')]=_[_0xd44b('0x43')](db[_0xd44b('0x2d')][_0xd44b('0x2e')]);_0x31c513[_0xd44b('0x32')]=_[_0xd44b('0x43')](_0x5d0034['query']);_0x31c513['filters']=_[_0xd44b('0x35')](_0x31c513['model'],_0x31c513['query']);_0x1138ec[_0xd44b('0x34')]=_['intersection'](_0x31c513[_0xd44b('0x31')],qs[_0xd44b('0x36')](_0x5d0034[_0xd44b('0x32')]['fields']));_0x1138ec[_0xd44b('0x34')]=_0x1138ec[_0xd44b('0x34')][_0xd44b('0x37')]?_0x1138ec[_0xd44b('0x34')]:_0x31c513['model'];if(_0x5d0034['query'][_0xd44b('0x44')]){_0x1138ec[_0xd44b('0x3e')]=[{'all':!![]}];}_0x1138ec=_['merge']({},_0x1138ec,_0x5d0034['options']);return db[_0xd44b('0x2d')][_0xd44b('0x45')](_0x1138ec)[_0xd44b('0x25')](handleEntityNotFound(_0x228a6e,null))[_0xd44b('0x25')](respondWithResult(_0x228a6e,null))['catch'](handleError(_0x228a6e,null));};exports['create']=function(_0x507d17,_0x4c56ec){return db[_0xd44b('0x2d')][_0xd44b('0x46')](_0x507d17[_0xd44b('0x47')],{})[_0xd44b('0x25')](respondWithResult(_0x4c56ec,0xc9))[_0xd44b('0x40')](handleError(_0x4c56ec,null));};exports[_0xd44b('0x24')]=function(_0x507b88,_0xaa57cf){if(_0x507b88[_0xd44b('0x47')]['id']){delete _0x507b88[_0xd44b('0x47')]['id'];}return db[_0xd44b('0x2d')][_0xd44b('0x45')]({'where':{'id':_0x507b88[_0xd44b('0x42')]['id']}})[_0xd44b('0x25')](handleEntityNotFound(_0xaa57cf,null))['then'](saveUpdates(_0x507b88['body'],null))['then'](respondWithResult(_0xaa57cf,null))[_0xd44b('0x40')](handleError(_0xaa57cf,null));};exports[_0xd44b('0x26')]=function(_0x302557,_0xc1910d){return db[_0xd44b('0x2d')]['find']({'where':{'id':_0x302557[_0xd44b('0x42')]['id']}})[_0xd44b('0x25')](handleEntityNotFound(_0xc1910d,null))[_0xd44b('0x25')](removeEntity(_0xc1910d,null))['catch'](handleError(_0xc1910d,null));};exports[_0xd44b('0x48')]=function(_0x4eb493,_0x3759fb){return db[_0xd44b('0x2d')]['describe']()[_0xd44b('0x25')](respondWithResult(_0x3759fb,null))['catch'](handleError(_0x3759fb,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 59ab25a..9eff745 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 _0xd9a3=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xd9a3,0xf1));var _0x3d9a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd9a3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3d9a('0x0'));var util=require(_0x3d9a('0x1'));var logger=require('../../config/logger')(_0x3d9a('0x2'));var moment=require(_0x3d9a('0x3'));var BPromise=require(_0x3d9a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d9a('0x5'));var rimraf=require(_0x3d9a('0x6'));var config=require(_0x3d9a('0x7'));var attributes=require(_0x3d9a('0x8'));module[_0x3d9a('0x9')]=function(_0x52a490,_0x437c41){return _0x52a490[_0x3d9a('0xa')](_0x3d9a('0xb'),attributes,{'tableName':_0x3d9a('0xc'),'paranoid':![],'indexes':[{'name':_0x3d9a('0xd'),'fields':[_0x3d9a('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3808=['bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x4e69f7,_0x2031af){var _0x67b5e2=function(_0x50b8b1){while(--_0x50b8b1){_0x4e69f7['push'](_0x4e69f7['shift']());}};_0x67b5e2(++_0x2031af);}(_0x3808,0xe9));var _0x8380=function(_0x2478c6,_0x5b9b3d){_0x2478c6=_0x2478c6-0x0;var _0x3a8a7b=_0x3808[_0x2478c6];return _0x3a8a7b;};'use strict';var _=require(_0x8380('0x0'));var util=require(_0x8380('0x1'));var logger=require(_0x8380('0x2'))(_0x8380('0x3'));var moment=require(_0x8380('0x4'));var BPromise=require(_0x8380('0x5'));var rp=require(_0x8380('0x6'));var fs=require('fs');var path=require(_0x8380('0x7'));var rimraf=require(_0x8380('0x8'));var config=require('../../config/environment');var attributes=require(_0x8380('0x9'));module[_0x8380('0xa')]=function(_0x4191fc,_0x2655ed){return _0x4191fc[_0x8380('0xb')]('ChatTransferReport',attributes,{'tableName':_0x8380('0xc'),'paranoid':![],'indexes':[{'name':_0x8380('0xd'),'fields':[_0x8380('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 6bc8f46..8372f9b 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 _0xc770=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x360055,_0x46cdbf){var _0x356f11=function(_0xfe83c9){while(--_0xfe83c9){_0x360055['push'](_0x360055['shift']());}};_0x356f11(++_0x46cdbf);}(_0xc770,0x12e));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var moment=require(_0x0c77('0x2'));var BPromise=require(_0x0c77('0x3'));var rs=require(_0x0c77('0x4'));var fs=require('fs');var Redis=require(_0x0c77('0x5'));var db=require(_0x0c77('0x6'))['db'];var utils=require(_0x0c77('0x7'));var logger=require(_0x0c77('0x8'))(_0x0c77('0x9'));var config=require(_0x0c77('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0c77('0xb')][_0x0c77('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16915f,_0xfb5a40,_0x1ca0ed){return new BPromise(function(_0x13f3ba,_0x7c2655){return client[_0x0c77('0xd')](_0x16915f,_0x1ca0ed)[_0x0c77('0xe')](function(_0x43ff5c){logger[_0x0c77('0xf')](_0x0c77('0x10'),_0xfb5a40,_0x0c77('0x11'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xfb5a40,_0x0c77('0x11'),JSON[_0x0c77('0x12')](_0x43ff5c));if(_0x43ff5c[_0x0c77('0x13')]){if(_0x43ff5c[_0x0c77('0x13')]['code']===0x1f4){logger[_0x0c77('0x13')](_0x0c77('0x10'),_0xfb5a40,_0x43ff5c[_0x0c77('0x13')][_0x0c77('0x14')]);return _0x7c2655(_0x43ff5c[_0x0c77('0x13')][_0x0c77('0x14')]);}logger[_0x0c77('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0xfb5a40,_0x43ff5c[_0x0c77('0x13')][_0x0c77('0x14')]);return _0x13f3ba(_0x43ff5c[_0x0c77('0x13')][_0x0c77('0x14')]);}else{logger['info'](_0x0c77('0x10'),_0xfb5a40,'request\x20sent');_0x13f3ba(_0x43ff5c[_0x0c77('0x15')][_0x0c77('0x14')]);}})[_0x0c77('0x16')](function(_0x1ebe10){logger[_0x0c77('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0xfb5a40,_0x1ebe10);_0x7c2655(_0x1ebe10);});});}
\ No newline at end of file
+var _0x5eb5=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x2cceaa,_0x2fc501){var _0x1a94d1=function(_0x540605){while(--_0x540605){_0x2cceaa['push'](_0x2cceaa['shift']());}};_0x1a94d1(++_0x2fc501);}(_0x5eb5,0x148));var _0x55eb=function(_0x326178,_0x5c28f6){_0x326178=_0x326178-0x0;var _0x1abda8=_0x5eb5[_0x326178];return _0x1abda8;};'use strict';var _=require(_0x55eb('0x0'));var util=require(_0x55eb('0x1'));var moment=require(_0x55eb('0x2'));var BPromise=require(_0x55eb('0x3'));var rs=require(_0x55eb('0x4'));var fs=require('fs');var Redis=require(_0x55eb('0x5'));var db=require(_0x55eb('0x6'))['db'];var utils=require(_0x55eb('0x7'));var logger=require(_0x55eb('0x8'))(_0x55eb('0x9'));var config=require(_0x55eb('0xa'));var jayson=require(_0x55eb('0xb'));var client=jayson[_0x55eb('0xc')][_0x55eb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xf575da,_0x43b706,_0xe64acc){return new BPromise(function(_0x3276c1,_0x58bc62){return client[_0x55eb('0xe')](_0xf575da,_0xe64acc)[_0x55eb('0xf')](function(_0x49500a){logger['info'](_0x55eb('0x10'),_0x43b706,_0x55eb('0x11'));logger[_0x55eb('0x12')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x43b706,_0x55eb('0x11'),JSON[_0x55eb('0x13')](_0x49500a));if(_0x49500a['error']){if(_0x49500a['error'][_0x55eb('0x14')]===0x1f4){logger[_0x55eb('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x43b706,_0x49500a[_0x55eb('0x15')]['message']);return _0x58bc62(_0x49500a['error'][_0x55eb('0x16')]);}logger[_0x55eb('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x43b706,_0x49500a[_0x55eb('0x15')][_0x55eb('0x16')]);return _0x3276c1(_0x49500a[_0x55eb('0x15')][_0x55eb('0x16')]);}else{logger[_0x55eb('0x17')](_0x55eb('0x10'),_0x43b706,_0x55eb('0x11'));_0x3276c1(_0x49500a[_0x55eb('0x18')][_0x55eb('0x16')]);}})['catch'](function(_0x5007ce){logger[_0x55eb('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x43b706,_0x5007ce);_0x58bc62(_0x5007ce);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 6c65f68..7ca8494 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 _0x9f2c=['isAuthenticated','index','/describe','describe','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x45fa59,_0x372e90){var _0x5b6c72=function(_0x41377b){while(--_0x41377b){_0x45fa59['push'](_0x45fa59['shift']());}};_0x5b6c72(++_0x372e90);}(_0x9f2c,0x186));var _0xc9f2=function(_0x29d849,_0x209ceb){_0x29d849=_0x29d849-0x0;var _0x30b104=_0x9f2c[_0x29d849];return _0x30b104;};'use strict';var multer=require(_0xc9f2('0x0'));var util=require(_0xc9f2('0x1'));var path=require(_0xc9f2('0x2'));var timeout=require(_0xc9f2('0x3'));var express=require(_0xc9f2('0x4'));var router=express[_0xc9f2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc9f2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc9f2('0x7'));var controller=require('./chatTransferReport.controller');router[_0xc9f2('0x8')]('/',auth[_0xc9f2('0x9')](),controller[_0xc9f2('0xa')]);router['get'](_0xc9f2('0xb'),auth[_0xc9f2('0x9')](),controller[_0xc9f2('0xc')]);router[_0xc9f2('0x8')](_0xc9f2('0xd'),auth[_0xc9f2('0x9')](),controller[_0xc9f2('0xe')]);router['post']('/',auth[_0xc9f2('0x9')](),controller['create']);router[_0xc9f2('0xf')]('/:id',auth[_0xc9f2('0x9')](),controller[_0xc9f2('0x10')]);router['delete']('/:id',auth[_0xc9f2('0x9')](),controller[_0xc9f2('0x11')]);module[_0xc9f2('0x12')]=router;
\ No newline at end of file
+var _0xb66c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','post','create','put','/:id','delete','destroy','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb66c,0x8c));var _0xcb66=function(_0x4d1092,_0x255ac4){_0x4d1092=_0x4d1092-0x0;var _0x39e150=_0xb66c[_0x4d1092];return _0x39e150;};'use strict';var multer=require('multer');var util=require(_0xcb66('0x0'));var path=require(_0xcb66('0x1'));var timeout=require(_0xcb66('0x2'));var express=require(_0xcb66('0x3'));var router=express[_0xcb66('0x4')]();var fs_extra=require(_0xcb66('0x5'));var auth=require(_0xcb66('0x6'));var interaction=require(_0xcb66('0x7'));var config=require('../../config/environment');var controller=require(_0xcb66('0x8'));router[_0xcb66('0x9')]('/',auth[_0xcb66('0xa')](),controller[_0xcb66('0xb')]);router[_0xcb66('0x9')](_0xcb66('0xc'),auth[_0xcb66('0xa')](),controller['describe']);router[_0xcb66('0x9')]('/:id',auth[_0xcb66('0xa')](),controller['show']);router[_0xcb66('0xd')]('/',auth[_0xcb66('0xa')](),controller[_0xcb66('0xe')]);router[_0xcb66('0xf')](_0xcb66('0x10'),auth[_0xcb66('0xa')](),controller['update']);router[_0xcb66('0x11')]('/:id',auth[_0xcb66('0xa')](),controller[_0xcb66('0x12')]);module[_0xcb66('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 9ed7533..c945630 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 _0xa8a8=['BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xa8a8,0xec));var _0x8a8a=function(_0x1947df,_0x4af7f9){_0x1947df=_0x1947df-0x0;var _0xd39126=_0xa8a8[_0x1947df];return _0xd39126;};'use strict';var Sequelize=require(_0x8a8a('0x0'));var rs=require(_0x8a8a('0x1'));module[_0x8a8a('0x2')]={'name':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8a8a('0x4')},'description':{'type':Sequelize[_0x8a8a('0x3')]},'mapKey':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x5')},'mapKeyOffline':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x5')},'key':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x6')},'customerAlias':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':_0x8a8a('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':_0x8a8a('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8a8a('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8a8a('0x3')]},'animation':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x8a8a('0xa'),_0x8a8a('0xb')),'defaultValue':_0x8a8a('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0xc')},'start_chat_button':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0xd')},'offline_chat_button':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8a8a('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8a8a('0x10')]},'closingQuestion':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x11')},'noteTitle':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x12')},'placeholderMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x13')},'closingMessageButton':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x14')},'skipMessageButton':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0x16')},'ratingType':{'type':Sequelize[_0x8a8a('0x17')](_0x8a8a('0x18'),_0x8a8a('0x19')),'defaultValue':_0x8a8a('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x8a8a('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':function(){return JSON[_0x8a8a('0x1a')]({'items':[{'type':_0x8a8a('0x1b'),'variable':null,'config':{'placeholder':_0x8a8a('0x1c'),'type':_0x8a8a('0x1d'),'required':!![]},'props':{'title':_0x8a8a('0x1c'),'helpText':''}},{'type':_0x8a8a('0x1b'),'props':{'title':_0x8a8a('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8a8a('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8a8a('0x1e')](_0x8a8a('0x1f'))?JSON[_0x8a8a('0x20')](this[_0x8a8a('0x1e')](_0x8a8a('0x1f'))):{};},'set':function(_0x251315){return this[_0x8a8a('0x21')]('onlineForm',JSON[_0x8a8a('0x1a')](_0x251315));}},'offlineForm':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':function(){return JSON[_0x8a8a('0x1a')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8a8a('0x5'),'type':_0x8a8a('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x8a8a('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8a8a('0x23'))?JSON[_0x8a8a('0x20')](this['getDataValue'](_0x8a8a('0x23'))):{};},'set':function(_0x2c8f27){return this[_0x8a8a('0x21')](_0x8a8a('0x23'),JSON[_0x8a8a('0x1a')](_0x2c8f27));}},'token':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':function(){return rs[_0x8a8a('0x24')]();}},'autoclose':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8a8a('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0x25')},'waitingMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x26')},'offlineMessageBody':{'type':Sequelize[_0x8a8a('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[_0x8a8a('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x15')},'sendUnmanaged':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8a8a('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8a8a('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':function(){return _0x8a8a('0x27');}},'notificationSound':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8a8a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0x29')},'messagesAlignment':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x2a')},'defaultTitle':{'type':Sequelize[_0x8a8a('0x3')]},'customerAvatar':{'type':Sequelize[_0x8a8a('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8a8a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x2b')},'systemAvatar':{'type':Sequelize[_0x8a8a('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8a8a('0xe')],'comment':_0x8a8a('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x40d509){if(!_0x40d509)this[_0x8a8a('0x21')](_0x8a8a('0x2d'),null);this['setDataValue'](_0x8a8a('0x2e'),_0x40d509);}},'vidaooEscalation':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8a8a('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8a8a('0x2f')},'vidaooNote':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':function(){return _0x8a8a('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8a8a('0x10')]}};
\ No newline at end of file
+var _0x99e9=['System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x1a51a0,_0x3f1541){var _0x35eef4=function(_0x3d91f2){while(--_0x3d91f2){_0x1a51a0['push'](_0x1a51a0['shift']());}};_0x35eef4(++_0x3f1541);}(_0x99e9,0xb4));var _0x999e=function(_0x9ae685,_0x2c6652){_0x9ae685=_0x9ae685-0x0;var _0x4c492e=_0x99e9[_0x9ae685];return _0x4c492e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x999e('0x0'));module[_0x999e('0x1')]={'name':{'type':Sequelize[_0x999e('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x999e('0x2')]},'mapKey':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x4')},'customerAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x999e('0x2')]},'animation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x999e('0x9')](_0x999e('0xa'),_0x999e('0xb')),'defaultValue':_0x999e('0xa')},'header_online':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xc')},'start_chat_button':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xf')},'download_transcript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x999e('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x13')},'noteTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x15')},'closingMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'skipMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'conditionAgreement':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x999e('0x18'),_0x999e('0x19')),'defaultValue':_0x999e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x999e('0x1c'),'helpText':''}},{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':_0x999e('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x999e('0x1d')](_0x999e('0x1e'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')]('onlineForm')):{};},'set':function(_0x2e1cc5){return this[_0x999e('0x20')](_0x999e('0x1e'),JSON[_0x999e('0x1a')](_0x2e1cc5));}},'offlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x999e('0x21')},'props':{'title':_0x999e('0x21'),'helpText':_0x999e('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x999e('0x23'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')](_0x999e('0x23'))):{};},'set':function(_0x15dca1){return this[_0x999e('0x20')](_0x999e('0x23'),JSON[_0x999e('0x1a')](_0x15dca1));}},'token':{'type':Sequelize[_0x999e('0x2')],'defaultValue':function(){return rs[_0x999e('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x999e('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x999e('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'sendUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x999e('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x999e('0x2')]},'notificationTemplate':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return _0x999e('0x27');}},'notificationSound':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x999e('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x28')},'systemAvatar':{'type':Sequelize[_0x999e('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x999e('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'comment':_0x999e('0x29'),'set':function(_0x1e1229){if(!_0x1e1229)this[_0x999e('0x20')]('mandatoryDispositionPauseId',null);this[_0x999e('0x20')]('mandatoryDisposition',_0x1e1229);}},'vidaooEscalation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x999e('0x2')]},'vidaooTopic':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x2a')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x999e('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0x999e('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 5a6ff37..62071b1 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 _0xc260=['inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','custom','License','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remote','connection','remoteAddress','replace','render','alignment','verticalAlignment','color','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','client','http','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','get','ChatWebsites','UserProfileResource','destroy','end','stack','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rawAttributes','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','isNil','existsSync','root','server/files/images/logos/','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','Contacts','ChatApplication','Applications','List','applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','ChatInteraction','threadId','externalUrl','interaction','lastName','messageId','created','autoclose','unmanaged','*,*,*,*','AttachmentId','User','UserId','forcedOwnership','startRouting','Start','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','utf8','offlineMessageBody','fromString','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','getInteractions','Contact','Owner','internal','Tag','tag','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone'];(function(_0x46f7ff,_0x3dfade){var _0x5e1235=function(_0x4cbbdd){while(--_0x4cbbdd){_0x46f7ff['push'](_0x46f7ff['shift']());}};_0x5e1235(++_0x3dfade);}(_0xc260,0x155));var _0x0c26=function(_0x2f96f7,_0x477c5f){_0x2f96f7=_0x2f96f7-0x0;var _0x53210e=_0xc260[_0x2f96f7];return _0x53210e;};'use strict';var BPromise=require(_0x0c26('0x0'));var Mustache=require(_0x0c26('0x1'));var util=require(_0x0c26('0x2'));var path=require(_0x0c26('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c26('0x4'));var _=require(_0x0c26('0x5'));var querystring=require('querystring');var Redis=require(_0x0c26('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x0c26('0x7'))(_0x0c26('0x8'));var config=require(_0x0c26('0x9'));var db=require(_0x0c26('0xa'))['db'];config[_0x0c26('0xb')]=_[_0x0c26('0xc')](config[_0x0c26('0xb')],{'host':_0x0c26('0xd'),'port':0x18eb});var socket=require(_0x0c26('0xe'))(new Redis(config[_0x0c26('0xb')]));require(_0x0c26('0xf'))['register'](socket);var htmlToText=require(_0x0c26('0x10'));var jayson=require('jayson/promise');var client=jayson[_0x0c26('0x11')][_0x0c26('0x12')]({'port':0x232c});var client9002=jayson[_0x0c26('0x11')][_0x0c26('0x12')]({'port':0x232a});var client9003=jayson['client'][_0x0c26('0x12')]({'port':0x232b});var client9001=jayson[_0x0c26('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x607fb9,_0x37633d,_0x2e626d,_0x53f538){return new BPromise(function(_0x500d9e,_0x2226eb){var _0x2eb2d7=_0x53f538||client;return _0x2eb2d7['request'](_0x607fb9,_0x2e626d)['then'](function(_0x3b4973){logger[_0x0c26('0x13')](_0x0c26('0x14'),_0x37633d,'request\x20sent');logger[_0x0c26('0x15')](_0x0c26('0x16'),_0x37633d,_0x0c26('0x17'),JSON[_0x0c26('0x18')](_0x3b4973));if(_0x3b4973[_0x0c26('0x19')]){if(_0x3b4973[_0x0c26('0x19')][_0x0c26('0x1a')]===0x1f4){logger[_0x0c26('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x37633d,_0x3b4973['error'][_0x0c26('0x1b')]);return _0x2226eb(_0x3b4973[_0x0c26('0x19')][_0x0c26('0x1b')]);}logger[_0x0c26('0x19')](_0x0c26('0x14'),_0x37633d,_0x3b4973[_0x0c26('0x19')][_0x0c26('0x1b')]);return _0x500d9e(_0x3b4973[_0x0c26('0x19')][_0x0c26('0x1b')]);}else{logger[_0x0c26('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x37633d,_0x0c26('0x17'));_0x500d9e(_0x3b4973['result'][_0x0c26('0x1b')]);}})['catch'](function(_0x5318a7){logger[_0x0c26('0x19')](_0x0c26('0x14'),_0x37633d,_0x5318a7);_0x2226eb(_0x5318a7);});});}function respondWithStatusCode(_0x1e4bbe,_0xfe650a){_0xfe650a=_0xfe650a||0xcc;return function(_0x133400){if(_0x133400){return _0x1e4bbe[_0x0c26('0x1c')](_0xfe650a);}return _0x1e4bbe[_0x0c26('0x1d')](_0xfe650a)['end']();};}function respondWithResult(_0x2d83ad,_0x6fe965){_0x6fe965=_0x6fe965||0xc8;return function(_0x52fe6b){if(_0x52fe6b){return _0x2d83ad['status'](_0x6fe965)[_0x0c26('0x1e')](_0x52fe6b);}};}function respondWithFilteredResult(_0x3898af,_0x34965f){return function(_0x4928d8){if(_0x4928d8){var _0x3bead5=typeof _0x34965f['offset']===_0x0c26('0x1f')&&typeof _0x34965f[_0x0c26('0x20')]===_0x0c26('0x1f');var _0x22200c=_0x4928d8[_0x0c26('0x21')];var _0xafe07a=_0x3bead5?0x0:_0x34965f['offset'];var _0x2c4d3f=_0x3bead5?_0x4928d8['count']:_0x34965f[_0x0c26('0x22')]+_0x34965f[_0x0c26('0x20')];var _0x5820bb;if(_0x2c4d3f>=_0x22200c){_0x2c4d3f=_0x22200c;_0x5820bb=0xc8;}else{_0x5820bb=0xce;}_0x3898af['status'](_0x5820bb);return _0x3898af[_0x0c26('0x23')](_0x0c26('0x24'),_0xafe07a+'-'+_0x2c4d3f+'/'+_0x22200c)[_0x0c26('0x1e')](_0x4928d8);}return null;};}function saveUpdates(_0x45869e){return function(_0x2256d3){if(_0x2256d3){return _0x2256d3[_0x0c26('0x25')](_0x45869e)['then'](function(_0x2a7e6e){return _0x2a7e6e;});}return null;};}function removeEntity(_0x2d3373){return function(_0x446d8c){if(_0x446d8c){return _0x446d8c['destroy']()[_0x0c26('0x26')](function(){var _0x4471d8=_0x446d8c[_0x0c26('0x27')]({'plain':!![]});var _0x4c9b9a=_0x0c26('0x28');return db[_0x0c26('0x29')][_0x0c26('0x2a')]({'where':{'type':_0x4c9b9a,'resourceId':_0x4471d8['id']}})[_0x0c26('0x26')](function(){return _0x446d8c;});})[_0x0c26('0x26')](function(){_0x2d3373[_0x0c26('0x1d')](0xcc)[_0x0c26('0x2b')]();});}};}function handleEntityNotFound(_0x31b2fb){return function(_0x842fb){if(!_0x842fb){_0x31b2fb[_0x0c26('0x1c')](0x194);}return _0x842fb;};}function handleError(_0x290821,_0x3fbeda){_0x3fbeda=_0x3fbeda||0x1f4;return function(_0xec6847){logger[_0x0c26('0x19')](_0xec6847[_0x0c26('0x2c')]);if(_0xec6847['name']){delete _0xec6847['name'];}_0x290821[_0x0c26('0x1d')](_0x3fbeda)[_0x0c26('0x2d')](_0xec6847);};}exports[_0x0c26('0x2e')]=function(_0x6db0e6,_0x1b40b5){var _0x1f1504={'include':[{'model':db[_0x0c26('0x2f')],'as':_0x0c26('0x30')}]},_0x42fad5={},_0xc0554f={'count':0x0,'rows':[]};var _0x4f9e64=_[_0x0c26('0x31')](db[_0x0c26('0x32')]['rawAttributes'],function(_0x33e798){return{'name':_0x33e798[_0x0c26('0x33')],'type':_0x33e798[_0x0c26('0x34')][_0x0c26('0x35')]};});_0x42fad5['model']=_[_0x0c26('0x31')](_0x4f9e64,_0x0c26('0x36'));_0x42fad5[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x6db0e6[_0x0c26('0x37')]);_0x42fad5[_0x0c26('0x39')]=_[_0x0c26('0x3a')](_0x42fad5[_0x0c26('0x3b')],_0x42fad5[_0x0c26('0x37')]);_0x1f1504[_0x0c26('0x3c')]=_[_0x0c26('0x3a')](_0x42fad5[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x1f1504[_0x0c26('0x3c')]=_0x1f1504[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x1f1504[_0x0c26('0x3c')]:_0x42fad5[_0x0c26('0x3b')];if(!_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x3f')](_0x0c26('0x40'))){_0x1f1504[_0x0c26('0x20')]=qs[_0x0c26('0x20')](_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x20')]);_0x1f1504[_0x0c26('0x22')]=qs[_0x0c26('0x22')](_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x22')]);}_0x1f1504['order']=qs[_0x0c26('0x41')](_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x41')]);_0x1f1504[_0x0c26('0x42')]=qs[_0x0c26('0x39')](_[_0x0c26('0x43')](_0x6db0e6['query'],_0x42fad5[_0x0c26('0x39')]),_0x4f9e64);if(_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x44')]){_0x1f1504[_0x0c26('0x42')]=_[_0x0c26('0x45')](_0x1f1504[_0x0c26('0x42')],{'$or':_[_0x0c26('0x31')](_0x4f9e64,function(_0x4e83eb){if(_0x4e83eb['type']!==_0x0c26('0x46')){var _0x57e2ca={};_0x57e2ca[_0x4e83eb[_0x0c26('0x36')]]={'$like':'%'+_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x44')]+'%'};return _0x57e2ca;}})});}_0x1f1504=_['merge']({},_0x1f1504,_0x6db0e6['options']);var _0x17ecf0={'where':_0x1f1504[_0x0c26('0x42')]};return db['ChatWebsite'][_0x0c26('0x21')](_0x17ecf0)['then'](function(_0x56256d){_0xc0554f[_0x0c26('0x21')]=_0x56256d;if(_0x6db0e6[_0x0c26('0x37')]['includeAll']){_0x1f1504[_0x0c26('0x47')]=[{'all':!![]}];}return db[_0x0c26('0x32')][_0x0c26('0x48')](_0x1f1504);})[_0x0c26('0x26')](function(_0x1e40c4){_0xc0554f[_0x0c26('0x49')]=_0x1e40c4;return _0xc0554f;})['then'](respondWithFilteredResult(_0x1b40b5,_0x1f1504))[_0x0c26('0x4a')](handleError(_0x1b40b5,null));};exports[_0x0c26('0x4b')]=function(_0x4267a9,_0x9fd0d7){var _0x3acecf={'raw':![],'where':{'id':_0x4267a9['params']['id']},'include':[{'model':db[_0x0c26('0x2f')],'as':_0x0c26('0x30')}]},_0x31263e={};_0x31263e[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db[_0x0c26('0x32')]['rawAttributes']);_0x31263e['query']=_[_0x0c26('0x38')](_0x4267a9[_0x0c26('0x37')]);_0x31263e[_0x0c26('0x39')]=_[_0x0c26('0x3a')](_0x31263e[_0x0c26('0x3b')],_0x31263e[_0x0c26('0x37')]);_0x3acecf[_0x0c26('0x3c')]=_['intersection'](_0x31263e[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x4267a9[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x3acecf[_0x0c26('0x3c')]=_0x3acecf[_0x0c26('0x3c')]['length']?_0x3acecf[_0x0c26('0x3c')]:_0x31263e['model'];if(_0x4267a9[_0x0c26('0x37')][_0x0c26('0x4c')]){_0x3acecf['include']=[{'all':!![]}];}_0x3acecf=_['merge']({},_0x3acecf,_0x4267a9[_0x0c26('0x4d')]);return db['ChatWebsite']['find'](_0x3acecf)['then'](handleEntityNotFound(_0x9fd0d7,null))[_0x0c26('0x26')](respondWithResult(_0x9fd0d7,null))['catch'](handleError(_0x9fd0d7,null));};exports[_0x0c26('0x4e')]=function(_0xe8f5f,_0x41ca7c){return db['ChatWebsite'][_0x0c26('0x4e')](_0xe8f5f[_0x0c26('0x4f')],{})[_0x0c26('0x26')](function(_0xa11e06){var _0x295676=_0xe8f5f['user'][_0x0c26('0x27')]({'plain':!![]});if(!_0x295676)throw new Error(_0x0c26('0x50'));if(_0x295676[_0x0c26('0x51')]===_0x0c26('0x52')){var _0x58f09b=_0xa11e06['get']({'plain':!![]});var _0x215a11=_0x0c26('0x28');return db[_0x0c26('0x53')][_0x0c26('0x54')]({'where':{'name':_0x215a11,'userProfileId':_0x295676[_0x0c26('0x55')]},'raw':!![]})[_0x0c26('0x26')](function(_0x18072b){if(_0x18072b&&_0x18072b[_0x0c26('0x56')]===0x0){return db['UserProfileResource'][_0x0c26('0x4e')]({'name':_0x58f09b[_0x0c26('0x36')],'resourceId':_0x58f09b['id'],'type':_0x18072b['name'],'sectionId':_0x18072b['id']},{})[_0x0c26('0x26')](function(){return _0xa11e06;});}else{return _0xa11e06;}})[_0x0c26('0x4a')](function(_0x3700c9){logger[_0x0c26('0x19')](_0x0c26('0x57'),_0x3700c9);throw _0x3700c9;});}return _0xa11e06;})[_0x0c26('0x26')](respondWithResult(_0x41ca7c,0xc9))[_0x0c26('0x4a')](handleError(_0x41ca7c,null));};exports[_0x0c26('0x25')]=function(_0x3a484e,_0x4fab7c){if(_0x3a484e['body']['id']){delete _0x3a484e[_0x0c26('0x4f')]['id'];}return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x3a484e[_0x0c26('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x0c26('0x30')}]})[_0x0c26('0x26')](handleEntityNotFound(_0x4fab7c,null))[_0x0c26('0x26')](saveUpdates(_0x3a484e[_0x0c26('0x4f')],null))['then'](respondWithResult(_0x4fab7c,null))[_0x0c26('0x4a')](handleError(_0x4fab7c,null));};exports[_0x0c26('0x2a')]=function(_0x5ef160,_0x32abe1){return db[_0x0c26('0x32')]['find']({'where':{'id':_0x5ef160['params']['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x32abe1,null))['then'](removeEntity(_0x32abe1,null))[_0x0c26('0x4a')](handleError(_0x32abe1,null));};exports[_0x0c26('0x59')]=function(_0x34aae8,_0x52d4dd){return db[_0x0c26('0x32')][_0x0c26('0x59')]()[_0x0c26('0x26')](respondWithResult(_0x52d4dd,null))[_0x0c26('0x4a')](handleError(_0x52d4dd,null));};exports[_0x0c26('0x5a')]=function(_0x47ba7d,_0x4b8a2b){if(_0x47ba7d[_0x0c26('0x4f')]['id']){delete _0x47ba7d['body']['id'];}return db['ChatWebsite'][_0x0c26('0x54')]({'where':{'id':_0x47ba7d[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x4b8a2b,null))['then'](function(_0x17941c){if(_0x17941c){_0x47ba7d[_0x0c26('0x4f')][_0x0c26('0x5b')]=_0x17941c['id'];return db[_0x0c26('0x5c')][_0x0c26('0x4e')](_0x47ba7d['body']);}})[_0x0c26('0x26')](respondWithResult(_0x4b8a2b,null))[_0x0c26('0x4a')](handleError(_0x4b8a2b,null));};exports[_0x0c26('0x5d')]=function(_0xb4a879,_0x8fe4e9){var _0x2099e1={'raw':![],'where':{}};var _0x100d7f={};var _0x31d8c1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0c26('0x5e')]({'where':{'id':_0xb4a879[_0x0c26('0x58')]['id']}})['then'](handleEntityNotFound(_0x8fe4e9,null))['then'](function(_0x223e2c){if(_0x223e2c){_0x100d7f[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db[_0x0c26('0x5c')][_0x0c26('0x5f')]);_0x100d7f[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0xb4a879['query']);_0x100d7f['filters']=_[_0x0c26('0x3a')](_0x100d7f[_0x0c26('0x3b')],_0x100d7f['query']);_0x2099e1['attributes']=_[_0x0c26('0x3a')](_0x100d7f[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0xb4a879[_0x0c26('0x37')]['fields']));_0x2099e1[_0x0c26('0x3c')]=_0x2099e1[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x2099e1['attributes']:_0x100d7f['model'];if(!_0xb4a879[_0x0c26('0x37')][_0x0c26('0x3f')](_0x0c26('0x40'))){_0x2099e1[_0x0c26('0x20')]=qs['limit'](_0xb4a879[_0x0c26('0x37')][_0x0c26('0x20')]);_0x2099e1[_0x0c26('0x22')]=qs[_0x0c26('0x22')](_0xb4a879[_0x0c26('0x37')][_0x0c26('0x22')]);}_0x2099e1[_0x0c26('0x60')]=qs['sort'](_0xb4a879[_0x0c26('0x37')][_0x0c26('0x41')]);_0x2099e1[_0x0c26('0x42')]=qs[_0x0c26('0x39')](_[_0x0c26('0x43')](_0xb4a879[_0x0c26('0x37')],_0x100d7f[_0x0c26('0x39')]));_0x2099e1[_0x0c26('0x42')][_0x0c26('0x5b')]=_0x223e2c['id'];if(_0xb4a879[_0x0c26('0x37')][_0x0c26('0x44')]){_0x2099e1[_0x0c26('0x42')]=_[_0x0c26('0x45')](_0x2099e1[_0x0c26('0x42')],{'$or':_[_0x0c26('0x31')](_0x2099e1[_0x0c26('0x3c')],function(_0xcf7411){var _0x42d069={};_0x42d069[_0xcf7411]={'$like':'%'+_0xb4a879[_0x0c26('0x37')][_0x0c26('0x44')]+'%'};return _0x42d069;})});}_0x2099e1=_['merge']({},_0x2099e1,_0xb4a879[_0x0c26('0x4d')]);return db[_0x0c26('0x5c')][_0x0c26('0x21')]({'where':_0x2099e1[_0x0c26('0x42')]})[_0x0c26('0x26')](function(_0x43a566){_0x31d8c1[_0x0c26('0x21')]=_0x43a566;if(_0xb4a879[_0x0c26('0x37')]['includeAll']){_0x2099e1[_0x0c26('0x47')]=[{'all':!![]}];}return db[_0x0c26('0x5c')][_0x0c26('0x48')](_0x2099e1);})[_0x0c26('0x26')](function(_0x5dbac9){_0x31d8c1[_0x0c26('0x49')]=_0x5dbac9;return _0x31d8c1;});}})['then'](respondWithFilteredResult(_0x8fe4e9,_0x2099e1))[_0x0c26('0x4a')](handleError(_0x8fe4e9,null));};exports[_0x0c26('0x61')]=function(_0x36a3f1,_0x35fe10){return db[_0x0c26('0x32')]['find']({'where':{'id':_0x36a3f1['params']['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x35fe10,null))[_0x0c26('0x26')](function(_0x5381f1){if(_0x5381f1){return _0x5381f1['removeDispositions'](_0x36a3f1[_0x0c26('0x37')]['ids']);}})[_0x0c26('0x26')](respondWithStatusCode(_0x35fe10,null))[_0x0c26('0x4a')](handleError(_0x35fe10,null));};exports[_0x0c26('0x62')]=function(_0x3a351a,_0x4bb6bf){if(_0x3a351a['body']['id']){delete _0x3a351a[_0x0c26('0x4f')]['id'];}return db[_0x0c26('0x32')]['find']({'where':{'id':_0x3a351a[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x4bb6bf,null))[_0x0c26('0x26')](function(_0x598078){if(_0x598078){_0x3a351a['body'][_0x0c26('0x5b')]=_0x598078['id'];return db[_0x0c26('0x63')][_0x0c26('0x4e')](_0x3a351a[_0x0c26('0x4f')]);}})[_0x0c26('0x26')](respondWithResult(_0x4bb6bf,null))[_0x0c26('0x4a')](handleError(_0x4bb6bf,null));};exports[_0x0c26('0x64')]=function(_0x5eeed4,_0x2803f7){var _0x30c720={'raw':![],'where':{}};var _0x5bb02f={};var _0x35d731={'count':0x0,'rows':[]};return db[_0x0c26('0x32')][_0x0c26('0x5e')]({'where':{'id':_0x5eeed4[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x2803f7,null))[_0x0c26('0x26')](function(_0x326ebf){if(_0x326ebf){_0x5bb02f[_0x0c26('0x3b')]=_['keys'](db[_0x0c26('0x63')]['rawAttributes']);_0x5bb02f[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x5eeed4[_0x0c26('0x37')]);_0x5bb02f['filters']=_[_0x0c26('0x3a')](_0x5bb02f['model'],_0x5bb02f[_0x0c26('0x37')]);_0x30c720[_0x0c26('0x3c')]=_[_0x0c26('0x3a')](_0x5bb02f[_0x0c26('0x3b')],qs['fields'](_0x5eeed4[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x30c720[_0x0c26('0x3c')]=_0x30c720[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x30c720['attributes']:_0x5bb02f[_0x0c26('0x3b')];if(!_0x5eeed4[_0x0c26('0x37')]['hasOwnProperty'](_0x0c26('0x40'))){_0x30c720[_0x0c26('0x20')]=qs[_0x0c26('0x20')](_0x5eeed4['query']['limit']);_0x30c720[_0x0c26('0x22')]=qs[_0x0c26('0x22')](_0x5eeed4[_0x0c26('0x37')][_0x0c26('0x22')]);}_0x30c720['order']=qs[_0x0c26('0x41')](_0x5eeed4[_0x0c26('0x37')][_0x0c26('0x41')]);_0x30c720[_0x0c26('0x42')]=qs[_0x0c26('0x39')](_[_0x0c26('0x43')](_0x5eeed4[_0x0c26('0x37')],_0x5bb02f['filters']));_0x30c720['where'][_0x0c26('0x5b')]=_0x326ebf['id'];if(_0x5eeed4[_0x0c26('0x37')]['filter']){_0x30c720[_0x0c26('0x42')]=_['merge'](_0x30c720['where'],{'$or':_['map'](_0x30c720[_0x0c26('0x3c')],function(_0xf1a82b){var _0x511bfb={};_0x511bfb[_0xf1a82b]={'$like':'%'+_0x5eeed4['query'][_0x0c26('0x44')]+'%'};return _0x511bfb;})});}_0x30c720=_[_0x0c26('0x45')]({},_0x30c720,_0x5eeed4[_0x0c26('0x4d')]);return db[_0x0c26('0x63')][_0x0c26('0x21')]({'where':_0x30c720[_0x0c26('0x42')]})[_0x0c26('0x26')](function(_0x2d05eb){_0x35d731['count']=_0x2d05eb;if(_0x5eeed4['query'][_0x0c26('0x4c')]){_0x30c720[_0x0c26('0x47')]=[{'all':!![]}];}return db[_0x0c26('0x63')][_0x0c26('0x48')](_0x30c720);})[_0x0c26('0x26')](function(_0x28451f){_0x35d731[_0x0c26('0x49')]=_0x28451f;return _0x35d731;});}})[_0x0c26('0x26')](respondWithFilteredResult(_0x2803f7,_0x30c720))[_0x0c26('0x4a')](handleError(_0x2803f7,null));};exports[_0x0c26('0x65')]=function(_0x427908,_0x21c2a1){return db['ChatWebsite'][_0x0c26('0x54')]({'where':{'id':_0x427908[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x21c2a1,null))[_0x0c26('0x26')](function(_0x355203){if(_0x355203){return _0x355203[_0x0c26('0x65')](_0x427908[_0x0c26('0x37')][_0x0c26('0x66')]);}})['then'](respondWithStatusCode(_0x21c2a1,null))[_0x0c26('0x4a')](handleError(_0x21c2a1,null));};exports[_0x0c26('0x67')]=function(_0x27e1f2,_0x55ac4f){_0x27e1f2[_0x0c26('0x4f')][_0x0c26('0x68')]=_0x27e1f2['file'][_0x0c26('0x69')];return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x27e1f2[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x55ac4f,null))['then'](saveUpdates(_0x27e1f2[_0x0c26('0x4f')],null))[_0x0c26('0x26')](respondWithResult(_0x55ac4f,null))[_0x0c26('0x4a')](handleError(_0x55ac4f,null));};exports[_0x0c26('0x6a')]=function(_0x470194,_0x5ea59e){_0x470194[_0x0c26('0x4f')][_0x0c26('0x6b')]=_0x470194[_0x0c26('0x6c')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x470194['params']['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x5ea59e,null))['then'](saveUpdates(_0x470194[_0x0c26('0x4f')],null))[_0x0c26('0x26')](respondWithResult(_0x5ea59e,null))[_0x0c26('0x4a')](handleError(_0x5ea59e,null));};exports[_0x0c26('0x6d')]=function(_0x4ef3ea,_0x54baba){_0x4ef3ea['body'][_0x0c26('0x6e')]=_0x4ef3ea['file'][_0x0c26('0x69')];return db[_0x0c26('0x32')]['find']({'where':{'id':_0x4ef3ea[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x54baba,null))[_0x0c26('0x26')](saveUpdates(_0x4ef3ea[_0x0c26('0x4f')],null))['then'](respondWithResult(_0x54baba,null))[_0x0c26('0x4a')](handleError(_0x54baba,null));};exports[_0x0c26('0x6f')]=function(_0x3d4f22,_0x24f89b){_0x3d4f22[_0x0c26('0x4f')][_0x0c26('0x70')]=_0x3d4f22['file'][_0x0c26('0x69')];return db['ChatWebsite'][_0x0c26('0x54')]({'where':{'id':_0x3d4f22[_0x0c26('0x58')]['id']}})['then'](handleEntityNotFound(_0x24f89b,null))[_0x0c26('0x26')](saveUpdates(_0x3d4f22['body'],null))[_0x0c26('0x26')](respondWithResult(_0x24f89b,null))['catch'](handleError(_0x24f89b,null));};exports[_0x0c26('0x71')]=function(_0x3fce0d,_0x1963d7){var _0x1125ba=path[_0x0c26('0x72')](config['root'],_0x0c26('0x73'));var _0x5280d3={'where':{'id':_0x3fce0d[_0x0c26('0x58')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x282a84=![];return require(_0x0c26('0x74'))['getLicense']()[_0x0c26('0x26')](function(_0x451fd4){if(_0x451fd4){_0x282a84=_0x451fd4['custom'];}})[_0x0c26('0x26')](function(){return db[_0x0c26('0x32')][_0x0c26('0x54')](_0x5280d3);})['then'](handleEntityNotFound(_0x1963d7,null))[_0x0c26('0x26')](function(_0x1658cd){if(_0x1658cd){if(!_[_0x0c26('0x75')](_0x1658cd[_0x0c26('0x68')])){if(fs[_0x0c26('0x76')](path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x78'),_0x1658cd[_0x0c26('0x68')]))&&_0x282a84){_0x1125ba=path['join'](config[_0x0c26('0x77')],_0x0c26('0x78'),_0x1658cd[_0x0c26('0x68')]);}}return _0x1963d7['download'](_0x1125ba);}})[_0x0c26('0x4a')](handleError(_0x1963d7,null));};exports['getAvatar']=function(_0x267f14,_0x176335){var _0x5c0fd6=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x4c4a58={'where':{'id':_0x267f14[_0x0c26('0x58')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x0c26('0x54')](_0x4c4a58)[_0x0c26('0x26')](handleEntityNotFound(_0x176335,null))[_0x0c26('0x26')](function(_0x78c1c0){if(_0x78c1c0){if(!_[_0x0c26('0x75')](_0x78c1c0[_0x0c26('0x6b')])){if(fs[_0x0c26('0x76')](path[_0x0c26('0x72')](config['root'],_0x0c26('0x79'),_0x78c1c0[_0x0c26('0x6b')]))){_0x5c0fd6=path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x79'),_0x78c1c0[_0x0c26('0x6b')]);}}return _0x176335[_0x0c26('0x7a')](_0x5c0fd6);}})[_0x0c26('0x4a')](handleError(_0x176335,null));};exports[_0x0c26('0x7b')]=function(_0x229a61,_0x306688){var _0x30a509=path[_0x0c26('0x72')](config[_0x0c26('0x77')],'server/files/images/avatars/customer_avatar.png');var _0x4ecc63={'where':{'id':_0x229a61[_0x0c26('0x58')]['id']},'attributes':['id',_0x0c26('0x6e'),_0x0c26('0x7c')],'raw':!![]};return db[_0x0c26('0x32')][_0x0c26('0x54')](_0x4ecc63)['then'](handleEntityNotFound(_0x306688,null))[_0x0c26('0x26')](function(_0x5d3a30){if(_0x5d3a30){if(!_['isNil'](_0x5d3a30['customerAvatar'])){if(fs[_0x0c26('0x76')](path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x79'),_0x5d3a30[_0x0c26('0x6e')]))&&_0x5d3a30[_0x0c26('0x7c')]){_0x30a509=path[_0x0c26('0x72')](config[_0x0c26('0x77')],'server/files/images/avatars/',_0x5d3a30[_0x0c26('0x6e')]);}}return _0x306688[_0x0c26('0x7a')](_0x30a509);}})[_0x0c26('0x4a')](handleError(_0x306688,null));};exports[_0x0c26('0x7d')]=function(_0x177e21,_0x23226a){var _0x5318fa=path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x7e'));var _0x117300={'where':{'id':_0x177e21[_0x0c26('0x58')]['id']},'attributes':['id',_0x0c26('0x70')],'raw':!![]};return db[_0x0c26('0x32')]['find'](_0x117300)[_0x0c26('0x26')](handleEntityNotFound(_0x23226a,null))[_0x0c26('0x26')](function(_0x5d3722){if(_0x5d3722){if(!_[_0x0c26('0x75')](_0x5d3722[_0x0c26('0x70')])){if(fs[_0x0c26('0x76')](path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x79'),_0x5d3722['systemAvatar']))){_0x5318fa=path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x79'),_0x5d3722[_0x0c26('0x70')]);}}return _0x23226a[_0x0c26('0x7a')](_0x5318fa);}})[_0x0c26('0x4a')](handleError(_0x23226a,null));};exports[_0x0c26('0x7f')]=function(_0x39dee2,_0x1f71ea){var _0x457339=require('user-agent-parser');var _0x36bb36=new _0x457339();var _0x16e26c=_0x36bb36[_0x0c26('0x80')](_0x39dee2[_0x0c26('0x81')]['user-agent'])[_0x0c26('0x82')]();var _0x4b2237={'body':_0x39dee2[_0x0c26('0x4f')],'channel':_0x0c26('0x83')};var _0x16fbbf=[];var _0x3ee11b=[];var _0xc0fc0d={};var _0xb6295f=![];return db[_0x0c26('0x84')][_0x0c26('0x59')]()[_0x0c26('0x26')](function(_0x299e50){if(!_0x299e50){throw new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))](_0x0c26('0x87'));}_0x16fbbf=_[_0x0c26('0x88')](_[_0x0c26('0x38')](_0x299e50),[_0x0c26('0x89'),_0x0c26('0x8a')]);_0x3ee11b=_[_0x0c26('0x88')](_[_0x0c26('0x38')](_0x299e50),[_0x0c26('0x89'),_0x0c26('0x8a'),_0x0c26('0x8b'),_0x0c26('0x8c')]);if(_0x39dee2['body']['id']){delete _0x39dee2[_0x0c26('0x4f')]['id'];}if(_[_0x0c26('0x75')](_0x39dee2[_0x0c26('0x4f')]['from'])){throw new db[(_0x0c26('0x85'))]['ValidationError'](_0x0c26('0x8d'));}if(_[_0x0c26('0x75')](_0x39dee2[_0x0c26('0x4f')]['body'])||_0x39dee2[_0x0c26('0x4f')][_0x0c26('0x4f')]===''){throw new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))](_0x0c26('0x8e'));}if(_[_0x0c26('0x75')](_0x39dee2[_0x0c26('0x4f')][_0x0c26('0x8f')])){throw new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))](_0x0c26('0x90')+_0x3ee11b);}if(!_[_0x0c26('0x91')](_0x3ee11b,_0x39dee2[_0x0c26('0x4f')][_0x0c26('0x8f')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ee11b);}_0xc0fc0d[_0x39dee2[_0x0c26('0x4f')][_0x0c26('0x8f')]]=_0x39dee2[_0x0c26('0x4f')][_0x0c26('0x92')];})[_0x0c26('0x26')](function(){return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x39dee2['params']['id']},'include':[{'model':db[_0x0c26('0x93')],'as':'List','include':[{'model':db[_0x0c26('0x84')],'as':_0x0c26('0x94'),'where':_0xc0fc0d,'limit':0x1,'order':[[_0x0c26('0x8a'),'DESC']]}]},{'model':db[_0x0c26('0x95')],'as':_0x0c26('0x96')}]});})['then'](handleEntityNotFound(_0x1f71ea,null))[_0x0c26('0x26')](function(_0x117c69){if(_0x117c69&&_0x117c69[_0x0c26('0x97')]){_0x4b2237['account']=_0x117c69;_0x4b2237[_0x0c26('0x98')]=_0x117c69['Applications'];_0x4b2237['list']=_0x117c69[_0x0c26('0x97')];_0x4b2237[_0x0c26('0x98')]=_[_0x0c26('0x99')](_0x4b2237[_0x0c26('0x98')],[_0x0c26('0x9a')],[_0x0c26('0x9b')]);if(_0x4b2237['account'][_0x0c26('0x96')]){delete _0x4b2237[_0x0c26('0x9c')][_0x0c26('0x96')];}if(_0x4b2237['account'][_0x0c26('0x97')]&&_0x4b2237['account']['List'][_0x0c26('0x94')]['length']){return _0x4b2237['account'][_0x0c26('0x97')][_0x0c26('0x94')][0x0];}var _0x1e4f25=_['defaults'](_0x39dee2[_0x0c26('0x4f')],{'firstName':_0x39dee2[_0x0c26('0x4f')]['from'],'ListId':_0x117c69[_0x0c26('0x8c')]});_0x1e4f25[_0x39dee2[_0x0c26('0x4f')]['mapKey']]=_0x39dee2[_0x0c26('0x4f')]['from'];return db['CmContact'][_0x0c26('0x4e')](_0x1e4f25,{'fields':_0x16fbbf,'raw':!![]});}})[_0x0c26('0x26')](handleEntityNotFound(_0x1f71ea,null))[_0x0c26('0x26')](function(_0x221400){_0x4b2237[_0x0c26('0x9d')]=_0x221400;var _0x1c2684=_0x39dee2['body'][_0x0c26('0x9e')];if(_0x39dee2[_0x0c26('0x81')]['cf-connecting-ip']){_0x1c2684=_0x39dee2[_0x0c26('0x81')][_0x0c26('0x9f')];}else if(_0x39dee2[_0x0c26('0x81')][_0x0c26('0xa0')]){_0x1c2684=_[_0x0c26('0xa1')](_0x39dee2[_0x0c26('0x81')][_0x0c26('0xa0')][_0x0c26('0xa2')](','));}if(_0x221400){var _0x3205b0={'ContactId':_0x221400['id'],'ChatWebsiteId':_0x39dee2[_0x0c26('0x58')]['id'],'from':(_0x221400[_0x0c26('0xa3')]||'')+'\x20'+(_0x221400['lastName']||''),'customerIp':_0x1c2684,'customerPort':_0x39dee2[_0x0c26('0x81')][_0x0c26('0xa4')]?_0x39dee2[_0x0c26('0x81')]['x-real-port']:null,'referer':_0x39dee2['body'][_0x0c26('0xa5')],'browserName':_0x16e26c[_0x0c26('0xa6')][_0x0c26('0x36')]&&_0x16e26c['browser'][_0x0c26('0xa7')]?util[_0x0c26('0xa8')](_0x0c26('0xa9'),_0x16e26c[_0x0c26('0xa6')][_0x0c26('0x36')],_0x16e26c['browser'][_0x0c26('0xa7')]):'unknown','browserVersion':_0x16e26c[_0x0c26('0xa6')][_0x0c26('0xa7')]||_0x0c26('0xaa'),'osName':util[_0x0c26('0xa8')]('%s\x20%s',_0x16e26c['os'][_0x0c26('0x36')],_0x16e26c['os'][_0x0c26('0xa7')]),'osVersion':_0x16e26c['os']['version'],'deviceModel':_0x16e26c[_0x0c26('0xab')][_0x0c26('0x3b')]&&_0x16e26c[_0x0c26('0xab')][_0x0c26('0xac')]?util[_0x0c26('0xa8')](_0x0c26('0xad'),_0x16e26c[_0x0c26('0xab')][_0x0c26('0x3b')],_0x16e26c[_0x0c26('0xab')][_0x0c26('0xac')],_0x16e26c[_0x0c26('0xab')][_0x0c26('0x34')]):null,'deviceVendor':_0x16e26c[_0x0c26('0xab')][_0x0c26('0xac')],'deviceType':_0x16e26c[_0x0c26('0xab')][_0x0c26('0x34')],'formData':JSON['stringify'](_0x39dee2['body'])};var _0x1b6416={'ChatWebsiteId':_0x39dee2['params']['id'],'closed':![]};if(_0x39dee2[_0x0c26('0x4f')]['threadId']){_0x1b6416['threadId']=_0x39dee2[_0x0c26('0x4f')]['threadId'];return db[_0x0c26('0xae')][_0x0c26('0x54')]({'where':_0x1b6416})[_0x0c26('0x26')](function(_0x8711af){if(_0x8711af){return[_0x8711af,![]];}_0x3205b0[_0x0c26('0xaf')]=_0x39dee2[_0x0c26('0x4f')]['threadId'];_0x3205b0[_0x0c26('0xb0')]=_0x39dee2[_0x0c26('0x4f')][_0x0c26('0xb0')];return db[_0x0c26('0xae')]['create'](_0x3205b0)[_0x0c26('0x26')](function(_0x1e85d0){return[_0x1e85d0,!![]];});});}_0x1b6416['ContactId']=_0x221400['id'];if(_0x39dee2['body'][_0x0c26('0xb1')]&&_0x39dee2[_0x0c26('0x4f')][_0x0c26('0xb1')]['id']){_0x1b6416['id']=_0x39dee2['body'][_0x0c26('0xb1')]['id'];return db[_0x0c26('0xae')][_0x0c26('0x54')]({'where':_0x1b6416})[_0x0c26('0x26')](function(_0x190a09){if(_0x190a09){return[_0x190a09,![]];}return db[_0x0c26('0xae')][_0x0c26('0x4e')](_0x3205b0)[_0x0c26('0x26')](function(_0x14ce8b){return[_0x14ce8b,!![]];});});}return db['ChatInteraction'][_0x0c26('0x4e')](_0x3205b0)[_0x0c26('0x26')](function(_0x523aa9){return[_0x523aa9,!![]];});}})['spread'](function(_0x55f829,_0x517eca){if(_0x55f829){_0xb6295f=_0x517eca;if(!_0x517eca){var _0x52f7d9={'from':(_0x4b2237[_0x0c26('0x9d')][_0x0c26('0xa3')]||'')+'\x20'+(_0x4b2237['contact'][_0x0c26('0xb2')]||'')};if(_0x39dee2[_0x0c26('0x4f')]['threadId']&&_0x39dee2['body'][_0x0c26('0xb3')]&&_0x39dee2[_0x0c26('0x4f')][_0x0c26('0xaf')]!=_0x39dee2[_0x0c26('0x4f')]['messageId']){_0x52f7d9['threadId']=_0x39dee2[_0x0c26('0x4f')][_0x0c26('0xb3')];}return _0x55f829[_0x0c26('0x25')](_0x52f7d9);}else{return _0x55f829;}}})[_0x0c26('0x26')](function(_0x40adc5){_0x4b2237[_0x0c26('0xb1')]=_0x40adc5['get']({'plain':!![]});_0x4b2237[_0x0c26('0xb1')]['created']=_0xb6295f;if(_0x4b2237[_0x0c26('0xb1')][_0x0c26('0xb4')]){if(_0x4b2237[_0x0c26('0x9c')][_0x0c26('0xb5')]){_0x4b2237['applications']['push']({'id':0x0,'priority':_0x4b2237[_0x0c26('0x98')][_0x0c26('0x3e')]+0x1,'app':'close','appdata':_0x0c26('0xb6'),'interval':_0x0c26('0xb7')});}}return db['ChatMessage'][_0x0c26('0x4e')]({'body':_0x39dee2[_0x0c26('0x4f')]['body'],'ChatWebsiteId':_0x39dee2[_0x0c26('0x58')]['id'],'ChatInteractionId':_0x40adc5['id'],'direction':'in','ContactId':_0x4b2237[_0x0c26('0x9d')]['id'],'AttachmentId':_0x39dee2[_0x0c26('0x4f')][_0x0c26('0xb8')]});})[_0x0c26('0x26')](function(_0x28d1cb){_0x4b2237['message']=_0x28d1cb;if(_0x4b2237[_0x0c26('0xb1')]['UserId']){return db[_0x0c26('0xb9')][_0x0c26('0x54')]({'attributes':['id',_0x0c26('0x36')],'where':{'id':_0x4b2237[_0x0c26('0xb1')][_0x0c26('0xba')]}})[_0x0c26('0x26')](function(_0x33626a){if(_0x33626a){_0x4b2237[_0x0c26('0x98')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x33626a[_0x0c26('0x36')]+','+(_0x4b2237['account']['waitForTheAssignedAgent']||0xa),'interval':_0x0c26('0xb7')});_0x4b2237[_0x0c26('0xbb')]=!![];}return respondWithRpcPromise('Start',_0x0c26('0xbc'),_0x4b2237);});}return respondWithRpcPromise(_0x0c26('0xbd'),'startRouting',_0x4b2237);})[_0x0c26('0x26')](function(_0x55aecb){respondWithRpcPromise(_0x0c26('0xbe'),_0x0c26('0xbe'),{'event':_0x0c26('0x7f'),'message':_0x55aecb},client9002);return _0x55aecb;})[_0x0c26('0x26')](respondWithResult(_0x1f71ea,null))[_0x0c26('0x4a')](handleError(_0x1f71ea,null));};exports[_0x0c26('0xbf')]=function(_0x1558f1,_0x255410){var _0x589805,_0x26acb3,_0x673b45;var _0x587138=[];var _0x1940f4={};var _0xe978e9=_0x1558f1['files']||[];var _0x661702=[];var _0x1a7324;return db[_0x0c26('0x84')][_0x0c26('0x59')]()[_0x0c26('0x26')](function(_0x245987){if(!_0x245987){throw new db[(_0x0c26('0x85'))]['ValidationError'](_0x0c26('0x87'));}_0x587138=_[_0x0c26('0x88')](_[_0x0c26('0x38')](_0x245987),[_0x0c26('0x89'),_0x0c26('0x8a'),_0x0c26('0x8b'),_0x0c26('0x8c')]);if(_0x1558f1[_0x0c26('0x4f')]['id']){delete _0x1558f1[_0x0c26('0x4f')]['id'];}if(_[_0x0c26('0x75')](_0x1558f1[_0x0c26('0x4f')][_0x0c26('0x92')])){throw _0x255410[_0x0c26('0x1d')](0x1f4)[_0x0c26('0x2d')](new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x1558f1[_0x0c26('0x4f')][_0x0c26('0x4f')])||_0x1558f1[_0x0c26('0x4f')]['body']===''){throw _0x255410['status'](0x1f4)[_0x0c26('0x2d')](new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))](_0x0c26('0x8e')));}if(_[_0x0c26('0x75')](_0x1558f1[_0x0c26('0x4f')][_0x0c26('0xc0')])){throw _0x255410[_0x0c26('0x1d')](0x1f4)[_0x0c26('0x2d')](new db['Sequelize'][(_0x0c26('0x86'))](_0x0c26('0xc1')+_0x587138));}if(!_[_0x0c26('0x91')](_0x587138,_0x1558f1['body'][_0x0c26('0xc0')])){throw _0x255410[_0x0c26('0x1d')](0x1f4)[_0x0c26('0x2d')](new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x587138));}_0x1940f4[_0x1558f1[_0x0c26('0x4f')][_0x0c26('0xc0')]]=_0x1558f1[_0x0c26('0x4f')][_0x0c26('0x92')];})[_0x0c26('0x26')](function(){return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x1558f1['params']['id']},'include':[{'model':db[_0x0c26('0x93')],'as':_0x0c26('0x97')},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x255410,null))[_0x0c26('0x26')](function(_0x512f86){if(_0x512f86&&_0x512f86['List']){_0x26acb3=_0x512f86;var _0x52222e=_['defaults'](_0x1558f1[_0x0c26('0x4f')],{'firstName':_0x1558f1['body']['from'],'phone':_0x1558f1['body'][_0x0c26('0x92')],'ListId':_0x512f86[_0x0c26('0x8c')]});_0x52222e[_0x1558f1[_0x0c26('0x4f')][_0x0c26('0xc0')]]=_0x1558f1[_0x0c26('0x4f')][_0x0c26('0x92')];return db[_0x0c26('0x84')][_0x0c26('0xc2')]({'where':_0x1940f4,'defaults':_0x52222e});}})[_0x0c26('0xc3')](function(_0x3abbd6){if(_0x3abbd6){_0x673b45=_0x3abbd6;var _0x1ff7fc=fs[_0x0c26('0xc4')](path[_0x0c26('0x72')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x0c26('0xc5'));var _0x3e72d5=ejs['render'](_0x1ff7fc,{'body':_['toPairs'](_0x1558f1['body'][_0x0c26('0x4f')]),'bodyTitle':_0x26acb3[_0x0c26('0xc6')]});return db['ChatOfflineMessage'][_0x0c26('0x4e')]({'body':_0x3e72d5,'plainBody':htmlToText[_0x0c26('0xc7')](_0x3e72d5),'ContactId':_0x3abbd6['id'],'ChatWebsiteId':_0x26acb3['id']});}})[_0x0c26('0x26')](function(_0x10c145){_0x1a7324=_0x10c145;if(_0xe978e9[_0x0c26('0x3e')]){var _0x14b280=_0xe978e9[_0x0c26('0x31')](function(_0x1371ae){return{'name':_0x1371ae[_0x0c26('0xc8')],'basename':_0x1371ae[_0x0c26('0x69')],'type':_0x1371ae[_0x0c26('0xc9')],'ChatOfflineMessageId':_0x10c145['id']};});_0x661702=_0x14b280['map'](_0x331606=>{var _0x4a2c11={'filename':_0x331606[_0x0c26('0x36')],'path':path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0xca'),_0x0c26('0xcb'),_0x0c26('0xcc'),_0x0c26('0xcd'),_0x331606[_0x0c26('0xce')])};return _0x4a2c11;});if(!_0x26acb3[_0x0c26('0xcf')]){return db[_0x0c26('0xd0')][_0x0c26('0xd1')](function(_0x281ba9){return db[_0x0c26('0xd2')][_0x0c26('0xd3')](_0x14b280,{'transaction':_0x281ba9});});}}})[_0x0c26('0x26')](function(){if(_0x1a7324){_0x589805=_0x1a7324;return db[_0x0c26('0xd4')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0c26('0xd5')],'as':_0x0c26('0xd6'),'raw':!![],'include':[{'model':db[_0x0c26('0xd7')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x0c26('0x26')](function(_0x906384){if(_0x906384&&_0x906384[_0x0c26('0xd6')]&&_0x26acb3[_0x0c26('0xd8')]&&_0x26acb3[_0x0c26('0xd9')]){var _0x506ffd=_0x906384['getSmtpOptions']();return respondWithRpcPromise(_0x0c26('0xda'),'sendMail',{'account':_0x506ffd,'message':{'from':util[_0x0c26('0xa8')](_0x0c26('0xdb'),_0x906384['name'],_0x906384[_0x0c26('0xdc')]||_0x906384['Smtp'][_0x0c26('0x52')]),'to':_0x26acb3[_0x0c26('0xd9')],'subject':_0x26acb3['offlineMessageSubject'],'html':_0x589805[_0x0c26('0x4f')],'attachments':_0x661702}},client9003)[_0x0c26('0x26')](function(){return _0x589805;})[_0x0c26('0x4a')](function(_0x56de59){logger[_0x0c26('0x19')](_0x56de59);});}})[_0x0c26('0x26')](function(){if(_0x26acb3&&_0x26acb3['openNewInteraction']&&_0x26acb3[_0x0c26('0xdd')]){var _0x3812ce=[];if(_0xe978e9[_0x0c26('0x3e')]){_0x3812ce=_0xe978e9[_0x0c26('0x31')](function(_0x57d4a5){return{'name':_0x57d4a5[_0x0c26('0xc8')],'basename':_0x57d4a5['filename'],'type':_0x57d4a5[_0x0c26('0xc9')],'ChatOfflineMessageId':_0x1a7324['id']};});}var _0xd99ea6;if(!_[_0x0c26('0x75')](_0x26acb3[_0x0c26('0xde')])){var _0x56b257=_[_0x0c26('0x31')](_0x1558f1[_0x0c26('0x4f')],function(_0x35fa29){return _0x35fa29;});var _0x4aaa35=_[_0x0c26('0xdf')](_0x56b257)[0x0];var _0xee14b6=_[_0x0c26('0xe0')](_0x4aaa35,function(_0xb8f952){return _0xb8f952;});_0xd99ea6=_0xee14b6[0x1][_0x26acb3[_0x0c26('0xde')]];}var _0x2fda26={'from':_0x673b45[_0x0c26('0xdc')],'firstName':_0x673b45[_0x0c26('0xa3')],'lastName':_0x673b45[_0x0c26('0xb2')],'mapKey':_0x0c26('0xdc'),'message':{'from':_0x673b45['email'],'to':_0x26acb3['MailAccount'][_0x0c26('0xdc')],'cc':'','subject':_[_0x0c26('0x75')](_0xd99ea6)?_0x26acb3[_0x0c26('0xe1')]:_0xd99ea6,'messageId':'','sentAt':new Date(),'attach':_0x3812ce[_0x0c26('0x3e')],'attachments':_0x3812ce,'originChannel':_0x0c26('0xe2'),'ChatWebsiteId':_0x26acb3['id'],'ChatOfflineMessageId':_0x589805['id'],'originTo':_0x26acb3[_0x0c26('0xd4')][_0x0c26('0xdc')]},'body':_0x589805[_0x0c26('0x4f')]};var _0x2c3fc7={'account':{'id':_0x26acb3[_0x0c26('0xdd')]},'body':_0x2fda26,'log':_0x0c26('0xe3')};return respondWithRpcPromise(_0x0c26('0xe3'),_0x0c26('0xe4'),_0x2c3fc7,client9001)[_0x0c26('0x26')](function(){return _0x589805;})[_0x0c26('0x4a')](function(_0x4bd1be){logger[_0x0c26('0x19')](_0x4bd1be);});}return;})[_0x0c26('0x26')](function(){if(_0x589805){return _0x589805;}})['then'](respondWithResult(_0x255410,null))[_0x0c26('0x4a')](function(_0x4ac77e){logger[_0x0c26('0x19')](_0x0c26('0x4a'),_0x4ac77e);for(var _0x46f56b of _0xe978e9){var _0x30f7bf=path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0xca'),_0x0c26('0xcb'),'attachments',_0x0c26('0xcd'),_0x46f56b['filename']);fs_extra['remove'](_0x30f7bf)['catch'](function(_0x5a27cd){logger[_0x0c26('0x19')](_0x0c26('0xe5'),_0x30f7bf,_0x5a27cd);});}});};exports['addInteraction']=function(_0x1db75b,_0x458b58){return db[_0x0c26('0xae')][_0x0c26('0x54')]({'where':{'id':_0x1db75b['params']['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x458b58,null))['then'](function(_0x4ec740){if(_0x4ec740){return _0x4ec740['addInteraction'](_0x1db75b[_0x0c26('0x4f')][_0x0c26('0x66')],_['omit'](_0x1db75b[_0x0c26('0x4f')],[_0x0c26('0x66'),'id'])||{});}})[_0x0c26('0x26')](respondWithResult(_0x458b58,null))['catch'](handleError(_0x458b58,null));};exports[_0x0c26('0xe6')]=function(_0x5b4fc1,_0x294948){var _0x4e089d={'raw':![],'where':{}};var _0x27b68d={};var _0x3493e6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0c26('0x5e')]({'where':{'id':_0x5b4fc1[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x294948,null))['then'](function(_0x11a39a){if(_0x11a39a){_0x27b68d[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db[_0x0c26('0xae')]['rawAttributes']);_0x27b68d[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x5b4fc1[_0x0c26('0x37')]);_0x27b68d[_0x0c26('0x39')]=_['intersection'](_0x27b68d[_0x0c26('0x3b')],_0x27b68d[_0x0c26('0x37')]);_0x4e089d[_0x0c26('0x3c')]=_[_0x0c26('0x3a')](_0x27b68d['model'],qs['fields'](_0x5b4fc1['query']['fields']));_0x4e089d[_0x0c26('0x3c')]=_0x4e089d['attributes'][_0x0c26('0x3e')]?_0x4e089d[_0x0c26('0x3c')]:_0x27b68d[_0x0c26('0x3b')];if(!_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0x3f')](_0x0c26('0x40'))){_0x4e089d[_0x0c26('0x20')]=qs[_0x0c26('0x20')](_0x5b4fc1[_0x0c26('0x37')]['limit']);_0x4e089d[_0x0c26('0x22')]=qs[_0x0c26('0x22')](_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0x22')]);}_0x4e089d[_0x0c26('0x60')]=qs[_0x0c26('0x41')](_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0x41')]);_0x4e089d[_0x0c26('0x42')]=qs['filters'](_[_0x0c26('0x43')](_0x5b4fc1[_0x0c26('0x37')],_0x27b68d[_0x0c26('0x39')]));_0x4e089d[_0x0c26('0x42')][_0x0c26('0x5b')]=_0x11a39a['id'];if(_0x5b4fc1['query']['filter']){_0x4e089d[_0x0c26('0x42')]=_['merge'](_0x4e089d[_0x0c26('0x42')],{'$or':_[_0x0c26('0x31')](_0x4e089d['attributes'],function(_0x324971){var _0x379537={};_0x379537[_0x324971]={'$like':'%'+_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0x44')]+'%'};return _0x379537;})});}_0x4e089d=_[_0x0c26('0x45')]({},_0x4e089d,_0x5b4fc1[_0x0c26('0x4d')]);return db[_0x0c26('0xae')][_0x0c26('0x21')]({'where':_0x4e089d['where']})[_0x0c26('0x26')](function(_0x4a33f5){_0x3493e6['count']=_0x4a33f5;if(_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0x4c')]){_0x4e089d[_0x0c26('0x47')]=[{'model':db[_0x0c26('0x84')],'as':_0x0c26('0xe7'),'required':![]},{'model':db[_0x0c26('0xb9')],'as':_0x0c26('0xe8'),'attributes':['name','fullname',_0x0c26('0xe9')],'required':![]},{'model':db[_0x0c26('0xea')],'as':'Tags','attributes':['id',_0x0c26('0x36'),'color'],'where':_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0xeb')]?{'id':_0x5b4fc1['query']['tag']}:undefined,'required':_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0xeb')]?!![]:![]}];}return db['ChatInteraction'][_0x0c26('0x48')](_0x4e089d);})[_0x0c26('0x26')](function(_0x240bc7){_0x3493e6['rows']=_0x240bc7;return _0x3493e6;});}})['then'](respondWithFilteredResult(_0x294948,_0x4e089d))[_0x0c26('0x4a')](handleError(_0x294948,null));};function iftimePromise(_0x438aca,_0x28ede3){return respondWithRpcPromise('Command','getSnippet',{'command':_0x28ede3[_0x0c26('0xec')]?util[_0x0c26('0xa8')](_0x0c26('0xed'),_0x438aca[_0x0c26('0xee')],_0x28ede3['timezone']):util[_0x0c26('0xa8')](_0x0c26('0xef'),_0x438aca[_0x0c26('0xee')])},client9002)[_0x0c26('0x26')](function(_0x2871c1){var _0x103e49=_0x2871c1&&_0x2871c1[_0x0c26('0xf0')]('true')>=0x0?!![]:![];logger[_0x0c26('0x13')](_0x0c26('0xf1'),_0x28ede3['id'],_0x438aca['id'],_0x438aca[_0x0c26('0xee')],_0x103e49?_0x0c26('0xf2'):_0x0c26('0xf3'),_0x28ede3[_0x0c26('0xec')]?_0x28ede3[_0x0c26('0xec')]:_0x0c26('0xf4'));return _0x103e49;})[_0x0c26('0x4a')](function(_0x315c01){logger[_0x0c26('0x19')](_0x0c26('0xf1'),_0x28ede3['id'],_0x438aca['id'],_0x438aca[_0x0c26('0xee')],util[_0x0c26('0xf5')](_0x315c01,{'showHidden':![],'depth':null}),_0x28ede3['timezone']?_0x28ede3[_0x0c26('0xec')]:_0x0c26('0xf4'));return![];});}exports[_0x0c26('0xf6')]=function(_0x4302a7,_0x24534d){var _0x6f3c9d=0x0;var _0x112d15=0x0;var _0x51d8d2=![];var _0x2b4ca2;var _0x4959bd;return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x4302a7[_0x0c26('0x58')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x0c26('0xf7')],'as':_0x0c26('0xf8'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x0c26('0x26')](handleEntityNotFound(_0x24534d,null))[_0x0c26('0x26')](function(_0xad6339){if(_0xad6339){_0x2b4ca2=_0xad6339;return _0xad6339[_0x0c26('0xf9')]({'raw':!![]});}})[_0x0c26('0x26')](function(_0x5ad1a5){if(_0x2b4ca2){if(_0x5ad1a5){_0x4959bd=_0x5ad1a5;}}return require(_0x0c26('0x74'))['getLicense']();})[_0x0c26('0x26')](function(_0x37f0fb){if(_0x37f0fb){_0x112d15=_0x37f0fb[_0x0c26('0xfa')];_0x51d8d2=_0x37f0fb[_0x0c26('0xfb')];}})[_0x0c26('0x26')](function(){return db[_0x0c26('0xae')]['count']({'where':{'closed':![]}});})['then'](function(_0xff5854){_0x6f3c9d=_0xff5854;if(_0x112d15&&_0xff5854>_0x112d15){return db[_0x0c26('0xfc')][_0x0c26('0x5e')]({'where':{'id':0x1}})[_0x0c26('0x26')](function(_0x511f3c){if(_0x511f3c){_0x511f3c['increment'](_0x0c26('0xfd'));}});}})[_0x0c26('0x26')](function(){if(_0x2b4ca2[_0x0c26('0xf7')]&&_0x2b4ca2[_0x0c26('0xf7')][_0x0c26('0xf8')]){var _0x5c4a9e=[];for(var _0x3bb917=0x0;_0x3bb917<_0x2b4ca2['Interval'][_0x0c26('0xf8')]['length'];_0x3bb917++){var _0x57f5f4=_0x2b4ca2[_0x0c26('0xf7')][_0x0c26('0xf8')][_0x3bb917][_0x0c26('0x27')]({'plain':!![]});_0x5c4a9e['push'](iftimePromise(_0x57f5f4,_0x2b4ca2));}return BPromise[_0x0c26('0xfe')](_0x5c4a9e)['then'](function(_0x528fd0){return _['some'](_0x528fd0);});}else{return!![];}})[_0x0c26('0x26')](function(_0x55ef1b){var _0x5a4ddf=fs[_0x0c26('0xc4')](path[_0x0c26('0x72')](config['root'],_0x0c26('0xff')),'utf8');var _0x403408={'remote':_0x2b4ca2[_0x0c26('0x100')],'query':querystring['stringify'](_[_0x0c26('0x45')](_0x2b4ca2[_0x0c26('0x27')]({'plain':!![]}),{'customerIp':_0x4302a7[_0x0c26('0x81')]['x-forwarded-for']||_0x4302a7['headers']['x-real-ip']||_0x4302a7[_0x0c26('0x101')][_0x0c26('0x102')]||_0x4302a7['ip'],'referer':_0x4302a7[_0x0c26('0x81')]['referer'],'openedInteractions':_0x6f3c9d,'maxInteractions':_0x112d15,'virtual':_0x51d8d2[_0x0c26('0xfa')],'online':_0x55ef1b,'custom':_0x51d8d2}))[_0x0c26('0x103')](/'/g,'\x5c\x27')};_0x24534d[_0x0c26('0x2d')](ejs['render'](Mustache[_0x0c26('0x104')](_0x5a4ddf,_0x403408),{'proactiveActions':_0x4959bd,'alignment':_0x2b4ca2[_0x0c26('0x105')],'verticalAlignment':_0x2b4ca2[_0x0c26('0x106')],'div_color':_0x2b4ca2[_0x0c26('0x107')],'labelText':_0x2b4ca2['labelText'],'text_color':_0x2b4ca2[_0x0c26('0x108')],'text_button_color':_0x2b4ca2[_0x0c26('0x109')],'button_color':_0x2b4ca2[_0x0c26('0x10a')],'background_color':_0x2b4ca2['backgroundColor'],'hideWhenOffline':_0x2b4ca2[_0x0c26('0x10b')],'interval':_0x2b4ca2[_0x0c26('0x10c')]}));})[_0x0c26('0x4a')](handleError(_0x24534d,null));};exports[_0x0c26('0x10d')]=function(_0x517eae,_0x1e68ad){var _0x58dd99=_0x517eae[_0x0c26('0x58')]['id'];var _0x29883d=_0x517eae[_0x0c26('0x4f')];var _0x4d7e1a=0xc8;var _0x543fe1=null;return db[_0x0c26('0xd0')][_0x0c26('0xd1')]({'isolationLevel':db[_0x0c26('0xd0')]['Transaction'][_0x0c26('0x10e')][_0x0c26('0x10f')]},function(_0x2191b1){return db['ChatWebsite']['findOne']({'where':{'id':_0x58dd99},'transaction':_0x2191b1})[_0x0c26('0x26')](function(_0x431bdd){if(_0x431bdd){return db[_0x0c26('0x95')][_0x0c26('0x2a')]({'where':{'ChatWebsiteId':_0x58dd99},'transaction':_0x2191b1})['then'](function(){var _0x2bf222=_['map'](_0x29883d,function(_0x31c3d4){_0x31c3d4[_0x0c26('0x5b')]=_0x58dd99;return _0x31c3d4;});return db[_0x0c26('0x95')][_0x0c26('0xd3')](_0x2bf222,{'transaction':_0x2191b1});});}else{_0x4d7e1a=0x194;_0x543fe1=[];}});})[_0x0c26('0x26')](function(){if(_0x4d7e1a!==0x194){return db['ChatApplication'][_0x0c26('0x110')]({'where':{'ChatWebsiteId':_0x58dd99},'order':_0x0c26('0x9a')})[_0x0c26('0x26')](function(_0x1e6e98){_0x543fe1=_0x1e6e98;});}})[_0x0c26('0x4a')](function(_0x36e78e){_0x4d7e1a=0x1f4;logger[_0x0c26('0x19')](_0x36e78e[_0x0c26('0x2c')]);if(_0x36e78e['name']){delete _0x36e78e[_0x0c26('0x36')];}_0x543fe1=_0x36e78e;})['finally'](function(){if(_0x543fe1===null){_0x1e68ad[_0x0c26('0x1c')](_0x4d7e1a);}else{if(_0x4d7e1a===0x1f4){_0x1e68ad[_0x0c26('0x1d')](_0x4d7e1a)['send'](_0x543fe1);}else{_0x1e68ad[_0x0c26('0x1d')](_0x4d7e1a)[_0x0c26('0x1e')](_0x543fe1);}}});};exports[_0x0c26('0x111')]=function(_0x368153,_0x578d57){var _0x2db291={};var _0x5a2fad={};var _0x3494f1;var _0x125d7d;return db[_0x0c26('0x32')]['findOne']({'where':{'id':_0x368153[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x578d57,null))[_0x0c26('0x26')](function(_0x4ada80){if(_0x4ada80){_0x3494f1=_0x4ada80;_0x5a2fad[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db[_0x0c26('0x95')][_0x0c26('0x5f')]);_0x5a2fad[_0x0c26('0x37')]=_['keys'](_0x368153[_0x0c26('0x37')]);_0x5a2fad[_0x0c26('0x39')]=_[_0x0c26('0x3a')](_0x5a2fad['model'],_0x5a2fad[_0x0c26('0x37')]);_0x2db291[_0x0c26('0x3c')]=_[_0x0c26('0x3a')](_0x5a2fad[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x368153[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x2db291[_0x0c26('0x3c')]=_0x2db291[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x2db291[_0x0c26('0x3c')]:_0x5a2fad[_0x0c26('0x3b')];_0x2db291[_0x0c26('0x60')]=qs[_0x0c26('0x41')](_0x368153['query'][_0x0c26('0x41')]);_0x2db291['where']=qs[_0x0c26('0x39')](_[_0x0c26('0x43')](_0x368153[_0x0c26('0x37')],_0x5a2fad[_0x0c26('0x39')]));if(_0x368153['query']['filter']){_0x2db291['where']=_[_0x0c26('0x45')](_0x2db291[_0x0c26('0x42')],{'$or':_[_0x0c26('0x31')](_0x2db291[_0x0c26('0x3c')],function(_0x11d539){var _0x598b9f={};_0x598b9f[_0x11d539]={'$like':'%'+_0x368153[_0x0c26('0x37')][_0x0c26('0x44')]+'%'};return _0x598b9f;})});}_0x2db291=_[_0x0c26('0x45')]({},_0x2db291,_0x368153['options']);return _0x3494f1[_0x0c26('0x111')](_0x2db291);}})[_0x0c26('0x26')](function(_0x5edb4d){if(_0x5edb4d){_0x125d7d=_0x5edb4d[_0x0c26('0x3e')];if(!_0x368153[_0x0c26('0x37')][_0x0c26('0x3f')]('nolimit')){_0x2db291[_0x0c26('0x20')]=qs[_0x0c26('0x20')](_0x368153[_0x0c26('0x37')][_0x0c26('0x20')]);_0x2db291[_0x0c26('0x22')]=qs['offset'](_0x368153[_0x0c26('0x37')][_0x0c26('0x22')]);}return _0x3494f1[_0x0c26('0x111')](_0x2db291);}})['then'](function(_0x16d496){if(_0x16d496){return _0x16d496?{'count':_0x125d7d,'rows':_0x16d496}:null;}})['then'](respondWithResult(_0x578d57,null))[_0x0c26('0x4a')](handleError(_0x578d57,null));};exports[_0x0c26('0x112')]=function(_0x1d22d3,_0x1ac3c5){return db[_0x0c26('0x113')]['find']({'where':{'id':_0x1d22d3[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x1ac3c5,null))[_0x0c26('0x26')](function(_0x5882c1){if(_0x5882c1){return _0x5882c1[_0x0c26('0x112')](_0x1d22d3[_0x0c26('0x4f')][_0x0c26('0x66')],_[_0x0c26('0x114')](_0x1d22d3['body'],['ids','id'])||{});}})[_0x0c26('0x26')](respondWithResult(_0x1ac3c5,null))['catch'](handleError(_0x1ac3c5,null));};exports['getProactiveActions']=function(_0x1142dd,_0x4f8747){var _0x43b36c={};var _0x754183={};var _0x5f5974;var _0x3022c;return db[_0x0c26('0x32')]['findOne']({'where':{'id':_0x1142dd[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x4f8747,null))[_0x0c26('0x26')](function(_0x20d568){if(_0x20d568){_0x5f5974=_0x20d568;_0x754183[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db['ChatProactiveAction'][_0x0c26('0x5f')]);_0x754183[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x1142dd['query']);_0x754183[_0x0c26('0x39')]=_[_0x0c26('0x3a')](_0x754183[_0x0c26('0x3b')],_0x754183[_0x0c26('0x37')]);_0x43b36c['attributes']=_['intersection'](_0x754183[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x1142dd[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x43b36c[_0x0c26('0x3c')]=_0x43b36c['attributes'][_0x0c26('0x3e')]?_0x43b36c[_0x0c26('0x3c')]:_0x754183[_0x0c26('0x3b')];_0x43b36c[_0x0c26('0x60')]=qs[_0x0c26('0x41')](_0x1142dd[_0x0c26('0x37')][_0x0c26('0x41')]);_0x43b36c[_0x0c26('0x42')]=qs[_0x0c26('0x39')](_[_0x0c26('0x43')](_0x1142dd['query'],_0x754183['filters']));if(_0x1142dd[_0x0c26('0x37')][_0x0c26('0x44')]){_0x43b36c['where']=_[_0x0c26('0x45')](_0x43b36c['where'],{'$or':_[_0x0c26('0x31')](_0x43b36c['attributes'],function(_0x4ff5b9){var _0x88454e={};_0x88454e[_0x4ff5b9]={'$like':'%'+_0x1142dd['query']['filter']+'%'};return _0x88454e;})});}_0x43b36c=_[_0x0c26('0x45')]({},_0x43b36c,_0x1142dd[_0x0c26('0x4d')]);return _0x5f5974[_0x0c26('0xf9')](_0x43b36c);}})[_0x0c26('0x26')](function(_0x872dd0){if(_0x872dd0){_0x3022c=_0x872dd0['length'];if(!_0x1142dd[_0x0c26('0x37')][_0x0c26('0x3f')](_0x0c26('0x40'))){_0x43b36c['limit']=qs[_0x0c26('0x20')](_0x1142dd[_0x0c26('0x37')][_0x0c26('0x20')]);_0x43b36c[_0x0c26('0x22')]=qs['offset'](_0x1142dd[_0x0c26('0x37')][_0x0c26('0x22')]);}return _0x5f5974['getProactiveActions'](_0x43b36c);}})[_0x0c26('0x26')](function(_0x45da80){if(_0x45da80){return _0x45da80?{'count':_0x3022c,'rows':_0x45da80}:null;}})[_0x0c26('0x26')](respondWithResult(_0x4f8747,null))[_0x0c26('0x4a')](handleError(_0x4f8747,null));};exports[_0x0c26('0x115')]=function(_0x536f1c,_0x51fd51){var _0x65aad5=_0x536f1c[_0x0c26('0x37')][_0x0c26('0x116')]===_0x0c26('0x117')?_0x0c26('0x118'):_0x0c26('0x119');return db[_0x0c26('0x32')][_0x0c26('0x54')]({'attributes':['id',_0x65aad5],'where':{'id':_0x536f1c[_0x0c26('0x58')]['id']}})['then'](handleEntityNotFound(_0x51fd51,null))[_0x0c26('0x26')](function(_0x30c377){if(_0x30c377){var _0x1638ed=_0x30c377[_0x65aad5];var _0x3cc2ff=_0x1638ed&&_0x1638ed[_0x0c26('0x11a')]?_0x1638ed[_0x0c26('0x11a')]:[];_0x51fd51[_0x0c26('0x2d')]({'fromKey':_['isNil'](_0x1638ed['fromKey'])?undefined:_0x1638ed[_0x0c26('0x11b')],'count':_0x3cc2ff[_0x0c26('0x3e')],'rows':_0x3cc2ff});}})[_0x0c26('0x4a')](handleError(_0x51fd51,null));};exports[_0x0c26('0x11c')]=function(_0x2addb1,_0x4d382d){var _0x59d7fe={'raw':![],'where':{}};var _0x3843f6={};var _0x3db9c6={'count':0x0,'rows':[]};return db[_0x0c26('0x32')][_0x0c26('0x5e')]({'where':{'id':_0x2addb1[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x4d382d,null))[_0x0c26('0x26')](function(_0x12b24b){if(_0x12b24b){_0x3843f6[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db[_0x0c26('0x11d')][_0x0c26('0x5f')]);_0x3843f6[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x2addb1[_0x0c26('0x37')]);_0x3843f6[_0x0c26('0x39')]=_[_0x0c26('0x3a')](_0x3843f6['model'],_0x3843f6[_0x0c26('0x37')]);_0x59d7fe[_0x0c26('0x3c')]=_[_0x0c26('0x3a')](_0x3843f6[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x2addb1[_0x0c26('0x37')]['fields']));_0x59d7fe[_0x0c26('0x3c')]=_0x59d7fe[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x59d7fe[_0x0c26('0x3c')]:_0x3843f6[_0x0c26('0x3b')];if(!_0x2addb1['query'][_0x0c26('0x3f')](_0x0c26('0x40'))){_0x59d7fe[_0x0c26('0x20')]=qs['limit'](_0x2addb1[_0x0c26('0x37')]['limit']);_0x59d7fe[_0x0c26('0x22')]=qs['offset'](_0x2addb1[_0x0c26('0x37')][_0x0c26('0x22')]);}_0x59d7fe['order']=qs[_0x0c26('0x41')](_0x2addb1[_0x0c26('0x37')]['sort']);_0x59d7fe['where']=qs[_0x0c26('0x39')](_['pick'](_0x2addb1[_0x0c26('0x37')],_0x3843f6[_0x0c26('0x39')]));_0x59d7fe[_0x0c26('0x42')][_0x0c26('0x5b')]=_0x12b24b['id'];if(_0x2addb1[_0x0c26('0x37')]['filter']){_0x59d7fe[_0x0c26('0x42')]=_[_0x0c26('0x45')](_0x59d7fe[_0x0c26('0x42')],{'$or':_[_0x0c26('0x31')](_0x59d7fe['attributes'],function(_0x18d991){var _0x581c2f={};_0x581c2f[_0x18d991]={'$like':'%'+_0x2addb1['query']['filter']+'%'};return _0x581c2f;})});}_0x59d7fe=_[_0x0c26('0x45')]({},_0x59d7fe,_0x2addb1['options']);return db[_0x0c26('0x11d')][_0x0c26('0x21')]({'where':_0x59d7fe[_0x0c26('0x42')]})[_0x0c26('0x26')](function(_0x16239c){_0x3db9c6[_0x0c26('0x21')]=_0x16239c;if(_0x2addb1[_0x0c26('0x37')][_0x0c26('0x4c')]){_0x59d7fe[_0x0c26('0x47')]=[{'all':!![]}];}else{_0x59d7fe[_0x0c26('0x47')]=[{'model':db[_0x0c26('0x84')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0x0c26('0x11e'),'required':![]}];}return db[_0x0c26('0x11d')][_0x0c26('0x48')](_0x59d7fe);})[_0x0c26('0x26')](function(_0x2f6a06){_0x3db9c6[_0x0c26('0x49')]=_0x2f6a06;return _0x3db9c6;});}})[_0x0c26('0x26')](respondWithFilteredResult(_0x4d382d,_0x59d7fe))[_0x0c26('0x4a')](handleError(_0x4d382d,null));};exports[_0x0c26('0x11f')]=function(_0x4de05e,_0x5c8c19){return db[_0x0c26('0x32')]['find']({'where':{'id':_0x4de05e[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x5c8c19,null))['then'](function(_0x5086a6){if(_0x5086a6){return _0x5086a6['addAgents'](_0x4de05e['body'][_0x0c26('0x66')],_['omit'](_0x4de05e[_0x0c26('0x4f')],[_0x0c26('0x66'),'id'])||{})['spread'](function(_0x483a02){for(var _0x4a7f42=0x0;_0x4a7f42<_0x4de05e[_0x0c26('0x4f')][_0x0c26('0x66')][_0x0c26('0x3e')];_0x4a7f42+=0x1){socket[_0x0c26('0x120')](_0x0c26('0x121'),{'UserId':Number(_0x4de05e[_0x0c26('0x4f')][_0x0c26('0x66')][_0x4a7f42]),'ChatWebsiteId':Number(_0x4de05e[_0x0c26('0x58')]['id'])});}return _0x483a02;});}})['then'](respondWithResult(_0x5c8c19,null))[_0x0c26('0x4a')](handleError(_0x5c8c19,null));};exports[_0x0c26('0x122')]=function(_0x590e3f,_0x2f44d9){return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x590e3f[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x2f44d9,null))['then'](function(_0x518cb9){if(_0x518cb9){return _0x518cb9[_0x0c26('0x122')](_0x590e3f[_0x0c26('0x37')][_0x0c26('0x66')])['then'](function(){if(_['isArray'](_0x590e3f[_0x0c26('0x37')][_0x0c26('0x66')])){for(var _0x3c41=0x0;_0x3c41<_0x590e3f['query']['ids'][_0x0c26('0x3e')];_0x3c41+=0x1){socket['emit'](_0x0c26('0x123'),{'UserId':Number(_0x590e3f['query'][_0x0c26('0x66')][_0x3c41]),'ChatWebsiteId':Number(_0x590e3f[_0x0c26('0x58')]['id'])});}}else{socket[_0x0c26('0x120')]('userChatWebsite:remove',{'UserId':Number(_0x590e3f[_0x0c26('0x37')][_0x0c26('0x66')]),'ChatWebsiteId':Number(_0x590e3f[_0x0c26('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x2f44d9,null))[_0x0c26('0x4a')](handleError(_0x2f44d9,null));};exports[_0x0c26('0x124')]=function(_0x312fee,_0x3bb9b7){var _0x344709={};var _0x35348c={};var _0x57cdc6;var _0x13f768;return db[_0x0c26('0x32')][_0x0c26('0x5e')]({'where':{'id':_0x312fee[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x3bb9b7,null))['then'](function(_0xa3a47b){if(_0xa3a47b){_0x57cdc6=_0xa3a47b;_0x35348c[_0x0c26('0x3b')]=_['keys'](db['User'][_0x0c26('0x5f')]);_0x35348c[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x312fee['query']);_0x35348c['filters']=_['intersection'](_0x35348c[_0x0c26('0x3b')],_0x35348c[_0x0c26('0x37')]);_0x344709[_0x0c26('0x3c')]=_['intersection'](_0x35348c[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x312fee[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x344709[_0x0c26('0x3c')]=_0x344709[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x344709[_0x0c26('0x3c')]:_0x35348c[_0x0c26('0x3b')];_0x344709[_0x0c26('0x60')]=qs[_0x0c26('0x41')](_0x312fee['query'][_0x0c26('0x41')]);_0x344709[_0x0c26('0x42')]=qs['filters'](_['pick'](_0x312fee[_0x0c26('0x37')],_0x35348c[_0x0c26('0x39')]));if(_0x312fee[_0x0c26('0x37')][_0x0c26('0x44')]){_0x344709[_0x0c26('0x42')]=_['merge'](_0x344709[_0x0c26('0x42')],{'$or':_['map'](_0x344709['attributes'],function(_0x3c10d5){var _0x47bc2a={};_0x47bc2a[_0x3c10d5]={'$like':'%'+_0x312fee['query'][_0x0c26('0x44')]+'%'};return _0x47bc2a;})});}_0x344709=_[_0x0c26('0x45')]({},_0x344709,_0x312fee[_0x0c26('0x4d')]);return _0x57cdc6[_0x0c26('0x124')](_0x344709);}})[_0x0c26('0x26')](function(_0x285151){if(_0x285151){_0x13f768=_0x285151[_0x0c26('0x3e')];if(!_0x312fee[_0x0c26('0x37')][_0x0c26('0x3f')]('nolimit')){_0x344709[_0x0c26('0x20')]=qs['limit'](_0x312fee[_0x0c26('0x37')][_0x0c26('0x20')]);_0x344709[_0x0c26('0x22')]=qs[_0x0c26('0x22')](_0x312fee[_0x0c26('0x37')][_0x0c26('0x22')]);}return _0x57cdc6[_0x0c26('0x124')](_0x344709);}})['then'](function(_0x222683){if(_0x222683){return _0x222683?{'count':_0x13f768,'rows':_0x222683}:null;}})[_0x0c26('0x26')](respondWithResult(_0x3bb9b7,null))[_0x0c26('0x4a')](handleError(_0x3bb9b7,null));};
\ No newline at end of file
+var _0xb36a=['setUA','user-agent','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','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','CmList','List','Contacts','DESC','Applications','applications','list','orderBy','priority','account','customerIp','cf-connecting-ip','headers','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','interaction','contact','lastName','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','server','attachments','basename','openNewInteraction','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','addInteraction','omit','getInteractions','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','remote','x-real-ip','connection','replace','render','alignment','labelText','textButtonColor','color_button','IntervalId','sequelize','Transaction','READ_COMMITTED','ChatApplication','bulkCreate','stack','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachment','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatWebsite','includeAll','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','length','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','customerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify'];(function(_0x2d12b1,_0x3e6443){var _0xf59bd2=function(_0x208417){while(--_0x208417){_0x2d12b1['push'](_0x2d12b1['shift']());}};_0xf59bd2(++_0x3e6443);}(_0xb36a,0x1cd));var _0xab36=function(_0x35961d,_0xd83321){_0x35961d=_0x35961d-0x0;var _0x31ad42=_0xb36a[_0x35961d];return _0x31ad42;};'use strict';var BPromise=require(_0xab36('0x0'));var Mustache=require(_0xab36('0x1'));var util=require(_0xab36('0x2'));var path=require(_0xab36('0x3'));var ejs=require(_0xab36('0x4'));var fs=require('fs');var fs_extra=require(_0xab36('0x5'));var _=require(_0xab36('0x6'));var querystring=require(_0xab36('0x7'));var Redis=require(_0xab36('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0xab36('0x9'))('api');var config=require(_0xab36('0xa'));var db=require(_0xab36('0xb'))['db'];config[_0xab36('0xc')]=_[_0xab36('0xd')](config[_0xab36('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab36('0xc')]));require(_0xab36('0xe'))[_0xab36('0xf')](socket);var htmlToText=require(_0xab36('0x10'));var jayson=require(_0xab36('0x11'));var client=jayson[_0xab36('0x12')]['http']({'port':0x232c});var client9002=jayson[_0xab36('0x12')][_0xab36('0x13')]({'port':0x232a});var client9003=jayson[_0xab36('0x12')][_0xab36('0x13')]({'port':0x232b});var client9001=jayson[_0xab36('0x12')][_0xab36('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x3790d0,_0x3c702c,_0x366d6e,_0x2cda42){return new BPromise(function(_0x5558bf,_0x4c51f7){var _0x581661=_0x2cda42||client;return _0x581661[_0xab36('0x14')](_0x3790d0,_0x366d6e)[_0xab36('0x15')](function(_0x37eee6){logger[_0xab36('0x16')](_0xab36('0x17'),_0x3c702c,'request\x20sent');logger[_0xab36('0x18')](_0xab36('0x19'),_0x3c702c,_0xab36('0x1a'),JSON['stringify'](_0x37eee6));if(_0x37eee6[_0xab36('0x1b')]){if(_0x37eee6[_0xab36('0x1b')][_0xab36('0x1c')]===0x1f4){logger[_0xab36('0x1b')](_0xab36('0x17'),_0x3c702c,_0x37eee6[_0xab36('0x1b')][_0xab36('0x1d')]);return _0x4c51f7(_0x37eee6[_0xab36('0x1b')][_0xab36('0x1d')]);}logger[_0xab36('0x1b')](_0xab36('0x17'),_0x3c702c,_0x37eee6[_0xab36('0x1b')][_0xab36('0x1d')]);return _0x5558bf(_0x37eee6[_0xab36('0x1b')][_0xab36('0x1d')]);}else{logger['info'](_0xab36('0x17'),_0x3c702c,_0xab36('0x1a'));_0x5558bf(_0x37eee6[_0xab36('0x1e')][_0xab36('0x1d')]);}})[_0xab36('0x1f')](function(_0x4a6e6a){logger[_0xab36('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x3c702c,_0x4a6e6a);_0x4c51f7(_0x4a6e6a);});});}function respondWithStatusCode(_0x5bed0f,_0x2efeca){_0x2efeca=_0x2efeca||0xcc;return function(_0x5350df){if(_0x5350df){return _0x5bed0f['sendStatus'](_0x2efeca);}return _0x5bed0f[_0xab36('0x20')](_0x2efeca)[_0xab36('0x21')]();};}function respondWithResult(_0x37f603,_0xdae847){_0xdae847=_0xdae847||0xc8;return function(_0x424cfb){if(_0x424cfb){return _0x37f603[_0xab36('0x20')](_0xdae847)[_0xab36('0x22')](_0x424cfb);}};}function respondWithFilteredResult(_0x4cb782,_0x4616e3){return function(_0x23f8c8){if(_0x23f8c8){var _0x1b25e8=typeof _0x4616e3[_0xab36('0x23')]==='undefined'&&typeof _0x4616e3[_0xab36('0x24')]===_0xab36('0x25');var _0x4b3bd8=_0x23f8c8[_0xab36('0x26')];var _0xbffcdc=_0x1b25e8?0x0:_0x4616e3[_0xab36('0x23')];var _0x4e3a0f=_0x1b25e8?_0x23f8c8[_0xab36('0x26')]:_0x4616e3['offset']+_0x4616e3[_0xab36('0x24')];var _0x2863d2;if(_0x4e3a0f>=_0x4b3bd8){_0x4e3a0f=_0x4b3bd8;_0x2863d2=0xc8;}else{_0x2863d2=0xce;}_0x4cb782[_0xab36('0x20')](_0x2863d2);return _0x4cb782[_0xab36('0x27')](_0xab36('0x28'),_0xbffcdc+'-'+_0x4e3a0f+'/'+_0x4b3bd8)[_0xab36('0x22')](_0x23f8c8);}return null;};}function saveUpdates(_0x483058){return function(_0x3435bf){if(_0x3435bf){return _0x3435bf[_0xab36('0x29')](_0x483058)[_0xab36('0x15')](function(_0x2147a3){return _0x2147a3;});}return null;};}function removeEntity(_0x18d144){return function(_0x444d14){if(_0x444d14){return _0x444d14[_0xab36('0x2a')]()[_0xab36('0x15')](function(){var _0x41f4fe=_0x444d14[_0xab36('0x2b')]({'plain':!![]});var _0x32d82f=_0xab36('0x2c');return db[_0xab36('0x2d')][_0xab36('0x2a')]({'where':{'type':_0x32d82f,'resourceId':_0x41f4fe['id']}})[_0xab36('0x15')](function(){return _0x444d14;});})[_0xab36('0x15')](function(){_0x18d144[_0xab36('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55e552){return function(_0x2d50b9){if(!_0x2d50b9){_0x55e552[_0xab36('0x2e')](0x194);}return _0x2d50b9;};}function handleError(_0x2caf29,_0xbe9498){_0xbe9498=_0xbe9498||0x1f4;return function(_0x367f69){logger[_0xab36('0x1b')](_0x367f69['stack']);if(_0x367f69[_0xab36('0x2f')]){delete _0x367f69[_0xab36('0x2f')];}_0x2caf29[_0xab36('0x20')](_0xbe9498)['send'](_0x367f69);};}exports[_0xab36('0x30')]=function(_0x23a17a,_0x58409b){var _0x3e20ae={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x299efc={},_0x250f41={'count':0x0,'rows':[]};var _0x4a1f85=_[_0xab36('0x31')](db['ChatWebsite']['rawAttributes'],function(_0x488a6f){return{'name':_0x488a6f[_0xab36('0x32')],'type':_0x488a6f[_0xab36('0x33')][_0xab36('0x34')]};});_0x299efc[_0xab36('0x35')]=_[_0xab36('0x31')](_0x4a1f85,_0xab36('0x2f'));_0x299efc[_0xab36('0x36')]=_[_0xab36('0x37')](_0x23a17a['query']);_0x299efc[_0xab36('0x38')]=_[_0xab36('0x39')](_0x299efc[_0xab36('0x35')],_0x299efc['query']);_0x3e20ae['attributes']=_[_0xab36('0x39')](_0x299efc[_0xab36('0x35')],qs[_0xab36('0x3a')](_0x23a17a[_0xab36('0x36')]['fields']));_0x3e20ae['attributes']=_0x3e20ae[_0xab36('0x3b')]['length']?_0x3e20ae['attributes']:_0x299efc[_0xab36('0x35')];if(!_0x23a17a['query']['hasOwnProperty'](_0xab36('0x3c'))){_0x3e20ae[_0xab36('0x24')]=qs[_0xab36('0x24')](_0x23a17a[_0xab36('0x36')][_0xab36('0x24')]);_0x3e20ae[_0xab36('0x23')]=qs[_0xab36('0x23')](_0x23a17a[_0xab36('0x36')][_0xab36('0x23')]);}_0x3e20ae[_0xab36('0x3d')]=qs[_0xab36('0x3e')](_0x23a17a['query'][_0xab36('0x3e')]);_0x3e20ae[_0xab36('0x3f')]=qs[_0xab36('0x38')](_[_0xab36('0x40')](_0x23a17a[_0xab36('0x36')],_0x299efc['filters']),_0x4a1f85);if(_0x23a17a[_0xab36('0x36')][_0xab36('0x41')]){_0x3e20ae[_0xab36('0x3f')]=_[_0xab36('0x42')](_0x3e20ae[_0xab36('0x3f')],{'$or':_[_0xab36('0x31')](_0x4a1f85,function(_0x57fccc){if(_0x57fccc[_0xab36('0x33')]!==_0xab36('0x43')){var _0x252473={};_0x252473[_0x57fccc[_0xab36('0x2f')]]={'$like':'%'+_0x23a17a['query'][_0xab36('0x41')]+'%'};return _0x252473;}})});}_0x3e20ae=_[_0xab36('0x42')]({},_0x3e20ae,_0x23a17a[_0xab36('0x44')]);var _0x242e83={'where':_0x3e20ae['where']};return db[_0xab36('0x45')][_0xab36('0x26')](_0x242e83)[_0xab36('0x15')](function(_0x307549){_0x250f41[_0xab36('0x26')]=_0x307549;if(_0x23a17a[_0xab36('0x36')][_0xab36('0x46')]){_0x3e20ae['include']=[{'all':!![]}];}return db[_0xab36('0x45')][_0xab36('0x47')](_0x3e20ae);})['then'](function(_0x53aace){_0x250f41[_0xab36('0x48')]=_0x53aace;return _0x250f41;})['then'](respondWithFilteredResult(_0x58409b,_0x3e20ae))[_0xab36('0x1f')](handleError(_0x58409b,null));};exports[_0xab36('0x49')]=function(_0x40c053,_0x44d62c){var _0x47124d={'raw':![],'where':{'id':_0x40c053[_0xab36('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0xab36('0x4b')}]},_0x30e24e={};_0x30e24e['model']=_[_0xab36('0x37')](db[_0xab36('0x45')][_0xab36('0x4c')]);_0x30e24e[_0xab36('0x36')]=_[_0xab36('0x37')](_0x40c053[_0xab36('0x36')]);_0x30e24e[_0xab36('0x38')]=_['intersection'](_0x30e24e[_0xab36('0x35')],_0x30e24e[_0xab36('0x36')]);_0x47124d[_0xab36('0x3b')]=_[_0xab36('0x39')](_0x30e24e['model'],qs[_0xab36('0x3a')](_0x40c053[_0xab36('0x36')][_0xab36('0x3a')]));_0x47124d[_0xab36('0x3b')]=_0x47124d[_0xab36('0x3b')][_0xab36('0x4d')]?_0x47124d['attributes']:_0x30e24e[_0xab36('0x35')];if(_0x40c053[_0xab36('0x36')][_0xab36('0x46')]){_0x47124d[_0xab36('0x4e')]=[{'all':!![]}];}_0x47124d=_[_0xab36('0x42')]({},_0x47124d,_0x40c053[_0xab36('0x44')]);return db[_0xab36('0x45')][_0xab36('0x4f')](_0x47124d)[_0xab36('0x15')](handleEntityNotFound(_0x44d62c,null))[_0xab36('0x15')](respondWithResult(_0x44d62c,null))[_0xab36('0x1f')](handleError(_0x44d62c,null));};exports[_0xab36('0x50')]=function(_0xa6c3b3,_0x571293){return db[_0xab36('0x45')][_0xab36('0x50')](_0xa6c3b3[_0xab36('0x51')],{})[_0xab36('0x15')](function(_0x5dc7c4){var _0x84ec3c=_0xa6c3b3[_0xab36('0x52')][_0xab36('0x2b')]({'plain':!![]});if(!_0x84ec3c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x84ec3c['role']===_0xab36('0x52')){var _0x3124ff=_0x5dc7c4[_0xab36('0x2b')]({'plain':!![]});var _0x189d44=_0xab36('0x2c');return db[_0xab36('0x53')]['find']({'where':{'name':_0x189d44,'userProfileId':_0x84ec3c[_0xab36('0x54')]},'raw':!![]})[_0xab36('0x15')](function(_0x4b6458){if(_0x4b6458&&_0x4b6458[_0xab36('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x3124ff[_0xab36('0x2f')],'resourceId':_0x3124ff['id'],'type':_0x4b6458['name'],'sectionId':_0x4b6458['id']},{})[_0xab36('0x15')](function(){return _0x5dc7c4;});}else{return _0x5dc7c4;}})[_0xab36('0x1f')](function(_0x55aeea){logger['error'](_0xab36('0x56'),_0x55aeea);throw _0x55aeea;});}return _0x5dc7c4;})[_0xab36('0x15')](respondWithResult(_0x571293,0xc9))[_0xab36('0x1f')](handleError(_0x571293,null));};exports[_0xab36('0x29')]=function(_0x465ee0,_0x20136c){if(_0x465ee0[_0xab36('0x51')]['id']){delete _0x465ee0[_0xab36('0x51')]['id'];}return db[_0xab36('0x45')]['find']({'where':{'id':_0x465ee0['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x20136c,null))['then'](saveUpdates(_0x465ee0[_0xab36('0x51')],null))[_0xab36('0x15')](respondWithResult(_0x20136c,null))[_0xab36('0x1f')](handleError(_0x20136c,null));};exports[_0xab36('0x2a')]=function(_0x11c503,_0x3d6996){return db[_0xab36('0x45')]['find']({'where':{'id':_0x11c503[_0xab36('0x4a')]['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x3d6996,null))[_0xab36('0x15')](removeEntity(_0x3d6996,null))[_0xab36('0x1f')](handleError(_0x3d6996,null));};exports[_0xab36('0x57')]=function(_0x2c95c7,_0x519d57){return db[_0xab36('0x45')]['describe']()['then'](respondWithResult(_0x519d57,null))[_0xab36('0x1f')](handleError(_0x519d57,null));};exports[_0xab36('0x58')]=function(_0x4debdf,_0x1fba50){if(_0x4debdf[_0xab36('0x51')]['id']){delete _0x4debdf[_0xab36('0x51')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x4debdf[_0xab36('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1fba50,null))[_0xab36('0x15')](function(_0x49d570){if(_0x49d570){_0x4debdf[_0xab36('0x51')][_0xab36('0x59')]=_0x49d570['id'];return db[_0xab36('0x5a')][_0xab36('0x50')](_0x4debdf['body']);}})[_0xab36('0x15')](respondWithResult(_0x1fba50,null))[_0xab36('0x1f')](handleError(_0x1fba50,null));};exports[_0xab36('0x5b')]=function(_0x25e763,_0xcb6268){var _0x359218={'raw':![],'where':{}};var _0x10510f={};var _0x4aa92f={'count':0x0,'rows':[]};return db[_0xab36('0x45')][_0xab36('0x5c')]({'where':{'id':_0x25e763['params']['id']}})[_0xab36('0x15')](handleEntityNotFound(_0xcb6268,null))[_0xab36('0x15')](function(_0x13047c){if(_0x13047c){_0x10510f[_0xab36('0x35')]=_[_0xab36('0x37')](db[_0xab36('0x5a')][_0xab36('0x4c')]);_0x10510f[_0xab36('0x36')]=_['keys'](_0x25e763[_0xab36('0x36')]);_0x10510f[_0xab36('0x38')]=_[_0xab36('0x39')](_0x10510f[_0xab36('0x35')],_0x10510f['query']);_0x359218[_0xab36('0x3b')]=_[_0xab36('0x39')](_0x10510f['model'],qs[_0xab36('0x3a')](_0x25e763[_0xab36('0x36')][_0xab36('0x3a')]));_0x359218[_0xab36('0x3b')]=_0x359218[_0xab36('0x3b')][_0xab36('0x4d')]?_0x359218[_0xab36('0x3b')]:_0x10510f[_0xab36('0x35')];if(!_0x25e763[_0xab36('0x36')][_0xab36('0x5d')]('nolimit')){_0x359218['limit']=qs['limit'](_0x25e763[_0xab36('0x36')][_0xab36('0x24')]);_0x359218[_0xab36('0x23')]=qs[_0xab36('0x23')](_0x25e763[_0xab36('0x36')][_0xab36('0x23')]);}_0x359218[_0xab36('0x3d')]=qs[_0xab36('0x3e')](_0x25e763[_0xab36('0x36')][_0xab36('0x3e')]);_0x359218[_0xab36('0x3f')]=qs[_0xab36('0x38')](_['pick'](_0x25e763[_0xab36('0x36')],_0x10510f[_0xab36('0x38')]));_0x359218[_0xab36('0x3f')]['ChatWebsiteId']=_0x13047c['id'];if(_0x25e763[_0xab36('0x36')]['filter']){_0x359218[_0xab36('0x3f')]=_[_0xab36('0x42')](_0x359218[_0xab36('0x3f')],{'$or':_[_0xab36('0x31')](_0x359218[_0xab36('0x3b')],function(_0xeedfaf){var _0x30def7={};_0x30def7[_0xeedfaf]={'$like':'%'+_0x25e763['query'][_0xab36('0x41')]+'%'};return _0x30def7;})});}_0x359218=_[_0xab36('0x42')]({},_0x359218,_0x25e763[_0xab36('0x44')]);return db[_0xab36('0x5a')][_0xab36('0x26')]({'where':_0x359218['where']})[_0xab36('0x15')](function(_0x5206f5){_0x4aa92f[_0xab36('0x26')]=_0x5206f5;if(_0x25e763[_0xab36('0x36')]['includeAll']){_0x359218[_0xab36('0x4e')]=[{'all':!![]}];}return db[_0xab36('0x5a')][_0xab36('0x47')](_0x359218);})[_0xab36('0x15')](function(_0x19fc2d){_0x4aa92f['rows']=_0x19fc2d;return _0x4aa92f;});}})[_0xab36('0x15')](respondWithFilteredResult(_0xcb6268,_0x359218))['catch'](handleError(_0xcb6268,null));};exports['removeDispositions']=function(_0x5dd176,_0x4fff02){return db[_0xab36('0x45')][_0xab36('0x4f')]({'where':{'id':_0x5dd176[_0xab36('0x4a')]['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x4fff02,null))[_0xab36('0x15')](function(_0x10e62d){if(_0x10e62d){return _0x10e62d[_0xab36('0x5e')](_0x5dd176[_0xab36('0x36')][_0xab36('0x5f')]);}})['then'](respondWithStatusCode(_0x4fff02,null))[_0xab36('0x1f')](handleError(_0x4fff02,null));};exports[_0xab36('0x60')]=function(_0x32619f,_0x3ebd6f){if(_0x32619f[_0xab36('0x51')]['id']){delete _0x32619f[_0xab36('0x51')]['id'];}return db[_0xab36('0x45')][_0xab36('0x4f')]({'where':{'id':_0x32619f['params']['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x3ebd6f,null))['then'](function(_0x335623){if(_0x335623){_0x32619f['body']['ChatWebsiteId']=_0x335623['id'];return db[_0xab36('0x61')]['create'](_0x32619f['body']);}})['then'](respondWithResult(_0x3ebd6f,null))['catch'](handleError(_0x3ebd6f,null));};exports[_0xab36('0x62')]=function(_0x49a5a8,_0x461bb4){var _0x207be0={'raw':![],'where':{}};var _0x4351b1={};var _0x4e046e={'count':0x0,'rows':[]};return db[_0xab36('0x45')]['findOne']({'where':{'id':_0x49a5a8[_0xab36('0x4a')]['id']}})['then'](handleEntityNotFound(_0x461bb4,null))[_0xab36('0x15')](function(_0x328dc7){if(_0x328dc7){_0x4351b1[_0xab36('0x35')]=_[_0xab36('0x37')](db['CannedAnswer'][_0xab36('0x4c')]);_0x4351b1[_0xab36('0x36')]=_[_0xab36('0x37')](_0x49a5a8[_0xab36('0x36')]);_0x4351b1[_0xab36('0x38')]=_[_0xab36('0x39')](_0x4351b1[_0xab36('0x35')],_0x4351b1['query']);_0x207be0[_0xab36('0x3b')]=_[_0xab36('0x39')](_0x4351b1[_0xab36('0x35')],qs['fields'](_0x49a5a8[_0xab36('0x36')][_0xab36('0x3a')]));_0x207be0[_0xab36('0x3b')]=_0x207be0['attributes'][_0xab36('0x4d')]?_0x207be0[_0xab36('0x3b')]:_0x4351b1['model'];if(!_0x49a5a8[_0xab36('0x36')]['hasOwnProperty'](_0xab36('0x3c'))){_0x207be0[_0xab36('0x24')]=qs[_0xab36('0x24')](_0x49a5a8[_0xab36('0x36')][_0xab36('0x24')]);_0x207be0['offset']=qs[_0xab36('0x23')](_0x49a5a8[_0xab36('0x36')][_0xab36('0x23')]);}_0x207be0['order']=qs[_0xab36('0x3e')](_0x49a5a8[_0xab36('0x36')][_0xab36('0x3e')]);_0x207be0[_0xab36('0x3f')]=qs[_0xab36('0x38')](_[_0xab36('0x40')](_0x49a5a8[_0xab36('0x36')],_0x4351b1[_0xab36('0x38')]));_0x207be0[_0xab36('0x3f')]['ChatWebsiteId']=_0x328dc7['id'];if(_0x49a5a8[_0xab36('0x36')][_0xab36('0x41')]){_0x207be0['where']=_['merge'](_0x207be0['where'],{'$or':_[_0xab36('0x31')](_0x207be0[_0xab36('0x3b')],function(_0x3eb819){var _0x365e7d={};_0x365e7d[_0x3eb819]={'$like':'%'+_0x49a5a8[_0xab36('0x36')][_0xab36('0x41')]+'%'};return _0x365e7d;})});}_0x207be0=_[_0xab36('0x42')]({},_0x207be0,_0x49a5a8[_0xab36('0x44')]);return db[_0xab36('0x61')][_0xab36('0x26')]({'where':_0x207be0['where']})[_0xab36('0x15')](function(_0x578ad8){_0x4e046e[_0xab36('0x26')]=_0x578ad8;if(_0x49a5a8[_0xab36('0x36')][_0xab36('0x46')]){_0x207be0[_0xab36('0x4e')]=[{'all':!![]}];}return db[_0xab36('0x61')]['findAll'](_0x207be0);})[_0xab36('0x15')](function(_0x46c9c4){_0x4e046e[_0xab36('0x48')]=_0x46c9c4;return _0x4e046e;});}})['then'](respondWithFilteredResult(_0x461bb4,_0x207be0))[_0xab36('0x1f')](handleError(_0x461bb4,null));};exports['removeAnswers']=function(_0xf17652,_0x81f205){return db[_0xab36('0x45')][_0xab36('0x4f')]({'where':{'id':_0xf17652['params']['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x81f205,null))[_0xab36('0x15')](function(_0x360099){if(_0x360099){return _0x360099[_0xab36('0x63')](_0xf17652[_0xab36('0x36')][_0xab36('0x5f')]);}})[_0xab36('0x15')](respondWithStatusCode(_0x81f205,null))['catch'](handleError(_0x81f205,null));};exports[_0xab36('0x64')]=function(_0x9d6c44,_0x2b249b){_0x9d6c44[_0xab36('0x51')][_0xab36('0x65')]=_0x9d6c44['file'][_0xab36('0x66')];return db[_0xab36('0x45')]['find']({'where':{'id':_0x9d6c44[_0xab36('0x4a')]['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x2b249b,null))[_0xab36('0x15')](saveUpdates(_0x9d6c44[_0xab36('0x51')],null))[_0xab36('0x15')](respondWithResult(_0x2b249b,null))['catch'](handleError(_0x2b249b,null));};exports[_0xab36('0x67')]=function(_0x24cfbc,_0x166b06){_0x24cfbc[_0xab36('0x51')][_0xab36('0x68')]=_0x24cfbc['file'][_0xab36('0x66')];return db[_0xab36('0x45')]['find']({'where':{'id':_0x24cfbc['params']['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x166b06,null))[_0xab36('0x15')](saveUpdates(_0x24cfbc[_0xab36('0x51')],null))['then'](respondWithResult(_0x166b06,null))['catch'](handleError(_0x166b06,null));};exports[_0xab36('0x69')]=function(_0x3c55f4,_0x5edc21){_0x3c55f4[_0xab36('0x51')]['customerAvatar']=_0x3c55f4['file'][_0xab36('0x66')];return db['ChatWebsite']['find']({'where':{'id':_0x3c55f4[_0xab36('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5edc21,null))['then'](saveUpdates(_0x3c55f4[_0xab36('0x51')],null))[_0xab36('0x15')](respondWithResult(_0x5edc21,null))['catch'](handleError(_0x5edc21,null));};exports[_0xab36('0x6a')]=function(_0x409315,_0x24fa03){_0x409315[_0xab36('0x51')]['systemAvatar']=_0x409315['file']['filename'];return db[_0xab36('0x45')]['find']({'where':{'id':_0x409315[_0xab36('0x4a')]['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x24fa03,null))[_0xab36('0x15')](saveUpdates(_0x409315['body'],null))[_0xab36('0x15')](respondWithResult(_0x24fa03,null))['catch'](handleError(_0x24fa03,null));};exports['getLogo']=function(_0xe3f6e2,_0x41e831){var _0x24671e=path[_0xab36('0x6b')](config[_0xab36('0x6c')],_0xab36('0x6d'));var _0x13e469={'where':{'id':_0xe3f6e2['params']['id']},'attributes':['id',_0xab36('0x65')],'raw':!![]};var _0x27f2b5=![];return require(_0xab36('0x6e'))[_0xab36('0x6f')]()['then'](function(_0x464bab){if(_0x464bab){_0x27f2b5=_0x464bab[_0xab36('0x70')];}})[_0xab36('0x15')](function(){return db[_0xab36('0x45')][_0xab36('0x4f')](_0x13e469);})[_0xab36('0x15')](handleEntityNotFound(_0x41e831,null))[_0xab36('0x15')](function(_0x584360){if(_0x584360){if(!_[_0xab36('0x71')](_0x584360[_0xab36('0x65')])){if(fs[_0xab36('0x72')](path[_0xab36('0x6b')](config[_0xab36('0x6c')],'server/files/images/logos/',_0x584360['sitepic']))&&_0x27f2b5){_0x24671e=path[_0xab36('0x6b')](config['root'],_0xab36('0x73'),_0x584360[_0xab36('0x65')]);}}return _0x41e831['download'](_0x24671e);}})['catch'](handleError(_0x41e831,null));};exports['getAvatar']=function(_0x486280,_0x10ce9c){var _0x51a50a=path[_0xab36('0x6b')](config[_0xab36('0x6c')],_0xab36('0x74'));var _0x3b1c9c={'where':{'id':_0x486280[_0xab36('0x4a')]['id']},'attributes':['id',_0xab36('0x68')],'raw':!![]};return db[_0xab36('0x45')][_0xab36('0x4f')](_0x3b1c9c)[_0xab36('0x15')](handleEntityNotFound(_0x10ce9c,null))[_0xab36('0x15')](function(_0x275848){if(_0x275848){if(!_['isNil'](_0x275848['agentAvatar'])){if(fs[_0xab36('0x72')](path[_0xab36('0x6b')](config['root'],_0xab36('0x75'),_0x275848[_0xab36('0x68')]))){_0x51a50a=path[_0xab36('0x6b')](config[_0xab36('0x6c')],_0xab36('0x75'),_0x275848[_0xab36('0x68')]);}}return _0x10ce9c[_0xab36('0x76')](_0x51a50a);}})[_0xab36('0x1f')](handleError(_0x10ce9c,null));};exports[_0xab36('0x77')]=function(_0x32e592,_0x202f80){var _0x4a9e4e=path[_0xab36('0x6b')](config[_0xab36('0x6c')],'server/files/images/avatars/customer_avatar.png');var _0x40e187={'where':{'id':_0x32e592[_0xab36('0x4a')]['id']},'attributes':['id','customerAvatar',_0xab36('0x78')],'raw':!![]};return db[_0xab36('0x45')][_0xab36('0x4f')](_0x40e187)[_0xab36('0x15')](handleEntityNotFound(_0x202f80,null))[_0xab36('0x15')](function(_0x577392){if(_0x577392){if(!_[_0xab36('0x71')](_0x577392['customerAvatar'])){if(fs['existsSync'](path[_0xab36('0x6b')](config[_0xab36('0x6c')],_0xab36('0x75'),_0x577392['customerAvatar']))&&_0x577392[_0xab36('0x78')]){_0x4a9e4e=path['join'](config[_0xab36('0x6c')],_0xab36('0x75'),_0x577392[_0xab36('0x79')]);}}return _0x202f80[_0xab36('0x76')](_0x4a9e4e);}})[_0xab36('0x1f')](handleError(_0x202f80,null));};exports['getSystemAvatar']=function(_0x1812b4,_0x5549b9){var _0xa17e46=path[_0xab36('0x6b')](config[_0xab36('0x6c')],_0xab36('0x7a'));var _0x35d4c0={'where':{'id':_0x1812b4[_0xab36('0x4a')]['id']},'attributes':['id',_0xab36('0x7b')],'raw':!![]};return db[_0xab36('0x45')][_0xab36('0x4f')](_0x35d4c0)[_0xab36('0x15')](handleEntityNotFound(_0x5549b9,null))[_0xab36('0x15')](function(_0x5f4a36){if(_0x5f4a36){if(!_[_0xab36('0x71')](_0x5f4a36[_0xab36('0x7b')])){if(fs[_0xab36('0x72')](path[_0xab36('0x6b')](config[_0xab36('0x6c')],_0xab36('0x75'),_0x5f4a36[_0xab36('0x7b')]))){_0xa17e46=path['join'](config[_0xab36('0x6c')],'server/files/images/avatars/',_0x5f4a36['systemAvatar']);}}return _0x5549b9[_0xab36('0x76')](_0xa17e46);}})['catch'](handleError(_0x5549b9,null));};exports[_0xab36('0x7c')]=function(_0x41c693,_0x339b43){var _0x139bc5=require('user-agent-parser');var _0x4417f2=new _0x139bc5();var _0x5dfaec=_0x4417f2[_0xab36('0x7d')](_0x41c693['headers'][_0xab36('0x7e')])[_0xab36('0x7f')]();var _0x377bae={'body':_0x41c693['body'],'channel':'chat'};var _0x5aac02=[];var _0x64eefd=[];var _0x4a4b29={};var _0x35bdb9=![];return db[_0xab36('0x80')][_0xab36('0x57')]()[_0xab36('0x15')](function(_0x77331a){if(!_0x77331a){throw new db[(_0xab36('0x81'))][(_0xab36('0x82'))](_0xab36('0x83'));}_0x5aac02=_[_0xab36('0x84')](_[_0xab36('0x37')](_0x77331a),[_0xab36('0x85'),_0xab36('0x86')]);_0x64eefd=_[_0xab36('0x84')](_[_0xab36('0x37')](_0x77331a),[_0xab36('0x85'),'updatedAt','CompanyId',_0xab36('0x87')]);if(_0x41c693[_0xab36('0x51')]['id']){delete _0x41c693[_0xab36('0x51')]['id'];}if(_[_0xab36('0x71')](_0x41c693['body'][_0xab36('0x88')])){throw new db[(_0xab36('0x81'))][(_0xab36('0x82'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x41c693['body'][_0xab36('0x51')])||_0x41c693[_0xab36('0x51')]['body']===''){throw new db[(_0xab36('0x81'))][(_0xab36('0x82'))](_0xab36('0x89'));}if(_[_0xab36('0x71')](_0x41c693['body']['mapKey'])){throw new db[(_0xab36('0x81'))][(_0xab36('0x82'))](_0xab36('0x8a')+_0x64eefd);}if(!_[_0xab36('0x8b')](_0x64eefd,_0x41c693[_0xab36('0x51')][_0xab36('0x8c')])){throw new db['Sequelize'][(_0xab36('0x82'))](_0xab36('0x8d')+_0x64eefd);}_0x4a4b29[_0x41c693[_0xab36('0x51')][_0xab36('0x8c')]]=_0x41c693[_0xab36('0x51')][_0xab36('0x88')];})[_0xab36('0x15')](function(){return db['ChatWebsite'][_0xab36('0x4f')]({'where':{'id':_0x41c693[_0xab36('0x4a')]['id']},'include':[{'model':db[_0xab36('0x8e')],'as':_0xab36('0x8f'),'include':[{'model':db[_0xab36('0x80')],'as':_0xab36('0x90'),'where':_0x4a4b29,'limit':0x1,'order':[['updatedAt',_0xab36('0x91')]]}]},{'model':db['ChatApplication'],'as':_0xab36('0x92')}]});})[_0xab36('0x15')](handleEntityNotFound(_0x339b43,null))[_0xab36('0x15')](function(_0x23da50){if(_0x23da50&&_0x23da50[_0xab36('0x8f')]){_0x377bae['account']=_0x23da50;_0x377bae[_0xab36('0x93')]=_0x23da50[_0xab36('0x92')];_0x377bae[_0xab36('0x94')]=_0x23da50[_0xab36('0x8f')];_0x377bae[_0xab36('0x93')]=_[_0xab36('0x95')](_0x377bae[_0xab36('0x93')],[_0xab36('0x96')],['asc']);if(_0x377bae[_0xab36('0x97')]['Applications']){delete _0x377bae[_0xab36('0x97')][_0xab36('0x92')];}if(_0x377bae[_0xab36('0x97')]['List']&&_0x377bae[_0xab36('0x97')][_0xab36('0x8f')]['Contacts']['length']){return _0x377bae['account']['List']['Contacts'][0x0];}var _0x583146=_[_0xab36('0xd')](_0x41c693['body'],{'firstName':_0x41c693['body'][_0xab36('0x88')],'ListId':_0x23da50[_0xab36('0x87')]});_0x583146[_0x41c693[_0xab36('0x51')][_0xab36('0x8c')]]=_0x41c693['body'][_0xab36('0x88')];return db['CmContact'][_0xab36('0x50')](_0x583146,{'fields':_0x5aac02,'raw':!![]});}})[_0xab36('0x15')](handleEntityNotFound(_0x339b43,null))[_0xab36('0x15')](function(_0x13f455){_0x377bae['contact']=_0x13f455;var _0x256ef2=_0x41c693[_0xab36('0x51')][_0xab36('0x98')];if(_0x41c693['headers']['cf-connecting-ip']){_0x256ef2=_0x41c693['headers'][_0xab36('0x99')];}else if(_0x41c693[_0xab36('0x9a')][_0xab36('0x9b')]){_0x256ef2=_['first'](_0x41c693[_0xab36('0x9a')][_0xab36('0x9b')][_0xab36('0x9c')](','));}if(_0x13f455){var _0x16b1e4={'ContactId':_0x13f455['id'],'ChatWebsiteId':_0x41c693[_0xab36('0x4a')]['id'],'from':(_0x13f455[_0xab36('0x9d')]||'')+'\x20'+(_0x13f455['lastName']||''),'customerIp':_0x256ef2,'customerPort':_0x41c693['headers'][_0xab36('0x9e')]?_0x41c693[_0xab36('0x9a')][_0xab36('0x9e')]:null,'referer':_0x41c693[_0xab36('0x51')][_0xab36('0x9f')],'browserName':_0x5dfaec[_0xab36('0xa0')][_0xab36('0x2f')]&&_0x5dfaec[_0xab36('0xa0')][_0xab36('0xa1')]?util[_0xab36('0xa2')](_0xab36('0xa3'),_0x5dfaec['browser'][_0xab36('0x2f')],_0x5dfaec[_0xab36('0xa0')][_0xab36('0xa1')]):'unknown','browserVersion':_0x5dfaec[_0xab36('0xa0')][_0xab36('0xa1')]||_0xab36('0xa4'),'osName':util[_0xab36('0xa2')](_0xab36('0xa3'),_0x5dfaec['os'][_0xab36('0x2f')],_0x5dfaec['os'][_0xab36('0xa1')]),'osVersion':_0x5dfaec['os'][_0xab36('0xa1')],'deviceModel':_0x5dfaec[_0xab36('0xa5')]['model']&&_0x5dfaec['device'][_0xab36('0xa6')]?util[_0xab36('0xa2')](_0xab36('0xa7'),_0x5dfaec[_0xab36('0xa5')][_0xab36('0x35')],_0x5dfaec[_0xab36('0xa5')][_0xab36('0xa6')],_0x5dfaec[_0xab36('0xa5')]['type']):null,'deviceVendor':_0x5dfaec[_0xab36('0xa5')]['vendor'],'deviceType':_0x5dfaec[_0xab36('0xa5')]['type'],'formData':JSON[_0xab36('0xa8')](_0x41c693['body'])};var _0x2e5d57={'ChatWebsiteId':_0x41c693[_0xab36('0x4a')]['id'],'closed':![]};if(_0x41c693[_0xab36('0x51')]['threadId']){_0x2e5d57[_0xab36('0xa9')]=_0x41c693[_0xab36('0x51')]['threadId'];return db[_0xab36('0xaa')][_0xab36('0x4f')]({'where':_0x2e5d57})[_0xab36('0x15')](function(_0x31ac19){if(_0x31ac19){return[_0x31ac19,![]];}_0x16b1e4[_0xab36('0xa9')]=_0x41c693[_0xab36('0x51')][_0xab36('0xa9')];_0x16b1e4[_0xab36('0xab')]=_0x41c693['body'][_0xab36('0xab')];return db[_0xab36('0xaa')][_0xab36('0x50')](_0x16b1e4)[_0xab36('0x15')](function(_0x4b623f){return[_0x4b623f,!![]];});});}_0x2e5d57['ContactId']=_0x13f455['id'];if(_0x41c693['body']['interaction']&&_0x41c693[_0xab36('0x51')][_0xab36('0xac')]['id']){_0x2e5d57['id']=_0x41c693['body'][_0xab36('0xac')]['id'];return db['ChatInteraction'][_0xab36('0x4f')]({'where':_0x2e5d57})[_0xab36('0x15')](function(_0x3baadf){if(_0x3baadf){return[_0x3baadf,![]];}return db['ChatInteraction'][_0xab36('0x50')](_0x16b1e4)['then'](function(_0x16685d){return[_0x16685d,!![]];});});}return db['ChatInteraction'][_0xab36('0x50')](_0x16b1e4)[_0xab36('0x15')](function(_0x4ccd9c){return[_0x4ccd9c,!![]];});}})['spread'](function(_0x30d9f8,_0x29cf45){if(_0x30d9f8){_0x35bdb9=_0x29cf45;if(!_0x29cf45){var _0x546a5f={'from':(_0x377bae[_0xab36('0xad')][_0xab36('0x9d')]||'')+'\x20'+(_0x377bae[_0xab36('0xad')][_0xab36('0xae')]||'')};if(_0x41c693[_0xab36('0x51')][_0xab36('0xa9')]&&_0x41c693[_0xab36('0x51')]['messageId']&&_0x41c693[_0xab36('0x51')][_0xab36('0xa9')]!=_0x41c693[_0xab36('0x51')][_0xab36('0xaf')]){_0x546a5f[_0xab36('0xa9')]=_0x41c693[_0xab36('0x51')][_0xab36('0xaf')];}return _0x30d9f8[_0xab36('0x29')](_0x546a5f);}else{return _0x30d9f8;}}})[_0xab36('0x15')](function(_0x54c004){_0x377bae[_0xab36('0xac')]=_0x54c004[_0xab36('0x2b')]({'plain':!![]});_0x377bae[_0xab36('0xac')][_0xab36('0xb0')]=_0x35bdb9;if(_0x377bae[_0xab36('0xac')]['created']){if(_0x377bae[_0xab36('0x97')][_0xab36('0xb1')]){_0x377bae[_0xab36('0x93')][_0xab36('0xb2')]({'id':0x0,'priority':_0x377bae[_0xab36('0x93')]['length']+0x1,'app':_0xab36('0xb3'),'appdata':'unmanaged','interval':_0xab36('0xb4')});}}return db[_0xab36('0xb5')][_0xab36('0x50')]({'body':_0x41c693[_0xab36('0x51')][_0xab36('0x51')],'ChatWebsiteId':_0x41c693['params']['id'],'ChatInteractionId':_0x54c004['id'],'direction':'in','ContactId':_0x377bae[_0xab36('0xad')]['id'],'AttachmentId':_0x41c693[_0xab36('0x51')][_0xab36('0xb6')]});})['then'](function(_0x25065a){_0x377bae[_0xab36('0x1d')]=_0x25065a;if(_0x377bae['interaction'][_0xab36('0xb7')]){return db['User'][_0xab36('0x4f')]({'attributes':['id',_0xab36('0x2f')],'where':{'id':_0x377bae[_0xab36('0xac')][_0xab36('0xb7')]}})[_0xab36('0x15')](function(_0x1b4283){if(_0x1b4283){_0x377bae['applications'][_0xab36('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1b4283[_0xab36('0x2f')]+','+(_0x377bae[_0xab36('0x97')]['waitForTheAssignedAgent']||0xa),'interval':_0xab36('0xb4')});_0x377bae[_0xab36('0xb9')]=!![];}return respondWithRpcPromise(_0xab36('0xba'),_0xab36('0xbb'),_0x377bae);});}return respondWithRpcPromise(_0xab36('0xba'),_0xab36('0xbb'),_0x377bae);})[_0xab36('0x15')](function(_0x34a54b){respondWithRpcPromise(_0xab36('0xbc'),_0xab36('0xbc'),{'event':'notify','message':_0x34a54b},client9002);return _0x34a54b;})['then'](respondWithResult(_0x339b43,null))[_0xab36('0x1f')](handleError(_0x339b43,null));};exports[_0xab36('0xbd')]=function(_0x20e076,_0x389253){var _0x29e0b3,_0xe3d3cd,_0x297c66;var _0x25a0dd=[];var _0x32faf2={};var _0x590d1d=_0x20e076[_0xab36('0xbe')]||[];var _0x410ad8=[];var _0x104f75;return db[_0xab36('0x80')][_0xab36('0x57')]()[_0xab36('0x15')](function(_0x16cb4b){if(!_0x16cb4b){throw new db[(_0xab36('0x81'))]['ValidationError'](_0xab36('0x83'));}_0x25a0dd=_[_0xab36('0x84')](_[_0xab36('0x37')](_0x16cb4b),['createdAt',_0xab36('0x86'),_0xab36('0xbf'),_0xab36('0x87')]);if(_0x20e076[_0xab36('0x51')]['id']){delete _0x20e076[_0xab36('0x51')]['id'];}if(_[_0xab36('0x71')](_0x20e076[_0xab36('0x51')][_0xab36('0x88')])){throw _0x389253[_0xab36('0x20')](0x1f4)[_0xab36('0xc0')](new db['Sequelize'][(_0xab36('0x82'))](_0xab36('0xc1')));}if(_['isNil'](_0x20e076[_0xab36('0x51')][_0xab36('0x51')])||_0x20e076[_0xab36('0x51')][_0xab36('0x51')]===''){throw _0x389253[_0xab36('0x20')](0x1f4)[_0xab36('0xc0')](new db['Sequelize'][(_0xab36('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xab36('0x71')](_0x20e076['body'][_0xab36('0xc2')])){throw _0x389253[_0xab36('0x20')](0x1f4)[_0xab36('0xc0')](new db[(_0xab36('0x81'))][(_0xab36('0x82'))](_0xab36('0xc3')+_0x25a0dd));}if(!_['includes'](_0x25a0dd,_0x20e076[_0xab36('0x51')][_0xab36('0xc2')])){throw _0x389253['status'](0x1f4)[_0xab36('0xc0')](new db[(_0xab36('0x81'))][(_0xab36('0x82'))](_0xab36('0xc4')+_0x25a0dd));}_0x32faf2[_0x20e076[_0xab36('0x51')][_0xab36('0xc2')]]=_0x20e076[_0xab36('0x51')][_0xab36('0x88')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x20e076['params']['id']},'include':[{'model':db['CmList'],'as':_0xab36('0x8f')},{'model':db[_0xab36('0xc5')],'as':_0xab36('0xc5')}]});})['then'](handleEntityNotFound(_0x389253,null))[_0xab36('0x15')](function(_0x415c60){if(_0x415c60&&_0x415c60[_0xab36('0x8f')]){_0xe3d3cd=_0x415c60;var _0x483af7=_[_0xab36('0xd')](_0x20e076[_0xab36('0x51')],{'firstName':_0x20e076[_0xab36('0x51')]['from'],'phone':_0x20e076['body'][_0xab36('0x88')],'ListId':_0x415c60['ListId']});_0x483af7[_0x20e076[_0xab36('0x51')][_0xab36('0xc2')]]=_0x20e076['body'][_0xab36('0x88')];return db[_0xab36('0x80')]['findOrCreate']({'where':_0x32faf2,'defaults':_0x483af7});}})[_0xab36('0xc6')](function(_0x1b8cc3){if(_0x1b8cc3){_0x297c66=_0x1b8cc3;var _0x2010ba=fs[_0xab36('0xc7')](path[_0xab36('0x6b')](config[_0xab36('0x6c')],_0xab36('0xc8')),_0xab36('0xc9'));var _0x2703be=ejs['render'](_0x2010ba,{'body':_[_0xab36('0xca')](_0x20e076[_0xab36('0x51')][_0xab36('0x51')]),'bodyTitle':_0xe3d3cd['offlineMessageBody']});return db[_0xab36('0xcb')][_0xab36('0x50')]({'body':_0x2703be,'plainBody':htmlToText['fromString'](_0x2703be),'ContactId':_0x1b8cc3['id'],'ChatWebsiteId':_0xe3d3cd['id']});}})[_0xab36('0x15')](function(_0x3e4039){_0x104f75=_0x3e4039;if(_0x590d1d['length']){var _0x291a19=_0x590d1d['map'](function(_0xb6ed32){return{'name':_0xb6ed32[_0xab36('0xcc')],'basename':_0xb6ed32[_0xab36('0x66')],'type':_0xb6ed32['mimetype'],'ChatOfflineMessageId':_0x3e4039['id']};});_0x410ad8=_0x291a19[_0xab36('0x31')](_0x5ecc4d=>{var _0xc3c4a9={'filename':_0x5ecc4d['name'],'path':path[_0xab36('0x6b')](config['root'],_0xab36('0xcd'),_0xab36('0xbe'),_0xab36('0xce'),'offline-chat',_0x5ecc4d[_0xab36('0xcf')])};return _0xc3c4a9;});if(!_0xe3d3cd[_0xab36('0xd0')]){return db['sequelize']['transaction'](function(_0x2ace0b){return db['Attachment']['bulkCreate'](_0x291a19,{'transaction':_0x2ace0b});});}}})[_0xab36('0x15')](function(){if(_0x104f75){_0x29e0b3=_0x104f75;return db[_0xab36('0xc5')][_0xab36('0x5c')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xab36('0xd1'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xab36('0xd2'),'raw':!![]}]}]});}})[_0xab36('0x15')](function(_0x5cd441){if(_0x5cd441&&_0x5cd441[_0xab36('0xd1')]&&_0xe3d3cd[_0xab36('0xd3')]&&_0xe3d3cd[_0xab36('0xd4')]){var _0x14f653=_0x5cd441[_0xab36('0xd5')]();return respondWithRpcPromise(_0xab36('0xd6'),_0xab36('0xd7'),{'account':_0x14f653,'message':{'from':util['format'](_0xab36('0xd8'),_0x5cd441[_0xab36('0x2f')],_0x5cd441[_0xab36('0xd9')]||_0x5cd441[_0xab36('0xd1')][_0xab36('0x52')]),'to':_0xe3d3cd['forwardOfflineAddress'],'subject':_0xe3d3cd[_0xab36('0xda')],'html':_0x29e0b3[_0xab36('0x51')],'attachments':_0x410ad8}},client9003)[_0xab36('0x15')](function(){return _0x29e0b3;})[_0xab36('0x1f')](function(_0x4cf967){logger['error'](_0x4cf967);});}})[_0xab36('0x15')](function(){if(_0xe3d3cd&&_0xe3d3cd[_0xab36('0xd0')]&&_0xe3d3cd[_0xab36('0xdb')]){var _0x1c447c=[];if(_0x590d1d[_0xab36('0x4d')]){_0x1c447c=_0x590d1d[_0xab36('0x31')](function(_0x4106cf){return{'name':_0x4106cf['originalname'],'basename':_0x4106cf['filename'],'type':_0x4106cf['mimetype'],'ChatOfflineMessageId':_0x104f75['id']};});}var _0x408e08;if(!_[_0xab36('0x71')](_0xe3d3cd['subjectOffline'])){var _0x31ad49=_['map'](_0x20e076[_0xab36('0x51')],function(_0x27660f){return _0x27660f;});var _0x385bdf=_[_0xab36('0xdc')](_0x31ad49)[0x0];var _0x971415=_[_0xab36('0xdd')](_0x385bdf,function(_0x33c84b){return _0x33c84b;});_0x408e08=_0x971415[0x1][_0xe3d3cd['subjectOffline']];}var _0x31b11e={'from':_0x297c66[_0xab36('0xd9')],'firstName':_0x297c66[_0xab36('0x9d')],'lastName':_0x297c66[_0xab36('0xae')],'mapKey':_0xab36('0xd9'),'message':{'from':_0x297c66[_0xab36('0xd9')],'to':_0xe3d3cd[_0xab36('0xc5')][_0xab36('0xd9')],'cc':'','subject':_[_0xab36('0x71')](_0x408e08)?_0xe3d3cd[_0xab36('0xda')]:_0x408e08,'messageId':'','sentAt':new Date(),'attach':_0x1c447c['length'],'attachments':_0x1c447c,'originChannel':_0xab36('0xde'),'ChatWebsiteId':_0xe3d3cd['id'],'ChatOfflineMessageId':_0x29e0b3['id'],'originTo':_0xe3d3cd[_0xab36('0xc5')]['email']},'body':_0x29e0b3[_0xab36('0x51')]};var _0xf9f9bd={'account':{'id':_0xe3d3cd['MailAccountId']},'body':_0x31b11e,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xab36('0xdf'),_0xab36('0xe0'),_0xf9f9bd,client9001)['then'](function(){return _0x29e0b3;})[_0xab36('0x1f')](function(_0x2f3cc0){logger[_0xab36('0x1b')](_0x2f3cc0);});}return;})[_0xab36('0x15')](function(){if(_0x29e0b3){return _0x29e0b3;}})[_0xab36('0x15')](respondWithResult(_0x389253,null))[_0xab36('0x1f')](function(_0x71d8b8){logger['error'](_0xab36('0x1f'),_0x71d8b8);for(var _0x2f72a1 of _0x590d1d){var _0x205029=path[_0xab36('0x6b')](config['root'],_0xab36('0xcd'),_0xab36('0xbe'),_0xab36('0xce'),_0xab36('0xe1'),_0x2f72a1[_0xab36('0x66')]);fs_extra['remove'](_0x205029)[_0xab36('0x1f')](function(_0x4d81a3){logger[_0xab36('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0x205029,_0x4d81a3);});}});};exports[_0xab36('0xe2')]=function(_0x3d3363,_0x98351){return db[_0xab36('0xaa')][_0xab36('0x4f')]({'where':{'id':_0x3d3363['params']['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x98351,null))[_0xab36('0x15')](function(_0x48ba73){if(_0x48ba73){return _0x48ba73[_0xab36('0xe2')](_0x3d3363[_0xab36('0x51')][_0xab36('0x5f')],_[_0xab36('0xe3')](_0x3d3363[_0xab36('0x51')],[_0xab36('0x5f'),'id'])||{});}})[_0xab36('0x15')](respondWithResult(_0x98351,null))[_0xab36('0x1f')](handleError(_0x98351,null));};exports[_0xab36('0xe4')]=function(_0x32d81c,_0x28cd9){var _0x3ac9ae={'raw':![],'where':{}};var _0x5e3443={};var _0x481e29={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xab36('0x5c')]({'where':{'id':_0x32d81c['params']['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x28cd9,null))[_0xab36('0x15')](function(_0x38c2a3){if(_0x38c2a3){_0x5e3443[_0xab36('0x35')]=_[_0xab36('0x37')](db[_0xab36('0xaa')]['rawAttributes']);_0x5e3443[_0xab36('0x36')]=_[_0xab36('0x37')](_0x32d81c[_0xab36('0x36')]);_0x5e3443[_0xab36('0x38')]=_[_0xab36('0x39')](_0x5e3443[_0xab36('0x35')],_0x5e3443[_0xab36('0x36')]);_0x3ac9ae[_0xab36('0x3b')]=_[_0xab36('0x39')](_0x5e3443[_0xab36('0x35')],qs[_0xab36('0x3a')](_0x32d81c['query']['fields']));_0x3ac9ae[_0xab36('0x3b')]=_0x3ac9ae[_0xab36('0x3b')][_0xab36('0x4d')]?_0x3ac9ae[_0xab36('0x3b')]:_0x5e3443[_0xab36('0x35')];if(!_0x32d81c['query'][_0xab36('0x5d')]('nolimit')){_0x3ac9ae['limit']=qs[_0xab36('0x24')](_0x32d81c[_0xab36('0x36')][_0xab36('0x24')]);_0x3ac9ae[_0xab36('0x23')]=qs[_0xab36('0x23')](_0x32d81c[_0xab36('0x36')]['offset']);}_0x3ac9ae['order']=qs[_0xab36('0x3e')](_0x32d81c[_0xab36('0x36')]['sort']);_0x3ac9ae['where']=qs[_0xab36('0x38')](_[_0xab36('0x40')](_0x32d81c[_0xab36('0x36')],_0x5e3443[_0xab36('0x38')]));_0x3ac9ae['where'][_0xab36('0x59')]=_0x38c2a3['id'];if(_0x32d81c['query'][_0xab36('0x41')]){_0x3ac9ae[_0xab36('0x3f')]=_[_0xab36('0x42')](_0x3ac9ae['where'],{'$or':_[_0xab36('0x31')](_0x3ac9ae['attributes'],function(_0x20327d){var _0xbec68e={};_0xbec68e[_0x20327d]={'$like':'%'+_0x32d81c[_0xab36('0x36')]['filter']+'%'};return _0xbec68e;})});}_0x3ac9ae=_[_0xab36('0x42')]({},_0x3ac9ae,_0x32d81c[_0xab36('0x44')]);return db['ChatInteraction'][_0xab36('0x26')]({'where':_0x3ac9ae['where']})['then'](function(_0x3682dc){_0x481e29[_0xab36('0x26')]=_0x3682dc;if(_0x32d81c[_0xab36('0x36')][_0xab36('0x46')]){_0x3ac9ae[_0xab36('0x4e')]=[{'model':db[_0xab36('0x80')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xab36('0xe5'),'attributes':[_0xab36('0x2f'),'fullname',_0xab36('0xe6')],'required':![]},{'model':db[_0xab36('0xe7')],'as':_0xab36('0xe8'),'attributes':['id',_0xab36('0x2f'),_0xab36('0xe9')],'where':_0x32d81c['query'][_0xab36('0xea')]?{'id':_0x32d81c[_0xab36('0x36')]['tag']}:undefined,'required':_0x32d81c['query'][_0xab36('0xea')]?!![]:![]}];}return db[_0xab36('0xaa')][_0xab36('0x47')](_0x3ac9ae);})[_0xab36('0x15')](function(_0x5609b1){_0x481e29[_0xab36('0x48')]=_0x5609b1;return _0x481e29;});}})[_0xab36('0x15')](respondWithFilteredResult(_0x28cd9,_0x3ac9ae))[_0xab36('0x1f')](handleError(_0x28cd9,null));};function iftimePromise(_0x3cd3a4,_0x103d01){return respondWithRpcPromise(_0xab36('0xeb'),_0xab36('0xec'),{'command':_0x103d01[_0xab36('0xed')]?util[_0xab36('0xa2')](_0xab36('0xee'),_0x3cd3a4['interval'],_0x103d01['timezone']):util[_0xab36('0xa2')](_0xab36('0xef'),_0x3cd3a4['interval'])},client9002)['then'](function(_0x13772b){var _0x327249=_0x13772b&&_0x13772b[_0xab36('0xf0')](_0xab36('0xf1'))>=0x0?!![]:![];logger[_0xab36('0x16')](_0xab36('0xf2'),_0x103d01['id'],_0x3cd3a4['id'],_0x3cd3a4[_0xab36('0xf3')],_0x327249?_0xab36('0xf4'):_0xab36('0xf5'),_0x103d01['timezone']?_0x103d01[_0xab36('0xed')]:_0xab36('0xf6'));return _0x327249;})[_0xab36('0x1f')](function(_0x7b2d16){logger[_0xab36('0x1b')](_0xab36('0xf2'),_0x103d01['id'],_0x3cd3a4['id'],_0x3cd3a4['interval'],util[_0xab36('0xf7')](_0x7b2d16,{'showHidden':![],'depth':null}),_0x103d01[_0xab36('0xed')]?_0x103d01[_0xab36('0xed')]:'No\x20timezone');return![];});}exports[_0xab36('0xec')]=function(_0x17bf2e,_0x2cf896){var _0x142c69=0x0;var _0x2a87d2=0x0;var _0x3e73a7=![];var _0x4061c;var _0x41879e;return db[_0xab36('0x45')][_0xab36('0x4f')]({'where':{'id':_0x17bf2e['params']['id']},'include':[{'model':db[_0xab36('0xf8')],'as':_0xab36('0xf8'),'include':[{'model':db[_0xab36('0xf8')],'as':_0xab36('0xf9'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xab36('0x15')](handleEntityNotFound(_0x2cf896,null))[_0xab36('0x15')](function(_0x43aec2){if(_0x43aec2){_0x4061c=_0x43aec2;return _0x43aec2[_0xab36('0xfa')]({'raw':!![]});}})[_0xab36('0x15')](function(_0x42ddc9){if(_0x4061c){if(_0x42ddc9){_0x41879e=_0x42ddc9;}}return require('../../config/license/util')[_0xab36('0x6f')]();})['then'](function(_0x37f1c7){if(_0x37f1c7){_0x2a87d2=_0x37f1c7[_0xab36('0xfb')];_0x3e73a7=_0x37f1c7[_0xab36('0x70')];}})[_0xab36('0x15')](function(){return db[_0xab36('0xaa')][_0xab36('0x26')]({'where':{'closed':![]}});})[_0xab36('0x15')](function(_0x17d0ce){_0x142c69=_0x17d0ce;if(_0x2a87d2&&_0x17d0ce>_0x2a87d2){return db['License']['findOne']({'where':{'id':0x1}})[_0xab36('0x15')](function(_0x5165be){if(_0x5165be){_0x5165be[_0xab36('0xfc')](_0xab36('0xfd'));}});}})[_0xab36('0x15')](function(){if(_0x4061c['Interval']&&_0x4061c[_0xab36('0xf8')][_0xab36('0xf9')]){var _0x5c029c=[];for(var _0x3e24e0=0x0;_0x3e24e0<_0x4061c[_0xab36('0xf8')]['Intervals']['length'];_0x3e24e0++){var _0x2cdea6=_0x4061c[_0xab36('0xf8')][_0xab36('0xf9')][_0x3e24e0][_0xab36('0x2b')]({'plain':!![]});_0x5c029c['push'](iftimePromise(_0x2cdea6,_0x4061c));}return BPromise[_0xab36('0xfe')](_0x5c029c)['then'](function(_0x5b00d3){return _[_0xab36('0xff')](_0x5b00d3);});}else{return!![];}})[_0xab36('0x15')](function(_0x21f91b){var _0x27abff=fs['readFileSync'](path[_0xab36('0x6b')](config[_0xab36('0x6c')],'server/files/chat/iframe.ejs'),'utf8');var _0x374deb={'remote':_0x4061c[_0xab36('0x100')],'query':querystring[_0xab36('0xa8')](_[_0xab36('0x42')](_0x4061c[_0xab36('0x2b')]({'plain':!![]}),{'customerIp':_0x17bf2e[_0xab36('0x9a')][_0xab36('0x9b')]||_0x17bf2e['headers'][_0xab36('0x101')]||_0x17bf2e[_0xab36('0x102')]['remoteAddress']||_0x17bf2e['ip'],'referer':_0x17bf2e[_0xab36('0x9a')][_0xab36('0x9f')],'openedInteractions':_0x142c69,'maxInteractions':_0x2a87d2,'virtual':_0x3e73a7[_0xab36('0xfb')],'online':_0x21f91b,'custom':_0x3e73a7}))[_0xab36('0x103')](/'/g,'\x5c\x27')};_0x2cf896[_0xab36('0xc0')](ejs[_0xab36('0x104')](Mustache[_0xab36('0x104')](_0x27abff,_0x374deb),{'proactiveActions':_0x41879e,'alignment':_0x4061c[_0xab36('0x105')],'verticalAlignment':_0x4061c['verticalAlignment'],'div_color':_0x4061c[_0xab36('0xe9')],'labelText':_0x4061c[_0xab36('0x106')],'text_color':_0x4061c['textColor'],'text_button_color':_0x4061c[_0xab36('0x107')],'button_color':_0x4061c[_0xab36('0x108')],'background_color':_0x4061c['backgroundColor'],'hideWhenOffline':_0x4061c['hideWhenOffline'],'interval':_0x4061c[_0xab36('0x109')]}));})[_0xab36('0x1f')](handleError(_0x2cf896,null));};exports['addApplications']=function(_0x501c43,_0x2195d8){var _0x5de9e2=_0x501c43[_0xab36('0x4a')]['id'];var _0x34d9bf=_0x501c43[_0xab36('0x51')];var _0xb8c58f=0xc8;var _0x4f4fb5=null;return db[_0xab36('0x10a')]['transaction']({'isolationLevel':db['sequelize'][_0xab36('0x10b')]['ISOLATION_LEVELS'][_0xab36('0x10c')]},function(_0x5bbbe8){return db[_0xab36('0x45')][_0xab36('0x5c')]({'where':{'id':_0x5de9e2},'transaction':_0x5bbbe8})[_0xab36('0x15')](function(_0x40ce75){if(_0x40ce75){return db[_0xab36('0x10d')][_0xab36('0x2a')]({'where':{'ChatWebsiteId':_0x5de9e2},'transaction':_0x5bbbe8})[_0xab36('0x15')](function(){var _0x5a23f7=_[_0xab36('0x31')](_0x34d9bf,function(_0x14fea1){_0x14fea1[_0xab36('0x59')]=_0x5de9e2;return _0x14fea1;});return db['ChatApplication'][_0xab36('0x10e')](_0x5a23f7,{'transaction':_0x5bbbe8});});}else{_0xb8c58f=0x194;_0x4f4fb5=[];}});})[_0xab36('0x15')](function(){if(_0xb8c58f!==0x194){return db[_0xab36('0x10d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x5de9e2},'order':_0xab36('0x96')})[_0xab36('0x15')](function(_0x162126){_0x4f4fb5=_0x162126;});}})[_0xab36('0x1f')](function(_0x2d6821){_0xb8c58f=0x1f4;logger[_0xab36('0x1b')](_0x2d6821[_0xab36('0x10f')]);if(_0x2d6821[_0xab36('0x2f')]){delete _0x2d6821[_0xab36('0x2f')];}_0x4f4fb5=_0x2d6821;})[_0xab36('0x110')](function(){if(_0x4f4fb5===null){_0x2195d8[_0xab36('0x2e')](_0xb8c58f);}else{if(_0xb8c58f===0x1f4){_0x2195d8[_0xab36('0x20')](_0xb8c58f)[_0xab36('0xc0')](_0x4f4fb5);}else{_0x2195d8[_0xab36('0x20')](_0xb8c58f)[_0xab36('0x22')](_0x4f4fb5);}}});};exports[_0xab36('0x111')]=function(_0x5ac907,_0x74ff7b){var _0x29c79c={};var _0x53cfb0={};var _0x43042c;var _0x506304;return db['ChatWebsite'][_0xab36('0x5c')]({'where':{'id':_0x5ac907[_0xab36('0x4a')]['id']}})['then'](handleEntityNotFound(_0x74ff7b,null))[_0xab36('0x15')](function(_0x129cd8){if(_0x129cd8){_0x43042c=_0x129cd8;_0x53cfb0['model']=_[_0xab36('0x37')](db[_0xab36('0x10d')][_0xab36('0x4c')]);_0x53cfb0['query']=_[_0xab36('0x37')](_0x5ac907[_0xab36('0x36')]);_0x53cfb0[_0xab36('0x38')]=_[_0xab36('0x39')](_0x53cfb0[_0xab36('0x35')],_0x53cfb0[_0xab36('0x36')]);_0x29c79c[_0xab36('0x3b')]=_[_0xab36('0x39')](_0x53cfb0[_0xab36('0x35')],qs[_0xab36('0x3a')](_0x5ac907[_0xab36('0x36')][_0xab36('0x3a')]));_0x29c79c[_0xab36('0x3b')]=_0x29c79c[_0xab36('0x3b')][_0xab36('0x4d')]?_0x29c79c[_0xab36('0x3b')]:_0x53cfb0[_0xab36('0x35')];_0x29c79c[_0xab36('0x3d')]=qs[_0xab36('0x3e')](_0x5ac907[_0xab36('0x36')]['sort']);_0x29c79c['where']=qs[_0xab36('0x38')](_[_0xab36('0x40')](_0x5ac907[_0xab36('0x36')],_0x53cfb0[_0xab36('0x38')]));if(_0x5ac907['query'][_0xab36('0x41')]){_0x29c79c[_0xab36('0x3f')]=_[_0xab36('0x42')](_0x29c79c[_0xab36('0x3f')],{'$or':_[_0xab36('0x31')](_0x29c79c['attributes'],function(_0x32f32f){var _0x4728af={};_0x4728af[_0x32f32f]={'$like':'%'+_0x5ac907[_0xab36('0x36')]['filter']+'%'};return _0x4728af;})});}_0x29c79c=_[_0xab36('0x42')]({},_0x29c79c,_0x5ac907[_0xab36('0x44')]);return _0x43042c[_0xab36('0x111')](_0x29c79c);}})[_0xab36('0x15')](function(_0x298ba9){if(_0x298ba9){_0x506304=_0x298ba9[_0xab36('0x4d')];if(!_0x5ac907['query']['hasOwnProperty'](_0xab36('0x3c'))){_0x29c79c[_0xab36('0x24')]=qs[_0xab36('0x24')](_0x5ac907['query'][_0xab36('0x24')]);_0x29c79c[_0xab36('0x23')]=qs[_0xab36('0x23')](_0x5ac907[_0xab36('0x36')][_0xab36('0x23')]);}return _0x43042c[_0xab36('0x111')](_0x29c79c);}})[_0xab36('0x15')](function(_0x39c857){if(_0x39c857){return _0x39c857?{'count':_0x506304,'rows':_0x39c857}:null;}})[_0xab36('0x15')](respondWithResult(_0x74ff7b,null))['catch'](handleError(_0x74ff7b,null));};exports['addProactiveActions']=function(_0xd25330,_0x2bf777){return db['chatProactiveAction'][_0xab36('0x4f')]({'where':{'id':_0xd25330['params']['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x2bf777,null))[_0xab36('0x15')](function(_0x2e4608){if(_0x2e4608){return _0x2e4608[_0xab36('0x112')](_0xd25330[_0xab36('0x51')]['ids'],_[_0xab36('0xe3')](_0xd25330[_0xab36('0x51')],[_0xab36('0x5f'),'id'])||{});}})[_0xab36('0x15')](respondWithResult(_0x2bf777,null))[_0xab36('0x1f')](handleError(_0x2bf777,null));};exports['getProactiveActions']=function(_0x2557d2,_0x5c487c){var _0x119abd={};var _0x5836b1={};var _0x5c6534;var _0x501c93;return db[_0xab36('0x45')]['findOne']({'where':{'id':_0x2557d2[_0xab36('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c487c,null))[_0xab36('0x15')](function(_0x38545c){if(_0x38545c){_0x5c6534=_0x38545c;_0x5836b1[_0xab36('0x35')]=_['keys'](db[_0xab36('0x113')][_0xab36('0x4c')]);_0x5836b1['query']=_['keys'](_0x2557d2['query']);_0x5836b1['filters']=_[_0xab36('0x39')](_0x5836b1[_0xab36('0x35')],_0x5836b1['query']);_0x119abd[_0xab36('0x3b')]=_[_0xab36('0x39')](_0x5836b1['model'],qs[_0xab36('0x3a')](_0x2557d2['query']['fields']));_0x119abd[_0xab36('0x3b')]=_0x119abd[_0xab36('0x3b')][_0xab36('0x4d')]?_0x119abd[_0xab36('0x3b')]:_0x5836b1[_0xab36('0x35')];_0x119abd[_0xab36('0x3d')]=qs[_0xab36('0x3e')](_0x2557d2[_0xab36('0x36')][_0xab36('0x3e')]);_0x119abd[_0xab36('0x3f')]=qs[_0xab36('0x38')](_['pick'](_0x2557d2['query'],_0x5836b1[_0xab36('0x38')]));if(_0x2557d2[_0xab36('0x36')]['filter']){_0x119abd[_0xab36('0x3f')]=_['merge'](_0x119abd[_0xab36('0x3f')],{'$or':_[_0xab36('0x31')](_0x119abd['attributes'],function(_0xda89d1){var _0x2e78e8={};_0x2e78e8[_0xda89d1]={'$like':'%'+_0x2557d2[_0xab36('0x36')][_0xab36('0x41')]+'%'};return _0x2e78e8;})});}_0x119abd=_[_0xab36('0x42')]({},_0x119abd,_0x2557d2[_0xab36('0x44')]);return _0x5c6534[_0xab36('0xfa')](_0x119abd);}})['then'](function(_0xf31aa4){if(_0xf31aa4){_0x501c93=_0xf31aa4[_0xab36('0x4d')];if(!_0x2557d2[_0xab36('0x36')][_0xab36('0x5d')](_0xab36('0x3c'))){_0x119abd[_0xab36('0x24')]=qs[_0xab36('0x24')](_0x2557d2['query'][_0xab36('0x24')]);_0x119abd[_0xab36('0x23')]=qs[_0xab36('0x23')](_0x2557d2[_0xab36('0x36')]['offset']);}return _0x5c6534[_0xab36('0xfa')](_0x119abd);}})[_0xab36('0x15')](function(_0x5a12a0){if(_0x5a12a0){return _0x5a12a0?{'count':_0x501c93,'rows':_0x5a12a0}:null;}})[_0xab36('0x15')](respondWithResult(_0x5c487c,null))[_0xab36('0x1f')](handleError(_0x5c487c,null));};exports[_0xab36('0x114')]=function(_0x115650,_0x5e4c68){var _0xe01c6c=_0x115650['query'][_0xab36('0x115')]===_0xab36('0x116')?_0xab36('0x117'):'onlineForm';return db[_0xab36('0x45')]['find']({'attributes':['id',_0xe01c6c],'where':{'id':_0x115650[_0xab36('0x4a')]['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x5e4c68,null))[_0xab36('0x15')](function(_0x28a3e5){if(_0x28a3e5){var _0x40aaf0=_0x28a3e5[_0xe01c6c];var _0x1a2510=_0x40aaf0&&_0x40aaf0[_0xab36('0x118')]?_0x40aaf0['items']:[];_0x5e4c68['send']({'fromKey':_[_0xab36('0x71')](_0x40aaf0[_0xab36('0x119')])?undefined:_0x40aaf0['fromKey'],'count':_0x1a2510['length'],'rows':_0x1a2510});}})[_0xab36('0x1f')](handleError(_0x5e4c68,null));};exports[_0xab36('0x11a')]=function(_0x5aaa4c,_0x523e0d){var _0x20e4ac={'raw':![],'where':{}};var _0xf6c3aa={};var _0x2d8446={'count':0x0,'rows':[]};return db[_0xab36('0x45')][_0xab36('0x5c')]({'where':{'id':_0x5aaa4c['params']['id']}})[_0xab36('0x15')](handleEntityNotFound(_0x523e0d,null))[_0xab36('0x15')](function(_0xa1b675){if(_0xa1b675){_0xf6c3aa[_0xab36('0x35')]=_[_0xab36('0x37')](db[_0xab36('0xcb')][_0xab36('0x4c')]);_0xf6c3aa[_0xab36('0x36')]=_[_0xab36('0x37')](_0x5aaa4c['query']);_0xf6c3aa[_0xab36('0x38')]=_[_0xab36('0x39')](_0xf6c3aa[_0xab36('0x35')],_0xf6c3aa[_0xab36('0x36')]);_0x20e4ac[_0xab36('0x3b')]=_['intersection'](_0xf6c3aa[_0xab36('0x35')],qs[_0xab36('0x3a')](_0x5aaa4c[_0xab36('0x36')][_0xab36('0x3a')]));_0x20e4ac[_0xab36('0x3b')]=_0x20e4ac[_0xab36('0x3b')][_0xab36('0x4d')]?_0x20e4ac[_0xab36('0x3b')]:_0xf6c3aa[_0xab36('0x35')];if(!_0x5aaa4c[_0xab36('0x36')][_0xab36('0x5d')]('nolimit')){_0x20e4ac['limit']=qs[_0xab36('0x24')](_0x5aaa4c[_0xab36('0x36')][_0xab36('0x24')]);_0x20e4ac['offset']=qs[_0xab36('0x23')](_0x5aaa4c[_0xab36('0x36')][_0xab36('0x23')]);}_0x20e4ac[_0xab36('0x3d')]=qs['sort'](_0x5aaa4c[_0xab36('0x36')][_0xab36('0x3e')]);_0x20e4ac[_0xab36('0x3f')]=qs['filters'](_['pick'](_0x5aaa4c[_0xab36('0x36')],_0xf6c3aa[_0xab36('0x38')]));_0x20e4ac[_0xab36('0x3f')][_0xab36('0x59')]=_0xa1b675['id'];if(_0x5aaa4c[_0xab36('0x36')]['filter']){_0x20e4ac[_0xab36('0x3f')]=_[_0xab36('0x42')](_0x20e4ac[_0xab36('0x3f')],{'$or':_[_0xab36('0x31')](_0x20e4ac[_0xab36('0x3b')],function(_0x36d855){var _0x138aea={};_0x138aea[_0x36d855]={'$like':'%'+_0x5aaa4c['query'][_0xab36('0x41')]+'%'};return _0x138aea;})});}_0x20e4ac=_[_0xab36('0x42')]({},_0x20e4ac,_0x5aaa4c['options']);return db[_0xab36('0xcb')][_0xab36('0x26')]({'where':_0x20e4ac[_0xab36('0x3f')]})[_0xab36('0x15')](function(_0x5b6ff9){_0x2d8446['count']=_0x5b6ff9;if(_0x5aaa4c[_0xab36('0x36')][_0xab36('0x46')]){_0x20e4ac[_0xab36('0x4e')]=[{'all':!![]}];}else{_0x20e4ac[_0xab36('0x4e')]=[{'model':db[_0xab36('0x80')],'as':_0xab36('0x11b'),'required':![]},{'model':db[_0xab36('0x11c')],'as':_0xab36('0x11d'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x20e4ac);})[_0xab36('0x15')](function(_0xc61176){_0x2d8446[_0xab36('0x48')]=_0xc61176;return _0x2d8446;});}})[_0xab36('0x15')](respondWithFilteredResult(_0x523e0d,_0x20e4ac))['catch'](handleError(_0x523e0d,null));};exports['addAgents']=function(_0x3597aa,_0x56adc9){return db[_0xab36('0x45')][_0xab36('0x4f')]({'where':{'id':_0x3597aa['params']['id']}})['then'](handleEntityNotFound(_0x56adc9,null))[_0xab36('0x15')](function(_0x4dc190){if(_0x4dc190){return _0x4dc190['addAgents'](_0x3597aa[_0xab36('0x51')][_0xab36('0x5f')],_[_0xab36('0xe3')](_0x3597aa[_0xab36('0x51')],[_0xab36('0x5f'),'id'])||{})[_0xab36('0xc6')](function(_0x2c7e16){for(var _0x26dab8=0x0;_0x26dab8<_0x3597aa[_0xab36('0x51')][_0xab36('0x5f')][_0xab36('0x4d')];_0x26dab8+=0x1){socket[_0xab36('0x11e')](_0xab36('0x11f'),{'UserId':Number(_0x3597aa[_0xab36('0x51')][_0xab36('0x5f')][_0x26dab8]),'ChatWebsiteId':Number(_0x3597aa[_0xab36('0x4a')]['id'])});}return _0x2c7e16;});}})[_0xab36('0x15')](respondWithResult(_0x56adc9,null))[_0xab36('0x1f')](handleError(_0x56adc9,null));};exports[_0xab36('0x120')]=function(_0x53a1c8,_0xbfba27){return db[_0xab36('0x45')]['find']({'where':{'id':_0x53a1c8[_0xab36('0x4a')]['id']}})['then'](handleEntityNotFound(_0xbfba27,null))[_0xab36('0x15')](function(_0x3f0c57){if(_0x3f0c57){return _0x3f0c57[_0xab36('0x120')](_0x53a1c8[_0xab36('0x36')]['ids'])[_0xab36('0x15')](function(){if(_[_0xab36('0x121')](_0x53a1c8[_0xab36('0x36')][_0xab36('0x5f')])){for(var _0x1df8f4=0x0;_0x1df8f4<_0x53a1c8['query'][_0xab36('0x5f')][_0xab36('0x4d')];_0x1df8f4+=0x1){socket[_0xab36('0x11e')](_0xab36('0x122'),{'UserId':Number(_0x53a1c8['query']['ids'][_0x1df8f4]),'ChatWebsiteId':Number(_0x53a1c8[_0xab36('0x4a')]['id'])});}}else{socket[_0xab36('0x11e')](_0xab36('0x122'),{'UserId':Number(_0x53a1c8[_0xab36('0x36')][_0xab36('0x5f')]),'ChatWebsiteId':Number(_0x53a1c8['params']['id'])});}});}})[_0xab36('0x15')](respondWithStatusCode(_0xbfba27,null))[_0xab36('0x1f')](handleError(_0xbfba27,null));};exports[_0xab36('0x123')]=function(_0xdcad8e,_0x1dde74){var _0x2b8060={};var _0x451577={};var _0xa09111;var _0x5236f1;return db[_0xab36('0x45')][_0xab36('0x5c')]({'where':{'id':_0xdcad8e[_0xab36('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1dde74,null))[_0xab36('0x15')](function(_0x337720){if(_0x337720){_0xa09111=_0x337720;_0x451577[_0xab36('0x35')]=_[_0xab36('0x37')](db[_0xab36('0x124')]['rawAttributes']);_0x451577[_0xab36('0x36')]=_[_0xab36('0x37')](_0xdcad8e[_0xab36('0x36')]);_0x451577[_0xab36('0x38')]=_[_0xab36('0x39')](_0x451577[_0xab36('0x35')],_0x451577[_0xab36('0x36')]);_0x2b8060[_0xab36('0x3b')]=_[_0xab36('0x39')](_0x451577[_0xab36('0x35')],qs['fields'](_0xdcad8e[_0xab36('0x36')][_0xab36('0x3a')]));_0x2b8060[_0xab36('0x3b')]=_0x2b8060[_0xab36('0x3b')][_0xab36('0x4d')]?_0x2b8060[_0xab36('0x3b')]:_0x451577[_0xab36('0x35')];_0x2b8060[_0xab36('0x3d')]=qs[_0xab36('0x3e')](_0xdcad8e[_0xab36('0x36')][_0xab36('0x3e')]);_0x2b8060['where']=qs[_0xab36('0x38')](_[_0xab36('0x40')](_0xdcad8e[_0xab36('0x36')],_0x451577[_0xab36('0x38')]));if(_0xdcad8e[_0xab36('0x36')]['filter']){_0x2b8060[_0xab36('0x3f')]=_[_0xab36('0x42')](_0x2b8060[_0xab36('0x3f')],{'$or':_[_0xab36('0x31')](_0x2b8060[_0xab36('0x3b')],function(_0x402e0c){var _0x430535={};_0x430535[_0x402e0c]={'$like':'%'+_0xdcad8e[_0xab36('0x36')][_0xab36('0x41')]+'%'};return _0x430535;})});}_0x2b8060=_['merge']({},_0x2b8060,_0xdcad8e['options']);return _0xa09111[_0xab36('0x123')](_0x2b8060);}})[_0xab36('0x15')](function(_0x33ef0f){if(_0x33ef0f){_0x5236f1=_0x33ef0f[_0xab36('0x4d')];if(!_0xdcad8e[_0xab36('0x36')][_0xab36('0x5d')]('nolimit')){_0x2b8060[_0xab36('0x24')]=qs['limit'](_0xdcad8e[_0xab36('0x36')][_0xab36('0x24')]);_0x2b8060[_0xab36('0x23')]=qs[_0xab36('0x23')](_0xdcad8e['query'][_0xab36('0x23')]);}return _0xa09111['getAgents'](_0x2b8060);}})[_0xab36('0x15')](function(_0x585368){if(_0x585368){return _0x585368?{'count':_0x5236f1,'rows':_0x585368}:null;}})['then'](respondWithResult(_0x1dde74,null))['catch'](handleError(_0x1dde74,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 84a080d..8f614f5 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 _0x1e19=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x3726a8,_0x47bbc1){var _0x4c6344=function(_0x5841ef){while(--_0x5841ef){_0x3726a8['push'](_0x3726a8['shift']());}};_0x4c6344(++_0x47bbc1);}(_0x1e19,0x1c9));var _0x91e1=function(_0x15dc91,_0x2109e5){_0x15dc91=_0x15dc91-0x0;var _0x3ea859=_0x1e19[_0x15dc91];return _0x3ea859;};'use strict';var EventEmitter=require(_0x91e1('0x0'));var ChatWebsite=require(_0x91e1('0x1'))['db'][_0x91e1('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x91e1('0x3')](0x0);var events={'afterCreate':_0x91e1('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x561f69){return function(_0x5e4bdc,_0x169cdf,_0x2db427){ChatWebsiteEvents[_0x91e1('0x5')](_0x561f69+':'+_0x5e4bdc['id'],_0x5e4bdc);ChatWebsiteEvents[_0x91e1('0x5')](_0x561f69,_0x5e4bdc);_0x2db427(null);};}for(var e in events){if(events[_0x91e1('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x91e1('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x27c9=['../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x210cdd,_0x3f52a7){var _0xb105f5=function(_0x6aef10){while(--_0x6aef10){_0x210cdd['push'](_0x210cdd['shift']());}};_0xb105f5(++_0x3f52a7);}(_0x27c9,0x1af));var _0x927c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x27c9[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require(_0x927c('0x0'));var ChatWebsite=require(_0x927c('0x1'))['db'][_0x927c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x927c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x927c('0x4'),'afterDestroy':_0x927c('0x5')};function emitEvent(_0x591cb0){return function(_0x3a091e,_0x3ec1a0,_0x3c36f6){ChatWebsiteEvents[_0x927c('0x6')](_0x591cb0+':'+_0x3a091e['id'],_0x3a091e);ChatWebsiteEvents[_0x927c('0x6')](_0x591cb0,_0x3a091e);_0x3c36f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x927c('0x7')](e,emitEvent(event));}}module[_0x927c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 7193c61..2fa3fc1 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 _0xc9b2=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x38e919,_0xb59a62){var _0x35b6cb=function(_0x45999a){while(--_0x45999a){_0x38e919['push'](_0x38e919['shift']());}};_0x35b6cb(++_0xb59a62);}(_0xc9b2,0x1e6));var _0x2c9b=function(_0x25a6b9,_0x12f190){_0x25a6b9=_0x25a6b9-0x0;var _0x40333f=_0xc9b2[_0x25a6b9];return _0x40333f;};'use strict';var _=require(_0x2c9b('0x0'));var util=require(_0x2c9b('0x1'));var logger=require(_0x2c9b('0x2'))(_0x2c9b('0x3'));var moment=require(_0x2c9b('0x4'));var BPromise=require('bluebird');var rp=require(_0x2c9b('0x5'));var fs=require('fs');var path=require(_0x2c9b('0x6'));var rimraf=require('rimraf');var config=require(_0x2c9b('0x7'));var attributes=require(_0x2c9b('0x8'));module[_0x2c9b('0x9')]=function(_0x115bc5,_0x2579ed){return _0x115bc5[_0x2c9b('0xa')](_0x2c9b('0xb'),attributes,{'tableName':_0x2c9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd787=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x26f959,_0x1cf0c9){var _0x1191b9=function(_0x54cc62){while(--_0x54cc62){_0x26f959['push'](_0x26f959['shift']());}};_0x1191b9(++_0x1cf0c9);}(_0xd787,0xa9));var _0x7d78=function(_0x4d3d50,_0x50f156){_0x4d3d50=_0x4d3d50-0x0;var _0x175e6d=_0xd787[_0x4d3d50];return _0x175e6d;};'use strict';var _=require(_0x7d78('0x0'));var util=require(_0x7d78('0x1'));var logger=require(_0x7d78('0x2'))(_0x7d78('0x3'));var moment=require(_0x7d78('0x4'));var BPromise=require(_0x7d78('0x5'));var rp=require(_0x7d78('0x6'));var fs=require('fs');var path=require(_0x7d78('0x7'));var rimraf=require(_0x7d78('0x8'));var config=require(_0x7d78('0x9'));var attributes=require(_0x7d78('0xa'));module[_0x7d78('0xb')]=function(_0x4fb0bf,_0x228427){return _0x4fb0bf[_0x7d78('0xc')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 8c87e5c..fe055c2 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 _0xc11c=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x2bd215,_0x178ce1){var _0x84453=function(_0x247ecd){while(--_0x247ecd){_0x2bd215['push'](_0x2bd215['shift']());}};_0x84453(++_0x178ce1);}(_0xc11c,0x111));var _0xcc11=function(_0xec4677,_0x570c02){_0xec4677=_0xec4677-0x0;var _0x1e99ab=_0xc11c[_0xec4677];return _0x1e99ab;};'use strict';var _=require(_0xcc11('0x0'));var util=require(_0xcc11('0x1'));var moment=require(_0xcc11('0x2'));var BPromise=require(_0xcc11('0x3'));var rs=require(_0xcc11('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcc11('0x5'));var logger=require(_0xcc11('0x6'))(_0xcc11('0x7'));var config=require(_0xcc11('0x8'));var jayson=require(_0xcc11('0x9'));var client=jayson['client'][_0xcc11('0xa')]({'port':0x232a});config[_0xcc11('0xb')]=_[_0xcc11('0xc')](config[_0xcc11('0xb')],{'host':_0xcc11('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcc11('0xe'))[_0xcc11('0xf')](socket);function respondWithRpcPromise(_0x48318f,_0xcebebc,_0x2693c7){return new BPromise(function(_0x2d1598,_0x221c99){return client[_0xcc11('0x10')](_0x48318f,_0x2693c7)[_0xcc11('0x11')](function(_0x585656){logger[_0xcc11('0x12')](_0xcc11('0x13'),_0xcebebc,_0xcc11('0x14'));logger['debug'](_0xcc11('0x15'),_0xcebebc,_0xcc11('0x14'),JSON[_0xcc11('0x16')](_0x585656));if(_0x585656[_0xcc11('0x17')]){if(_0x585656[_0xcc11('0x17')][_0xcc11('0x18')]===0x1f4){logger[_0xcc11('0x17')](_0xcc11('0x13'),_0xcebebc,_0x585656[_0xcc11('0x17')][_0xcc11('0x19')]);return _0x221c99(_0x585656[_0xcc11('0x17')][_0xcc11('0x19')]);}logger[_0xcc11('0x17')](_0xcc11('0x13'),_0xcebebc,_0x585656[_0xcc11('0x17')]['message']);return _0x2d1598(_0x585656['error'][_0xcc11('0x19')]);}else{logger[_0xcc11('0x12')]('ChatWebsite,\x20%s,\x20%s',_0xcebebc,_0xcc11('0x14'));_0x2d1598(_0x585656[_0xcc11('0x1a')][_0xcc11('0x19')]);}})[_0xcc11('0x1b')](function(_0x5aa379){logger[_0xcc11('0x17')](_0xcc11('0x13'),_0xcebebc,_0x5aa379);_0x221c99(_0x5aa379);});});}
\ No newline at end of file
+var _0x1b54=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x423456,_0x3d212d){var _0x5d5ec8=function(_0x2eea50){while(--_0x2eea50){_0x423456['push'](_0x423456['shift']());}};_0x5d5ec8(++_0x3d212d);}(_0x1b54,0x65));var _0x41b5=function(_0x5e7bd1,_0x3634dd){_0x5e7bd1=_0x5e7bd1-0x0;var _0x33d089=_0x1b54[_0x5e7bd1];return _0x33d089;};'use strict';var _=require(_0x41b5('0x0'));var util=require(_0x41b5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x41b5('0x2'));var fs=require('fs');var Redis=require(_0x41b5('0x3'));var db=require(_0x41b5('0x4'))['db'];var utils=require(_0x41b5('0x5'));var logger=require(_0x41b5('0x6'))(_0x41b5('0x7'));var config=require('../../config/environment');var jayson=require(_0x41b5('0x8'));var client=jayson[_0x41b5('0x9')][_0x41b5('0xa')]({'port':0x232a});config[_0x41b5('0xb')]=_[_0x41b5('0xc')](config[_0x41b5('0xb')],{'host':_0x41b5('0xd'),'port':0x18eb});var socket=require(_0x41b5('0xe'))(new Redis(config[_0x41b5('0xb')]));require(_0x41b5('0xf'))['register'](socket);function respondWithRpcPromise(_0x5416db,_0x1e219b,_0x2478e2){return new BPromise(function(_0x5e6983,_0x47ef09){return client[_0x41b5('0x10')](_0x5416db,_0x2478e2)['then'](function(_0x3ad266){logger[_0x41b5('0x11')](_0x41b5('0x12'),_0x1e219b,_0x41b5('0x13'));logger[_0x41b5('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1e219b,_0x41b5('0x13'),JSON[_0x41b5('0x15')](_0x3ad266));if(_0x3ad266[_0x41b5('0x16')]){if(_0x3ad266[_0x41b5('0x16')][_0x41b5('0x17')]===0x1f4){logger[_0x41b5('0x16')](_0x41b5('0x12'),_0x1e219b,_0x3ad266['error']['message']);return _0x47ef09(_0x3ad266[_0x41b5('0x16')][_0x41b5('0x18')]);}logger[_0x41b5('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1e219b,_0x3ad266[_0x41b5('0x16')][_0x41b5('0x18')]);return _0x5e6983(_0x3ad266[_0x41b5('0x16')]['message']);}else{logger['info'](_0x41b5('0x12'),_0x1e219b,_0x41b5('0x13'));_0x5e6983(_0x3ad266[_0x41b5('0x19')][_0x41b5('0x18')]);}})[_0x41b5('0x1a')](function(_0x315d25){logger[_0x41b5('0x16')](_0x41b5('0x12'),_0x1e219b,_0x315d25);_0x47ef09(_0x315d25);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8799548..cb55652 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 _0x36a9=['chatWebsite:','save','remove','update','emit','removeListener','register','length'];(function(_0x3bc329,_0x51de4e){var _0x372a3a=function(_0x5ac402){while(--_0x5ac402){_0x3bc329['push'](_0x3bc329['shift']());}};_0x372a3a(++_0x51de4e);}(_0x36a9,0x139));var _0x936a=function(_0x15f722,_0x181197){_0x15f722=_0x15f722-0x0;var _0x18554e=_0x36a9[_0x15f722];return _0x18554e;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x936a('0x0'),_0x936a('0x1'),_0x936a('0x2')];function createListener(_0x5a511a,_0x2eaf7a){return function(_0x4676e2){_0x2eaf7a[_0x936a('0x3')](_0x5a511a,_0x4676e2);};}function removeListener(_0x5cd2e7,_0x1884a2){return function(){ChatWebsiteEvents[_0x936a('0x4')](_0x5cd2e7,_0x1884a2);};}exports[_0x936a('0x5')]=function(_0x3d02a6){for(var _0x174906=0x0,_0x22f5ff=events[_0x936a('0x6')];_0x174906<_0x22f5ff;_0x174906++){var _0x2c318e=events[_0x174906];var _0x200010=createListener(_0x936a('0x7')+_0x2c318e,_0x3d02a6);ChatWebsiteEvents['on'](_0x2c318e,_0x200010);}};
\ No newline at end of file
+var _0x1449=['update','register','./chatWebsite.events','save','remove'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x1449,0x1b0));var _0x9144=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x1449[_0x5b78e8];return _0xf2c321;};'use strict';var ChatWebsiteEvents=require(_0x9144('0x0'));var events=[_0x9144('0x1'),_0x9144('0x2'),_0x9144('0x3')];function createListener(_0x18b2f8,_0x5f2dd7){return function(_0x4eda41){_0x5f2dd7['emit'](_0x18b2f8,_0x4eda41);};}function removeListener(_0x18291c,_0x278eb4){return function(){ChatWebsiteEvents['removeListener'](_0x18291c,_0x278eb4);};}exports[_0x9144('0x4')]=function(_0x11d041){for(var _0x2cb495=0x0,_0x3d2a7b=events['length'];_0x2cb495<_0x3d2a7b;_0x2cb495++){var _0x18571f=events[_0x2cb495];var _0x834ec8=createListener('chatWebsite:'+_0x18571f,_0x11d041);ChatWebsiteEvents['on'](_0x18571f,_0x834ec8);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 67f7694..6a10d6b 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 _0x9bc1=['removeDispositions','removeAnswers','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','server/files/images/avatars/','file','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','/:id/applications','addApplications','addAgents','put','update','destroy','delete'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0x9bc1,0x1d1));var _0x19bc=function(_0x16cf22,_0x504218){_0x16cf22=_0x16cf22-0x0;var _0x113c09=_0x9bc1[_0x16cf22];return _0x113c09;};'use strict';var multer=require(_0x19bc('0x0'));var util=require('util');var path=require(_0x19bc('0x1'));var timeout=require(_0x19bc('0x2'));var express=require(_0x19bc('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x19bc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x19bc('0x5'));var controller=require(_0x19bc('0x6'));router['get']('/',auth[_0x19bc('0x7')](),controller[_0x19bc('0x8')]);router[_0x19bc('0x9')](_0x19bc('0xa'),auth[_0x19bc('0x7')](),controller['describe']);router['get'](_0x19bc('0xb'),auth['isAuthenticated'](),controller[_0x19bc('0xc')]);router['get'](_0x19bc('0xd'),auth[_0x19bc('0x7')](),controller[_0x19bc('0xe')]);router[_0x19bc('0x9')](_0x19bc('0xf'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x10')]);router[_0x19bc('0x9')]('/:id/logo',controller[_0x19bc('0x11')]);router[_0x19bc('0x9')](_0x19bc('0x12'),controller['getAvatar']);router['get'](_0x19bc('0x13'),controller[_0x19bc('0x14')]);router[_0x19bc('0x9')](_0x19bc('0x15'),controller[_0x19bc('0x16')]);router[_0x19bc('0x9')]('/:id/interactions',auth[_0x19bc('0x7')](),controller[_0x19bc('0x17')]);router['get'](_0x19bc('0x18'),controller[_0x19bc('0x19')]);router[_0x19bc('0x9')]('/:id/applications',auth[_0x19bc('0x7')](),controller['getApplications']);router[_0x19bc('0x9')](_0x19bc('0x1a'),auth[_0x19bc('0x7')](),controller['getProactiveActions']);router['get'](_0x19bc('0x1b'),controller['getFields']);router[_0x19bc('0x9')](_0x19bc('0x1c'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x1d')]);router['get'](_0x19bc('0x1e'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x1f')]);router[_0x19bc('0x20')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x19bc('0xd'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x21')]);router[_0x19bc('0x20')](_0x19bc('0xf'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x22')]);var upload=multer({'storage':multer[_0x19bc('0x23')]({'destination':function(_0x3d3d6b,_0x23acc1,_0x47be0c){_0x47be0c(null,path[_0x19bc('0x24')](config[_0x19bc('0x25')],'server/files/images/logos/'));},'filename':function(_0x2f5ee4,_0xd53f95,_0x4ff631){_0x4ff631(null,util[_0x19bc('0x26')](_0x19bc('0x27'),Date[_0x19bc('0x28')](),_0xd53f95[_0x19bc('0x29')]));}})});router[_0x19bc('0x20')]('/:id/logo',upload[_0x19bc('0x2a')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x223a2a,_0x3d3527,_0x223f78){_0x223f78(null,path['join'](config[_0x19bc('0x25')],_0x19bc('0x2b')));},'filename':function(_0x491d92,_0x33dd9c,_0x233348){_0x233348(null,util[_0x19bc('0x26')]('%s-%s',Date['now'](),_0x33dd9c[_0x19bc('0x29')]));}})});router[_0x19bc('0x20')](_0x19bc('0x12'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x19bc('0x23')]({'destination':function(_0x23c52f,_0xca3cd6,_0x24f768){_0x24f768(null,path[_0x19bc('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x249ef9,_0x478c3a,_0x137b1a){_0x137b1a(null,util['format']('%s-%s',Date[_0x19bc('0x28')](),_0x478c3a[_0x19bc('0x29')]));}})});router[_0x19bc('0x20')]('/:id/customer_avatar',upload[_0x19bc('0x2a')](_0x19bc('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38cf95,_0x3b48d1,_0x138280){_0x138280(null,path[_0x19bc('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3407b5,_0x52db61,_0xa3c449){_0xa3c449(null,util[_0x19bc('0x26')](_0x19bc('0x27'),Date[_0x19bc('0x28')](),_0x52db61[_0x19bc('0x29')]));}})});router['post'](_0x19bc('0x15'),upload[_0x19bc('0x2a')](_0x19bc('0x2c')),controller[_0x19bc('0x2d')]);router[_0x19bc('0x20')](_0x19bc('0x2e'),controller[_0x19bc('0x2f')]);const offlineUploadMulter=multer({'storage':multer[_0x19bc('0x23')]({'destination':function(_0xba71a4,_0x32a3fd,_0x4112cc){const _0x3efd95=path[_0x19bc('0x24')](config[_0x19bc('0x25')],'server/files',_0x19bc('0x30'),_0x19bc('0x31'));fs_extra[_0x19bc('0x32')](_0x3efd95,function(){_0x4112cc(null,_0x3efd95);});},'filename':function(_0x13fb5a,_0x1c225e,_0x15461e){const _0x15f6db=_0x1c225e[_0x19bc('0x29')][_0x19bc('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x17b945=path[_0x19bc('0x34')](_0x15f6db);const _0x368499=Date[_0x19bc('0x28')]()+'-'+_0x15f6db[_0x19bc('0x33')](_0x17b945,'')+_0x17b945;_0x15461e(null,_0x368499);}})});router[_0x19bc('0x20')](_0x19bc('0x35'),offlineUploadMulter['any'](),controller[_0x19bc('0x36')]);router[_0x19bc('0x20')]('/:id/interactions',auth[_0x19bc('0x7')](),controller[_0x19bc('0x37')]);router['post'](_0x19bc('0x38'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x39')]);router['post'](_0x19bc('0x1a'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x19bc('0x20')](_0x19bc('0x1e'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x3a')]);router[_0x19bc('0x3b')](_0x19bc('0xb'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x3c')]);router['delete'](_0x19bc('0xb'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x3d')]);router[_0x19bc('0x3e')](_0x19bc('0xd'),auth['isAuthenticated'](),controller[_0x19bc('0x3f')]);router[_0x19bc('0x3e')](_0x19bc('0xf'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x40')]);router[_0x19bc('0x3e')](_0x19bc('0x1e'),auth[_0x19bc('0x7')](),controller['removeAgents']);module[_0x19bc('0x41')]=router;
\ No newline at end of file
+var _0x8418=['getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','server/files/images/avatars/','/:id/avatar','addAvatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addProactiveActions','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet'];(function(_0x2bfd74,_0x470f4f){var _0x4227a2=function(_0x2b7ccb){while(--_0x2b7ccb){_0x2bfd74['push'](_0x2bfd74['shift']());}};_0x4227a2(++_0x470f4f);}(_0x8418,0xc0));var _0x8841=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0x8418[_0x50d84b];return _0x6d4270;};'use strict';var multer=require(_0x8841('0x0'));var util=require(_0x8841('0x1'));var path=require(_0x8841('0x2'));var timeout=require('connect-timeout');var express=require(_0x8841('0x3'));var router=express[_0x8841('0x4')]();var fs_extra=require(_0x8841('0x5'));var auth=require(_0x8841('0x6'));var interaction=require(_0x8841('0x7'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router[_0x8841('0x8')]('/',auth[_0x8841('0x9')](),controller['index']);router[_0x8841('0x8')](_0x8841('0xa'),auth[_0x8841('0x9')](),controller[_0x8841('0xb')]);router[_0x8841('0x8')](_0x8841('0xc'),auth[_0x8841('0x9')](),controller['show']);router[_0x8841('0x8')](_0x8841('0xd'),auth[_0x8841('0x9')](),controller[_0x8841('0xe')]);router[_0x8841('0x8')](_0x8841('0xf'),auth[_0x8841('0x9')](),controller[_0x8841('0x10')]);router[_0x8841('0x8')](_0x8841('0x11'),controller[_0x8841('0x12')]);router[_0x8841('0x8')]('/:id/avatar',controller[_0x8841('0x13')]);router[_0x8841('0x8')](_0x8841('0x14'),controller[_0x8841('0x15')]);router[_0x8841('0x8')](_0x8841('0x16'),controller[_0x8841('0x17')]);router[_0x8841('0x8')](_0x8841('0x18'),auth[_0x8841('0x9')](),controller[_0x8841('0x19')]);router[_0x8841('0x8')](_0x8841('0x1a'),controller[_0x8841('0x1b')]);router[_0x8841('0x8')](_0x8841('0x1c'),auth['isAuthenticated'](),controller[_0x8841('0x1d')]);router[_0x8841('0x8')](_0x8841('0x1e'),auth[_0x8841('0x9')](),controller['getProactiveActions']);router[_0x8841('0x8')](_0x8841('0x1f'),controller[_0x8841('0x20')]);router[_0x8841('0x8')](_0x8841('0x21'),auth['isAuthenticated'](),controller[_0x8841('0x22')]);router[_0x8841('0x8')](_0x8841('0x23'),auth[_0x8841('0x9')](),controller[_0x8841('0x24')]);router[_0x8841('0x25')]('/',auth[_0x8841('0x9')](),controller[_0x8841('0x26')]);router[_0x8841('0x25')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8841('0x27')]);router[_0x8841('0x25')](_0x8841('0xf'),auth['isAuthenticated'](),controller[_0x8841('0x28')]);var upload=multer({'storage':multer[_0x8841('0x29')]({'destination':function(_0x46ca7a,_0x3d2839,_0x138969){_0x138969(null,path[_0x8841('0x2a')](config[_0x8841('0x2b')],_0x8841('0x2c')));},'filename':function(_0x47bb3c,_0x230fc8,_0x57aa2c){_0x57aa2c(null,util[_0x8841('0x2d')](_0x8841('0x2e'),Date[_0x8841('0x2f')](),_0x230fc8[_0x8841('0x30')]));}})});router[_0x8841('0x25')]('/:id/logo',upload[_0x8841('0x31')](_0x8841('0x32')),controller['addLogo']);var upload=multer({'storage':multer[_0x8841('0x29')]({'destination':function(_0x15e5cc,_0x4bf59b,_0x5bd21c){_0x5bd21c(null,path[_0x8841('0x2a')](config[_0x8841('0x2b')],_0x8841('0x33')));},'filename':function(_0xe7ab5,_0x12af5c,_0x5854e5){_0x5854e5(null,util['format'](_0x8841('0x2e'),Date['now'](),_0x12af5c['originalname']));}})});router[_0x8841('0x25')](_0x8841('0x34'),upload[_0x8841('0x31')](_0x8841('0x32')),controller[_0x8841('0x35')]);var upload=multer({'storage':multer[_0x8841('0x29')]({'destination':function(_0x180d94,_0x37b7ef,_0x30fe27){_0x30fe27(null,path[_0x8841('0x2a')](config[_0x8841('0x2b')],'server/files/images/avatars/'));},'filename':function(_0xd17fe6,_0xddafbe,_0x46e7bc){_0x46e7bc(null,util[_0x8841('0x2d')](_0x8841('0x2e'),Date['now'](),_0xddafbe[_0x8841('0x30')]));}})});router[_0x8841('0x25')](_0x8841('0x14'),upload[_0x8841('0x31')](_0x8841('0x32')),controller[_0x8841('0x36')]);var upload=multer({'storage':multer[_0x8841('0x29')]({'destination':function(_0x38c557,_0x15bf24,_0x3fbaa1){_0x3fbaa1(null,path[_0x8841('0x2a')](config[_0x8841('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x47150d,_0x180387,_0x1c4bdb){_0x1c4bdb(null,util[_0x8841('0x2d')](_0x8841('0x2e'),Date[_0x8841('0x2f')](),_0x180387[_0x8841('0x30')]));}})});router['post'](_0x8841('0x16'),upload[_0x8841('0x31')](_0x8841('0x32')),controller[_0x8841('0x37')]);router['post']('/:id/notify',controller[_0x8841('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x8841('0x29')]({'destination':function(_0x2d9fe6,_0x5b9094,_0x40330d){const _0x164561=path[_0x8841('0x2a')](config['root'],_0x8841('0x39'),_0x8841('0x3a'),_0x8841('0x3b'));fs_extra[_0x8841('0x3c')](_0x164561,function(){_0x40330d(null,_0x164561);});},'filename':function(_0x47ae43,_0x22aff9,_0x21841b){const _0x48897c=_0x22aff9[_0x8841('0x30')][_0x8841('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4f4c82=path['extname'](_0x48897c);const _0x37f9a4=Date['now']()+'-'+_0x48897c[_0x8841('0x3d')](_0x4f4c82,'')+_0x4f4c82;_0x21841b(null,_0x37f9a4);}})});router['post'](_0x8841('0x3e'),offlineUploadMulter[_0x8841('0x3f')](),controller[_0x8841('0x40')]);router[_0x8841('0x25')]('/:id/interactions',auth[_0x8841('0x9')](),controller[_0x8841('0x41')]);router[_0x8841('0x25')]('/:id/applications',auth[_0x8841('0x9')](),controller['addApplications']);router[_0x8841('0x25')]('/:id/proactive_actions',auth[_0x8841('0x9')](),controller[_0x8841('0x42')]);router[_0x8841('0x25')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x8841('0x43')](_0x8841('0xc'),auth['isAuthenticated'](),controller[_0x8841('0x44')]);router[_0x8841('0x45')](_0x8841('0xc'),auth[_0x8841('0x9')](),controller['destroy']);router['delete'](_0x8841('0xd'),auth['isAuthenticated'](),controller[_0x8841('0x46')]);router[_0x8841('0x45')](_0x8841('0xf'),auth[_0x8841('0x9')](),controller[_0x8841('0x47')]);router[_0x8841('0x45')]('/:id/users',auth[_0x8841('0x9')](),controller['removeAgents']);module[_0x8841('0x48')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 1ad7a6f..789dada 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 _0xfc14=['expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x37b903,_0x2b6c30){var _0x291da1=function(_0x283624){while(--_0x283624){_0x37b903['push'](_0x37b903['shift']());}};_0x291da1(++_0x2b6c30);}(_0xfc14,0x6c));var _0x4fc1=function(_0x32d709,_0x6baf73){_0x32d709=_0x32d709-0x0;var _0x42a8fc=_0xfc14[_0x32d709];return _0x42a8fc;};var beaverLogger=require(_0x4fc1('0x0'));var express=require(_0x4fc1('0x1'));var auth=require('../components/auth/service');var config=require(_0x4fc1('0x2'));var router=express['Router']();var isProduction=config[_0x4fc1('0x3')]===_0x4fc1('0x4')||![];function clientSideLogs(_0x73b4f9,_0x1af3f0,_0x299485){var _0x42954e=_0x73b4f9[_0x4fc1('0x5')][_0x4fc1('0x6')](_0x4fc1('0x7'));if(!_0x42954e){throw new Error(_0x4fc1('0x8'));}return beaverLogger[_0x4fc1('0x9')]({'uri':'/client-logs','logger':_0x42954e,'enableCors':!isProduction})(_0x73b4f9,_0x1af3f0,_0x299485);}router[_0x4fc1('0xa')](auth[_0x4fc1('0xb')](),clientSideLogs);module[_0x4fc1('0xc')]=router;
\ No newline at end of file
+var _0x29eb=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','env','production','app','get','client-side-logger'];(function(_0x166af6,_0x5580a5){var _0x698473=function(_0x5ddb0b){while(--_0x5ddb0b){_0x166af6['push'](_0x166af6['shift']());}};_0x698473(++_0x5580a5);}(_0x29eb,0x1c5));var _0xb29e=function(_0x54c284,_0x5b5f7a){_0x54c284=_0x54c284-0x0;var _0x3b250d=_0x29eb[_0x54c284];return _0x3b250d;};var beaverLogger=require(_0xb29e('0x0'));var express=require(_0xb29e('0x1'));var auth=require(_0xb29e('0x2'));var config=require('../config/environment');var router=express[_0xb29e('0x3')]();var isProduction=config[_0xb29e('0x4')]===_0xb29e('0x5')||![];function clientSideLogs(_0x4a9b91,_0x29356f,_0x4c648e){var _0x14c35b=_0x4a9b91[_0xb29e('0x6')][_0xb29e('0x7')](_0xb29e('0x8'));if(!_0x14c35b){throw new Error(_0xb29e('0x9'));}return beaverLogger[_0xb29e('0xa')]({'uri':'/client-logs','logger':_0x14c35b,'enableCors':!isProduction})(_0x4a9b91,_0x29356f,_0x4c648e);}router[_0xb29e('0xb')](auth[_0xb29e('0xc')](),clientSideLogs);module[_0xb29e('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index ce78aa1..caad247 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 _0xdf5e=['ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','Google'];(function(_0x82895,_0x459f3c){var _0x547316=function(_0x510429){while(--_0x510429){_0x82895['push'](_0x82895['shift']());}};_0x547316(++_0x459f3c);}(_0xdf5e,0x130));var _0xedf5=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0xdf5e[_0x43fdf8];return _0x1160c6;};'use strict';var Sequelize=require(_0xedf5('0x0'));module[_0xedf5('0x1')]={'name':{'type':Sequelize[_0xedf5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xedf5('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xedf5('0x4')](_0xedf5('0x5'),_0xedf5('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0xedf5('0x7')},'data2':{'type':Sequelize[_0xedf5('0x2')],'comment':_0xedf5('0x8')},'data3':{'type':Sequelize[_0xedf5('0x2')],'comment':_0xedf5('0x9')},'data4':{'type':Sequelize[_0xedf5('0x2')],'comment':_0xedf5('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xedf5('0xb')},'data6':{'type':Sequelize[_0xedf5('0xc')],'comment':_0xedf5('0xd')},'data7':{'type':Sequelize[_0xedf5('0xc')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x8606=['MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x4beca3,_0x20057c){var _0x5b5547=function(_0x4738c9){while(--_0x4738c9){_0x4beca3['push'](_0x4beca3['shift']());}};_0x5b5547(++_0x20057c);}(_0x8606,0x8c));var _0x6860=function(_0x41f55e,_0x264009){_0x41f55e=_0x41f55e-0x0;var _0x922b33=_0x8606[_0x41f55e];return _0x922b33;};'use strict';var Sequelize=require(_0x6860('0x0'));module[_0x6860('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6860('0x2')](_0x6860('0x3'),_0x6860('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6860('0x2')](_0x6860('0x5'),_0x6860('0x6'))},'data1':{'type':Sequelize[_0x6860('0x7')],'comment':_0x6860('0x8')},'data2':{'type':Sequelize[_0x6860('0x7')],'comment':_0x6860('0x9')},'data3':{'type':Sequelize[_0x6860('0x7')],'comment':_0x6860('0xa')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x6860('0xb')],'comment':_0x6860('0xc')},'data6':{'type':Sequelize[_0x6860('0xb')],'comment':_0x6860('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':_0x6860('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index f33c401..8955b89 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 _0xbfb1=['Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','error','stack','name','send','slice','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','params','find','MicrosoftAzure','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','base64','toString','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error'];(function(_0xdbc609,_0x2a9cf2){var _0x43c00f=function(_0x2375af){while(--_0x2375af){_0xdbc609['push'](_0xdbc609['shift']());}};_0x43c00f(++_0x2a9cf2);}(_0xbfb1,0x187));var _0x1bfb=function(_0x2f6e2d,_0x3ba8a5){_0x2f6e2d=_0x2f6e2d-0x0;var _0x3d122c=_0xbfb1[_0x2f6e2d];return _0x3d122c;};'use strict';var _=require(_0x1bfb('0x0'));var Redis=require('ioredis');var qs=require(_0x1bfb('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x1bfb('0x2'));var logger=require(_0x1bfb('0x3'))(_0x1bfb('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0x1bfb('0x5'));config[_0x1bfb('0x6')]=_[_0x1bfb('0x7')](config[_0x1bfb('0x6')],{'host':_0x1bfb('0x8'),'port':0x18eb});var socket=require(_0x1bfb('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0x1bfb('0x6')]);function respondWithStatusCode(_0x4860a5,_0x47aadb){_0x47aadb=_0x47aadb||0xcc;return function(_0x2c23ef){if(_0x2c23ef){return _0x4860a5[_0x1bfb('0xa')](_0x47aadb);}return _0x4860a5[_0x1bfb('0xb')](_0x47aadb)['end']();};}function respondWithResult(_0x5130c1,_0x5b0ebc){_0x5b0ebc=_0x5b0ebc||0xc8;return function(_0x368440){if(_0x368440){return _0x5130c1['status'](_0x5b0ebc)[_0x1bfb('0xc')](_0x368440);}};}function respondWithFilteredResult(_0x52b3ff,_0x5478fc){return function(_0x1d883b){if(_0x1d883b){var _0x53aad7=typeof _0x5478fc['offset']===_0x1bfb('0xd')&&typeof _0x5478fc[_0x1bfb('0xe')]===_0x1bfb('0xd');var _0x5e2dc7=_0x1d883b[_0x1bfb('0xf')];var _0x571a3b=_0x53aad7?0x0:_0x5478fc[_0x1bfb('0x10')];var _0x44fff4=_0x53aad7?_0x1d883b[_0x1bfb('0xf')]:_0x5478fc['offset']+_0x5478fc[_0x1bfb('0xe')];var _0x68bd38;if(_0x44fff4>=_0x5e2dc7){_0x44fff4=_0x5e2dc7;_0x68bd38=0xc8;}else{_0x68bd38=0xce;}_0x52b3ff[_0x1bfb('0xb')](_0x68bd38);return _0x52b3ff[_0x1bfb('0x11')](_0x1bfb('0x12'),_0x571a3b+'-'+_0x44fff4+'/'+_0x5e2dc7)[_0x1bfb('0xc')](_0x1d883b);}return null;};}function saveUpdates(_0x34e13c){return function(_0x4c2275){if(_0x4c2275){return _0x4c2275[_0x1bfb('0x13')](_0x34e13c)[_0x1bfb('0x14')](function(_0x2cb67b){return _0x2cb67b;});}return null;};}function removeEntity(_0x4afa8d){return function(_0x29c8ac){if(_0x29c8ac){return _0x29c8ac[_0x1bfb('0x15')]()['then'](function(){_0x4afa8d[_0x1bfb('0xb')](0xcc)[_0x1bfb('0x16')]();});}};}function handleEntityNotFound(_0x56ea22){return function(_0x3e4dc2){if(!_0x3e4dc2){_0x56ea22[_0x1bfb('0xa')](0x194);}return _0x3e4dc2;};}function handleError(_0x4ba36c,_0xb0710d){_0xb0710d=_0xb0710d||0x1f4;return function(_0x31d115){logger[_0x1bfb('0x17')](_0x31d115[_0x1bfb('0x18')]);if(_0x31d115[_0x1bfb('0x19')]){delete _0x31d115[_0x1bfb('0x19')];}_0x4ba36c['status'](_0xb0710d)[_0x1bfb('0x1a')](_0x31d115);};}function maskClientSecret(_0x340fab){return _['padEnd'](_0x340fab[_0x1bfb('0x1b')](0x0,0x3),0x14,'*');}exports[_0x1bfb('0x1c')]=function(_0x5d844c,_0xc10af5){var _0x4a8ec8={},_0x5ad9f0={},_0x145f21={'count':0x0,'rows':[]};var _0xb4b617=_[_0x1bfb('0x1d')](db['CloudProvider'][_0x1bfb('0x1e')],function(_0xdb290c){return{'name':_0xdb290c[_0x1bfb('0x1f')],'type':_0xdb290c[_0x1bfb('0x20')][_0x1bfb('0x21')]};});_0x5ad9f0[_0x1bfb('0x22')]=_[_0x1bfb('0x1d')](_0xb4b617,'name');_0x5ad9f0[_0x1bfb('0x23')]=_[_0x1bfb('0x24')](_0x5d844c[_0x1bfb('0x23')]);_0x5ad9f0[_0x1bfb('0x25')]=_[_0x1bfb('0x26')](_0x5ad9f0['model'],_0x5ad9f0[_0x1bfb('0x23')]);_0x4a8ec8[_0x1bfb('0x27')]=_[_0x1bfb('0x26')](_0x5ad9f0[_0x1bfb('0x22')],qs[_0x1bfb('0x28')](_0x5d844c['query'][_0x1bfb('0x28')]));_0x4a8ec8[_0x1bfb('0x27')]=_0x4a8ec8[_0x1bfb('0x27')][_0x1bfb('0x29')]?_0x4a8ec8['attributes']:_0x5ad9f0[_0x1bfb('0x22')];if(!_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0x2a')](_0x1bfb('0x2b'))){_0x4a8ec8[_0x1bfb('0xe')]=qs[_0x1bfb('0xe')](_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0xe')]);_0x4a8ec8[_0x1bfb('0x10')]=qs['offset'](_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0x10')]);}_0x4a8ec8['order']=qs[_0x1bfb('0x2c')](_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0x2c')]);_0x4a8ec8['where']=qs[_0x1bfb('0x25')](_[_0x1bfb('0x2d')](_0x5d844c[_0x1bfb('0x23')],_0x5ad9f0[_0x1bfb('0x25')]),_0xb4b617);if(_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0x2e')]){_0x4a8ec8[_0x1bfb('0x2f')]=_[_0x1bfb('0x30')](_0x4a8ec8[_0x1bfb('0x2f')],{'$or':_[_0x1bfb('0x1d')](_0xb4b617,function(_0x44a4c){if(_0x44a4c[_0x1bfb('0x20')]!==_0x1bfb('0x31')){var _0x51ee4={};_0x51ee4[_0x44a4c[_0x1bfb('0x19')]]={'$like':'%'+_0x5d844c[_0x1bfb('0x23')]['filter']+'%'};return _0x51ee4;}})});}_0x4a8ec8=_['merge']({},_0x4a8ec8,_0x5d844c[_0x1bfb('0x32')]);var _0x2d328a={'where':_0x4a8ec8[_0x1bfb('0x2f')]};return db[_0x1bfb('0x33')][_0x1bfb('0xf')](_0x2d328a)[_0x1bfb('0x14')](function(_0x267f80){_0x145f21[_0x1bfb('0xf')]=_0x267f80;if(_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0x34')]){_0x4a8ec8[_0x1bfb('0x35')]=[{'all':!![]}];}return db[_0x1bfb('0x33')][_0x1bfb('0x36')](_0x4a8ec8);})[_0x1bfb('0x14')](function(_0x20ac5a){_0x145f21[_0x1bfb('0x37')]=_[_0x1bfb('0x1d')](_0x20ac5a,function(_0xa08f2a){if(_0xa08f2a[_0x1bfb('0x38')]==='MicrosoftAzure'){var _0x1889a0=encryptor[_0x1bfb('0x39')](_0xa08f2a[_0x1bfb('0x3a')]);_0xa08f2a[_0x1bfb('0x3a')]=maskClientSecret(_0x1889a0);}return _0xa08f2a;});return _0x145f21;})['then'](respondWithFilteredResult(_0xc10af5,_0x4a8ec8))[_0x1bfb('0x3b')](handleError(_0xc10af5,null));};exports[_0x1bfb('0x3c')]=function(_0x5c6e35,_0x1ccb56){var _0x4ca134={'raw':!![],'where':{'id':_0x5c6e35[_0x1bfb('0x3d')]['id']}},_0x11fb9e={};_0x11fb9e[_0x1bfb('0x22')]=_[_0x1bfb('0x24')](db['CloudProvider'][_0x1bfb('0x1e')]);_0x11fb9e[_0x1bfb('0x23')]=_[_0x1bfb('0x24')](_0x5c6e35[_0x1bfb('0x23')]);_0x11fb9e[_0x1bfb('0x25')]=_['intersection'](_0x11fb9e[_0x1bfb('0x22')],_0x11fb9e[_0x1bfb('0x23')]);_0x4ca134[_0x1bfb('0x27')]=_[_0x1bfb('0x26')](_0x11fb9e['model'],qs['fields'](_0x5c6e35[_0x1bfb('0x23')][_0x1bfb('0x28')]));_0x4ca134[_0x1bfb('0x27')]=_0x4ca134[_0x1bfb('0x27')][_0x1bfb('0x29')]?_0x4ca134[_0x1bfb('0x27')]:_0x11fb9e[_0x1bfb('0x22')];if(_0x5c6e35['query'][_0x1bfb('0x34')]){_0x4ca134[_0x1bfb('0x35')]=[{'all':!![]}];}_0x4ca134=_['merge']({},_0x4ca134,_0x5c6e35[_0x1bfb('0x32')]);return db['CloudProvider'][_0x1bfb('0x3e')](_0x4ca134)[_0x1bfb('0x14')](handleEntityNotFound(_0x1ccb56,null))[_0x1bfb('0x14')](function(_0x3686a9){if(_0x3686a9[_0x1bfb('0x38')]===_0x1bfb('0x3f')){var _0x47174e=encryptor[_0x1bfb('0x39')](_0x3686a9[_0x1bfb('0x3a')]);_0x3686a9[_0x1bfb('0x3a')]=maskClientSecret(_0x47174e);}return _0x3686a9;})[_0x1bfb('0x14')](respondWithResult(_0x1ccb56,null))[_0x1bfb('0x3b')](handleError(_0x1ccb56,null));};exports[_0x1bfb('0x40')]=function(_0xd12cff,_0x2827bf){if(!_0xd12cff[_0x1bfb('0x41')][_0x1bfb('0x19')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0xd12cff['body'][_0x1bfb('0x38')])throw new Error(_0x1bfb('0x42'));var _0x4eeb5b=db['CloudProvider'][_0x1bfb('0x1e')][_0x1bfb('0x38')][_0x1bfb('0x43')];if(!_0x4eeb5b[_0x1bfb('0x44')](_0xd12cff[_0x1bfb('0x41')][_0x1bfb('0x38')]))throw new Error(_0x1bfb('0x45')+_0x4eeb5b[_0x1bfb('0x46')](',\x20'));if(_0xd12cff[_0x1bfb('0x41')][_0x1bfb('0x38')]===_0x1bfb('0x3f')&&_0xd12cff['body'][_0x1bfb('0x3a')]){_0xd12cff[_0x1bfb('0x41')][_0x1bfb('0x3a')]=encryptor['encryptString'](_0xd12cff[_0x1bfb('0x41')][_0x1bfb('0x3a')]);}return db[_0x1bfb('0x33')][_0x1bfb('0x40')](_0xd12cff['body'],{})[_0x1bfb('0x14')](respondWithResult(_0x2827bf,0xc9))[_0x1bfb('0x3b')](handleError(_0x2827bf,null));};exports['update']=function(_0x2f2347,_0x916fb3){if(_0x2f2347['body']['id']){delete _0x2f2347[_0x1bfb('0x41')]['id'];}return db['CloudProvider'][_0x1bfb('0x3e')]({'where':{'id':_0x2f2347[_0x1bfb('0x3d')]['id']}})[_0x1bfb('0x14')](handleEntityNotFound(_0x916fb3,null))[_0x1bfb('0x14')](function(_0x283f97){if(_0x283f97[_0x1bfb('0x38')]===_0x1bfb('0x3f')&&_0x2f2347[_0x1bfb('0x41')][_0x1bfb('0x3a')]){_0x2f2347['body'][_0x1bfb('0x3a')]=encryptor[_0x1bfb('0x47')](_0x2f2347[_0x1bfb('0x41')][_0x1bfb('0x3a')]);}return _0x283f97;})[_0x1bfb('0x14')](saveUpdates(_0x2f2347['body'],null))[_0x1bfb('0x14')](respondWithResult(_0x916fb3,null))[_0x1bfb('0x3b')](handleError(_0x916fb3,null));};exports[_0x1bfb('0x15')]=function(_0x2a13e7,_0x1a3bf8){return db[_0x1bfb('0x33')][_0x1bfb('0x3e')]({'where':{'id':_0x2a13e7[_0x1bfb('0x3d')]['id']}})[_0x1bfb('0x14')](handleEntityNotFound(_0x1a3bf8,null))[_0x1bfb('0x14')](removeEntity(_0x1a3bf8,null))[_0x1bfb('0x3b')](handleError(_0x1a3bf8,null));};exports[_0x1bfb('0x48')]=function(_0x1f9401,_0x39bebc){return db[_0x1bfb('0x33')][_0x1bfb('0x49')]({'where':{'id':_0x1f9401['params']['id']},'raw':!![]})[_0x1bfb('0x14')](function(_0x39e2d8){if(!_0x39e2d8)return _0x39bebc[_0x1bfb('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x39e2d8,_0x1f9401[_0x1bfb('0x4a')]['id'])};})[_0x1bfb('0x14')](respondWithResult(_0x39bebc,null))[_0x1bfb('0x3b')](handleError(_0x39bebc,null));};exports[_0x1bfb('0x4b')]=function(_0x5802d5,_0x53b9f1){var _0x3a1a84=_0x5802d5[_0x1bfb('0x41')];var _0x590975;var _0x201a69;if(_0x3a1a84['error'])throw _0x3a1a84;redis[_0x1bfb('0x4c')](_0x3a1a84[_0x1bfb('0x4d')])[_0x1bfb('0x14')](function(_0x3591a3){if(!_0x3591a3)throw new Error(_0x1bfb('0x4e'));_0x590975=JSON['parse'](_0x3591a3);var _0x32c6e6=Buffer['from'](_0x3a1a84['state'],_0x1bfb('0x4f'))[_0x1bfb('0x50')](_0x1bfb('0x51'));_0x201a69=JSON[_0x1bfb('0x52')](_0x32c6e6);if(!oauth['isValidIdToken'](_0x3a1a84[_0x1bfb('0x53')],_0x590975[_0x1bfb('0x54')]))throw new Error(_0x1bfb('0x55'));redis['del'](_0x3a1a84[_0x1bfb('0x4d')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3a1a84[_0x1bfb('0x56')],_0x590975);})[_0x1bfb('0x14')](function(_0x26151c){_0x590975[_0x1bfb('0x57')]=_0x26151c['access_token'];_0x590975[_0x1bfb('0x58')]=_0x26151c[_0x1bfb('0x59')];return db[_0x1bfb('0x33')][_0x1bfb('0x13')]({'data5':_0x590975[_0x1bfb('0x57')],'data6':_0x590975[_0x1bfb('0x58')]},{'where':{'id':_0x590975['id']}});})['then'](function(){oauth[_0x1bfb('0x5a')](_0x590975);socket['emit'](_0x1bfb('0x5b'),{'id':_0x201a69['id']});return;})[_0x1bfb('0x14')](respondWithStatusCode(_0x53b9f1,null))[_0x1bfb('0x3b')](function(_0x3f1bfc){if(_0x201a69){socket[_0x1bfb('0x5c')](_0x1bfb('0x5d'),{'id':_0x201a69['id']});}if(!_0x590975){logger[_0x1bfb('0x17')](_0x1bfb('0x5e'),_0x3f1bfc);return _0x53b9f1[_0x1bfb('0xb')](0x1f4)['send'](_0x3f1bfc[_0x1bfb('0x5f')]);}logger['error'](_0x1bfb('0x60'),_0x590975['id'],JSON['stringify'](_0x3f1bfc));});};
\ No newline at end of file
+var _0xe0f1=['localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','Content-Range','update','then','error','stack','name','send','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','filter','includeAll','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','options','body','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','create','find','params','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','from','state','base64','toString','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','defaults'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe0f1,0xb4));var _0x1e0f=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0xe0f1[_0x5a6644];return _0x3a2a5d;};'use strict';var _=require('lodash');var Redis=require(_0x1e0f('0x0'));var qs=require(_0x1e0f('0x1'));var encryptor=require(_0x1e0f('0x2'));var config=require(_0x1e0f('0x3'));var logger=require(_0x1e0f('0x4'))('api');var db=require(_0x1e0f('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x1e0f('0x6')]=_[_0x1e0f('0x7')](config[_0x1e0f('0x6')],{'host':_0x1e0f('0x8'),'port':0x18eb});var socket=require(_0x1e0f('0x9'))(new Redis(config[_0x1e0f('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x2ee537,_0x3847bf){_0x3847bf=_0x3847bf||0xcc;return function(_0x1831c3){if(_0x1831c3){return _0x2ee537[_0x1e0f('0xa')](_0x3847bf);}return _0x2ee537[_0x1e0f('0xb')](_0x3847bf)['end']();};}function respondWithResult(_0x1c6e7c,_0x4bdd08){_0x4bdd08=_0x4bdd08||0xc8;return function(_0x2ca4e6){if(_0x2ca4e6){return _0x1c6e7c['status'](_0x4bdd08)[_0x1e0f('0xc')](_0x2ca4e6);}};}function respondWithFilteredResult(_0x1d3557,_0x274357){return function(_0x3940ff){if(_0x3940ff){var _0x23ef94=typeof _0x274357[_0x1e0f('0xd')]===_0x1e0f('0xe')&&typeof _0x274357['limit']==='undefined';var _0x46f1b0=_0x3940ff['count'];var _0xf4a0af=_0x23ef94?0x0:_0x274357['offset'];var _0x57aaae=_0x23ef94?_0x3940ff[_0x1e0f('0xf')]:_0x274357['offset']+_0x274357[_0x1e0f('0x10')];var _0x58a25d;if(_0x57aaae>=_0x46f1b0){_0x57aaae=_0x46f1b0;_0x58a25d=0xc8;}else{_0x58a25d=0xce;}_0x1d3557[_0x1e0f('0xb')](_0x58a25d);return _0x1d3557['set'](_0x1e0f('0x11'),_0xf4a0af+'-'+_0x57aaae+'/'+_0x46f1b0)['json'](_0x3940ff);}return null;};}function saveUpdates(_0x2f0f22){return function(_0x11e4b1){if(_0x11e4b1){return _0x11e4b1[_0x1e0f('0x12')](_0x2f0f22)[_0x1e0f('0x13')](function(_0x409c18){return _0x409c18;});}return null;};}function removeEntity(_0x3740c5){return function(_0x3a1408){if(_0x3a1408){return _0x3a1408['destroy']()['then'](function(){_0x3740c5[_0x1e0f('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x504a3d){return function(_0x2b174){if(!_0x2b174){_0x504a3d['sendStatus'](0x194);}return _0x2b174;};}function handleError(_0x3c16ae,_0xe91649){_0xe91649=_0xe91649||0x1f4;return function(_0x3af248){logger[_0x1e0f('0x14')](_0x3af248[_0x1e0f('0x15')]);if(_0x3af248[_0x1e0f('0x16')]){delete _0x3af248[_0x1e0f('0x16')];}_0x3c16ae[_0x1e0f('0xb')](_0xe91649)[_0x1e0f('0x17')](_0x3af248);};}function maskClientSecret(_0x28f5c4){return _[_0x1e0f('0x18')](_0x28f5c4[_0x1e0f('0x19')](0x0,0x3),0x14,'*');}exports[_0x1e0f('0x1a')]=function(_0x55a6ba,_0x44d28f){var _0x190040={},_0x1b2d7f={},_0x255f21={'count':0x0,'rows':[]};var _0x4beb1a=_['map'](db[_0x1e0f('0x1b')][_0x1e0f('0x1c')],function(_0x36268f){return{'name':_0x36268f[_0x1e0f('0x1d')],'type':_0x36268f[_0x1e0f('0x1e')][_0x1e0f('0x1f')]};});_0x1b2d7f[_0x1e0f('0x20')]=_['map'](_0x4beb1a,'name');_0x1b2d7f[_0x1e0f('0x21')]=_[_0x1e0f('0x22')](_0x55a6ba[_0x1e0f('0x21')]);_0x1b2d7f[_0x1e0f('0x23')]=_[_0x1e0f('0x24')](_0x1b2d7f[_0x1e0f('0x20')],_0x1b2d7f[_0x1e0f('0x21')]);_0x190040['attributes']=_[_0x1e0f('0x24')](_0x1b2d7f[_0x1e0f('0x20')],qs[_0x1e0f('0x25')](_0x55a6ba[_0x1e0f('0x21')][_0x1e0f('0x25')]));_0x190040[_0x1e0f('0x26')]=_0x190040[_0x1e0f('0x26')][_0x1e0f('0x27')]?_0x190040[_0x1e0f('0x26')]:_0x1b2d7f[_0x1e0f('0x20')];if(!_0x55a6ba[_0x1e0f('0x21')][_0x1e0f('0x28')]('nolimit')){_0x190040[_0x1e0f('0x10')]=qs[_0x1e0f('0x10')](_0x55a6ba[_0x1e0f('0x21')]['limit']);_0x190040[_0x1e0f('0xd')]=qs[_0x1e0f('0xd')](_0x55a6ba[_0x1e0f('0x21')][_0x1e0f('0xd')]);}_0x190040[_0x1e0f('0x29')]=qs[_0x1e0f('0x2a')](_0x55a6ba[_0x1e0f('0x21')]['sort']);_0x190040['where']=qs[_0x1e0f('0x23')](_[_0x1e0f('0x2b')](_0x55a6ba[_0x1e0f('0x21')],_0x1b2d7f[_0x1e0f('0x23')]),_0x4beb1a);if(_0x55a6ba['query']['filter']){_0x190040[_0x1e0f('0x2c')]=_[_0x1e0f('0x2d')](_0x190040[_0x1e0f('0x2c')],{'$or':_['map'](_0x4beb1a,function(_0x12e5e7){if(_0x12e5e7[_0x1e0f('0x1e')]!=='VIRTUAL'){var _0x113844={};_0x113844[_0x12e5e7[_0x1e0f('0x16')]]={'$like':'%'+_0x55a6ba[_0x1e0f('0x21')][_0x1e0f('0x2e')]+'%'};return _0x113844;}})});}_0x190040=_[_0x1e0f('0x2d')]({},_0x190040,_0x55a6ba['options']);var _0x5b671e={'where':_0x190040[_0x1e0f('0x2c')]};return db[_0x1e0f('0x1b')][_0x1e0f('0xf')](_0x5b671e)[_0x1e0f('0x13')](function(_0x448f84){_0x255f21[_0x1e0f('0xf')]=_0x448f84;if(_0x55a6ba['query'][_0x1e0f('0x2f')]){_0x190040[_0x1e0f('0x30')]=[{'all':!![]}];}return db[_0x1e0f('0x1b')][_0x1e0f('0x31')](_0x190040);})[_0x1e0f('0x13')](function(_0x35090b){_0x255f21['rows']=_['map'](_0x35090b,function(_0x35d25a){if(_0x35d25a[_0x1e0f('0x32')]===_0x1e0f('0x33')){var _0x3b58ae=encryptor[_0x1e0f('0x34')](_0x35d25a[_0x1e0f('0x35')]);_0x35d25a[_0x1e0f('0x35')]=maskClientSecret(_0x3b58ae);}return _0x35d25a;});return _0x255f21;})[_0x1e0f('0x13')](respondWithFilteredResult(_0x44d28f,_0x190040))[_0x1e0f('0x36')](handleError(_0x44d28f,null));};exports[_0x1e0f('0x37')]=function(_0x33da40,_0x2c527b){var _0x3b7d94={'raw':!![],'where':{'id':_0x33da40['params']['id']}},_0x47aacd={};_0x47aacd[_0x1e0f('0x20')]=_[_0x1e0f('0x22')](db[_0x1e0f('0x1b')][_0x1e0f('0x1c')]);_0x47aacd['query']=_[_0x1e0f('0x22')](_0x33da40[_0x1e0f('0x21')]);_0x47aacd[_0x1e0f('0x23')]=_['intersection'](_0x47aacd[_0x1e0f('0x20')],_0x47aacd[_0x1e0f('0x21')]);_0x3b7d94[_0x1e0f('0x26')]=_[_0x1e0f('0x24')](_0x47aacd[_0x1e0f('0x20')],qs[_0x1e0f('0x25')](_0x33da40['query'][_0x1e0f('0x25')]));_0x3b7d94[_0x1e0f('0x26')]=_0x3b7d94['attributes']['length']?_0x3b7d94[_0x1e0f('0x26')]:_0x47aacd[_0x1e0f('0x20')];if(_0x33da40[_0x1e0f('0x21')][_0x1e0f('0x2f')]){_0x3b7d94[_0x1e0f('0x30')]=[{'all':!![]}];}_0x3b7d94=_['merge']({},_0x3b7d94,_0x33da40[_0x1e0f('0x38')]);return db[_0x1e0f('0x1b')]['find'](_0x3b7d94)[_0x1e0f('0x13')](handleEntityNotFound(_0x2c527b,null))['then'](function(_0x552783){if(_0x552783[_0x1e0f('0x32')]==='MicrosoftAzure'){var _0x1063ad=encryptor[_0x1e0f('0x34')](_0x552783[_0x1e0f('0x35')]);_0x552783[_0x1e0f('0x35')]=maskClientSecret(_0x1063ad);}return _0x552783;})[_0x1e0f('0x13')](respondWithResult(_0x2c527b,null))['catch'](handleError(_0x2c527b,null));};exports['create']=function(_0x4c1415,_0x48616f){if(!_0x4c1415[_0x1e0f('0x39')][_0x1e0f('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x4c1415['body'][_0x1e0f('0x32')])throw new Error(_0x1e0f('0x3a'));var _0xa73862=db[_0x1e0f('0x1b')][_0x1e0f('0x1c')][_0x1e0f('0x32')][_0x1e0f('0x3b')];if(!_0xa73862['includes'](_0x4c1415[_0x1e0f('0x39')][_0x1e0f('0x32')]))throw new Error(_0x1e0f('0x3c')+_0xa73862[_0x1e0f('0x3d')](',\x20'));if(_0x4c1415[_0x1e0f('0x39')][_0x1e0f('0x32')]==='MicrosoftAzure'&&_0x4c1415[_0x1e0f('0x39')][_0x1e0f('0x35')]){_0x4c1415[_0x1e0f('0x39')][_0x1e0f('0x35')]=encryptor['encryptString'](_0x4c1415[_0x1e0f('0x39')][_0x1e0f('0x35')]);}return db[_0x1e0f('0x1b')][_0x1e0f('0x3e')](_0x4c1415[_0x1e0f('0x39')],{})[_0x1e0f('0x13')](respondWithResult(_0x48616f,0xc9))['catch'](handleError(_0x48616f,null));};exports[_0x1e0f('0x12')]=function(_0x455e2b,_0x279bd7){if(_0x455e2b[_0x1e0f('0x39')]['id']){delete _0x455e2b[_0x1e0f('0x39')]['id'];}return db[_0x1e0f('0x1b')][_0x1e0f('0x3f')]({'where':{'id':_0x455e2b[_0x1e0f('0x40')]['id']}})[_0x1e0f('0x13')](handleEntityNotFound(_0x279bd7,null))[_0x1e0f('0x13')](function(_0x3e80d9){if(_0x3e80d9[_0x1e0f('0x32')]===_0x1e0f('0x33')&&_0x455e2b[_0x1e0f('0x39')][_0x1e0f('0x35')]){_0x455e2b['body']['data3']=encryptor['encryptString'](_0x455e2b['body'][_0x1e0f('0x35')]);}return _0x3e80d9;})['then'](saveUpdates(_0x455e2b['body'],null))[_0x1e0f('0x13')](respondWithResult(_0x279bd7,null))['catch'](handleError(_0x279bd7,null));};exports[_0x1e0f('0x41')]=function(_0x153fd3,_0x48d285){return db[_0x1e0f('0x1b')][_0x1e0f('0x3f')]({'where':{'id':_0x153fd3[_0x1e0f('0x40')]['id']}})[_0x1e0f('0x13')](handleEntityNotFound(_0x48d285,null))['then'](removeEntity(_0x48d285,null))[_0x1e0f('0x36')](handleError(_0x48d285,null));};exports[_0x1e0f('0x42')]=function(_0xc26580,_0x4ae150){return db[_0x1e0f('0x1b')][_0x1e0f('0x43')]({'where':{'id':_0xc26580[_0x1e0f('0x40')]['id']},'raw':!![]})[_0x1e0f('0x13')](function(_0x1965f8){if(!_0x1965f8)return _0x4ae150['sendStatus'](0x194);return{'url':oauth[_0x1e0f('0x44')](_0x1965f8,_0xc26580['user']['id'])};})[_0x1e0f('0x13')](respondWithResult(_0x4ae150,null))['catch'](handleError(_0x4ae150,null));};exports[_0x1e0f('0x45')]=function(_0xf7c1d9,_0x175650){var _0x1fb31e=_0xf7c1d9[_0x1e0f('0x39')];var _0x2db76c;var _0x3e8233;if(_0x1fb31e[_0x1e0f('0x14')])throw _0x1fb31e;redis[_0x1e0f('0x46')](_0x1fb31e['state'])[_0x1e0f('0x13')](function(_0x3e0f41){if(!_0x3e0f41)throw new Error(_0x1e0f('0x47'));_0x2db76c=JSON['parse'](_0x3e0f41);var _0x3dcaf9=Buffer[_0x1e0f('0x48')](_0x1fb31e[_0x1e0f('0x49')],_0x1e0f('0x4a'))[_0x1e0f('0x4b')](_0x1e0f('0x4c'));_0x3e8233=JSON[_0x1e0f('0x4d')](_0x3dcaf9);if(!oauth['isValidIdToken'](_0x1fb31e[_0x1e0f('0x4e')],_0x2db76c[_0x1e0f('0x4f')]))throw new Error(_0x1e0f('0x50'));redis[_0x1e0f('0x51')](_0x1fb31e[_0x1e0f('0x49')]);return oauth[_0x1e0f('0x52')](_0x1fb31e['code'],_0x2db76c);})[_0x1e0f('0x13')](function(_0x1facb3){_0x2db76c[_0x1e0f('0x53')]=_0x1facb3[_0x1e0f('0x54')];_0x2db76c[_0x1e0f('0x55')]=_0x1facb3[_0x1e0f('0x56')];return db[_0x1e0f('0x1b')][_0x1e0f('0x12')]({'data5':_0x2db76c[_0x1e0f('0x53')],'data6':_0x2db76c['data6']},{'where':{'id':_0x2db76c['id']}});})[_0x1e0f('0x13')](function(){oauth['startRefreshInterval'](_0x2db76c);socket[_0x1e0f('0x57')](_0x1e0f('0x58'),{'id':_0x3e8233['id']});return;})[_0x1e0f('0x13')](respondWithStatusCode(_0x175650,null))[_0x1e0f('0x36')](function(_0x4ac833){if(_0x3e8233){socket['emit'](_0x1e0f('0x59'),{'id':_0x3e8233['id']});}if(!_0x2db76c){logger['error'](_0x1e0f('0x5a'),_0x4ac833);return _0x175650[_0x1e0f('0xb')](0x1f4)['send'](_0x4ac833[_0x1e0f('0x5b')]);}logger['error'](_0x1e0f('0x5c'),_0x2db76c['id'],JSON[_0x1e0f('0x5d')](_0x4ac833));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index b4e8c93..8c353c5 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 _0x27c0=['../../config/environment','./cloudProvider.attributes','CloudProvider','cloud_providers','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x27c0,0x1cf));var _0x027c=function(_0x136108,_0x33ae59){_0x136108=_0x136108-0x0;var _0x49ab70=_0x27c0[_0x136108];return _0x49ab70;};'use strict';var _=require('lodash');var util=require(_0x027c('0x0'));var logger=require(_0x027c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x027c('0x2'));var rp=require(_0x027c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x027c('0x4'));var config=require(_0x027c('0x5'));var attributes=require(_0x027c('0x6'));module['exports']=function(_0x555bc3,_0x3f4a7b){return _0x555bc3['define'](_0x027c('0x7'),attributes,{'tableName':_0x027c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1623=['request-promise','path','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','util','../../config/logger','api','moment','bluebird'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x1623,0x67));var _0x3162=function(_0x2ec26d,_0x5a426e){_0x2ec26d=_0x2ec26d-0x0;var _0x12d8d5=_0x1623[_0x2ec26d];return _0x12d8d5;};'use strict';var _=require('lodash');var util=require(_0x3162('0x0'));var logger=require(_0x3162('0x1'))(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var rp=require(_0x3162('0x5'));var fs=require('fs');var path=require(_0x3162('0x6'));var rimraf=require('rimraf');var config=require(_0x3162('0x7'));var attributes=require(_0x3162('0x8'));module[_0x3162('0x9')]=function(_0x40029b,_0x30a8d6){return _0x40029b['define'](_0x3162('0xa'),attributes,{'tableName':_0x3162('0xb'),'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 65f2a4c..8f5c78d 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 _0xcccf=['/authorize','/token','map','push','data7','/.default','type','Outlook365','Dynamics365','{TENANT_ID}','data2','code','id_token','toString','randomBytes','client_id','data1','response_type','join','redirect_uri','data4','scope','nonce','prompt','key','value','oauth2Claims','oauth2/','set','stringify','decode','payload','audience','isAfter','unix','exp','then','data3','refresh_token','decryptString','POST','replace','data5','access_token','data6','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access'];(function(_0x5cb5ab,_0x3d6d21){var _0x5be2ab=function(_0x417a55){while(--_0x417a55){_0x5cb5ab['push'](_0x5cb5ab['shift']());}};_0x5be2ab(++_0x3d6d21);}(_0xcccf,0x85));var _0xfccc=function(_0x3e946d,_0x11e07f){_0x3e946d=_0x3e946d-0x0;var _0x4cb65b=_0xcccf[_0x3e946d];return _0x4cb65b;};'use strict';var _=require('lodash');var crypto=require(_0xfccc('0x0'));var jwt=require(_0xfccc('0x1'));var moment=require(_0xfccc('0x2'));var Redis=require(_0xfccc('0x3'));var rp=require(_0xfccc('0x4'));var util=require(_0xfccc('0x5'));var encryptor=require(_0xfccc('0x6'));var config=require(_0xfccc('0x7'));var logger=require('../../config/logger')(_0xfccc('0x8'));var schedule=require(_0xfccc('0x9'));var db=require('../../mysqldb')['db'];config[_0xfccc('0xa')]=_['defaults'](config[_0xfccc('0xa')],{'host':_0xfccc('0xb'),'port':0x18eb});var redis=new Redis(config[_0xfccc('0xa')]);var MICROSOFT_AUTH_URL=_0xfccc('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xfccc('0xd'),'profile',_0xfccc('0xe'),'offline_access',_0xfccc('0xf'),_0xfccc('0x10'),_0xfccc('0x11')],'Dynamics365':[_0xfccc('0xd'),_0xfccc('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xfccc('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xfccc('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x26714d){var _0x1b8332=_[_0xfccc('0x15')](AZURE_AUTH_SCOPES[_0x26714d['type']]);if(_0x26714d['type']==='Dynamics365')_0x1b8332[_0xfccc('0x16')](_0x26714d[_0xfccc('0x17')]+_0xfccc('0x18'));return _0x1b8332['join']('\x20');}function getAccessTokenScope(_0x365c54){if(_0x365c54[_0xfccc('0x19')]===_0xfccc('0x1a'))return _0xfccc('0xf');if(_0x365c54[_0xfccc('0x19')]===_0xfccc('0x1b'))return _0x365c54['data7']+_0xfccc('0x18');}function generateMicrosoftAuthorizationUrl(_0x4b1985,_0x57a2ab){var _0x4b46b5=MICROSOFT_AUTH_URL['replace'](_0xfccc('0x1c'),_0x4b1985[_0xfccc('0x1d')]);var _0x4b08e5=[_0xfccc('0x1e'),_0xfccc('0x1f')];var _0x17158b=Buffer['from'](JSON['stringify']({'id':_0x57a2ab}))[_0xfccc('0x20')]('base64');var _0x3cf545=crypto[_0xfccc('0x21')](0x10)[_0xfccc('0x20')]('hex');var _0x477367=getAuthorizationScopes(_0x4b1985);var _0x342aac=[{'key':_0xfccc('0x22'),'value':_0x4b1985[_0xfccc('0x23')]},{'key':_0xfccc('0x24'),'value':encodeURIComponent(_0x4b08e5[_0xfccc('0x25')]('\x20'))},{'key':_0xfccc('0x26'),'value':_0x4b1985[_0xfccc('0x27')]},{'key':'response_mode','value':'form_post'},{'key':_0xfccc('0x28'),'value':encodeURIComponent(_0x477367)},{'key':'state','value':_0x17158b},{'key':_0xfccc('0x29'),'value':_0x3cf545},{'key':_0xfccc('0x2a'),'value':'login'}];var _0x3a5329=_0x4b46b5+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x342aac,function(_0x1fabcc){return _0x1fabcc[_0xfccc('0x2b')]+'='+_0x1fabcc[_0xfccc('0x2c')];})['join']('&');_0x4b1985[_0xfccc('0x2d')]={'issuer':_0x4b46b5['replace'](_0xfccc('0x2e'),''),'audience':_0x4b1985[_0xfccc('0x23')],'state':_0x17158b,'nonce':_0x3cf545};redis[_0xfccc('0x2f')](_0x17158b,JSON[_0xfccc('0x30')](_0x4b1985));return _0x3a5329;}function isValidIdToken(_0xf11ee,_0x4a73cb){try{var _0x433b17=jwt[_0xfccc('0x31')](_0xf11ee,{'complete':!![]});var _0x4fe097=_0x433b17[_0xfccc('0x32')];if(_0x4fe097['iss']!==_0x4a73cb['issuer'])return![];if(_0x4fe097['aud']!==_0x4a73cb[_0xfccc('0x33')])return![];if(_0x4fe097[_0xfccc('0x29')]!==_0x4a73cb[_0xfccc('0x29')])return![];if(moment()[_0xfccc('0x34')](moment[_0xfccc('0x35')](_0x4fe097[_0xfccc('0x36')])))return![];return!![];}catch(_0x403550){throw _0x403550;}}function refreshOauth2MicrosoftAccessToken(_0x5cd3c7){return Promise['resolve']()[_0xfccc('0x37')](function(){if(_0x5cd3c7[_0xfccc('0x38')])return _0x5cd3c7;return db['CloudProvider']['findOne']({'where':{'id':_0x5cd3c7['id']},'raw':!![]});})['then'](function(_0x48438e){var _0x14c71d={'grant_type':_0xfccc('0x39'),'refresh_token':_0x48438e['data6'],'scope':getAccessTokenScope(_0x48438e),'redirect_uri':_0x48438e['data4'],'client_id':_0x48438e[_0xfccc('0x23')],'client_secret':encryptor[_0xfccc('0x3a')](_0x48438e['data3'])};var _0x1aba79={'method':_0xfccc('0x3b'),'uri':MICROSOFT_AUTH_URL[_0xfccc('0x3c')](_0xfccc('0x1c'),_0x48438e[_0xfccc('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x14c71d,'json':!![]};return rp(_0x1aba79);})[_0xfccc('0x37')](function(_0x191eb3){_0x5cd3c7[_0xfccc('0x3d')]=_0x191eb3[_0xfccc('0x3e')];_0x5cd3c7[_0xfccc('0x3f')]=_0x191eb3[_0xfccc('0x39')];return db[_0xfccc('0x40')][_0xfccc('0x41')]({'data5':_0x5cd3c7[_0xfccc('0x3d')],'data6':_0x5cd3c7[_0xfccc('0x3f')]},{'where':{'id':_0x5cd3c7['id']}});})[_0xfccc('0x37')](function(){return _0x5cd3c7;})[_0xfccc('0x42')](function(_0x6807cb){logger['error'](_0xfccc('0x43'),_0x5cd3c7['id'],_0x6807cb);});}function getOauth2MicrosoftAccessToken(_0x72e483,_0x2a6079){var _0xb61fd9={'grant_type':'authorization_code','code':_0x72e483,'scope':getAccessTokenScope(_0x2a6079),'redirect_uri':_0x2a6079[_0xfccc('0x27')],'client_id':_0x2a6079[_0xfccc('0x23')],'client_secret':encryptor[_0xfccc('0x3a')](_0x2a6079[_0xfccc('0x38')])};var _0x2ffb55={'method':_0xfccc('0x3b'),'uri':MICROSOFT_AUTH_URL['replace'](_0xfccc('0x1c'),_0x2a6079[_0xfccc('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xb61fd9,'json':!![]};return rp(_0x2ffb55);}function startRefreshInterval(_0x5269a8){var _0x5d6b99=schedule[_0xfccc('0x44')];if(_0x5d6b99[_0x5269a8['id']])clearInterval(_0x5d6b99[_0x5269a8['id']]);_0x5d6b99[_0x5269a8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xfccc('0x45')](this,{'id':_0x5269a8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xfccc('0x44')]=_0x5d6b99;}function startAllRefreshIntervals(){return db[_0xfccc('0x40')][_0xfccc('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x43b76b){var _0x54597c=_0x43b76b[_0xfccc('0x15')](function(_0x406b2a){return refreshOauth2MicrosoftAccessToken(_0x406b2a)[_0xfccc('0x37')](function(_0x59b75b){startRefreshInterval(_0x59b75b);});});return Promise[_0xfccc('0x47')](_0x54597c);})[_0xfccc('0x42')](function(_0x4342f5){var _0x11078d=_0x4342f5?util[_0xfccc('0x48')](_0x4342f5,{'showHidden':![],'depth':null}):'';logger[_0xfccc('0x49')](_0xfccc('0x4a'),_0x11078d);});}module[_0xfccc('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x2b74=['iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','access_token','catch','error','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','data4','response_mode','form_post','scope','nonce','prompt','login','oauth2Claims','oauth2/','set','decode','payload'];(function(_0x29db48,_0x529533){var _0x130523=function(_0x349fa5){while(--_0x349fa5){_0x29db48['push'](_0x29db48['shift']());}};_0x130523(++_0x529533);}(_0x2b74,0x10a));var _0x42b7=function(_0x4d5bdc,_0x59e300){_0x4d5bdc=_0x4d5bdc-0x0;var _0xb316da=_0x2b74[_0x4d5bdc];return _0xb316da;};'use strict';var _=require(_0x42b7('0x0'));var crypto=require(_0x42b7('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x42b7('0x2'));var Redis=require('ioredis');var rp=require(_0x42b7('0x3'));var util=require(_0x42b7('0x4'));var encryptor=require(_0x42b7('0x5'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x42b7('0x6'));var schedule=require(_0x42b7('0x7'));var db=require(_0x42b7('0x8'))['db'];config[_0x42b7('0x9')]=_[_0x42b7('0xa')](config[_0x42b7('0x9')],{'host':_0x42b7('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x42b7('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x42b7('0xd'),_0x42b7('0xe'),_0x42b7('0xf'),_0x42b7('0x10'),_0x42b7('0x11'),_0x42b7('0x12')],'Dynamics365':['openid',_0x42b7('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x42b7('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x42b7('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x486e82){var _0x3ebf13=_[_0x42b7('0x15')](AZURE_AUTH_SCOPES[_0x486e82[_0x42b7('0x16')]]);if(_0x486e82[_0x42b7('0x16')]===_0x42b7('0x17'))_0x3ebf13[_0x42b7('0x18')](_0x486e82[_0x42b7('0x19')]+_0x42b7('0x1a'));return _0x3ebf13[_0x42b7('0x1b')]('\x20');}function getAccessTokenScope(_0x292b8c){if(_0x292b8c[_0x42b7('0x16')]===_0x42b7('0x1c'))return _0x42b7('0x10');if(_0x292b8c[_0x42b7('0x16')]===_0x42b7('0x17'))return _0x292b8c[_0x42b7('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x2e46af,_0x25df27){var _0x4198dd=MICROSOFT_AUTH_URL[_0x42b7('0x1d')](_0x42b7('0x1e'),_0x2e46af[_0x42b7('0x1f')]);var _0xb24064=[_0x42b7('0x20'),_0x42b7('0x21')];var _0x5f18c9=Buffer[_0x42b7('0x22')](JSON[_0x42b7('0x23')]({'id':_0x25df27}))['toString'](_0x42b7('0x24'));var _0x3e5938=crypto[_0x42b7('0x25')](0x10)[_0x42b7('0x26')](_0x42b7('0x27'));var _0x14d76d=getAuthorizationScopes(_0x2e46af);var _0x59982f=[{'key':_0x42b7('0x28'),'value':_0x2e46af[_0x42b7('0x29')]},{'key':'response_type','value':encodeURIComponent(_0xb24064[_0x42b7('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x2e46af[_0x42b7('0x2a')]},{'key':_0x42b7('0x2b'),'value':_0x42b7('0x2c')},{'key':_0x42b7('0x2d'),'value':encodeURIComponent(_0x14d76d)},{'key':'state','value':_0x5f18c9},{'key':_0x42b7('0x2e'),'value':_0x3e5938},{'key':_0x42b7('0x2f'),'value':_0x42b7('0x30')}];var _0x3d3a17=_0x4198dd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x42b7('0x15')](_0x59982f,function(_0x243895){return _0x243895['key']+'='+_0x243895['value'];})[_0x42b7('0x1b')]('&');_0x2e46af[_0x42b7('0x31')]={'issuer':_0x4198dd[_0x42b7('0x1d')](_0x42b7('0x32'),''),'audience':_0x2e46af[_0x42b7('0x29')],'state':_0x5f18c9,'nonce':_0x3e5938};redis[_0x42b7('0x33')](_0x5f18c9,JSON[_0x42b7('0x23')](_0x2e46af));return _0x3d3a17;}function isValidIdToken(_0x6181ab,_0x3e65c7){try{var _0x18894d=jwt[_0x42b7('0x34')](_0x6181ab,{'complete':!![]});var _0x5168b5=_0x18894d[_0x42b7('0x35')];if(_0x5168b5[_0x42b7('0x36')]!==_0x3e65c7[_0x42b7('0x37')])return![];if(_0x5168b5[_0x42b7('0x38')]!==_0x3e65c7[_0x42b7('0x39')])return![];if(_0x5168b5[_0x42b7('0x2e')]!==_0x3e65c7[_0x42b7('0x2e')])return![];if(moment()[_0x42b7('0x3a')](moment[_0x42b7('0x3b')](_0x5168b5[_0x42b7('0x3c')])))return![];return!![];}catch(_0x1c2248){throw _0x1c2248;}}function refreshOauth2MicrosoftAccessToken(_0x441cdd){return Promise[_0x42b7('0x3d')]()[_0x42b7('0x3e')](function(){if(_0x441cdd['data3'])return _0x441cdd;return db[_0x42b7('0x3f')][_0x42b7('0x40')]({'where':{'id':_0x441cdd['id']},'raw':!![]});})['then'](function(_0x1dd16c){var _0x4ce7a3={'grant_type':_0x42b7('0x41'),'refresh_token':_0x1dd16c[_0x42b7('0x42')],'scope':getAccessTokenScope(_0x1dd16c),'redirect_uri':_0x1dd16c[_0x42b7('0x2a')],'client_id':_0x1dd16c['data1'],'client_secret':encryptor[_0x42b7('0x43')](_0x1dd16c[_0x42b7('0x44')])};var _0x275d50={'method':_0x42b7('0x45'),'uri':MICROSOFT_AUTH_URL[_0x42b7('0x1d')](_0x42b7('0x1e'),_0x1dd16c['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4ce7a3,'json':!![]};return rp(_0x275d50);})[_0x42b7('0x3e')](function(_0x496010){_0x441cdd['data5']=_0x496010[_0x42b7('0x46')];_0x441cdd[_0x42b7('0x42')]=_0x496010[_0x42b7('0x41')];return db[_0x42b7('0x3f')]['update']({'data5':_0x441cdd['data5'],'data6':_0x441cdd[_0x42b7('0x42')]},{'where':{'id':_0x441cdd['id']}});})['then'](function(){return _0x441cdd;})[_0x42b7('0x47')](function(_0x5761ac){logger[_0x42b7('0x48')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x441cdd['id'],_0x5761ac);});}function getOauth2MicrosoftAccessToken(_0x38ed66,_0x5cf8f7){var _0x18fd42={'grant_type':_0x42b7('0x49'),'code':_0x38ed66,'scope':getAccessTokenScope(_0x5cf8f7),'redirect_uri':_0x5cf8f7['data4'],'client_id':_0x5cf8f7[_0x42b7('0x29')],'client_secret':encryptor[_0x42b7('0x43')](_0x5cf8f7[_0x42b7('0x44')])};var _0x21c316={'method':_0x42b7('0x45'),'uri':MICROSOFT_AUTH_URL['replace'](_0x42b7('0x1e'),_0x5cf8f7[_0x42b7('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x18fd42,'json':!![]};return rp(_0x21c316);}function startRefreshInterval(_0xfe3b5e){var _0xef236f=schedule[_0x42b7('0x4a')];if(_0xef236f[_0xfe3b5e['id']])clearInterval(_0xef236f[_0xfe3b5e['id']]);_0xef236f[_0xfe3b5e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0xfe3b5e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xef236f;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x42b7('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x42b7('0x3e')](function(_0x12b935){var _0x3c43c5=_0x12b935[_0x42b7('0x15')](function(_0x8ea0f1){return refreshOauth2MicrosoftAccessToken(_0x8ea0f1)[_0x42b7('0x3e')](function(_0x2e9bb8){startRefreshInterval(_0x2e9bb8);});});return Promise[_0x42b7('0x4c')](_0x3c43c5);})['catch'](function(_0x445add){var _0xae9bf5=_0x445add?util[_0x42b7('0x4d')](_0x445add,{'showHidden':![],'depth':null}):'';logger[_0x42b7('0x48')](_0x42b7('0x4e'),_0xae9bf5);});}module[_0x42b7('0x4f')]={'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 25ecd75..ac8ce73 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 _0x4f7a=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x425288,_0x4d5ec9){var _0x3b148a=function(_0x5d6c0d){while(--_0x5d6c0d){_0x425288['push'](_0x425288['shift']());}};_0x3b148a(++_0x4d5ec9);}(_0x4f7a,0x105));var _0xa4f7=function(_0x2187cd,_0x51613f){_0x2187cd=_0x2187cd-0x0;var _0x1341b2=_0x4f7a[_0x2187cd];return _0x1341b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa4f7('0x0'));var BPromise=require(_0xa4f7('0x1'));var rs=require(_0xa4f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4f7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4f7('0x4'))(_0xa4f7('0x5'));var config=require(_0xa4f7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa4f7('0x7')][_0xa4f7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c78bd,_0x58e1c7,_0x1cea4c){return new BPromise(function(_0x1e3ff3,_0x1410a1){return client[_0xa4f7('0x9')](_0x4c78bd,_0x1cea4c)[_0xa4f7('0xa')](function(_0x498186){logger[_0xa4f7('0xb')](_0xa4f7('0xc'),_0x58e1c7,_0xa4f7('0xd'));logger[_0xa4f7('0xe')](_0xa4f7('0xf'),_0x58e1c7,_0xa4f7('0xd'),JSON[_0xa4f7('0x10')](_0x498186));if(_0x498186['error']){if(_0x498186['error'][_0xa4f7('0x11')]===0x1f4){logger[_0xa4f7('0x12')]('CloudProvider,\x20%s,\x20%s',_0x58e1c7,_0x498186[_0xa4f7('0x12')][_0xa4f7('0x13')]);return _0x1410a1(_0x498186[_0xa4f7('0x12')]['message']);}logger[_0xa4f7('0x12')](_0xa4f7('0xc'),_0x58e1c7,_0x498186[_0xa4f7('0x12')]['message']);return _0x1e3ff3(_0x498186[_0xa4f7('0x12')][_0xa4f7('0x13')]);}else{logger[_0xa4f7('0xb')](_0xa4f7('0xc'),_0x58e1c7,'request\x20sent');_0x1e3ff3(_0x498186[_0xa4f7('0x14')][_0xa4f7('0x13')]);}})['catch'](function(_0x501fe1){logger[_0xa4f7('0x12')]('CloudProvider,\x20%s,\x20%s',_0x58e1c7,_0x501fe1);_0x1410a1(_0x501fe1);});});}
\ No newline at end of file
+var _0x1c7c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird'];(function(_0xe56506,_0x47cd5a){var _0x4edd71=function(_0x45274d){while(--_0x45274d){_0xe56506['push'](_0xe56506['shift']());}};_0x4edd71(++_0x47cd5a);}(_0x1c7c,0x164));var _0xc1c7=function(_0x1167ec,_0x39a2c2){_0x1167ec=_0x1167ec-0x0;var _0x2052c2=_0x1c7c[_0x1167ec];return _0x2052c2;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419138,_0xce5bcd,_0x3b3e9c){return new BPromise(function(_0x434a35,_0x11c7ef){return client[_0xc1c7('0xc')](_0x419138,_0x3b3e9c)[_0xc1c7('0xd')](function(_0x339649){logger[_0xc1c7('0xe')](_0xc1c7('0xf'),_0xce5bcd,'request\x20sent');logger[_0xc1c7('0x10')](_0xc1c7('0x11'),_0xce5bcd,'request\x20sent',JSON[_0xc1c7('0x12')](_0x339649));if(_0x339649[_0xc1c7('0x13')]){if(_0x339649[_0xc1c7('0x13')]['code']===0x1f4){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x11c7ef(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x434a35(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}else{logger['info'](_0xc1c7('0xf'),_0xce5bcd,_0xc1c7('0x15'));_0x434a35(_0x339649[_0xc1c7('0x16')]['message']);}})[_0xc1c7('0x17')](function(_0x3939c1){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x3939c1);_0x11c7ef(_0x3939c1);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 40c5b10..6dc1dfb 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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x23f7c0,_0x258721){var _0x3e7049=function(_0x930a35){while(--_0x930a35){_0x23f7c0['push'](_0x23f7c0['shift']());}};_0x3e7049(++_0x258721);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x42fe9c,_0x8ea8df){_0x42fe9c=_0x42fe9c-0x0;var _0xe8737f=_0x5f2f[_0x42fe9c];return _0xe8737f;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 2bc6276..5da26d7 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 _0xb03a=['sequelize','STRING'];(function(_0x1ef540,_0x19bf9f){var _0x3d050c=function(_0x11a9b2){while(--_0x11a9b2){_0x1ef540['push'](_0x1ef540['shift']());}};_0x3d050c(++_0x19bf9f);}(_0xb03a,0xa6));var _0xab03=function(_0x305293,_0x2ee5d3){_0x305293=_0x305293-0x0;var _0x33cd45=_0xb03a[_0x305293];return _0x33cd45;};'use strict';var Sequelize=require(_0xab03('0x0'));module['exports']={'name':{'type':Sequelize[_0xab03('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xab03('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xab03('0x1')]},'fax':{'type':Sequelize[_0xab03('0x1')]},'type':{'type':Sequelize[_0xab03('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xab03('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xab03('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xab03('0x1')]},'sStreet':{'type':Sequelize[_0xab03('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xab03('0x1')]},'sCountry':{'type':Sequelize[_0xab03('0x1')]},'description':{'type':Sequelize[_0xab03('0x1')]}};
\ No newline at end of file
+var _0xe7ad=['STRING'];(function(_0xc51b18,_0x1b7832){var _0x57c74b=function(_0x27b604){while(--_0x27b604){_0xc51b18['push'](_0xc51b18['shift']());}};_0x57c74b(++_0x1b7832);}(_0xe7ad,0x1b1));var _0xde7a=function(_0x3f8b7e,_0x3968ba){_0x3f8b7e=_0x3f8b7e-0x0;var _0x587c23=_0xe7ad[_0x3f8b7e];return _0x587c23;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xde7a('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xde7a('0x0')]},'companyId':{'type':Sequelize[_0xde7a('0x0')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xde7a('0x0')]},'type':{'type':Sequelize[_0xde7a('0x0')]},'street':{'type':Sequelize[_0xde7a('0x0')]},'postalCode':{'type':Sequelize[_0xde7a('0x0')]},'city':{'type':Sequelize[_0xde7a('0x0')]},'country':{'type':Sequelize[_0xde7a('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xde7a('0x0')]},'sCity':{'type':Sequelize[_0xde7a('0x0')]},'sCountry':{'type':Sequelize[_0xde7a('0x0')]},'description':{'type':Sequelize[_0xde7a('0x0')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 6dc70a3..e6c639f 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 _0x31fd=['attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','CmCompany','includeAll','include','rows','catch','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','addContacts','ids','omit','getContacts','length','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','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','Companies','UserProfileResource','stack','name','send','describe','model','query','keys','filters','intersection'];(function(_0xf4add4,_0x5b9cc1){var _0x1c42fb=function(_0x2674c1){while(--_0x2674c1){_0xf4add4['push'](_0xf4add4['shift']());}};_0x1c42fb(++_0x5b9cc1);}(_0x31fd,0x79));var _0xd31f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x31fd[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xd31f('0x0'));var rimraf=require(_0xd31f('0x1'));var zipdir=require(_0xd31f('0x2'));var jsonpatch=require(_0xd31f('0x3'));var rp=require(_0xd31f('0x4'));var moment=require(_0xd31f('0x5'));var BPromise=require(_0xd31f('0x6'));var Mustache=require(_0xd31f('0x7'));var util=require(_0xd31f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd31f('0x9'));var ejs=require(_0xd31f('0xa'));var fs=require('fs');var fs_extra=require(_0xd31f('0xb'));var _=require(_0xd31f('0xc'));var squel=require(_0xd31f('0xd'));var crypto=require(_0xd31f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd31f('0x9'));var querystring=require(_0xd31f('0xf'));var Papa=require(_0xd31f('0x10'));var Redis=require(_0xd31f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd31f('0x12'));var as=require(_0xd31f('0x13'));var hardwareService=require(_0xd31f('0x14'));var logger=require(_0xd31f('0x15'))(_0xd31f('0x16'));var utils=require(_0xd31f('0x17'));var config=require(_0xd31f('0x18'));var licenseUtil=require(_0xd31f('0x19'));var db=require(_0xd31f('0x1a'))['db'];function respondWithStatusCode(_0x201f88,_0x1fba88){_0x1fba88=_0x1fba88||0xcc;return function(_0x36ff94){if(_0x36ff94){return _0x201f88[_0xd31f('0x1b')](_0x1fba88);}return _0x201f88['status'](_0x1fba88)[_0xd31f('0x1c')]();};}function respondWithResult(_0x3dbc5a,_0x23a324){_0x23a324=_0x23a324||0xc8;return function(_0x1572fa){if(_0x1572fa){return _0x3dbc5a[_0xd31f('0x1d')](_0x23a324)[_0xd31f('0x1e')](_0x1572fa);}};}function respondWithFilteredResult(_0x1d4238,_0xbfcd2d){return function(_0x5a2959){if(_0x5a2959){var _0x117465=typeof _0xbfcd2d[_0xd31f('0x1f')]===_0xd31f('0x20')&&typeof _0xbfcd2d[_0xd31f('0x21')]===_0xd31f('0x20');var _0x53b084=_0x5a2959[_0xd31f('0x22')];var _0x17a290=_0x117465?0x0:_0xbfcd2d['offset'];var _0x543963=_0x117465?_0x5a2959[_0xd31f('0x22')]:_0xbfcd2d[_0xd31f('0x1f')]+_0xbfcd2d[_0xd31f('0x21')];var _0xda27c7;if(_0x543963>=_0x53b084){_0x543963=_0x53b084;_0xda27c7=0xc8;}else{_0xda27c7=0xce;}_0x1d4238[_0xd31f('0x1d')](_0xda27c7);return _0x1d4238[_0xd31f('0x23')](_0xd31f('0x24'),_0x17a290+'-'+_0x543963+'/'+_0x53b084)[_0xd31f('0x1e')](_0x5a2959);}return null;};}function patchUpdates(_0x4aaac8){return function(_0x4feef3){try{jsonpatch[_0xd31f('0x25')](_0x4feef3,_0x4aaac8,!![]);}catch(_0x491d7d){return BPromise[_0xd31f('0x26')](_0x491d7d);}return _0x4feef3[_0xd31f('0x27')]();};}function saveUpdates(_0x1db448,_0x51815d){return function(_0x55914a){if(_0x55914a){return _0x55914a[_0xd31f('0x28')](_0x1db448)[_0xd31f('0x29')](function(_0x433e0a){return _0x433e0a;});}return null;};}function removeEntity(_0xcb3126,_0x583d84){return function(_0x25fdd2){if(_0x25fdd2){return _0x25fdd2[_0xd31f('0x2a')]()[_0xd31f('0x29')](function(){var _0x2fe961=_0x25fdd2[_0xd31f('0x2b')]({'plain':!![]});var _0x490986=_0xd31f('0x2c');return db[_0xd31f('0x2d')]['destroy']({'where':{'type':_0x490986,'resourceId':_0x2fe961['id']}})['then'](function(){return _0x25fdd2;});})[_0xd31f('0x29')](function(){_0xcb3126[_0xd31f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x265ebc,_0x4038de){return function(_0xfc5a3){if(!_0xfc5a3){_0x265ebc['sendStatus'](0x194);}return _0xfc5a3;};}function handleError(_0x6c259c,_0xbd7a41){_0xbd7a41=_0xbd7a41||0x1f4;return function(_0x16fcb5){logger['error'](_0x16fcb5[_0xd31f('0x2e')]);if(_0x16fcb5[_0xd31f('0x2f')]){delete _0x16fcb5[_0xd31f('0x2f')];}_0x6c259c[_0xd31f('0x1d')](_0xbd7a41)[_0xd31f('0x30')](_0x16fcb5);};}exports['index']=function(_0x1976ff,_0x59237d){var _0x1274ef={},_0x2459e0={},_0x41c4e0={'count':0x0,'rows':[]};return db['CmCompany'][_0xd31f('0x31')]()['then'](function(_0xf9fed3){_0x2459e0[_0xd31f('0x32')]=_['keys'](_0xf9fed3);_0x2459e0[_0xd31f('0x33')]=_[_0xd31f('0x34')](_0x1976ff[_0xd31f('0x33')]);_0x2459e0[_0xd31f('0x35')]=_[_0xd31f('0x36')](_0x2459e0[_0xd31f('0x32')],_0x2459e0['query']);_0x1274ef[_0xd31f('0x37')]=_[_0xd31f('0x36')](_0x2459e0[_0xd31f('0x32')],qs[_0xd31f('0x38')](_0x1976ff[_0xd31f('0x33')]['fields']));_0x1274ef[_0xd31f('0x37')]=_0x1274ef[_0xd31f('0x37')]['length']?_0x1274ef['attributes']:_0x2459e0[_0xd31f('0x32')];if(!_0x1976ff[_0xd31f('0x33')][_0xd31f('0x39')]('nolimit')){_0x1274ef[_0xd31f('0x21')]=qs[_0xd31f('0x21')](_0x1976ff[_0xd31f('0x33')][_0xd31f('0x21')]);_0x1274ef[_0xd31f('0x1f')]=qs['offset'](_0x1976ff[_0xd31f('0x33')][_0xd31f('0x1f')]);}_0x1274ef[_0xd31f('0x3a')]=qs[_0xd31f('0x3b')](_0x1976ff[_0xd31f('0x33')]['sort']);_0x1274ef[_0xd31f('0x3c')]=qs[_0xd31f('0x35')](_[_0xd31f('0x3d')](_0x1976ff[_0xd31f('0x33')],_0x2459e0[_0xd31f('0x35')]),_0xf9fed3);if(_0x1976ff[_0xd31f('0x33')][_0xd31f('0x3e')]){_0x1274ef[_0xd31f('0x3c')]=_[_0xd31f('0x3f')](_0x1274ef[_0xd31f('0x3c')],{'$or':_['map'](_0x1274ef[_0xd31f('0x37')],function(_0x322f30){var _0x4ebf73={};_0x4ebf73[_0x322f30]={'$like':'%'+_0x1976ff[_0xd31f('0x33')][_0xd31f('0x3e')]+'%'};return _0x4ebf73;})});}_0x1274ef=_[_0xd31f('0x3f')]({},_0x1274ef,_0x1976ff[_0xd31f('0x40')]);var _0x4353d1={'where':_0x1274ef[_0xd31f('0x3c')]};return db[_0xd31f('0x41')][_0xd31f('0x22')](_0x4353d1)['then'](function(_0x5bcdf5){_0x41c4e0[_0xd31f('0x22')]=_0x5bcdf5;if(_0x1976ff[_0xd31f('0x33')][_0xd31f('0x42')]){_0x1274ef[_0xd31f('0x43')]=[{'all':!![]}];}return db[_0xd31f('0x41')]['findAll'](_0x1274ef);})['then'](function(_0x468515){_0x41c4e0[_0xd31f('0x44')]=_0x468515;return _0x41c4e0;})[_0xd31f('0x29')](respondWithFilteredResult(_0x59237d,_0x1274ef))[_0xd31f('0x45')](handleError(_0x59237d,null));})['catch'](handleError(_0x59237d,null));};exports['show']=function(_0xefc703,_0x14d3f1){var _0x2acea6={'raw':![],'where':{'id':_0xefc703[_0xd31f('0x46')]['id']}},_0x1a8427={};_0x1a8427[_0xd31f('0x32')]=_['keys'](db[_0xd31f('0x41')]['rawAttributes']);_0x1a8427['query']=_[_0xd31f('0x34')](_0xefc703['query']);_0x1a8427[_0xd31f('0x35')]=_[_0xd31f('0x36')](_0x1a8427[_0xd31f('0x32')],_0x1a8427[_0xd31f('0x33')]);_0x2acea6[_0xd31f('0x37')]=_['intersection'](_0x1a8427[_0xd31f('0x32')],qs[_0xd31f('0x38')](_0xefc703[_0xd31f('0x33')]['fields']));_0x2acea6[_0xd31f('0x37')]=_0x2acea6[_0xd31f('0x37')]['length']?_0x2acea6[_0xd31f('0x37')]:_0x1a8427[_0xd31f('0x32')];if(_0xefc703[_0xd31f('0x33')][_0xd31f('0x42')]){_0x2acea6[_0xd31f('0x43')]=[{'all':!![]}];}_0x2acea6=_[_0xd31f('0x3f')]({},_0x2acea6,_0xefc703['options']);return db['CmCompany'][_0xd31f('0x47')](_0x2acea6)['then'](handleEntityNotFound(_0x14d3f1,null))[_0xd31f('0x29')](respondWithResult(_0x14d3f1,null))[_0xd31f('0x45')](handleError(_0x14d3f1,null));};exports[_0xd31f('0x48')]=function(_0x14fcca,_0x374f71){return db[_0xd31f('0x41')][_0xd31f('0x48')](_0x14fcca[_0xd31f('0x49')],{})['then'](function(_0xd595c5){var _0x251299=_0x14fcca[_0xd31f('0x4a')][_0xd31f('0x2b')]({'plain':!![]});if(!_0x251299)throw new Error(_0xd31f('0x4b'));if(_0x251299[_0xd31f('0x4c')]===_0xd31f('0x4a')){var _0x19479a=_0xd595c5['get']({'plain':!![]});var _0x4c7ccf=_0xd31f('0x2c');return db[_0xd31f('0x4d')][_0xd31f('0x47')]({'where':{'name':_0x4c7ccf,'userProfileId':_0x251299[_0xd31f('0x4e')]},'raw':!![]})['then'](function(_0x3e9b73){if(_0x3e9b73&&_0x3e9b73[_0xd31f('0x4f')]===0x0){return db[_0xd31f('0x2d')][_0xd31f('0x48')]({'name':_0x19479a[_0xd31f('0x2f')],'resourceId':_0x19479a['id'],'type':_0x3e9b73['name'],'sectionId':_0x3e9b73['id']},{})[_0xd31f('0x29')](function(){return _0xd595c5;});}else{return _0xd595c5;}})[_0xd31f('0x45')](function(_0x6625d7){logger[_0xd31f('0x50')](_0xd31f('0x51'),_0x6625d7);throw _0x6625d7;});}return _0xd595c5;})['then'](respondWithResult(_0x374f71,0xc9))[_0xd31f('0x45')](handleError(_0x374f71,null));};exports[_0xd31f('0x28')]=function(_0x2632b8,_0x526ba0){if(_0x2632b8[_0xd31f('0x49')]['id']){delete _0x2632b8[_0xd31f('0x49')]['id'];}return db[_0xd31f('0x41')][_0xd31f('0x47')]({'where':{'id':_0x2632b8[_0xd31f('0x46')]['id']}})[_0xd31f('0x29')](handleEntityNotFound(_0x526ba0,null))[_0xd31f('0x29')](saveUpdates(_0x2632b8[_0xd31f('0x49')],null))[_0xd31f('0x29')](respondWithResult(_0x526ba0,null))[_0xd31f('0x45')](handleError(_0x526ba0,null));};exports['destroy']=function(_0x23860d,_0x8aff5b){return db['CmCompany'][_0xd31f('0x47')]({'where':{'id':_0x23860d[_0xd31f('0x46')]['id']}})[_0xd31f('0x29')](handleEntityNotFound(_0x8aff5b,null))[_0xd31f('0x29')](removeEntity(_0x8aff5b,null))['catch'](handleError(_0x8aff5b,null));};exports[_0xd31f('0x31')]=function(_0x5683d0,_0x518aa6){return db[_0xd31f('0x41')]['describe']()[_0xd31f('0x29')](respondWithResult(_0x518aa6,null))[_0xd31f('0x45')](handleError(_0x518aa6,null));};exports[_0xd31f('0x52')]=function(_0x1d59c9,_0x37242a,_0x699290){return db['CmContact'][_0xd31f('0x47')]({'where':{'id':_0x1d59c9[_0xd31f('0x46')]['id']}})[_0xd31f('0x29')](handleEntityNotFound(_0x37242a,null))['then'](function(_0x58c0d0){if(_0x58c0d0){return _0x58c0d0['addContacts'](_0x1d59c9[_0xd31f('0x49')][_0xd31f('0x53')],_[_0xd31f('0x54')](_0x1d59c9['body'],[_0xd31f('0x53'),'id'])||{});}})[_0xd31f('0x29')](respondWithResult(_0x37242a,null))[_0xd31f('0x45')](handleError(_0x37242a,null));};exports[_0xd31f('0x55')]=function(_0x484217,_0x568c2d,_0x55d175){var _0x56ddfd={};var _0x45f480={};var _0x1e86fb;var _0x23b7f1;return db[_0xd31f('0x41')]['findOne']({'where':{'id':_0x484217[_0xd31f('0x46')]['id']}})['then'](handleEntityNotFound(_0x568c2d,null))[_0xd31f('0x29')](function(_0x230e90){if(_0x230e90){_0x1e86fb=_0x230e90;_0x45f480[_0xd31f('0x32')]=_[_0xd31f('0x34')](db['CmContact']['rawAttributes']);_0x45f480[_0xd31f('0x33')]=_['keys'](_0x484217['query']);_0x45f480[_0xd31f('0x35')]=_[_0xd31f('0x36')](_0x45f480[_0xd31f('0x32')],_0x45f480[_0xd31f('0x33')]);_0x56ddfd[_0xd31f('0x37')]=_[_0xd31f('0x36')](_0x45f480[_0xd31f('0x32')],qs[_0xd31f('0x38')](_0x484217[_0xd31f('0x33')][_0xd31f('0x38')]));_0x56ddfd['attributes']=_0x56ddfd[_0xd31f('0x37')][_0xd31f('0x56')]?_0x56ddfd[_0xd31f('0x37')]:_0x45f480[_0xd31f('0x32')];_0x56ddfd[_0xd31f('0x3a')]=qs[_0xd31f('0x3b')](_0x484217[_0xd31f('0x33')][_0xd31f('0x3b')]);_0x56ddfd[_0xd31f('0x3c')]=qs[_0xd31f('0x35')](_[_0xd31f('0x3d')](_0x484217['query'],_0x45f480[_0xd31f('0x35')]));if(_0x484217[_0xd31f('0x33')]['filter']){_0x56ddfd[_0xd31f('0x3c')]=_['merge'](_0x56ddfd[_0xd31f('0x3c')],{'$or':_['map'](_0x56ddfd[_0xd31f('0x37')],function(_0xeb5dfb){var _0x4317a5={};_0x4317a5[_0xeb5dfb]={'$like':'%'+_0x484217[_0xd31f('0x33')][_0xd31f('0x3e')]+'%'};return _0x4317a5;})});}_0x56ddfd=_[_0xd31f('0x3f')]({},_0x56ddfd,_0x484217[_0xd31f('0x40')]);return _0x1e86fb[_0xd31f('0x55')](_0x56ddfd);}})[_0xd31f('0x29')](function(_0x22054b){if(_0x22054b){_0x23b7f1=_0x22054b[_0xd31f('0x56')];if(!_0x484217[_0xd31f('0x33')][_0xd31f('0x39')](_0xd31f('0x57'))){_0x56ddfd['limit']=qs[_0xd31f('0x21')](_0x484217[_0xd31f('0x33')][_0xd31f('0x21')]);_0x56ddfd['offset']=qs[_0xd31f('0x1f')](_0x484217['query'][_0xd31f('0x1f')]);}return _0x1e86fb[_0xd31f('0x55')](_0x56ddfd);}})[_0xd31f('0x29')](function(_0x1fd930){if(_0x1fd930){return _0x1fd930?{'count':_0x23b7f1,'rows':_0x1fd930}:null;}})[_0xd31f('0x29')](respondWithResult(_0x568c2d,null))[_0xd31f('0x45')](handleError(_0x568c2d,null));};
\ No newline at end of file
+var _0xc363=['intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','merge','options','CmCompany','include','rows','catch','show','params','rawAttributes','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','findOne','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','Companies','error','name','send','index','describe','keys','query','filters','model'];(function(_0x575d96,_0x1e05d3){var _0x3379f=function(_0xf69bb3){while(--_0xf69bb3){_0x575d96['push'](_0x575d96['shift']());}};_0x3379f(++_0x1e05d3);}(_0xc363,0xd6));var _0x3c36=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xc363[_0x349367];return _0x14179b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c36('0x0'));var zipdir=require(_0x3c36('0x1'));var jsonpatch=require(_0x3c36('0x2'));var rp=require(_0x3c36('0x3'));var moment=require(_0x3c36('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3c36('0x5'));var path=require(_0x3c36('0x6'));var sox=require(_0x3c36('0x7'));var csv=require(_0x3c36('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3c36('0x9'));var crypto=require('crypto');var jsforce=require(_0x3c36('0xa'));var deskjs=require(_0x3c36('0xb'));var toCsv=require(_0x3c36('0x8'));var querystring=require(_0x3c36('0xc'));var Papa=require(_0x3c36('0xd'));var Redis=require(_0x3c36('0xe'));var authService=require(_0x3c36('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3c36('0x10'));var hardwareService=require(_0x3c36('0x11'));var logger=require('../../config/logger')(_0x3c36('0x12'));var utils=require(_0x3c36('0x13'));var config=require(_0x3c36('0x14'));var licenseUtil=require(_0x3c36('0x15'));var db=require(_0x3c36('0x16'))['db'];function respondWithStatusCode(_0x16754a,_0xd6114b){_0xd6114b=_0xd6114b||0xcc;return function(_0x525aee){if(_0x525aee){return _0x16754a[_0x3c36('0x17')](_0xd6114b);}return _0x16754a[_0x3c36('0x18')](_0xd6114b)[_0x3c36('0x19')]();};}function respondWithResult(_0x2301e3,_0x31badd){_0x31badd=_0x31badd||0xc8;return function(_0x1c624c){if(_0x1c624c){return _0x2301e3[_0x3c36('0x18')](_0x31badd)[_0x3c36('0x1a')](_0x1c624c);}};}function respondWithFilteredResult(_0x31dcc7,_0x360f27){return function(_0xfb6a9){if(_0xfb6a9){var _0x1be569=typeof _0x360f27[_0x3c36('0x1b')]===_0x3c36('0x1c')&&typeof _0x360f27[_0x3c36('0x1d')]===_0x3c36('0x1c');var _0x45e28a=_0xfb6a9[_0x3c36('0x1e')];var _0x5bee8a=_0x1be569?0x0:_0x360f27[_0x3c36('0x1b')];var _0x36b4ad=_0x1be569?_0xfb6a9['count']:_0x360f27[_0x3c36('0x1b')]+_0x360f27[_0x3c36('0x1d')];var _0x2e221f;if(_0x36b4ad>=_0x45e28a){_0x36b4ad=_0x45e28a;_0x2e221f=0xc8;}else{_0x2e221f=0xce;}_0x31dcc7[_0x3c36('0x18')](_0x2e221f);return _0x31dcc7[_0x3c36('0x1f')](_0x3c36('0x20'),_0x5bee8a+'-'+_0x36b4ad+'/'+_0x45e28a)[_0x3c36('0x1a')](_0xfb6a9);}return null;};}function patchUpdates(_0x1bbaef){return function(_0xa470fe){try{jsonpatch[_0x3c36('0x21')](_0xa470fe,_0x1bbaef,!![]);}catch(_0xc592e5){return BPromise[_0x3c36('0x22')](_0xc592e5);}return _0xa470fe['save']();};}function saveUpdates(_0x414552,_0x5e334e){return function(_0x202fbc){if(_0x202fbc){return _0x202fbc['update'](_0x414552)[_0x3c36('0x23')](function(_0x51742e){return _0x51742e;});}return null;};}function removeEntity(_0x132e52,_0x3a4aca){return function(_0xda926e){if(_0xda926e){return _0xda926e[_0x3c36('0x24')]()[_0x3c36('0x23')](function(){var _0x18a104=_0xda926e['get']({'plain':!![]});var _0x5ea1f3=_0x3c36('0x25');return db['UserProfileResource'][_0x3c36('0x24')]({'where':{'type':_0x5ea1f3,'resourceId':_0x18a104['id']}})[_0x3c36('0x23')](function(){return _0xda926e;});})[_0x3c36('0x23')](function(){_0x132e52[_0x3c36('0x18')](0xcc)[_0x3c36('0x19')]();});}};}function handleEntityNotFound(_0x512cff,_0x1880d3){return function(_0x2497fc){if(!_0x2497fc){_0x512cff['sendStatus'](0x194);}return _0x2497fc;};}function handleError(_0x549a45,_0x2179f6){_0x2179f6=_0x2179f6||0x1f4;return function(_0x1db4cd){logger[_0x3c36('0x26')](_0x1db4cd['stack']);if(_0x1db4cd[_0x3c36('0x27')]){delete _0x1db4cd['name'];}_0x549a45[_0x3c36('0x18')](_0x2179f6)[_0x3c36('0x28')](_0x1db4cd);};}exports[_0x3c36('0x29')]=function(_0x1ca1f3,_0x4c85ff){var _0x4abed1={},_0x57cba1={},_0x33a564={'count':0x0,'rows':[]};return db['CmCompany'][_0x3c36('0x2a')]()[_0x3c36('0x23')](function(_0x507313){_0x57cba1['model']=_[_0x3c36('0x2b')](_0x507313);_0x57cba1['query']=_[_0x3c36('0x2b')](_0x1ca1f3[_0x3c36('0x2c')]);_0x57cba1[_0x3c36('0x2d')]=_['intersection'](_0x57cba1[_0x3c36('0x2e')],_0x57cba1[_0x3c36('0x2c')]);_0x4abed1['attributes']=_[_0x3c36('0x2f')](_0x57cba1[_0x3c36('0x2e')],qs[_0x3c36('0x30')](_0x1ca1f3[_0x3c36('0x2c')]['fields']));_0x4abed1[_0x3c36('0x31')]=_0x4abed1[_0x3c36('0x31')][_0x3c36('0x32')]?_0x4abed1[_0x3c36('0x31')]:_0x57cba1[_0x3c36('0x2e')];if(!_0x1ca1f3[_0x3c36('0x2c')]['hasOwnProperty'](_0x3c36('0x33'))){_0x4abed1[_0x3c36('0x1d')]=qs[_0x3c36('0x1d')](_0x1ca1f3[_0x3c36('0x2c')][_0x3c36('0x1d')]);_0x4abed1[_0x3c36('0x1b')]=qs[_0x3c36('0x1b')](_0x1ca1f3[_0x3c36('0x2c')]['offset']);}_0x4abed1[_0x3c36('0x34')]=qs[_0x3c36('0x35')](_0x1ca1f3[_0x3c36('0x2c')][_0x3c36('0x35')]);_0x4abed1[_0x3c36('0x36')]=qs[_0x3c36('0x2d')](_[_0x3c36('0x37')](_0x1ca1f3[_0x3c36('0x2c')],_0x57cba1['filters']),_0x507313);if(_0x1ca1f3[_0x3c36('0x2c')][_0x3c36('0x38')]){_0x4abed1[_0x3c36('0x36')]=_['merge'](_0x4abed1['where'],{'$or':_[_0x3c36('0x39')](_0x4abed1[_0x3c36('0x31')],function(_0x4c2333){var _0x134640={};_0x134640[_0x4c2333]={'$like':'%'+_0x1ca1f3[_0x3c36('0x2c')][_0x3c36('0x38')]+'%'};return _0x134640;})});}_0x4abed1=_[_0x3c36('0x3a')]({},_0x4abed1,_0x1ca1f3[_0x3c36('0x3b')]);var _0x2811d6={'where':_0x4abed1[_0x3c36('0x36')]};return db[_0x3c36('0x3c')]['count'](_0x2811d6)[_0x3c36('0x23')](function(_0x2553e0){_0x33a564['count']=_0x2553e0;if(_0x1ca1f3[_0x3c36('0x2c')]['includeAll']){_0x4abed1[_0x3c36('0x3d')]=[{'all':!![]}];}return db[_0x3c36('0x3c')]['findAll'](_0x4abed1);})[_0x3c36('0x23')](function(_0x250702){_0x33a564[_0x3c36('0x3e')]=_0x250702;return _0x33a564;})[_0x3c36('0x23')](respondWithFilteredResult(_0x4c85ff,_0x4abed1))['catch'](handleError(_0x4c85ff,null));})[_0x3c36('0x3f')](handleError(_0x4c85ff,null));};exports[_0x3c36('0x40')]=function(_0x19ce5a,_0x26ad63){var _0x29d251={'raw':![],'where':{'id':_0x19ce5a[_0x3c36('0x41')]['id']}},_0x39a224={};_0x39a224[_0x3c36('0x2e')]=_[_0x3c36('0x2b')](db[_0x3c36('0x3c')][_0x3c36('0x42')]);_0x39a224[_0x3c36('0x2c')]=_[_0x3c36('0x2b')](_0x19ce5a['query']);_0x39a224[_0x3c36('0x2d')]=_[_0x3c36('0x2f')](_0x39a224['model'],_0x39a224[_0x3c36('0x2c')]);_0x29d251[_0x3c36('0x31')]=_[_0x3c36('0x2f')](_0x39a224[_0x3c36('0x2e')],qs[_0x3c36('0x30')](_0x19ce5a['query'][_0x3c36('0x30')]));_0x29d251['attributes']=_0x29d251[_0x3c36('0x31')][_0x3c36('0x32')]?_0x29d251[_0x3c36('0x31')]:_0x39a224['model'];if(_0x19ce5a['query'][_0x3c36('0x43')]){_0x29d251[_0x3c36('0x3d')]=[{'all':!![]}];}_0x29d251=_[_0x3c36('0x3a')]({},_0x29d251,_0x19ce5a[_0x3c36('0x3b')]);return db['CmCompany'][_0x3c36('0x44')](_0x29d251)['then'](handleEntityNotFound(_0x26ad63,null))[_0x3c36('0x23')](respondWithResult(_0x26ad63,null))[_0x3c36('0x3f')](handleError(_0x26ad63,null));};exports[_0x3c36('0x45')]=function(_0x3eb048,_0x5dbbe3){return db['CmCompany'][_0x3c36('0x45')](_0x3eb048['body'],{})[_0x3c36('0x23')](function(_0xcabaf){var _0x52b4ff=_0x3eb048[_0x3c36('0x46')][_0x3c36('0x47')]({'plain':!![]});if(!_0x52b4ff)throw new Error(_0x3c36('0x48'));if(_0x52b4ff[_0x3c36('0x49')]===_0x3c36('0x46')){var _0x57239c=_0xcabaf['get']({'plain':!![]});var _0x59c36e=_0x3c36('0x25');return db[_0x3c36('0x4a')][_0x3c36('0x44')]({'where':{'name':_0x59c36e,'userProfileId':_0x52b4ff[_0x3c36('0x4b')]},'raw':!![]})[_0x3c36('0x23')](function(_0x22ee22){if(_0x22ee22&&_0x22ee22[_0x3c36('0x4c')]===0x0){return db[_0x3c36('0x4d')]['create']({'name':_0x57239c[_0x3c36('0x27')],'resourceId':_0x57239c['id'],'type':_0x22ee22[_0x3c36('0x27')],'sectionId':_0x22ee22['id']},{})[_0x3c36('0x23')](function(){return _0xcabaf;});}else{return _0xcabaf;}})[_0x3c36('0x3f')](function(_0x45de24){logger[_0x3c36('0x26')](_0x3c36('0x4e'),_0x45de24);throw _0x45de24;});}return _0xcabaf;})[_0x3c36('0x23')](respondWithResult(_0x5dbbe3,0xc9))[_0x3c36('0x3f')](handleError(_0x5dbbe3,null));};exports['update']=function(_0x2977d0,_0x2f5f02){if(_0x2977d0[_0x3c36('0x4f')]['id']){delete _0x2977d0[_0x3c36('0x4f')]['id'];}return db[_0x3c36('0x3c')][_0x3c36('0x44')]({'where':{'id':_0x2977d0[_0x3c36('0x41')]['id']}})[_0x3c36('0x23')](handleEntityNotFound(_0x2f5f02,null))[_0x3c36('0x23')](saveUpdates(_0x2977d0[_0x3c36('0x4f')],null))[_0x3c36('0x23')](respondWithResult(_0x2f5f02,null))[_0x3c36('0x3f')](handleError(_0x2f5f02,null));};exports['destroy']=function(_0x5519bf,_0x53d63a){return db[_0x3c36('0x3c')]['find']({'where':{'id':_0x5519bf[_0x3c36('0x41')]['id']}})['then'](handleEntityNotFound(_0x53d63a,null))['then'](removeEntity(_0x53d63a,null))[_0x3c36('0x3f')](handleError(_0x53d63a,null));};exports['describe']=function(_0x1d2035,_0x2a0b4a){return db[_0x3c36('0x3c')][_0x3c36('0x2a')]()[_0x3c36('0x23')](respondWithResult(_0x2a0b4a,null))[_0x3c36('0x3f')](handleError(_0x2a0b4a,null));};exports[_0x3c36('0x50')]=function(_0x1cd736,_0x152785,_0x198e80){return db[_0x3c36('0x51')][_0x3c36('0x44')]({'where':{'id':_0x1cd736['params']['id']}})[_0x3c36('0x23')](handleEntityNotFound(_0x152785,null))[_0x3c36('0x23')](function(_0x509990){if(_0x509990){return _0x509990[_0x3c36('0x50')](_0x1cd736[_0x3c36('0x4f')][_0x3c36('0x52')],_[_0x3c36('0x53')](_0x1cd736[_0x3c36('0x4f')],['ids','id'])||{});}})[_0x3c36('0x23')](respondWithResult(_0x152785,null))[_0x3c36('0x3f')](handleError(_0x152785,null));};exports[_0x3c36('0x54')]=function(_0x238f64,_0x52bb20,_0xb62e5c){var _0xb1567f={};var _0x3e31ab={};var _0x5ac39f;var _0x47428d;return db['CmCompany'][_0x3c36('0x55')]({'where':{'id':_0x238f64[_0x3c36('0x41')]['id']}})[_0x3c36('0x23')](handleEntityNotFound(_0x52bb20,null))[_0x3c36('0x23')](function(_0x2866e2){if(_0x2866e2){_0x5ac39f=_0x2866e2;_0x3e31ab[_0x3c36('0x2e')]=_['keys'](db['CmContact'][_0x3c36('0x42')]);_0x3e31ab[_0x3c36('0x2c')]=_['keys'](_0x238f64['query']);_0x3e31ab[_0x3c36('0x2d')]=_['intersection'](_0x3e31ab['model'],_0x3e31ab[_0x3c36('0x2c')]);_0xb1567f[_0x3c36('0x31')]=_[_0x3c36('0x2f')](_0x3e31ab[_0x3c36('0x2e')],qs[_0x3c36('0x30')](_0x238f64[_0x3c36('0x2c')][_0x3c36('0x30')]));_0xb1567f[_0x3c36('0x31')]=_0xb1567f[_0x3c36('0x31')]['length']?_0xb1567f[_0x3c36('0x31')]:_0x3e31ab['model'];_0xb1567f[_0x3c36('0x34')]=qs['sort'](_0x238f64[_0x3c36('0x2c')]['sort']);_0xb1567f[_0x3c36('0x36')]=qs[_0x3c36('0x2d')](_[_0x3c36('0x37')](_0x238f64['query'],_0x3e31ab[_0x3c36('0x2d')]));if(_0x238f64[_0x3c36('0x2c')][_0x3c36('0x38')]){_0xb1567f[_0x3c36('0x36')]=_[_0x3c36('0x3a')](_0xb1567f[_0x3c36('0x36')],{'$or':_['map'](_0xb1567f[_0x3c36('0x31')],function(_0x27fc16){var _0xc9ed93={};_0xc9ed93[_0x27fc16]={'$like':'%'+_0x238f64['query'][_0x3c36('0x38')]+'%'};return _0xc9ed93;})});}_0xb1567f=_[_0x3c36('0x3a')]({},_0xb1567f,_0x238f64[_0x3c36('0x3b')]);return _0x5ac39f[_0x3c36('0x54')](_0xb1567f);}})['then'](function(_0x276d0d){if(_0x276d0d){_0x47428d=_0x276d0d[_0x3c36('0x32')];if(!_0x238f64[_0x3c36('0x2c')][_0x3c36('0x56')]('nolimit')){_0xb1567f['limit']=qs[_0x3c36('0x1d')](_0x238f64[_0x3c36('0x2c')]['limit']);_0xb1567f['offset']=qs[_0x3c36('0x1b')](_0x238f64['query']['offset']);}return _0x5ac39f[_0x3c36('0x54')](_0xb1567f);}})[_0x3c36('0x23')](function(_0x1e6ca5){if(_0x1e6ca5){return _0x1e6ca5?{'count':_0x47428d,'rows':_0x1e6ca5}:null;}})[_0x3c36('0x23')](respondWithResult(_0x52bb20,null))[_0x3c36('0x3f')](handleError(_0x52bb20,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index fa1558f..639da68 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 _0x1a9b=['path','rimraf','./cmCompany.attributes','define','cm_companies','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a9b,0xc0));var _0xb1a9=function(_0x7ea9e0,_0x3e2a22){_0x7ea9e0=_0x7ea9e0-0x0;var _0x191073=_0x1a9b[_0x7ea9e0];return _0x191073;};'use strict';var _=require(_0xb1a9('0x0'));var util=require(_0xb1a9('0x1'));var logger=require(_0xb1a9('0x2'))(_0xb1a9('0x3'));var moment=require(_0xb1a9('0x4'));var BPromise=require('bluebird');var rp=require(_0xb1a9('0x5'));var fs=require('fs');var path=require(_0xb1a9('0x6'));var rimraf=require(_0xb1a9('0x7'));var config=require('../../config/environment');var attributes=require(_0xb1a9('0x8'));module['exports']=function(_0xc45b0a,_0x1d089c){return _0xc45b0a[_0xb1a9('0x9')]('CmCompany',attributes,{'tableName':_0xb1a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8003=['rimraf','./cmCompany.attributes','CmCompany','cm_companies','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xbc4df,_0x1aa754){var _0x4306c7=function(_0x275ddf){while(--_0x275ddf){_0xbc4df['push'](_0xbc4df['shift']());}};_0x4306c7(++_0x1aa754);}(_0x8003,0xbf));var _0x3800=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x8003[_0xc6be3a];return _0x56a310;};'use strict';var _=require('lodash');var util=require(_0x3800('0x0'));var logger=require(_0x3800('0x1'))(_0x3800('0x2'));var moment=require(_0x3800('0x3'));var BPromise=require(_0x3800('0x4'));var rp=require(_0x3800('0x5'));var fs=require('fs');var path=require(_0x3800('0x6'));var rimraf=require(_0x3800('0x7'));var config=require('../../config/environment');var attributes=require(_0x3800('0x8'));module['exports']=function(_0x39a60e,_0x10ae48){return _0x39a60e['define'](_0x3800('0x9'),attributes,{'tableName':_0x3800('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index d72611b..09e3147 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 _0x659f=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x168cab,_0x1b0292){var _0x437052=function(_0x416c01){while(--_0x416c01){_0x168cab['push'](_0x168cab['shift']());}};_0x437052(++_0x1b0292);}(_0x659f,0x10a));var _0xf659=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x659f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xf659('0x0'));var moment=require('moment');var BPromise=require(_0xf659('0x1'));var rs=require(_0xf659('0x2'));var fs=require('fs');var Redis=require(_0xf659('0x3'));var db=require(_0xf659('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf659('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf659('0x6'));var client=jayson[_0xf659('0x7')][_0xf659('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5276a2,_0x1d9b90,_0x24709f){return new BPromise(function(_0xe4aeb3,_0x53f7d8){return client[_0xf659('0x9')](_0x5276a2,_0x24709f)[_0xf659('0xa')](function(_0x29580b){logger[_0xf659('0xb')](_0xf659('0xc'),_0x1d9b90,_0xf659('0xd'));logger['debug'](_0xf659('0xe'),_0x1d9b90,_0xf659('0xd'),JSON[_0xf659('0xf')](_0x29580b));if(_0x29580b['error']){if(_0x29580b[_0xf659('0x10')][_0xf659('0x11')]===0x1f4){logger['error'](_0xf659('0xc'),_0x1d9b90,_0x29580b[_0xf659('0x10')][_0xf659('0x12')]);return _0x53f7d8(_0x29580b[_0xf659('0x10')][_0xf659('0x12')]);}logger['error'](_0xf659('0xc'),_0x1d9b90,_0x29580b[_0xf659('0x10')][_0xf659('0x12')]);return _0xe4aeb3(_0x29580b[_0xf659('0x10')][_0xf659('0x12')]);}else{logger['info'](_0xf659('0xc'),_0x1d9b90,'request\x20sent');_0xe4aeb3(_0x29580b[_0xf659('0x13')][_0xf659('0x12')]);}})['catch'](function(_0x577516){logger[_0xf659('0x10')]('CmCompany,\x20%s,\x20%s',_0x1d9b90,_0x577516);_0x53f7d8(_0x577516);});});}
\ No newline at end of file
+var _0x70b6=['lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2cbb23,_0x2cc579){var _0xf4bcfe=function(_0x220ff6){while(--_0x220ff6){_0x2cbb23['push'](_0x2cbb23['shift']());}};_0xf4bcfe(++_0x2cc579);}(_0x70b6,0x10a));var _0x670b=function(_0x407df1,_0x5ee3bf){_0x407df1=_0x407df1-0x0;var _0x578906=_0x70b6[_0x407df1];return _0x578906;};'use strict';var _=require(_0x670b('0x0'));var util=require('util');var moment=require(_0x670b('0x1'));var BPromise=require(_0x670b('0x2'));var rs=require(_0x670b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x670b('0x4'))('rpc');var config=require(_0x670b('0x5'));var jayson=require(_0x670b('0x6'));var client=jayson[_0x670b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e0e1d,_0x57a4a8,_0x51282a){return new BPromise(function(_0x4bd731,_0x221a37){return client[_0x670b('0x8')](_0x5e0e1d,_0x51282a)[_0x670b('0x9')](function(_0x632aa8){logger[_0x670b('0xa')](_0x670b('0xb'),_0x57a4a8,_0x670b('0xc'));logger['debug'](_0x670b('0xd'),_0x57a4a8,_0x670b('0xc'),JSON[_0x670b('0xe')](_0x632aa8));if(_0x632aa8[_0x670b('0xf')]){if(_0x632aa8[_0x670b('0xf')][_0x670b('0x10')]===0x1f4){logger[_0x670b('0xf')](_0x670b('0xb'),_0x57a4a8,_0x632aa8[_0x670b('0xf')]['message']);return _0x221a37(_0x632aa8[_0x670b('0xf')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x57a4a8,_0x632aa8[_0x670b('0xf')][_0x670b('0x11')]);return _0x4bd731(_0x632aa8[_0x670b('0xf')][_0x670b('0x11')]);}else{logger[_0x670b('0xa')]('CmCompany,\x20%s,\x20%s',_0x57a4a8,'request\x20sent');_0x4bd731(_0x632aa8['result'][_0x670b('0x11')]);}})[_0x670b('0x12')](function(_0x5f5436){logger[_0x670b('0xf')](_0x670b('0xb'),_0x57a4a8,_0x5f5436);_0x221a37(_0x5f5436);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 5a9b8c6..bf46655 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 _0xa058=['../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','show','/:id/contacts','getContacts','post','create','addContacts','/:id','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x37689d,_0x5474ac){var _0x159c74=function(_0x4dd6c7){while(--_0x4dd6c7){_0x37689d['push'](_0x37689d['shift']());}};_0x159c74(++_0x5474ac);}(_0xa058,0x67));var _0x8a05=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0xa058[_0x4bc428];return _0x3ca37f;};'use strict';var multer=require(_0x8a05('0x0'));var util=require('util');var path=require(_0x8a05('0x1'));var timeout=require(_0x8a05('0x2'));var express=require(_0x8a05('0x3'));var router=express[_0x8a05('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8a05('0x5'));var interaction=require(_0x8a05('0x6'));var config=require(_0x8a05('0x7'));var controller=require(_0x8a05('0x8'));router['get']('/',auth[_0x8a05('0x9')](),controller[_0x8a05('0xa')]);router[_0x8a05('0xb')](_0x8a05('0xc'),auth[_0x8a05('0x9')](),controller[_0x8a05('0xd')]);router[_0x8a05('0xb')]('/:id',auth[_0x8a05('0x9')](),controller[_0x8a05('0xe')]);router[_0x8a05('0xb')](_0x8a05('0xf'),auth[_0x8a05('0x9')](),controller[_0x8a05('0x10')]);router[_0x8a05('0x11')]('/',auth[_0x8a05('0x9')](),controller[_0x8a05('0x12')]);router[_0x8a05('0x11')](_0x8a05('0xf'),auth[_0x8a05('0x9')](),controller[_0x8a05('0x13')]);router['put'](_0x8a05('0x14'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8a05('0x9')](),controller[_0x8a05('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x4bcd=['/:id','/:id/contacts','getContacts','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe'];(function(_0x257bb4,_0x286623){var _0x330015=function(_0x4c4eaf){while(--_0x4c4eaf){_0x257bb4['push'](_0x257bb4['shift']());}};_0x330015(++_0x286623);}(_0x4bcd,0x81));var _0xd4bc=function(_0x2d2c77,_0x2fe0e9){_0x2d2c77=_0x2d2c77-0x0;var _0x5d7c06=_0x4bcd[_0x2d2c77];return _0x5d7c06;};'use strict';var multer=require(_0xd4bc('0x0'));var util=require(_0xd4bc('0x1'));var path=require(_0xd4bc('0x2'));var timeout=require(_0xd4bc('0x3'));var express=require(_0xd4bc('0x4'));var router=express[_0xd4bc('0x5')]();var fs_extra=require(_0xd4bc('0x6'));var auth=require(_0xd4bc('0x7'));var interaction=require(_0xd4bc('0x8'));var config=require(_0xd4bc('0x9'));var controller=require(_0xd4bc('0xa'));router['get']('/',auth[_0xd4bc('0xb')](),controller[_0xd4bc('0xc')]);router[_0xd4bc('0xd')](_0xd4bc('0xe'),auth[_0xd4bc('0xb')](),controller['describe']);router['get'](_0xd4bc('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xd4bc('0xd')](_0xd4bc('0x10'),auth[_0xd4bc('0xb')](),controller[_0xd4bc('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd4bc('0x12')]);router['post'](_0xd4bc('0x10'),auth['isAuthenticated'](),controller['addContacts']);router[_0xd4bc('0x13')]('/:id',auth[_0xd4bc('0xb')](),controller[_0xd4bc('0x14')]);router[_0xd4bc('0x15')](_0xd4bc('0xf'),auth['isAuthenticated'](),controller[_0xd4bc('0x16')]);module[_0xd4bc('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index cc749bf..e5e8227 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 _0x6249=['lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','NOW'];(function(_0x2fe3fc,_0x396fce){var _0x59a3b6=function(_0x2e0421){while(--_0x2e0421){_0x2fe3fc['push'](_0x2fe3fc['shift']());}};_0x59a3b6(++_0x396fce);}(_0x6249,0x111));var _0x9624=function(_0x51b760,_0x5b440c){_0x51b760=_0x51b760-0x0;var _0x33c26d=_0x6249[_0x51b760];return _0x33c26d;};'use strict';var _=require(_0x9624('0x0'));var Sequelize=require(_0x9624('0x1'));module[_0x9624('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x9624('0x3')]},'street':{'type':Sequelize[_0x9624('0x3')]},'postalCode':{'type':Sequelize[_0x9624('0x3')]},'city':{'type':Sequelize[_0x9624('0x3')]},'country':{'type':Sequelize[_0x9624('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x9624('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x9624('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x9624('0x3')]},'facebook':{'type':Sequelize[_0x9624('0x3')]},'fb_data':{'type':Sequelize[_0x9624('0x3')]},'twitter':{'type':Sequelize[_0x9624('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9624('0x3')]},'wechat':{'type':Sequelize[_0x9624('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x9624('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x9624('0x3')]},'priority':{'type':Sequelize[_0x9624('0x4')](0x2)[_0x9624('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x9624('0x6')]},'dialTimezone':{'type':Sequelize[_0x9624('0x3')]},'utcOffset':{'type':Sequelize[_0x9624('0x4')]}};
\ No newline at end of file
+var _0x42c5=['INTEGER','UNSIGNED','lodash','sequelize','exports','STRING','TEXT'];(function(_0x4264bf,_0x39db0f){var _0x515e5f=function(_0x130168){while(--_0x130168){_0x4264bf['push'](_0x4264bf['shift']());}};_0x515e5f(++_0x39db0f);}(_0x42c5,0x14b));var _0x542c=function(_0x323a1f,_0x2b5ad0){_0x323a1f=_0x323a1f-0x0;var _0x22717a=_0x42c5[_0x323a1f];return _0x22717a;};'use strict';var _=require(_0x542c('0x0'));var Sequelize=require(_0x542c('0x1'));module[_0x542c('0x2')]={'firstName':{'type':Sequelize[_0x542c('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x542c('0x3')]},'street':{'type':Sequelize[_0x542c('0x3')]},'postalCode':{'type':Sequelize[_0x542c('0x3')]},'city':{'type':Sequelize[_0x542c('0x3')]},'country':{'type':Sequelize[_0x542c('0x3')]},'dateOfBirth':{'type':Sequelize[_0x542c('0x3')]},'description':{'type':Sequelize[_0x542c('0x4')]},'phone':{'type':Sequelize[_0x542c('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x542c('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x542c('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x542c('0x3')]},'skype':{'type':Sequelize[_0x542c('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x542c('0x3')]},'line':{'type':Sequelize[_0x542c('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x542c('0x3')]},'UserId':{'type':Sequelize[_0x542c('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x542c('0x3')]},'priority':{'type':Sequelize[_0x542c('0x5')](0x2)[_0x542c('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x542c('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 6ea87d5..08b18b2 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 _0x9ebe=['closedAt','disposition','secondDisposition','key','Owner','customerPort','osName','ratingType','ratingValue','referer','subject','externalUrl','threadId','Interaction','reverse','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','destroy','then','end','error','name','send','index','CmContact','describe','keys','startsWith','cf_','push','CmCustomField','all','length','fieldType','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','field','from','select','uc.CmContactId\x20=\x20c.id','left_join','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','expr','search','parseSearch','conditions','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','value','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','resolve','some','User','user','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','c.phone','c.fax','c.email','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','rows','catch','find','params','tags','columnName','analytics','findAll','displayName','custom','values','hasOwnProperty','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','CmHopperBlack','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','findOrCreate','contact','show','color','ContactItemType','literal','Phones.OrderBy','$and','omit','format','cf_%d','pickBy','table','cm_contacts','id\x20=\x20?','toParam','phone','getTags','findOne','Tag','rawAttributes','options','setTags','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','item','ItemType','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','getHopperHistories','getHopperFinals','includeAll','include','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','binding_keys','CompanyId','socket_timestamp','pid','path','parse','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','fullname','findAndCountAll','alias','startCase','Website','Account'];(function(_0x3af7c4,_0x15dd29){var _0x2d357c=function(_0x266124){while(--_0x266124){_0x3af7c4['push'](_0x3af7c4['shift']());}};_0x2d357c(++_0x15dd29);}(_0x9ebe,0x13b));var _0xe9eb=function(_0x3e8cd5,_0x4bcf2d){_0x3e8cd5=_0x3e8cd5-0x0;var _0x4986a9=_0x9ebe[_0x3e8cd5];return _0x4986a9;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe9eb('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xe9eb('0x1'));var squel=require(_0xe9eb('0x2'));var Papa=require('papaparse');var Redis=require(_0xe9eb('0x3'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xe9eb('0x4'))(_0xe9eb('0x5'));var config=require(_0xe9eb('0x6'));var shared=require('../../config/environment/shared');var db=require(_0xe9eb('0x7'))['db'];config['redis']=_[_0xe9eb('0x8')](config[_0xe9eb('0x9')],{'host':_0xe9eb('0xa'),'port':0x18eb});var socket=require(_0xe9eb('0xb'))(new Redis(config['redis']));require(_0xe9eb('0xc'))[_0xe9eb('0xd')](socket);function respondWithResult(_0x3e547a,_0x37b301){_0x37b301=_0x37b301||0xc8;return function(_0x7a43ff){if(_0x7a43ff){return _0x3e547a[_0xe9eb('0xe')](_0x37b301)[_0xe9eb('0xf')](_0x7a43ff);}};}function respondWithFilteredResult(_0x4c318a,_0x313840){return function(_0x1fee1e){if(_0x1fee1e){var _0x5a7ab8=typeof _0x313840[_0xe9eb('0x10')]===_0xe9eb('0x11')&&typeof _0x313840[_0xe9eb('0x12')]===_0xe9eb('0x11');var _0x4f2c2e=_0x1fee1e[_0xe9eb('0x13')];var _0x4219a9=_0x5a7ab8?0x0:_0x313840['offset'];var _0x38eddc=_0x5a7ab8?_0x1fee1e[_0xe9eb('0x13')]:_0x313840[_0xe9eb('0x10')]+_0x313840[_0xe9eb('0x12')];var _0x562bd5;if(_0x38eddc>=_0x4f2c2e){_0x38eddc=_0x4f2c2e;_0x562bd5=0xc8;}else{_0x562bd5=0xce;}_0x4c318a[_0xe9eb('0xe')](_0x562bd5);return _0x4c318a['set'](_0xe9eb('0x14'),_0x4219a9+'-'+_0x38eddc+'/'+_0x4f2c2e)[_0xe9eb('0xf')](_0x1fee1e);}return null;};}function saveUpdates(_0x34404b){return function(_0x5cceb4){if(_0x5cceb4){return _0x5cceb4[_0xe9eb('0x15')](_0x34404b)['then'](function(_0x371356){return _0x371356;});}return null;};}function removeEntity(_0x1fec7f){return function(_0xd32766){if(_0xd32766){return _0xd32766[_0xe9eb('0x16')]()[_0xe9eb('0x17')](function(){_0x1fec7f['status'](0xcc)[_0xe9eb('0x18')]();});}};}function handleEntityNotFound(_0x18ab40){return function(_0x251f30){if(!_0x251f30){_0x18ab40['sendStatus'](0x194);}return _0x251f30;};}function handleError(_0xc0cc6d,_0x2f21a2){_0x2f21a2=_0x2f21a2||0x1f4;return function(_0x173cb0){logger[_0xe9eb('0x19')](_0x173cb0['stack']);if(_0x173cb0['name']){delete _0x173cb0[_0xe9eb('0x1a')];}_0xc0cc6d[_0xe9eb('0xe')](_0x2f21a2)[_0xe9eb('0x1b')](_0x173cb0);};}exports[_0xe9eb('0x1c')]=function(_0x315690,_0xbe2474){var _0x5243cc={},_0x57a559={},_0x519c68={'count':0x0,'rows':[]};return db[_0xe9eb('0x1d')][_0xe9eb('0x1e')]()['then'](function(_0x23a503){var _0x8bf6f5=[];for(var _0x85c766=0x0;_0x85c766
','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','toString','base64','randomstring','path','util','../../../config/logger','email','../../../config/environment','value','address','@xcally.com','name','substring','indexOf','length','slice','join','Anonymous','head','split','isEmpty','anonymous','generate','html','replace','includes'];(function(_0x136e31,_0x431ff3){var _0xd82eb=function(_0x1835b1){while(--_0x1835b1){_0x136e31['push'](_0x136e31['shift']());}};_0xd82eb(++_0x431ff3);}(_0x64f6,0xf0));var _0x664f=function(_0x3fbca8,_0x2e2902){_0x3fbca8=_0x3fbca8-0x0;var _0x47e565=_0x64f6[_0x3fbca8];return _0x47e565;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x664f('0x0'));var fs=require('fs');var path=require(_0x664f('0x1'));var util=require(_0x664f('0x2'));var tnef=require('node-tnef');var logger=require(_0x664f('0x3'))(_0x664f('0x4'));var config=require(_0x664f('0x5'));function getAddress(_0xc84fb5){var _0x2b3ee0=_['head'](_0xc84fb5[_0x664f('0x6')]);return _0x2b3ee0&&_0x2b3ee0[_0x664f('0x7')]?_0x2b3ee0[_0x664f('0x7')]:'anonymous'+random['generate'](0x6)+_0x664f('0x8');}function getFirstName(_0x21a77d){var _0x4a06c5=_['head'](_0x21a77d[_0x664f('0x6')]);if(_0x4a06c5&&_0x4a06c5['name']){if(_0x4a06c5[_0x664f('0x9')]==_0x4a06c5['address']){return _0x4a06c5[_0x664f('0x9')][_0x664f('0xa')](0x0,_0x4a06c5[_0x664f('0x9')][_0x664f('0xb')]('@'));}var _0x287bd9=_0x4a06c5[_0x664f('0x9')]['split'](/\s+/);return _0x287bd9[_0x664f('0xc')]>0x1?_0x287bd9[_0x664f('0xd')](0x0,-0x1)[_0x664f('0xe')]('\x20'):_0x4a06c5[_0x664f('0x9')];}return _0x664f('0xf');}function getLastName(_0x5a1f26){var _0x1ebb59=_[_0x664f('0x10')](_0x5a1f26['value']);if(_0x1ebb59&&_0x1ebb59['name']){var _0x546026=_0x1ebb59['name'][_0x664f('0x11')](/\s+/);return _0x546026['length']>0x1?_0x546026['pop']():'';}return'';}function getMails(_0x599a04,_0xd7edd2){var _0x58d170='';for(var _0x48c232=0x0;_0x48c232<_0xd7edd2[_0x664f('0x6')][_0x664f('0xc')];_0x48c232+=0x1){if(_0xd7edd2[_0x664f('0x6')][_0x48c232]['address']!==_0x599a04){if(!_[_0x664f('0x12')](_0x58d170)){_0x58d170+=',';}_0x58d170+=_0xd7edd2['value'][_0x48c232][_0x664f('0x9')]||_0xd7edd2[_0x664f('0x6')][_0x48c232]['address']||'';_0x58d170+='\x20<';_0x58d170+=_0xd7edd2['value'][_0x48c232][_0x664f('0x7')]?_0xd7edd2['value'][_0x48c232][_0x664f('0x7')]:_0x664f('0x13')+random[_0x664f('0x14')](0x6)+_0x664f('0x8');_0x58d170+='>';}}return _0x58d170;}function parseEmail(_0x52b139,_0x13f1bf,_0x43abfc){if(_0x13f1bf[_0x664f('0x15')]){var _0x40f8be=/