From 0fe7d63fdd24ac799f5260a5b10b06097955b09f Mon Sep 17 00:00:00 2001
From: support
Date: Fri, 15 Jul 2022 13:22:32 +0000
Subject: [PATCH] Built motion from commit 9d0783e6.|2.6.13
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
server/api/client-side-logs.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.oauth.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/contacts/index.js | 2 +-
server/components/contacts/sql-utils.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/import/cm/csvUpdates.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/interaction/sql-utils.js | 2 +-
.../components/interaction/update-interaction.js | 2 +-
server/components/interaction/utils.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/components/realtime/agents.js | 2 +-
server/components/realtime/queues.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/cloud-provider.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/api.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/events.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/project.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/models/action.js | 2 +-
server/services/ami/dialer/models/agentComplete.js | 2 +-
server/services/ami/dialer/models/final.js | 2 +-
server/services/ami/dialer/models/hangup.js | 2 +-
server/services/ami/dialer/models/history.js | 2 +-
.../ami/dialer/models/queueCallerAbandon.js | 2 +-
server/services/ami/dialer/utils/hopper.js | 2 +-
server/services/ami/dialer/utils/index.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/voiceQueueSummary.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/realtime/utils.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/interval.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/iftime.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
server/utils/update-app-config.js | 2 +-
1203 files changed, 1203 insertions(+), 1203 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index dd93e42..ad51c56 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-15T12:41:16.416Z",
+ "time": "2022-07-15T13:15:52.909Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 2d10272..f2e04f3 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-15T12:41:16.416Z",
+ "time": "2022-07-15T13:15:52.909Z",
"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 a068999..4d61090 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 _0x7fcf=['action','contactManager','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0x7fcf,0xce));var _0xf7fc=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7fcf[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require('sequelize');module[_0xf7fc('0x0')]={'name':{'type':Sequelize[_0xf7fc('0x1')],'get':function(_0x340c94){return this['getDataValue'](_0xf7fc('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xf7fc('0x3'),'integration','motionbar',_0xf7fc('0x4'),_0xf7fc('0x5'),_0xf7fc('0x6'),'bot',_0xf7fc('0x7')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xf7fc('0x8')},'data1':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comment':_0xf7fc('0xa')},'data2':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comment':_0xf7fc('0xb')},'data4':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comments':_0xf7fc('0xc')},'data6':{'type':Sequelize[_0xf7fc('0x9')],'comments':_0xf7fc('0xd')},'data7':{'type':Sequelize[_0xf7fc('0xe')],'comments':_0xf7fc('0xf')}};
\ No newline at end of file
+var _0xea78=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager','motionbar','jscripty','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)]'];(function(_0x5c2c72,_0x22cf09){var _0x11c44c=function(_0x37bcca){while(--_0x37bcca){_0x5c2c72['push'](_0x5c2c72['shift']());}};_0x11c44c(++_0x22cf09);}(_0xea78,0x162));var _0x8ea7=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0xea78[_0x2fee96];return _0x2e6ad1;};'use strict';var Sequelize=require(_0x8ea7('0x0'));module[_0x8ea7('0x1')]={'name':{'type':Sequelize[_0x8ea7('0x2')],'get':function(_0x53977f){return this['getDataValue'](_0x8ea7('0x3'));}},'action':{'type':Sequelize[_0x8ea7('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8ea7('0x5'),'integration',_0x8ea7('0x6'),_0x8ea7('0x7'),'urlForward',_0x8ea7('0x8'),'bot',_0x8ea7('0x9')]],'msg':_0x8ea7('0xa')}},'comment':_0x8ea7('0xa')},'data1':{'type':Sequelize[_0x8ea7('0x4')](0x1000),'comment':_0x8ea7('0xb')},'data2':{'type':Sequelize[_0x8ea7('0x4')](0x1000),'comment':_0x8ea7('0xc')},'data3':{'type':Sequelize[_0x8ea7('0x4')](0x1000),'comment':_0x8ea7('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x8ea7('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x8ea7('0x4')],'comments':_0x8ea7('0xe')},'data7':{'type':Sequelize[_0x8ea7('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index c1b432c..c06d7ca 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 _0xd7b9=['mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x308b5c,_0x31bf56){var _0x2de469=function(_0x298e66){while(--_0x298e66){_0x308b5c['push'](_0x308b5c['shift']());}};_0x2de469(++_0x31bf56);}(_0xd7b9,0x12c));var _0x9d7b=function(_0x1c22f0,_0x1924e2){_0x1c22f0=_0x1c22f0-0x0;var _0x5a32d8=_0xd7b9[_0x1c22f0];return _0x5a32d8;};'use strict';var emlformat=require(_0x9d7b('0x0'));var rimraf=require(_0x9d7b('0x1'));var zipdir=require(_0x9d7b('0x2'));var jsonpatch=require(_0x9d7b('0x3'));var rp=require(_0x9d7b('0x4'));var moment=require(_0x9d7b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9d7b('0x6'));var util=require(_0x9d7b('0x7'));var path=require(_0x9d7b('0x8'));var sox=require('sox');var csv=require(_0x9d7b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d7b('0xa'));var _=require('lodash');var squel=require(_0x9d7b('0xb'));var crypto=require(_0x9d7b('0xc'));var jsforce=require(_0x9d7b('0xd'));var deskjs=require(_0x9d7b('0xe'));var toCsv=require(_0x9d7b('0x9'));var querystring=require(_0x9d7b('0xf'));var Papa=require(_0x9d7b('0x10'));var Redis=require(_0x9d7b('0x11'));var authService=require(_0x9d7b('0x12'));var qs=require(_0x9d7b('0x13'));var as=require(_0x9d7b('0x14'));var hardwareService=require(_0x9d7b('0x15'));var logger=require(_0x9d7b('0x16'))(_0x9d7b('0x17'));var utils=require('../../config/utils');var config=require(_0x9d7b('0x18'));var licenseUtil=require(_0x9d7b('0x19'));var db=require(_0x9d7b('0x1a'))['db'];function respondWithStatusCode(_0x12fc68,_0x4bb5b3){_0x4bb5b3=_0x4bb5b3||0xcc;return function(_0x5c70f1){if(_0x5c70f1){return _0x12fc68[_0x9d7b('0x1b')](_0x4bb5b3);}return _0x12fc68[_0x9d7b('0x1c')](_0x4bb5b3)[_0x9d7b('0x1d')]();};}function respondWithResult(_0x3cb368,_0x329255){_0x329255=_0x329255||0xc8;return function(_0x5905b4){if(_0x5905b4){return _0x3cb368[_0x9d7b('0x1c')](_0x329255)['json'](_0x5905b4);}};}function respondWithFilteredResult(_0x3d19c1,_0x58209e){return function(_0x4a1fea){if(_0x4a1fea){var _0x4ab7d0=typeof _0x58209e[_0x9d7b('0x1e')]==='undefined'&&typeof _0x58209e[_0x9d7b('0x1f')]===_0x9d7b('0x20');var _0x5b74a4=_0x4a1fea[_0x9d7b('0x21')];var _0x1d1a7f=_0x4ab7d0?0x0:_0x58209e['offset'];var _0x3800da=_0x4ab7d0?_0x4a1fea[_0x9d7b('0x21')]:_0x58209e[_0x9d7b('0x1e')]+_0x58209e[_0x9d7b('0x1f')];var _0x4a9e18;if(_0x3800da>=_0x5b74a4){_0x3800da=_0x5b74a4;_0x4a9e18=0xc8;}else{_0x4a9e18=0xce;}_0x3d19c1['status'](_0x4a9e18);return _0x3d19c1[_0x9d7b('0x22')]('Content-Range',_0x1d1a7f+'-'+_0x3800da+'/'+_0x5b74a4)[_0x9d7b('0x23')](_0x4a1fea);}return null;};}function patchUpdates(_0x4fd040){return function(_0x139d4b){try{jsonpatch[_0x9d7b('0x24')](_0x139d4b,_0x4fd040,!![]);}catch(_0x27cdc8){return BPromise[_0x9d7b('0x25')](_0x27cdc8);}return _0x139d4b[_0x9d7b('0x26')]();};}function saveUpdates(_0x464abb,_0x261880){return function(_0x4f7d7e){if(_0x4f7d7e){return _0x4f7d7e[_0x9d7b('0x27')](_0x464abb)['then'](function(_0x340d78){return _0x340d78;});}return null;};}function removeEntity(_0x25b510,_0x1fabd4){return function(_0x2a404e){if(_0x2a404e){return _0x2a404e[_0x9d7b('0x28')]()[_0x9d7b('0x29')](function(){_0x25b510[_0x9d7b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53b741,_0x524ad0){return function(_0x1e5fdd){if(!_0x1e5fdd){_0x53b741[_0x9d7b('0x1b')](0x194);}return _0x1e5fdd;};}function handleError(_0x2f9d43,_0x3ba0a0){_0x3ba0a0=_0x3ba0a0||0x1f4;return function(_0x9aa3eb){logger[_0x9d7b('0x2a')](_0x9aa3eb[_0x9d7b('0x2b')]);if(_0x9aa3eb[_0x9d7b('0x2c')]){delete _0x9aa3eb['name'];}_0x2f9d43[_0x9d7b('0x1c')](_0x3ba0a0)[_0x9d7b('0x2d')](_0x9aa3eb);};}exports[_0x9d7b('0x27')]=function(_0x16d1d0,_0x5d374d){if(_0x16d1d0[_0x9d7b('0x2e')]['id']){delete _0x16d1d0['body']['id'];}return db[_0x9d7b('0x2f')][_0x9d7b('0x30')]({'where':{'id':_0x16d1d0['params']['id']}})[_0x9d7b('0x29')](handleEntityNotFound(_0x5d374d,null))[_0x9d7b('0x29')](saveUpdates(_0x16d1d0[_0x9d7b('0x2e')],null))[_0x9d7b('0x29')](respondWithResult(_0x5d374d,null))[_0x9d7b('0x31')](handleError(_0x5d374d,null));};exports[_0x9d7b('0x28')]=function(_0x423de2,_0xa14b67){return db[_0x9d7b('0x2f')][_0x9d7b('0x30')]({'where':{'id':_0x423de2[_0x9d7b('0x32')]['id']}})[_0x9d7b('0x29')](handleEntityNotFound(_0xa14b67,null))[_0x9d7b('0x29')](removeEntity(_0xa14b67,null))[_0x9d7b('0x31')](handleError(_0xa14b67,null));};
\ No newline at end of file
+var _0xeeb3=['util','sox','to-csv','fs-extra','lodash','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','name','send','Action','find','params','body','catch','rimraf','zip-dir','request-promise','moment'];(function(_0x37dbf9,_0x529eb5){var _0x40e897=function(_0x10fbcf){while(--_0x10fbcf){_0x37dbf9['push'](_0x37dbf9['shift']());}};_0x40e897(++_0x529eb5);}(_0xeeb3,0x74));var _0x3eeb=function(_0xaa0720,_0x12e8fa){_0xaa0720=_0xaa0720-0x0;var _0x79ec4c=_0xeeb3[_0xaa0720];return _0x79ec4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3eeb('0x0'));var zipdir=require(_0x3eeb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3eeb('0x2'));var moment=require(_0x3eeb('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3eeb('0x4'));var path=require('path');var sox=require(_0x3eeb('0x5'));var csv=require(_0x3eeb('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3eeb('0x7'));var _=require(_0x3eeb('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3eeb('0x9'));var Papa=require(_0x3eeb('0xa'));var Redis=require(_0x3eeb('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x3eeb('0xc'));var as=require(_0x3eeb('0xd'));var hardwareService=require(_0x3eeb('0xe'));var logger=require(_0x3eeb('0xf'))(_0x3eeb('0x10'));var utils=require('../../config/utils');var config=require(_0x3eeb('0x11'));var licenseUtil=require(_0x3eeb('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x111174,_0x421cf6){_0x421cf6=_0x421cf6||0xcc;return function(_0xeea686){if(_0xeea686){return _0x111174[_0x3eeb('0x13')](_0x421cf6);}return _0x111174[_0x3eeb('0x14')](_0x421cf6)[_0x3eeb('0x15')]();};}function respondWithResult(_0x2f4562,_0x304e57){_0x304e57=_0x304e57||0xc8;return function(_0x1b8aaf){if(_0x1b8aaf){return _0x2f4562[_0x3eeb('0x14')](_0x304e57)[_0x3eeb('0x16')](_0x1b8aaf);}};}function respondWithFilteredResult(_0x19c2bb,_0x146c03){return function(_0x7cfc3){if(_0x7cfc3){var _0x5465a0=typeof _0x146c03[_0x3eeb('0x17')]===_0x3eeb('0x18')&&typeof _0x146c03[_0x3eeb('0x19')]===_0x3eeb('0x18');var _0x3843d3=_0x7cfc3['count'];var _0x443d5a=_0x5465a0?0x0:_0x146c03['offset'];var _0x25bbe6=_0x5465a0?_0x7cfc3[_0x3eeb('0x1a')]:_0x146c03[_0x3eeb('0x17')]+_0x146c03['limit'];var _0x3dbc4a;if(_0x25bbe6>=_0x3843d3){_0x25bbe6=_0x3843d3;_0x3dbc4a=0xc8;}else{_0x3dbc4a=0xce;}_0x19c2bb[_0x3eeb('0x14')](_0x3dbc4a);return _0x19c2bb[_0x3eeb('0x1b')](_0x3eeb('0x1c'),_0x443d5a+'-'+_0x25bbe6+'/'+_0x3843d3)[_0x3eeb('0x16')](_0x7cfc3);}return null;};}function patchUpdates(_0x40c04e){return function(_0x2768bf){try{jsonpatch[_0x3eeb('0x1d')](_0x2768bf,_0x40c04e,!![]);}catch(_0x316c18){return BPromise['reject'](_0x316c18);}return _0x2768bf['save']();};}function saveUpdates(_0x3507c4,_0x35674c){return function(_0x344bd7){if(_0x344bd7){return _0x344bd7['update'](_0x3507c4)[_0x3eeb('0x1e')](function(_0x43b5d3){return _0x43b5d3;});}return null;};}function removeEntity(_0x468e5a,_0x2b08f1){return function(_0x65bebe){if(_0x65bebe){return _0x65bebe[_0x3eeb('0x1f')]()[_0x3eeb('0x1e')](function(){_0x468e5a[_0x3eeb('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x371585,_0x5bc1f3){return function(_0xce0236){if(!_0xce0236){_0x371585[_0x3eeb('0x13')](0x194);}return _0xce0236;};}function handleError(_0x3de58f,_0x3ee9c5){_0x3ee9c5=_0x3ee9c5||0x1f4;return function(_0x53ba13){logger[_0x3eeb('0x20')](_0x53ba13['stack']);if(_0x53ba13['name']){delete _0x53ba13[_0x3eeb('0x21')];}_0x3de58f[_0x3eeb('0x14')](_0x3ee9c5)[_0x3eeb('0x22')](_0x53ba13);};}exports['update']=function(_0x54f80c,_0x371ff2){if(_0x54f80c['body']['id']){delete _0x54f80c['body']['id'];}return db[_0x3eeb('0x23')][_0x3eeb('0x24')]({'where':{'id':_0x54f80c[_0x3eeb('0x25')]['id']}})[_0x3eeb('0x1e')](handleEntityNotFound(_0x371ff2,null))[_0x3eeb('0x1e')](saveUpdates(_0x54f80c[_0x3eeb('0x26')],null))['then'](respondWithResult(_0x371ff2,null))['catch'](handleError(_0x371ff2,null));};exports[_0x3eeb('0x1f')]=function(_0x5b119d,_0x3768fa){return db['Action'][_0x3eeb('0x24')]({'where':{'id':_0x5b119d[_0x3eeb('0x25')]['id']}})[_0x3eeb('0x1e')](handleEntityNotFound(_0x3768fa,null))[_0x3eeb('0x1e')](removeEntity(_0x3768fa,null))[_0x3eeb('0x27')](handleError(_0x3768fa,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 9fecbc4..405fd15 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 _0x8d03=['Action','../../config/logger','api','bluebird','rimraf','../../config/environment','./action.attributes','exports','define'];(function(_0x126895,_0x468fb0){var _0x2df6da=function(_0x3d1ee1){while(--_0x3d1ee1){_0x126895['push'](_0x126895['shift']());}};_0x2df6da(++_0x468fb0);}(_0x8d03,0xd0));var _0x38d0=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8d03[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x38d0('0x0'))(_0x38d0('0x1'));var moment=require('moment');var BPromise=require(_0x38d0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x38d0('0x3'));var config=require(_0x38d0('0x4'));var attributes=require(_0x38d0('0x5'));module[_0x38d0('0x6')]=function(_0x1f9c92,_0x2289fc){return _0x1f9c92[_0x38d0('0x7')](_0x38d0('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a28=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action','tools_actions'];(function(_0xe55e2c,_0x1e0152){var _0x315d02=function(_0x1d7c9e){while(--_0x1d7c9e){_0xe55e2c['push'](_0xe55e2c['shift']());}};_0x315d02(++_0x1e0152);}(_0x5a28,0x1c7));var _0x85a2=function(_0x159468,_0x19e94c){_0x159468=_0x159468-0x0;var _0x2d9008=_0x5a28[_0x159468];return _0x2d9008;};'use strict';var _=require(_0x85a2('0x0'));var util=require(_0x85a2('0x1'));var logger=require(_0x85a2('0x2'))(_0x85a2('0x3'));var moment=require(_0x85a2('0x4'));var BPromise=require('bluebird');var rp=require(_0x85a2('0x5'));var fs=require('fs');var path=require(_0x85a2('0x6'));var rimraf=require(_0x85a2('0x7'));var config=require(_0x85a2('0x8'));var attributes=require(_0x85a2('0x9'));module['exports']=function(_0x147531,_0x2f8e92){return _0x147531[_0x85a2('0xa')](_0x85a2('0xb'),attributes,{'tableName':_0x85a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 711f593..ff13ce0 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3528e1,_0x3a7c02){var _0x1e0216=function(_0x4bd7fa){while(--_0x4bd7fa){_0x3528e1['push'](_0x3528e1['shift']());}};_0x1e0216(++_0x3a7c02);}(_0xabce,0x103));var _0xeabc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xabce[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x231bba,_0x5eb1ac){var _0x446c0e=function(_0x51f4f6){while(--_0x51f4f6){_0x231bba['push'](_0x231bba['shift']());}};_0x446c0e(++_0x5eb1ac);}(_0xe14b,0x93));var _0xbe14=function(_0xcf42ea,_0x377d94){_0xcf42ea=_0xcf42ea-0x0;var _0x33dde6=_0xe14b[_0xcf42ea];return _0x33dde6;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 7f5d092..515a16a 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 _0x3ffc=['/:id','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put'];(function(_0x57fb1f,_0x2ff657){var _0x3330bd=function(_0xc31e1d){while(--_0xc31e1d){_0x57fb1f['push'](_0x57fb1f['shift']());}};_0x3330bd(++_0x2ff657);}(_0x3ffc,0xb8));var _0xc3ff=function(_0x425d5e,_0x3b9040){_0x425d5e=_0x425d5e-0x0;var _0x3cc67b=_0x3ffc[_0x425d5e];return _0x3cc67b;};'use strict';var multer=require('multer');var util=require(_0xc3ff('0x0'));var path=require(_0xc3ff('0x1'));var timeout=require(_0xc3ff('0x2'));var express=require(_0xc3ff('0x3'));var router=express[_0xc3ff('0x4')]();var fs_extra=require(_0xc3ff('0x5'));var auth=require(_0xc3ff('0x6'));var interaction=require(_0xc3ff('0x7'));var config=require(_0xc3ff('0x8'));var controller=require(_0xc3ff('0x9'));router[_0xc3ff('0xa')](_0xc3ff('0xb'),auth[_0xc3ff('0xc')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc3ff('0xd')]);module[_0xc3ff('0xe')]=router;
\ No newline at end of file
+var _0xe3c9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x57390d,_0x5746a0){var _0x59bd6a=function(_0x14effb){while(--_0x14effb){_0x57390d['push'](_0x57390d['shift']());}};_0x59bd6a(++_0x5746a0);}(_0xe3c9,0x14a));var _0x9e3c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe3c9[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x9e3c('0x0'));var util=require(_0x9e3c('0x1'));var path=require('path');var timeout=require(_0x9e3c('0x2'));var express=require(_0x9e3c('0x3'));var router=express[_0x9e3c('0x4')]();var fs_extra=require(_0x9e3c('0x5'));var auth=require(_0x9e3c('0x6'));var interaction=require(_0x9e3c('0x7'));var config=require(_0x9e3c('0x8'));var controller=require(_0x9e3c('0x9'));router['put'](_0x9e3c('0xa'),auth[_0x9e3c('0xb')](),controller[_0x9e3c('0xc')]);router[_0x9e3c('0xd')](_0x9e3c('0xa'),auth[_0x9e3c('0xb')](),controller[_0x9e3c('0xe')]);module[_0x9e3c('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 7dfeb81..2337d51 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0xad3b12,_0xdffe90){var _0x2b9872=function(_0x49439b){while(--_0x49439b){_0xad3b12['push'](_0xad3b12['shift']());}};_0x2b9872(++_0xdffe90);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
+var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x5f1d74,_0x33e095){var _0xab75f5=function(_0x1765f1){while(--_0x1765f1){_0x5f1d74['push'](_0x5f1d74['shift']());}};_0xab75f5(++_0x33e095);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0x24ca[_0x4a82ac];return _0x58ee97;};'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 9361620..061f09a 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 _0xabe1=['query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','model','keys','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','group','DESC','alias','joins','includes','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','IS\x20NULL','operator','ValidationErrorItem','orderBy','output','web','fullPath','%s-%s.%s','generate','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','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/utils','../../mysqldb','dbH','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','filters','intersection','attributes','fields'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xabe1,0x1c2));var _0x1abe=function(_0x4ddcec,_0x42870a){_0x4ddcec=_0x4ddcec-0x0;var _0x47fb0f=_0xabe1[_0x4ddcec];return _0x47fb0f;};'use strict';var emlformat=require(_0x1abe('0x0'));var rimraf=require(_0x1abe('0x1'));var zipdir=require(_0x1abe('0x2'));var jsonpatch=require(_0x1abe('0x3'));var rp=require(_0x1abe('0x4'));var moment=require(_0x1abe('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1abe('0x6'));var sox=require(_0x1abe('0x7'));var csv=require(_0x1abe('0x8'));var ejs=require(_0x1abe('0x9'));var fs=require('fs');var fs_extra=require(_0x1abe('0xa'));var _=require(_0x1abe('0xb'));var squel=require(_0x1abe('0xc'));var crypto=require(_0x1abe('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1abe('0xe'));var toCsv=require(_0x1abe('0x8'));var querystring=require('querystring');var Papa=require(_0x1abe('0xf'));var Redis=require(_0x1abe('0x10'));var authService=require(_0x1abe('0x11'));var qs=require(_0x1abe('0x12'));var as=require(_0x1abe('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1abe('0x14'))(_0x1abe('0x15'));var utils=require(_0x1abe('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1abe('0x17'))['db'];var dbH=require('../../mysqldb')[_0x1abe('0x18')];function respondWithStatusCode(_0x37d53d,_0x19d66b){_0x19d66b=_0x19d66b||0xcc;return function(_0x4f3ad1){if(_0x4f3ad1){return _0x37d53d[_0x1abe('0x19')](_0x19d66b);}return _0x37d53d[_0x1abe('0x1a')](_0x19d66b)[_0x1abe('0x1b')]();};}function respondWithResult(_0x4b809f,_0x3829f2){_0x3829f2=_0x3829f2||0xc8;return function(_0x225314){if(_0x225314){return _0x4b809f[_0x1abe('0x1a')](_0x3829f2)['json'](_0x225314);}};}function respondWithFilteredResult(_0x477fcf,_0x1ce694){return function(_0x1d0bba){if(_0x1d0bba){var _0x33478b=typeof _0x1ce694[_0x1abe('0x1c')]==='undefined'&&typeof _0x1ce694[_0x1abe('0x1d')]===_0x1abe('0x1e');var _0x18b6e3=_0x1d0bba['count'];var _0x39f6fc=_0x33478b?0x0:_0x1ce694[_0x1abe('0x1c')];var _0x35e7ee=_0x33478b?_0x1d0bba[_0x1abe('0x1f')]:_0x1ce694[_0x1abe('0x1c')]+_0x1ce694[_0x1abe('0x1d')];var _0x1c4ff0;if(_0x35e7ee>=_0x18b6e3){_0x35e7ee=_0x18b6e3;_0x1c4ff0=0xc8;}else{_0x1c4ff0=0xce;}_0x477fcf[_0x1abe('0x1a')](_0x1c4ff0);return _0x477fcf[_0x1abe('0x20')](_0x1abe('0x21'),_0x39f6fc+'-'+_0x35e7ee+'/'+_0x18b6e3)[_0x1abe('0x22')](_0x1d0bba);}return null;};}function patchUpdates(_0x56f2f9){return function(_0x572a6f){try{jsonpatch[_0x1abe('0x23')](_0x572a6f,_0x56f2f9,!![]);}catch(_0x28dc76){return BPromise[_0x1abe('0x24')](_0x28dc76);}return _0x572a6f[_0x1abe('0x25')]();};}function saveUpdates(_0xedf367,_0x11eecc){return function(_0x272911){if(_0x272911){return _0x272911['update'](_0xedf367)[_0x1abe('0x26')](function(_0x262107){return _0x262107;});}return null;};}function removeEntity(_0x4b9c5d,_0x1bcaa6){return function(_0x373bb1){if(_0x373bb1){return _0x373bb1[_0x1abe('0x27')]()[_0x1abe('0x26')](function(){var _0x5db149=_0x373bb1[_0x1abe('0x28')]({'plain':!![]});var _0x57c938=_0x1abe('0x29');return db['UserProfileResource'][_0x1abe('0x27')]({'where':{'type':_0x57c938,'resourceId':_0x5db149['id']}})[_0x1abe('0x26')](function(){return _0x373bb1;});})['then'](function(){_0x4b9c5d[_0x1abe('0x1a')](0xcc)[_0x1abe('0x1b')]();});}};}function handleEntityNotFound(_0x301248,_0x949016){return function(_0x548840){if(!_0x548840){_0x301248[_0x1abe('0x19')](0x194);}return _0x548840;};}function handleError(_0x265050,_0x298911){_0x298911=_0x298911||0x1f4;return function(_0x22be9b){logger[_0x1abe('0x2a')](_0x22be9b[_0x1abe('0x2b')]);if(_0x22be9b[_0x1abe('0x2c')]){delete _0x22be9b[_0x1abe('0x2c')];}_0x265050['status'](_0x298911)[_0x1abe('0x2d')](_0x22be9b);};}exports[_0x1abe('0x2e')]=function(_0x2d1f78,_0x149bda){var _0x5289d0={},_0xa632d4={},_0x168f8b={'count':0x0,'rows':[]};var _0xa1b8e9=_[_0x1abe('0x2f')](db[_0x1abe('0x30')][_0x1abe('0x31')],function(_0xd4ba27){return{'name':_0xd4ba27[_0x1abe('0x32')],'type':_0xd4ba27[_0x1abe('0x33')][_0x1abe('0x34')]};});_0xa632d4['model']=_[_0x1abe('0x2f')](_0xa1b8e9,_0x1abe('0x2c'));_0xa632d4['query']=_['keys'](_0x2d1f78['query']);_0xa632d4[_0x1abe('0x35')]=_[_0x1abe('0x36')](_0xa632d4['model'],_0xa632d4['query']);_0x5289d0[_0x1abe('0x37')]=_[_0x1abe('0x36')](_0xa632d4['model'],qs[_0x1abe('0x38')](_0x2d1f78[_0x1abe('0x39')][_0x1abe('0x38')]));_0x5289d0[_0x1abe('0x37')]=_0x5289d0['attributes']['length']?_0x5289d0[_0x1abe('0x37')]:_0xa632d4['model'];if(!_0x2d1f78['query'][_0x1abe('0x3a')](_0x1abe('0x3b'))){_0x5289d0['limit']=qs['limit'](_0x2d1f78[_0x1abe('0x39')]['limit']);_0x5289d0['offset']=qs[_0x1abe('0x1c')](_0x2d1f78[_0x1abe('0x39')][_0x1abe('0x1c')]);}_0x5289d0[_0x1abe('0x3c')]=qs[_0x1abe('0x3d')](_0x2d1f78[_0x1abe('0x39')][_0x1abe('0x3d')]);_0x5289d0[_0x1abe('0x3e')]=qs[_0x1abe('0x35')](_[_0x1abe('0x3f')](_0x2d1f78[_0x1abe('0x39')],_0xa632d4[_0x1abe('0x35')]),_0xa1b8e9);if(_0x2d1f78[_0x1abe('0x39')][_0x1abe('0x40')]){_0x5289d0[_0x1abe('0x3e')]=_[_0x1abe('0x41')](_0x5289d0[_0x1abe('0x3e')],{'$or':_[_0x1abe('0x2f')](_0xa1b8e9,function(_0x58b5d8){if(_0x58b5d8[_0x1abe('0x33')]!=='VIRTUAL'){var _0x11cf84={};_0x11cf84[_0x58b5d8['name']]={'$like':'%'+_0x2d1f78[_0x1abe('0x39')][_0x1abe('0x40')]+'%'};return _0x11cf84;}})});}_0x5289d0=_[_0x1abe('0x41')]({},_0x5289d0,_0x2d1f78[_0x1abe('0x42')]);var _0x5046eb={'where':_0x5289d0[_0x1abe('0x3e')]};return db[_0x1abe('0x30')][_0x1abe('0x1f')](_0x5046eb)['then'](function(_0x27e788){_0x168f8b['count']=_0x27e788;if(_0x2d1f78[_0x1abe('0x39')]['includeAll']){_0x5289d0[_0x1abe('0x43')]=[{'all':!![]}];}return db[_0x1abe('0x30')][_0x1abe('0x44')](_0x5289d0);})[_0x1abe('0x26')](function(_0x515395){_0x168f8b['rows']=_0x515395;return _0x168f8b;})[_0x1abe('0x26')](respondWithFilteredResult(_0x149bda,_0x5289d0))[_0x1abe('0x45')](handleError(_0x149bda,null));};exports[_0x1abe('0x46')]=function(_0x3e1c8a,_0x28eda0){var _0xb0e576={'raw':![],'where':{'id':_0x3e1c8a['params']['id']}},_0x59a749={};_0x59a749[_0x1abe('0x47')]=_[_0x1abe('0x48')](db[_0x1abe('0x30')]['rawAttributes']);_0x59a749[_0x1abe('0x39')]=_[_0x1abe('0x48')](_0x3e1c8a[_0x1abe('0x39')]);_0x59a749[_0x1abe('0x35')]=_[_0x1abe('0x36')](_0x59a749[_0x1abe('0x47')],_0x59a749[_0x1abe('0x39')]);_0xb0e576[_0x1abe('0x37')]=_['intersection'](_0x59a749['model'],qs['fields'](_0x3e1c8a[_0x1abe('0x39')][_0x1abe('0x38')]));_0xb0e576[_0x1abe('0x37')]=_0xb0e576[_0x1abe('0x37')][_0x1abe('0x49')]?_0xb0e576[_0x1abe('0x37')]:_0x59a749[_0x1abe('0x47')];if(_0x3e1c8a[_0x1abe('0x39')][_0x1abe('0x4a')]){_0xb0e576[_0x1abe('0x43')]=[{'all':!![]}];}_0xb0e576=_[_0x1abe('0x41')]({},_0xb0e576,_0x3e1c8a[_0x1abe('0x42')]);return db['AnalyticCustomReport'][_0x1abe('0x4b')](_0xb0e576)[_0x1abe('0x26')](handleEntityNotFound(_0x28eda0,null))[_0x1abe('0x26')](respondWithResult(_0x28eda0,null))['catch'](handleError(_0x28eda0,null));};exports['create']=function(_0x3c5038,_0x1f75ee){return db[_0x1abe('0x30')][_0x1abe('0x4c')](_0x3c5038[_0x1abe('0x4d')],{})[_0x1abe('0x26')](function(_0x582997){var _0xac1ba8=_0x3c5038[_0x1abe('0x4e')][_0x1abe('0x28')]({'plain':!![]});if(!_0xac1ba8)throw new Error(_0x1abe('0x4f'));if(_0xac1ba8[_0x1abe('0x50')]===_0x1abe('0x4e')){var _0x5aed68=_0x582997[_0x1abe('0x28')]({'plain':!![]});var _0x3f9930='Reports';return db[_0x1abe('0x51')][_0x1abe('0x4b')]({'where':{'name':_0x3f9930,'userProfileId':_0xac1ba8[_0x1abe('0x52')]},'raw':!![]})[_0x1abe('0x26')](function(_0x58803a){if(_0x58803a&&_0x58803a[_0x1abe('0x53')]===0x0){return db[_0x1abe('0x54')][_0x1abe('0x4c')]({'name':_0x5aed68['name'],'resourceId':_0x5aed68['id'],'type':_0x1abe('0x29'),'sectionId':_0x58803a['id']},{})[_0x1abe('0x26')](function(){return _0x582997;});}else{return _0x582997;}})['catch'](function(_0xbebd93){logger[_0x1abe('0x2a')](_0x1abe('0x55'),_0xbebd93);throw _0xbebd93;});}return _0x582997;})[_0x1abe('0x26')](respondWithResult(_0x1f75ee,0xc9))[_0x1abe('0x45')](handleError(_0x1f75ee,null));};exports[_0x1abe('0x56')]=function(_0x2ec980,_0x2ea6de){if(_0x2ec980[_0x1abe('0x4d')]['id']){delete _0x2ec980[_0x1abe('0x4d')]['id'];}return db['AnalyticCustomReport'][_0x1abe('0x4b')]({'where':{'id':_0x2ec980[_0x1abe('0x57')]['id']}})[_0x1abe('0x26')](handleEntityNotFound(_0x2ea6de,null))['then'](saveUpdates(_0x2ec980[_0x1abe('0x4d')],null))['then'](respondWithResult(_0x2ea6de,null))[_0x1abe('0x45')](handleError(_0x2ea6de,null));};exports[_0x1abe('0x27')]=function(_0x18ca08,_0x51ead5){return db[_0x1abe('0x30')][_0x1abe('0x4b')]({'where':{'id':_0x18ca08[_0x1abe('0x57')]['id']}})[_0x1abe('0x26')](handleEntityNotFound(_0x51ead5,null))[_0x1abe('0x26')](removeEntity(_0x51ead5,null))[_0x1abe('0x45')](handleError(_0x51ead5,null));};exports[_0x1abe('0x58')]=function(_0xe8529f,_0x137204){var _0x2e9f94=0xa;var _0x1ce8e6=[_0x1abe('0x59'),_0x1abe('0x5a'),_0x1abe('0x5b'),_0x1abe('0x5c')];var _0x4b14c5={'SUM':_0x1abe('0x5d'),'COUNT':_0x1abe('0x5e'),'COUNT DISTINCT':_0x1abe('0x5f'),'MAX':_0x1abe('0x60'),'MIN':_0x1abe('0x61'),'AVG':_0x1abe('0x62'),'GROUP_CONCAT':_0x1abe('0x63'),'GROUP_CONCAT ASC':_0x1abe('0x64'),'GROUP_CONCAT DESC':_0x1abe('0x65')};var _0x43924a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x1abe('0x66'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1abe('0x67')};var _0x282743=function(_0x8615f){return!_['includes'](['IS\x20NULL',_0x1abe('0x68'),_0x1abe('0x69'),_0x1abe('0x6a')],_0x8615f);};var _0x5b7d01=function(_0x591f3a){if(!_0x591f3a||!_0x591f3a[_0x1abe('0x6b')][_0x1abe('0x49')]){return'';}for(var _0xd1cbc0='(',_0x5c9d36=0x0;_0x5c9d36<_0x591f3a[_0x1abe('0x6b')][_0x1abe('0x49')];_0x5c9d36+=0x1){_0x5c9d36>0x0&&(_0xd1cbc0+='\x20'+_0x591f3a['operator']+'\x20');_0xd1cbc0+=_0x591f3a[_0x1abe('0x6b')][_0x5c9d36]['group']?_0x5b7d01(_0x591f3a[_0x1abe('0x6b')][_0x5c9d36]['group']):_0x591f3a['rules'][_0x5c9d36][_0x1abe('0x6c')]+'\x20'+_0x591f3a[_0x1abe('0x6b')][_0x5c9d36][_0x1abe('0x6d')]+(_0x282743(_0x591f3a['rules'][_0x5c9d36]['condition'])?'\x20'+_0x591f3a[_0x1abe('0x6b')][_0x5c9d36][_0x1abe('0x6e')]:'');}return _0xd1cbc0+')';};var _0x4e12e6={'where':{'id':_0xe8529f[_0x1abe('0x57')]['id']}},_0x54b36c,_0x567424,_0x22404f,_0x285968,_0x33ab1b;_0x4e12e6=_[_0x1abe('0x41')]({},_0x4e12e6,_0xe8529f['options']);return db[_0x1abe('0x30')]['find'](_0x4e12e6)['then'](function(_0xb78939){if(_0xb78939){_0x54b36c=_0xb78939;return _0xb78939[_0x1abe('0x6f')]();}return null;})[_0x1abe('0x26')](function(_0x418093){if(_0x418093){if(!_0x418093['length']){throw new db[(_0x1abe('0x70'))]['ValidationErrorItem'](_0x1abe('0x71'),0x193);}_0x567424=_0x418093;return db[_0x1abe('0x72')][_0x1abe('0x44')]({'raw':!![]});}return null;})[_0x1abe('0x26')](function(_0x1c9648){if(_0x1c9648){_0x22404f=_[_0x1abe('0x73')](_0x1c9648,'id');var _0x13457;var _0x20308b=squel[_0x1abe('0x74')]();_0x20308b[_0x1abe('0x75')](_0x54b36c[_0x1abe('0x76')]);for(var _0x5fefd1=0x0;_0x5fefd1<_0x567424['length'];_0x5fefd1+=0x1){_0x13457=_0x567424[_0x5fefd1][_0x1abe('0x77')]?_0x22404f[_0x567424[_0x5fefd1][_0x1abe('0x77')]][_0x1abe('0x78')]:_0x567424[_0x5fefd1][_0x1abe('0x6c')];_0x13457=_0x567424[_0x5fefd1][_0x1abe('0x79')]?_[_0x1abe('0x7a')](_0x4b14c5[_0x567424[_0x5fefd1]['function']],'%s',_0x13457):_0x13457;_0x13457=_0x567424[_0x5fefd1][_0x1abe('0x7b')]?_['replace'](_0x43924a[_0x567424[_0x5fefd1][_0x1abe('0x7b')]],'%s',_0x13457):_0x13457;if(_0x567424[_0x5fefd1][_0x1abe('0x7c')]){_0x20308b[_0x1abe('0x7d')](_0x13457);}_0x567424[_0x5fefd1]['orderBy']&&_0x20308b['order'](_0x13457,_0x567424[_0x5fefd1]['orderBy']===_0x1abe('0x7e')?![]:!![]);_0x20308b[_0x1abe('0x6c')](_0x13457,_0x567424[_0x5fefd1][_0x1abe('0x7f')]||_0x13457);}if(_0x54b36c[_0x1abe('0x80')]){_0x54b36c['joins']=JSON['parse'](_0x54b36c[_0x1abe('0x80')]);for(var _0x559ebf=0x0;_0x559ebf<_0x54b36c[_0x1abe('0x80')][_0x1abe('0x49')];_0x559ebf+=0x1){if(_0x54b36c[_0x1abe('0x80')][_0x559ebf][_0x1abe('0x33')]&&_[_0x1abe('0x81')](_0x1ce8e6,_0x54b36c[_0x1abe('0x80')][_0x559ebf][_0x1abe('0x33')])&&_0x54b36c[_0x1abe('0x80')][_0x559ebf][_0x1abe('0x82')]&&_0x54b36c['joins'][_0x559ebf]['foreignTable']&&_0x54b36c[_0x1abe('0x80')][_0x559ebf][_0x1abe('0x83')]){_0x20308b[_0x54b36c[_0x1abe('0x80')][_0x559ebf][_0x1abe('0x33')]](_0x54b36c['joins'][_0x559ebf][_0x1abe('0x84')],null,util[_0x1abe('0x7b')](_0x1abe('0x85'),_0x54b36c[_0x1abe('0x76')],_0x54b36c['joins'][_0x559ebf]['parentKey'],_0x54b36c[_0x1abe('0x80')][_0x559ebf][_0x1abe('0x84')],_0x54b36c[_0x1abe('0x80')][_0x559ebf][_0x1abe('0x83')]));}}}if(_0x54b36c[_0x1abe('0x86')]){_0x54b36c[_0x1abe('0x86')]=JSON[_0x1abe('0x87')](_0x54b36c[_0x1abe('0x86')]);_0x20308b[_0x1abe('0x3e')](_0x5b7d01(_0x54b36c[_0x1abe('0x86')][_0x1abe('0x7d')]));}_0x33ab1b=_0x20308b[_0x1abe('0x88')]();_0x20308b[_0x1abe('0x1d')](_0x2e9f94);_0x20308b[_0x1abe('0x1c')](0x0);logger[_0x1abe('0x89')](_0x1abe('0x8a'),_0x20308b[_0x1abe('0x8b')]());return dbH[_0x1abe('0x8c')][_0x1abe('0x39')](_0x20308b[_0x1abe('0x8b')](),{'type':dbH['sequelize']['QueryTypes'][_0x1abe('0x8d')]});}})[_0x1abe('0x26')](respondWithResult(_0x137204,null))[_0x1abe('0x45')](handleError(_0x137204,null));};function runReport(_0x5f5b96,_0xcd81d3,_0x23fb87){var _0x200bbf=_0xcd81d3[_0x1abe('0x2c')];var _0x40c856=0xa;var _0x5a9d90=[_0x1abe('0x59'),_0x1abe('0x5a'),'right_join','cross_join'];var _0xfcc419={'SUM':_0x1abe('0x5d'),'COUNT':_0x1abe('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1abe('0x60'),'MIN':_0x1abe('0x61'),'AVG':_0x1abe('0x62'),'GROUP_CONCAT':_0x1abe('0x63'),'GROUP_CONCAT ASC':_0x1abe('0x64'),'GROUP_CONCAT DESC':_0x1abe('0x65')};var _0x3b1621={'SEC_TO_TIME':_0x1abe('0x8e'),'DATE':_0x1abe('0x8f'),'HOUR':_0x1abe('0x66'),'ROUND':_0x1abe('0x90'),'UNIX_TIMESTAMP':_0x1abe('0x67')};var _0x33a025=function(_0x1700c9){return!_['includes']([_0x1abe('0x91'),_0x1abe('0x68'),_0x1abe('0x69'),_0x1abe('0x6a')],_0x1700c9);};var _0xb6fd3f=function(_0x49836f){if(!_0x49836f||!_0x49836f[_0x1abe('0x6b')][_0x1abe('0x49')]){return'';}for(var _0x5a3652='(',_0x447f23=0x0;_0x447f23<_0x49836f['rules']['length'];_0x447f23+=0x1){_0x447f23>0x0&&(_0x5a3652+='\x20'+_0x49836f[_0x1abe('0x92')]+'\x20');_0x5a3652+=_0x49836f[_0x1abe('0x6b')][_0x447f23][_0x1abe('0x7d')]?_0xb6fd3f(_0x49836f[_0x1abe('0x6b')][_0x447f23][_0x1abe('0x7d')]):_0x49836f[_0x1abe('0x6b')][_0x447f23][_0x1abe('0x6c')]+'\x20'+_0x49836f['rules'][_0x447f23][_0x1abe('0x6d')]+(_0x33a025(_0x49836f['rules'][_0x447f23]['condition'])?'\x20'+_0x49836f[_0x1abe('0x6b')][_0x447f23]['value']:'');}return _0x5a3652+')';};var _0x43e1ad={'where':{'id':_0x5f5b96['id']}},_0x1673d2,_0x4d84b5,_0x2bb08d,_0x49bf0a,_0x344f78;_0x43e1ad=_[_0x1abe('0x41')]({},_0x43e1ad,_0x23fb87);return db[_0x1abe('0x30')]['find'](_0x43e1ad)[_0x1abe('0x26')](function(_0x2abe49){if(_0x2abe49){_0x1673d2=_0x2abe49;return _0x2abe49[_0x1abe('0x6f')]();}return null;})[_0x1abe('0x26')](function(_0xe6d4c5){if(_0xe6d4c5){if(!_0xe6d4c5[_0x1abe('0x49')]){throw new db['Sequelize'][(_0x1abe('0x93'))](_0x1abe('0x71'),0x193);}_0x4d84b5=_0xe6d4c5;return db[_0x1abe('0x72')][_0x1abe('0x44')]({'raw':!![]});}return null;})[_0x1abe('0x26')](function(_0x343dde){if(_0x343dde){_0x2bb08d=_[_0x1abe('0x73')](_0x343dde,'id');var _0x438024;var _0x24b360=squel['select']();_0x24b360['from'](_0x1673d2[_0x1abe('0x76')]);for(var _0x1a1a9d=0x0;_0x1a1a9d<_0x4d84b5[_0x1abe('0x49')];_0x1a1a9d+=0x1){_0x438024=_0x4d84b5[_0x1a1a9d]['MetricId']?_0x2bb08d[_0x4d84b5[_0x1a1a9d][_0x1abe('0x77')]][_0x1abe('0x78')]:_0x4d84b5[_0x1a1a9d][_0x1abe('0x6c')];_0x438024=_0x4d84b5[_0x1a1a9d][_0x1abe('0x79')]?_['replace'](_0xfcc419[_0x4d84b5[_0x1a1a9d][_0x1abe('0x79')]],'%s',_0x438024):_0x438024;_0x438024=_0x4d84b5[_0x1a1a9d][_0x1abe('0x7b')]?_['replace'](_0x3b1621[_0x4d84b5[_0x1a1a9d][_0x1abe('0x7b')]],'%s',_0x438024):_0x438024;if(_0x4d84b5[_0x1a1a9d][_0x1abe('0x7c')]){_0x24b360['group'](_0x438024);}_0x4d84b5[_0x1a1a9d][_0x1abe('0x94')]&&_0x24b360['order'](_0x438024,_0x4d84b5[_0x1a1a9d][_0x1abe('0x94')]===_0x1abe('0x7e')?![]:!![]);_0x24b360['field'](_0x438024,_0x4d84b5[_0x1a1a9d][_0x1abe('0x7f')]||_0x438024);}if(_0x1673d2[_0x1abe('0x80')]){_0x1673d2[_0x1abe('0x80')]=JSON['parse'](_0x1673d2['joins']);for(var _0x4197ee=0x0;_0x4197ee<_0x1673d2['joins'][_0x1abe('0x49')];_0x4197ee+=0x1){if(_0x1673d2[_0x1abe('0x80')][_0x4197ee][_0x1abe('0x33')]&&_[_0x1abe('0x81')](_0x5a9d90,_0x1673d2[_0x1abe('0x80')][_0x4197ee]['type'])&&_0x1673d2[_0x1abe('0x80')][_0x4197ee][_0x1abe('0x82')]&&_0x1673d2[_0x1abe('0x80')][_0x4197ee]['foreignTable']&&_0x1673d2[_0x1abe('0x80')][_0x4197ee][_0x1abe('0x83')]){_0x24b360[_0x1673d2[_0x1abe('0x80')][_0x4197ee][_0x1abe('0x33')]](_0x1673d2[_0x1abe('0x80')][_0x4197ee][_0x1abe('0x84')],null,util[_0x1abe('0x7b')](_0x1abe('0x85'),_0x1673d2[_0x1abe('0x76')],_0x1673d2[_0x1abe('0x80')][_0x4197ee][_0x1abe('0x82')],_0x1673d2[_0x1abe('0x80')][_0x4197ee][_0x1abe('0x84')],_0x1673d2[_0x1abe('0x80')][_0x4197ee][_0x1abe('0x83')]));}}}if(_0x1673d2[_0x1abe('0x86')]){_0x1673d2['conditions']=JSON['parse'](_0x1673d2['conditions']);_0x24b360[_0x1abe('0x3e')](_0xb6fd3f(_0x1673d2[_0x1abe('0x86')]['group']));}_0x344f78=_0x24b360['clone']();_0x24b360[_0x1abe('0x1d')](_0x40c856);_0x24b360['offset'](0x0);return;}})[_0x1abe('0x26')](function(){if(_0xcd81d3[_0x1abe('0x95')]===_0x1abe('0x96')){return null;}var _0x23432b=_[_0x1abe('0x41')](_0xcd81d3,{'name':_0xcd81d3[_0x1abe('0x97')]||_0xcd81d3[_0x1abe('0x2c')]||_0x1673d2[_0x1abe('0x2c')],'basename':_0x200bbf,'savename':util[_0x1abe('0x7b')](_0x1abe('0x98'),_0xcd81d3[_0x1abe('0x2c')]||_0x1673d2['name'],require('randomstring')[_0x1abe('0x99')](0x4),_0xcd81d3[_0x1abe('0x95')]||'csv'),'reportId':_0x1673d2['id'],'reportType':'custom'});return db[_0x1abe('0x9a')][_0x1abe('0x4c')](_0x23432b,{'raw':!![]});})['then'](function(_0xda1f04){if(_0x1673d2[_0x1abe('0x76')]===_0x1abe('0x9b')){_0x344f78[_0x1abe('0x3e')](_0x1673d2[_0x1abe('0x76')]+_0x1abe('0x9c'),_0xcd81d3[_0x1abe('0x9d')],_0xcd81d3['endDate']);}else{_0x344f78['where'](_0x1673d2[_0x1abe('0x76')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xcd81d3[_0x1abe('0x9d')],_0xcd81d3[_0x1abe('0x9e')]);}if(_0xda1f04){logger[_0x1abe('0x9f')]('Run\x20Query:',_0x344f78['toString']());require('child_process')[_0x1abe('0xa0')](path['join'](__dirname,_0x1abe('0xa1'),_0xda1f04[_0x1abe('0x95')]),[_0xda1f04['id'],_0x344f78['toString'](),path['join'](__dirname,_0x1abe('0xa2'),_0xda1f04[_0x1abe('0xa3')]),_0x200bbf]);return _0xda1f04;}else{var _0x21760e=squel['select']();_0x21760e[_0x1abe('0x75')]('('+_0x344f78[_0x1abe('0x8b')]()+')',_0x1abe('0xa4'));_0x21760e['field'](_0x1abe('0xa5'),_0x1abe('0x1f'));_0x344f78['limit'](_0xcd81d3[_0x1abe('0x1d')]||_0x40c856);_0x344f78[_0x1abe('0x1c')](_0xcd81d3['offset']||0x0);return dbH[_0x1abe('0x8c')][_0x1abe('0x39')](_0x21760e[_0x1abe('0x8b')](),{'type':dbH['sequelize'][_0x1abe('0xa6')][_0x1abe('0x8d')]})[_0x1abe('0x26')](function(_0x4962bb){if(!_0x4962bb['length']){_0x49bf0a=0x0;}else{_0x49bf0a=_0x4962bb[0x0][_0x1abe('0x1f')]||0x0;}return dbH[_0x1abe('0x8c')][_0x1abe('0x39')](_0x344f78['toString'](),{'type':dbH[_0x1abe('0x8c')]['QueryTypes'][_0x1abe('0x8d')]});})[_0x1abe('0x26')](function(_0x3ca21a){return{'rows':_0x3ca21a||[],'count':_0x49bf0a};});}});}exports[_0x1abe('0xa7')]=function(_0x3421bd,_0x35b1db){return runReport(_0x3421bd[_0x1abe('0x57')],_0x3421bd['query'],_0x3421bd[_0x1abe('0x42')])[_0x1abe('0x26')](respondWithResult(_0x35b1db,null))[_0x1abe('0x45')](handleError(_0x35b1db,null));};exports[_0x1abe('0xa8')]=runReport;exports[_0x1abe('0x39')]=function(_0x3d5137,_0x225fa){var _0x37e76f=0xa;var _0x2ede05=[_0x1abe('0x59'),_0x1abe('0x5a'),'right_join',_0x1abe('0x5c')];var _0x13a5f1={'SUM':_0x1abe('0x5d'),'COUNT':_0x1abe('0x5e'),'COUNT DISTINCT':_0x1abe('0x5f'),'MAX':_0x1abe('0x60'),'MIN':_0x1abe('0x61'),'AVG':_0x1abe('0x62'),'GROUP_CONCAT':_0x1abe('0x63'),'GROUP_CONCAT ASC':_0x1abe('0x64'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xa17df7={'SEC_TO_TIME':_0x1abe('0x8e'),'DATE':_0x1abe('0x8f'),'HOUR':_0x1abe('0x66'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1abe('0x67')};var _0x2d2ed0=function(_0x3e305e){return!_[_0x1abe('0x81')]([_0x1abe('0x91'),_0x1abe('0x68'),_0x1abe('0x69'),_0x1abe('0x6a')],_0x3e305e);};var _0x9fcafd=function(_0x57d328){if(!_0x57d328||!_0x57d328[_0x1abe('0x6b')][_0x1abe('0x49')]){return'';}for(var _0x4e3eab='(',_0x4bb1d9=0x0;_0x4bb1d9<_0x57d328['rules']['length'];_0x4bb1d9+=0x1){_0x4bb1d9>0x0&&(_0x4e3eab+='\x20'+_0x57d328[_0x1abe('0x92')]+'\x20');_0x4e3eab+=_0x57d328['rules'][_0x4bb1d9]['group']?_0x9fcafd(_0x57d328[_0x1abe('0x6b')][_0x4bb1d9]['group']):_0x57d328[_0x1abe('0x6b')][_0x4bb1d9]['field']+'\x20'+_0x57d328['rules'][_0x4bb1d9]['condition']+(_0x2d2ed0(_0x57d328[_0x1abe('0x6b')][_0x4bb1d9][_0x1abe('0x6d')])?'\x20'+_0x57d328[_0x1abe('0x6b')][_0x4bb1d9][_0x1abe('0x6e')]:'');}return _0x4e3eab+')';};var _0xd013d4={'where':{'id':_0x3d5137['params']['id']}},_0xf2660,_0xb7ef29,_0x4036f7,_0x4d58da,_0x4884cd;_0xd013d4=_[_0x1abe('0x41')]({},_0xd013d4,_0x3d5137[_0x1abe('0x42')]);return db[_0x1abe('0x30')][_0x1abe('0x4b')](_0xd013d4)[_0x1abe('0x26')](function(_0x4ee4be){if(_0x4ee4be){_0xf2660=_0x4ee4be;return _0x4ee4be['getFields']();}return null;})[_0x1abe('0x26')](function(_0x24aa67){if(_0x24aa67){if(!_0x24aa67['length']){throw new db[(_0x1abe('0x70'))][(_0x1abe('0x93'))](_0x1abe('0x71'),0x193);}_0xb7ef29=_0x24aa67;return db[_0x1abe('0x72')][_0x1abe('0x44')]({'raw':!![]});}return null;})[_0x1abe('0x26')](function(_0x5a6039){if(_0x5a6039){_0x4036f7=_[_0x1abe('0x73')](_0x5a6039,'id');var _0x3c9d64;var _0x43321c=squel[_0x1abe('0x74')]();_0x43321c['from'](_0xf2660['table']);for(var _0x4a7788=0x0;_0x4a7788<_0xb7ef29[_0x1abe('0x49')];_0x4a7788+=0x1){_0x3c9d64=_0xb7ef29[_0x4a7788]['MetricId']?_0x4036f7[_0xb7ef29[_0x4a7788]['MetricId']][_0x1abe('0x78')]:_0xb7ef29[_0x4a7788][_0x1abe('0x6c')];_0x3c9d64=_0xb7ef29[_0x4a7788][_0x1abe('0x79')]?_['replace'](_0x13a5f1[_0xb7ef29[_0x4a7788][_0x1abe('0x79')]],'%s',_0x3c9d64):_0x3c9d64;_0x3c9d64=_0xb7ef29[_0x4a7788][_0x1abe('0x7b')]?_[_0x1abe('0x7a')](_0xa17df7[_0xb7ef29[_0x4a7788]['format']],'%s',_0x3c9d64):_0x3c9d64;if(_0xb7ef29[_0x4a7788]['groupBy']){_0x43321c[_0x1abe('0x7d')](_0x3c9d64);}_0xb7ef29[_0x4a7788][_0x1abe('0x94')]&&_0x43321c['order'](_0x3c9d64,_0xb7ef29[_0x4a7788][_0x1abe('0x94')]==='DESC'?![]:!![]);_0x43321c[_0x1abe('0x6c')](_0x3c9d64,_0xb7ef29[_0x4a7788][_0x1abe('0x7f')]||_0x3c9d64);}if(_0xf2660[_0x1abe('0x80')]){_0xf2660[_0x1abe('0x80')]=JSON[_0x1abe('0x87')](_0xf2660[_0x1abe('0x80')]);for(var _0xd2fc1=0x0;_0xd2fc1<_0xf2660[_0x1abe('0x80')]['length'];_0xd2fc1+=0x1){if(_0xf2660['joins'][_0xd2fc1][_0x1abe('0x33')]&&_['includes'](_0x2ede05,_0xf2660[_0x1abe('0x80')][_0xd2fc1]['type'])&&_0xf2660['joins'][_0xd2fc1]['parentKey']&&_0xf2660[_0x1abe('0x80')][_0xd2fc1][_0x1abe('0x84')]&&_0xf2660[_0x1abe('0x80')][_0xd2fc1]['foreignKey']){_0x43321c[_0xf2660['joins'][_0xd2fc1][_0x1abe('0x33')]](_0xf2660[_0x1abe('0x80')][_0xd2fc1][_0x1abe('0x84')],null,util[_0x1abe('0x7b')](_0x1abe('0x85'),_0xf2660[_0x1abe('0x76')],_0xf2660[_0x1abe('0x80')][_0xd2fc1][_0x1abe('0x82')],_0xf2660[_0x1abe('0x80')][_0xd2fc1][_0x1abe('0x84')],_0xf2660['joins'][_0xd2fc1][_0x1abe('0x83')]));}}}if(_0xf2660[_0x1abe('0x86')]){_0xf2660['conditions']=JSON[_0x1abe('0x87')](_0xf2660['conditions']);_0x43321c[_0x1abe('0x3e')](_0x9fcafd(_0xf2660[_0x1abe('0x86')][_0x1abe('0x7d')]));}_0x4884cd=_0x43321c['clone']();_0x43321c['limit'](_0x37e76f);_0x43321c[_0x1abe('0x1c')](0x0);logger[_0x1abe('0x89')](_0x1abe('0x8a'),_0x43321c[_0x1abe('0x8b')]());return dbH[_0x1abe('0x8c')][_0x1abe('0x39')](_0x43321c[_0x1abe('0x8b')](),{'type':dbH['sequelize'][_0x1abe('0xa6')][_0x1abe('0x8d')]});}})[_0x1abe('0x26')](function(){return{'sql':_0x4884cd[_0x1abe('0x8b')]()};})[_0x1abe('0x26')](respondWithResult(_0x225fa,null))['catch'](handleError(_0x225fa,null));};
\ No newline at end of file
+var _0xd978=['IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','sequelize','toString','QueryTypes','SELECT','MIN(%s)','UNIX_TIMESTAMP(%s)','value','ValidationErrorItem','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../components/export/','savename','from','countTable','COUNT(*)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','status','end','offset','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','get','CustomReports','sendStatus','error','stack','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','UserProfileResource','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd978,0x186));var _0x8d97=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xd978[_0x269ee8];return _0x4d98bd;};'use strict';var emlformat=require(_0x8d97('0x0'));var rimraf=require(_0x8d97('0x1'));var zipdir=require(_0x8d97('0x2'));var jsonpatch=require(_0x8d97('0x3'));var rp=require(_0x8d97('0x4'));var moment=require(_0x8d97('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8d97('0x6'));var util=require(_0x8d97('0x7'));var path=require('path');var sox=require(_0x8d97('0x8'));var csv=require(_0x8d97('0x9'));var ejs=require(_0x8d97('0xa'));var fs=require('fs');var fs_extra=require(_0x8d97('0xb'));var _=require(_0x8d97('0xc'));var squel=require('squel');var crypto=require(_0x8d97('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8d97('0xe'));var toCsv=require(_0x8d97('0x9'));var querystring=require(_0x8d97('0xf'));var Papa=require(_0x8d97('0x10'));var Redis=require('ioredis');var authService=require(_0x8d97('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8d97('0x12'));var hardwareService=require(_0x8d97('0x13'));var logger=require(_0x8d97('0x14'))(_0x8d97('0x15'));var utils=require(_0x8d97('0x16'));var config=require(_0x8d97('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0x8d97('0x18'))[_0x8d97('0x19')];function respondWithStatusCode(_0x1273d9,_0x47031d){_0x47031d=_0x47031d||0xcc;return function(_0x537838){if(_0x537838){return _0x1273d9['sendStatus'](_0x47031d);}return _0x1273d9[_0x8d97('0x1a')](_0x47031d)[_0x8d97('0x1b')]();};}function respondWithResult(_0x4a45fd,_0x4c77dd){_0x4c77dd=_0x4c77dd||0xc8;return function(_0x201443){if(_0x201443){return _0x4a45fd[_0x8d97('0x1a')](_0x4c77dd)['json'](_0x201443);}};}function respondWithFilteredResult(_0x2fb49c,_0xf30378){return function(_0x2df358){if(_0x2df358){var _0x46462b=typeof _0xf30378[_0x8d97('0x1c')]==='undefined'&&typeof _0xf30378[_0x8d97('0x1d')]==='undefined';var _0x35425c=_0x2df358[_0x8d97('0x1e')];var _0x4130aa=_0x46462b?0x0:_0xf30378['offset'];var _0x2e73b5=_0x46462b?_0x2df358[_0x8d97('0x1e')]:_0xf30378[_0x8d97('0x1c')]+_0xf30378[_0x8d97('0x1d')];var _0x39a833;if(_0x2e73b5>=_0x35425c){_0x2e73b5=_0x35425c;_0x39a833=0xc8;}else{_0x39a833=0xce;}_0x2fb49c[_0x8d97('0x1a')](_0x39a833);return _0x2fb49c['set'](_0x8d97('0x1f'),_0x4130aa+'-'+_0x2e73b5+'/'+_0x35425c)[_0x8d97('0x20')](_0x2df358);}return null;};}function patchUpdates(_0x194161){return function(_0x1210fa){try{jsonpatch[_0x8d97('0x21')](_0x1210fa,_0x194161,!![]);}catch(_0x5e31e5){return BPromise[_0x8d97('0x22')](_0x5e31e5);}return _0x1210fa[_0x8d97('0x23')]();};}function saveUpdates(_0x2b90f7,_0x1fa54d){return function(_0x1d2623){if(_0x1d2623){return _0x1d2623[_0x8d97('0x24')](_0x2b90f7)['then'](function(_0x720d0d){return _0x720d0d;});}return null;};}function removeEntity(_0x1ba65b,_0x20962a){return function(_0x127e39){if(_0x127e39){return _0x127e39[_0x8d97('0x25')]()[_0x8d97('0x26')](function(){var _0x59bf41=_0x127e39[_0x8d97('0x27')]({'plain':!![]});var _0x11ac11=_0x8d97('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x11ac11,'resourceId':_0x59bf41['id']}})[_0x8d97('0x26')](function(){return _0x127e39;});})[_0x8d97('0x26')](function(){_0x1ba65b['status'](0xcc)[_0x8d97('0x1b')]();});}};}function handleEntityNotFound(_0x39593e,_0x31c914){return function(_0x3751f5){if(!_0x3751f5){_0x39593e[_0x8d97('0x29')](0x194);}return _0x3751f5;};}function handleError(_0x20ffa3,_0x8282c6){_0x8282c6=_0x8282c6||0x1f4;return function(_0x40744d){logger[_0x8d97('0x2a')](_0x40744d[_0x8d97('0x2b')]);if(_0x40744d['name']){delete _0x40744d['name'];}_0x20ffa3[_0x8d97('0x1a')](_0x8282c6)[_0x8d97('0x2c')](_0x40744d);};}exports[_0x8d97('0x2d')]=function(_0x257a77,_0x120e3b){var _0x2bf51d={},_0x42a5eb={},_0x45828b={'count':0x0,'rows':[]};var _0x8e37ec=_[_0x8d97('0x2e')](db[_0x8d97('0x2f')][_0x8d97('0x30')],function(_0x4c0f88){return{'name':_0x4c0f88[_0x8d97('0x31')],'type':_0x4c0f88[_0x8d97('0x32')]['key']};});_0x42a5eb[_0x8d97('0x33')]=_[_0x8d97('0x2e')](_0x8e37ec,_0x8d97('0x34'));_0x42a5eb[_0x8d97('0x35')]=_[_0x8d97('0x36')](_0x257a77[_0x8d97('0x35')]);_0x42a5eb[_0x8d97('0x37')]=_[_0x8d97('0x38')](_0x42a5eb['model'],_0x42a5eb['query']);_0x2bf51d['attributes']=_[_0x8d97('0x38')](_0x42a5eb[_0x8d97('0x33')],qs[_0x8d97('0x39')](_0x257a77[_0x8d97('0x35')][_0x8d97('0x39')]));_0x2bf51d['attributes']=_0x2bf51d[_0x8d97('0x3a')][_0x8d97('0x3b')]?_0x2bf51d[_0x8d97('0x3a')]:_0x42a5eb[_0x8d97('0x33')];if(!_0x257a77[_0x8d97('0x35')][_0x8d97('0x3c')](_0x8d97('0x3d'))){_0x2bf51d[_0x8d97('0x1d')]=qs[_0x8d97('0x1d')](_0x257a77['query'][_0x8d97('0x1d')]);_0x2bf51d['offset']=qs[_0x8d97('0x1c')](_0x257a77[_0x8d97('0x35')][_0x8d97('0x1c')]);}_0x2bf51d[_0x8d97('0x3e')]=qs[_0x8d97('0x3f')](_0x257a77[_0x8d97('0x35')][_0x8d97('0x3f')]);_0x2bf51d[_0x8d97('0x40')]=qs['filters'](_[_0x8d97('0x41')](_0x257a77[_0x8d97('0x35')],_0x42a5eb['filters']),_0x8e37ec);if(_0x257a77['query'][_0x8d97('0x42')]){_0x2bf51d[_0x8d97('0x40')]=_[_0x8d97('0x43')](_0x2bf51d[_0x8d97('0x40')],{'$or':_[_0x8d97('0x2e')](_0x8e37ec,function(_0x32fb7d){if(_0x32fb7d[_0x8d97('0x32')]!==_0x8d97('0x44')){var _0x3294a6={};_0x3294a6[_0x32fb7d[_0x8d97('0x34')]]={'$like':'%'+_0x257a77['query'][_0x8d97('0x42')]+'%'};return _0x3294a6;}})});}_0x2bf51d=_[_0x8d97('0x43')]({},_0x2bf51d,_0x257a77[_0x8d97('0x45')]);var _0x11212f={'where':_0x2bf51d[_0x8d97('0x40')]};return db[_0x8d97('0x2f')]['count'](_0x11212f)['then'](function(_0xda83b0){_0x45828b[_0x8d97('0x1e')]=_0xda83b0;if(_0x257a77[_0x8d97('0x35')][_0x8d97('0x46')]){_0x2bf51d[_0x8d97('0x47')]=[{'all':!![]}];}return db[_0x8d97('0x2f')][_0x8d97('0x48')](_0x2bf51d);})['then'](function(_0x428540){_0x45828b['rows']=_0x428540;return _0x45828b;})[_0x8d97('0x26')](respondWithFilteredResult(_0x120e3b,_0x2bf51d))[_0x8d97('0x49')](handleError(_0x120e3b,null));};exports[_0x8d97('0x4a')]=function(_0x2688be,_0x408c22){var _0xe431a2={'raw':![],'where':{'id':_0x2688be['params']['id']}},_0x1a883e={};_0x1a883e['model']=_[_0x8d97('0x36')](db[_0x8d97('0x2f')]['rawAttributes']);_0x1a883e[_0x8d97('0x35')]=_[_0x8d97('0x36')](_0x2688be[_0x8d97('0x35')]);_0x1a883e[_0x8d97('0x37')]=_['intersection'](_0x1a883e[_0x8d97('0x33')],_0x1a883e[_0x8d97('0x35')]);_0xe431a2[_0x8d97('0x3a')]=_[_0x8d97('0x38')](_0x1a883e[_0x8d97('0x33')],qs[_0x8d97('0x39')](_0x2688be[_0x8d97('0x35')][_0x8d97('0x39')]));_0xe431a2[_0x8d97('0x3a')]=_0xe431a2[_0x8d97('0x3a')][_0x8d97('0x3b')]?_0xe431a2[_0x8d97('0x3a')]:_0x1a883e[_0x8d97('0x33')];if(_0x2688be['query'][_0x8d97('0x46')]){_0xe431a2[_0x8d97('0x47')]=[{'all':!![]}];}_0xe431a2=_[_0x8d97('0x43')]({},_0xe431a2,_0x2688be[_0x8d97('0x45')]);return db['AnalyticCustomReport'][_0x8d97('0x4b')](_0xe431a2)[_0x8d97('0x26')](handleEntityNotFound(_0x408c22,null))[_0x8d97('0x26')](respondWithResult(_0x408c22,null))[_0x8d97('0x49')](handleError(_0x408c22,null));};exports['create']=function(_0x21bce2,_0x36a086){return db[_0x8d97('0x2f')][_0x8d97('0x4c')](_0x21bce2[_0x8d97('0x4d')],{})[_0x8d97('0x26')](function(_0x35ae34){var _0x3dcfc9=_0x21bce2[_0x8d97('0x4e')]['get']({'plain':!![]});if(!_0x3dcfc9)throw new Error(_0x8d97('0x4f'));if(_0x3dcfc9[_0x8d97('0x50')]===_0x8d97('0x4e')){var _0x1ae33f=_0x35ae34[_0x8d97('0x27')]({'plain':!![]});var _0x2548b3=_0x8d97('0x51');return db[_0x8d97('0x52')][_0x8d97('0x4b')]({'where':{'name':_0x2548b3,'userProfileId':_0x3dcfc9[_0x8d97('0x53')]},'raw':!![]})[_0x8d97('0x26')](function(_0x8ad7ee){if(_0x8ad7ee&&_0x8ad7ee['autoAssociation']===0x0){return db[_0x8d97('0x54')][_0x8d97('0x4c')]({'name':_0x1ae33f[_0x8d97('0x34')],'resourceId':_0x1ae33f['id'],'type':_0x8d97('0x28'),'sectionId':_0x8ad7ee['id']},{})['then'](function(){return _0x35ae34;});}else{return _0x35ae34;}})[_0x8d97('0x49')](function(_0x1c2f11){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c2f11);throw _0x1c2f11;});}return _0x35ae34;})['then'](respondWithResult(_0x36a086,0xc9))[_0x8d97('0x49')](handleError(_0x36a086,null));};exports[_0x8d97('0x24')]=function(_0x26a804,_0x4d8aba){if(_0x26a804[_0x8d97('0x4d')]['id']){delete _0x26a804[_0x8d97('0x4d')]['id'];}return db['AnalyticCustomReport'][_0x8d97('0x4b')]({'where':{'id':_0x26a804[_0x8d97('0x55')]['id']}})[_0x8d97('0x26')](handleEntityNotFound(_0x4d8aba,null))[_0x8d97('0x26')](saveUpdates(_0x26a804[_0x8d97('0x4d')],null))[_0x8d97('0x26')](respondWithResult(_0x4d8aba,null))['catch'](handleError(_0x4d8aba,null));};exports[_0x8d97('0x25')]=function(_0x208765,_0x576d9a){return db[_0x8d97('0x2f')][_0x8d97('0x4b')]({'where':{'id':_0x208765[_0x8d97('0x55')]['id']}})[_0x8d97('0x26')](handleEntityNotFound(_0x576d9a,null))['then'](removeEntity(_0x576d9a,null))[_0x8d97('0x49')](handleError(_0x576d9a,null));};exports[_0x8d97('0x56')]=function(_0x572bdb,_0x37796a){var _0x4c50cd=0xa;var _0x20a667=[_0x8d97('0x57'),_0x8d97('0x58'),_0x8d97('0x59'),_0x8d97('0x5a')];var _0x29f256={'SUM':_0x8d97('0x5b'),'COUNT':_0x8d97('0x5c'),'COUNT DISTINCT':_0x8d97('0x5d'),'MAX':_0x8d97('0x5e'),'MIN':'MIN(%s)','AVG':_0x8d97('0x5f'),'GROUP_CONCAT':_0x8d97('0x60'),'GROUP_CONCAT ASC':_0x8d97('0x61'),'GROUP_CONCAT DESC':_0x8d97('0x62')};var _0x255c0b={'SEC_TO_TIME':_0x8d97('0x63'),'DATE':_0x8d97('0x64'),'HOUR':_0x8d97('0x65'),'ROUND':_0x8d97('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x361db1=function(_0x8759bd){return!_[_0x8d97('0x67')]([_0x8d97('0x68'),'IS\x20NOT\x20NULL',_0x8d97('0x69'),_0x8d97('0x6a')],_0x8759bd);};var _0x4f84b0=function(_0x1bff9d){if(!_0x1bff9d||!_0x1bff9d[_0x8d97('0x6b')][_0x8d97('0x3b')]){return'';}for(var _0xabf76c='(',_0x3fb655=0x0;_0x3fb655<_0x1bff9d['rules'][_0x8d97('0x3b')];_0x3fb655+=0x1){_0x3fb655>0x0&&(_0xabf76c+='\x20'+_0x1bff9d[_0x8d97('0x6c')]+'\x20');_0xabf76c+=_0x1bff9d[_0x8d97('0x6b')][_0x3fb655][_0x8d97('0x6d')]?_0x4f84b0(_0x1bff9d[_0x8d97('0x6b')][_0x3fb655][_0x8d97('0x6d')]):_0x1bff9d[_0x8d97('0x6b')][_0x3fb655]['field']+'\x20'+_0x1bff9d['rules'][_0x3fb655][_0x8d97('0x6e')]+(_0x361db1(_0x1bff9d[_0x8d97('0x6b')][_0x3fb655][_0x8d97('0x6e')])?'\x20'+_0x1bff9d[_0x8d97('0x6b')][_0x3fb655]['value']:'');}return _0xabf76c+')';};var _0x2e6f3d={'where':{'id':_0x572bdb['params']['id']}},_0x1e3934,_0x4c9748,_0x258512,_0x49aa7e,_0x12b0f3;_0x2e6f3d=_[_0x8d97('0x43')]({},_0x2e6f3d,_0x572bdb[_0x8d97('0x45')]);return db[_0x8d97('0x2f')][_0x8d97('0x4b')](_0x2e6f3d)[_0x8d97('0x26')](function(_0x4d17f2){if(_0x4d17f2){_0x1e3934=_0x4d17f2;return _0x4d17f2[_0x8d97('0x6f')]();}return null;})[_0x8d97('0x26')](function(_0x588471){if(_0x588471){if(!_0x588471[_0x8d97('0x3b')]){throw new db[(_0x8d97('0x70'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4c9748=_0x588471;return db[_0x8d97('0x71')][_0x8d97('0x48')]({'raw':!![]});}return null;})[_0x8d97('0x26')](function(_0x4b5cf6){if(_0x4b5cf6){_0x258512=_[_0x8d97('0x72')](_0x4b5cf6,'id');var _0x2dfda0;var _0x50dfc4=squel[_0x8d97('0x73')]();_0x50dfc4['from'](_0x1e3934[_0x8d97('0x74')]);for(var _0x4743b3=0x0;_0x4743b3<_0x4c9748['length'];_0x4743b3+=0x1){_0x2dfda0=_0x4c9748[_0x4743b3][_0x8d97('0x75')]?_0x258512[_0x4c9748[_0x4743b3][_0x8d97('0x75')]][_0x8d97('0x76')]:_0x4c9748[_0x4743b3][_0x8d97('0x77')];_0x2dfda0=_0x4c9748[_0x4743b3][_0x8d97('0x78')]?_[_0x8d97('0x79')](_0x29f256[_0x4c9748[_0x4743b3]['function']],'%s',_0x2dfda0):_0x2dfda0;_0x2dfda0=_0x4c9748[_0x4743b3][_0x8d97('0x7a')]?_[_0x8d97('0x79')](_0x255c0b[_0x4c9748[_0x4743b3]['format']],'%s',_0x2dfda0):_0x2dfda0;if(_0x4c9748[_0x4743b3][_0x8d97('0x7b')]){_0x50dfc4[_0x8d97('0x6d')](_0x2dfda0);}_0x4c9748[_0x4743b3][_0x8d97('0x7c')]&&_0x50dfc4[_0x8d97('0x3e')](_0x2dfda0,_0x4c9748[_0x4743b3]['orderBy']===_0x8d97('0x7d')?![]:!![]);_0x50dfc4[_0x8d97('0x77')](_0x2dfda0,_0x4c9748[_0x4743b3][_0x8d97('0x7e')]||_0x2dfda0);}if(_0x1e3934[_0x8d97('0x7f')]){_0x1e3934[_0x8d97('0x7f')]=JSON[_0x8d97('0x80')](_0x1e3934[_0x8d97('0x7f')]);for(var _0x11355a=0x0;_0x11355a<_0x1e3934[_0x8d97('0x7f')][_0x8d97('0x3b')];_0x11355a+=0x1){if(_0x1e3934[_0x8d97('0x7f')][_0x11355a][_0x8d97('0x32')]&&_[_0x8d97('0x67')](_0x20a667,_0x1e3934['joins'][_0x11355a]['type'])&&_0x1e3934[_0x8d97('0x7f')][_0x11355a]['parentKey']&&_0x1e3934[_0x8d97('0x7f')][_0x11355a][_0x8d97('0x81')]&&_0x1e3934[_0x8d97('0x7f')][_0x11355a][_0x8d97('0x82')]){_0x50dfc4[_0x1e3934['joins'][_0x11355a]['type']](_0x1e3934[_0x8d97('0x7f')][_0x11355a][_0x8d97('0x81')],null,util[_0x8d97('0x7a')](_0x8d97('0x83'),_0x1e3934[_0x8d97('0x74')],_0x1e3934[_0x8d97('0x7f')][_0x11355a][_0x8d97('0x84')],_0x1e3934[_0x8d97('0x7f')][_0x11355a]['foreignTable'],_0x1e3934[_0x8d97('0x7f')][_0x11355a][_0x8d97('0x82')]));}}}if(_0x1e3934[_0x8d97('0x85')]){_0x1e3934[_0x8d97('0x85')]=JSON[_0x8d97('0x80')](_0x1e3934[_0x8d97('0x85')]);_0x50dfc4['where'](_0x4f84b0(_0x1e3934[_0x8d97('0x85')]['group']));}_0x12b0f3=_0x50dfc4[_0x8d97('0x86')]();_0x50dfc4[_0x8d97('0x1d')](_0x4c50cd);_0x50dfc4[_0x8d97('0x1c')](0x0);logger[_0x8d97('0x87')]('Limited\x20Query:',_0x50dfc4['toString']());return dbH[_0x8d97('0x88')]['query'](_0x50dfc4[_0x8d97('0x89')](),{'type':dbH[_0x8d97('0x88')][_0x8d97('0x8a')][_0x8d97('0x8b')]});}})[_0x8d97('0x26')](respondWithResult(_0x37796a,null))[_0x8d97('0x49')](handleError(_0x37796a,null));};function runReport(_0x3f23f7,_0x2d65a5,_0x5dce26){var _0x493eca=_0x2d65a5['name'];var _0x242ccb=0xa;var _0x548826=['join',_0x8d97('0x58'),_0x8d97('0x59'),'cross_join'];var _0x34c973={'SUM':_0x8d97('0x5b'),'COUNT':_0x8d97('0x5c'),'COUNT DISTINCT':_0x8d97('0x5d'),'MAX':_0x8d97('0x5e'),'MIN':_0x8d97('0x8c'),'AVG':_0x8d97('0x5f'),'GROUP_CONCAT':_0x8d97('0x60'),'GROUP_CONCAT ASC':_0x8d97('0x61'),'GROUP_CONCAT DESC':_0x8d97('0x62')};var _0x3a5257={'SEC_TO_TIME':_0x8d97('0x63'),'DATE':'DATE(%s)','HOUR':_0x8d97('0x65'),'ROUND':_0x8d97('0x66'),'UNIX_TIMESTAMP':_0x8d97('0x8d')};var _0x1198ff=function(_0x41e35f){return!_[_0x8d97('0x67')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x8d97('0x69'),_0x8d97('0x6a')],_0x41e35f);};var _0x3a1c59=function(_0x453911){if(!_0x453911||!_0x453911['rules']['length']){return'';}for(var _0xa5f12d='(',_0x7e358e=0x0;_0x7e358e<_0x453911[_0x8d97('0x6b')]['length'];_0x7e358e+=0x1){_0x7e358e>0x0&&(_0xa5f12d+='\x20'+_0x453911[_0x8d97('0x6c')]+'\x20');_0xa5f12d+=_0x453911[_0x8d97('0x6b')][_0x7e358e][_0x8d97('0x6d')]?_0x3a1c59(_0x453911['rules'][_0x7e358e][_0x8d97('0x6d')]):_0x453911[_0x8d97('0x6b')][_0x7e358e][_0x8d97('0x77')]+'\x20'+_0x453911['rules'][_0x7e358e][_0x8d97('0x6e')]+(_0x1198ff(_0x453911[_0x8d97('0x6b')][_0x7e358e]['condition'])?'\x20'+_0x453911[_0x8d97('0x6b')][_0x7e358e][_0x8d97('0x8e')]:'');}return _0xa5f12d+')';};var _0x5456ed={'where':{'id':_0x3f23f7['id']}},_0x481b3d,_0x1bafd2,_0x2682ed,_0x47f649,_0xa81e1a;_0x5456ed=_[_0x8d97('0x43')]({},_0x5456ed,_0x5dce26);return db[_0x8d97('0x2f')][_0x8d97('0x4b')](_0x5456ed)[_0x8d97('0x26')](function(_0xe4f28c){if(_0xe4f28c){_0x481b3d=_0xe4f28c;return _0xe4f28c[_0x8d97('0x6f')]();}return null;})[_0x8d97('0x26')](function(_0x32c8d0){if(_0x32c8d0){if(!_0x32c8d0[_0x8d97('0x3b')]){throw new db['Sequelize'][(_0x8d97('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bafd2=_0x32c8d0;return db['AnalyticMetric'][_0x8d97('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1bad57){if(_0x1bad57){_0x2682ed=_[_0x8d97('0x72')](_0x1bad57,'id');var _0x2990a2;var _0x7c589a=squel[_0x8d97('0x73')]();_0x7c589a['from'](_0x481b3d[_0x8d97('0x74')]);for(var _0x58a316=0x0;_0x58a316<_0x1bafd2[_0x8d97('0x3b')];_0x58a316+=0x1){_0x2990a2=_0x1bafd2[_0x58a316][_0x8d97('0x75')]?_0x2682ed[_0x1bafd2[_0x58a316]['MetricId']][_0x8d97('0x76')]:_0x1bafd2[_0x58a316]['field'];_0x2990a2=_0x1bafd2[_0x58a316][_0x8d97('0x78')]?_[_0x8d97('0x79')](_0x34c973[_0x1bafd2[_0x58a316]['function']],'%s',_0x2990a2):_0x2990a2;_0x2990a2=_0x1bafd2[_0x58a316][_0x8d97('0x7a')]?_[_0x8d97('0x79')](_0x3a5257[_0x1bafd2[_0x58a316][_0x8d97('0x7a')]],'%s',_0x2990a2):_0x2990a2;if(_0x1bafd2[_0x58a316]['groupBy']){_0x7c589a[_0x8d97('0x6d')](_0x2990a2);}_0x1bafd2[_0x58a316][_0x8d97('0x7c')]&&_0x7c589a[_0x8d97('0x3e')](_0x2990a2,_0x1bafd2[_0x58a316][_0x8d97('0x7c')]===_0x8d97('0x7d')?![]:!![]);_0x7c589a['field'](_0x2990a2,_0x1bafd2[_0x58a316]['alias']||_0x2990a2);}if(_0x481b3d[_0x8d97('0x7f')]){_0x481b3d['joins']=JSON['parse'](_0x481b3d['joins']);for(var _0x1f8301=0x0;_0x1f8301<_0x481b3d[_0x8d97('0x7f')][_0x8d97('0x3b')];_0x1f8301+=0x1){if(_0x481b3d[_0x8d97('0x7f')][_0x1f8301][_0x8d97('0x32')]&&_[_0x8d97('0x67')](_0x548826,_0x481b3d[_0x8d97('0x7f')][_0x1f8301][_0x8d97('0x32')])&&_0x481b3d['joins'][_0x1f8301]['parentKey']&&_0x481b3d[_0x8d97('0x7f')][_0x1f8301][_0x8d97('0x81')]&&_0x481b3d[_0x8d97('0x7f')][_0x1f8301][_0x8d97('0x82')]){_0x7c589a[_0x481b3d[_0x8d97('0x7f')][_0x1f8301]['type']](_0x481b3d[_0x8d97('0x7f')][_0x1f8301][_0x8d97('0x81')],null,util[_0x8d97('0x7a')]('%s.%s\x20=\x20%s.%s',_0x481b3d[_0x8d97('0x74')],_0x481b3d[_0x8d97('0x7f')][_0x1f8301]['parentKey'],_0x481b3d['joins'][_0x1f8301]['foreignTable'],_0x481b3d[_0x8d97('0x7f')][_0x1f8301]['foreignKey']));}}}if(_0x481b3d[_0x8d97('0x85')]){_0x481b3d[_0x8d97('0x85')]=JSON[_0x8d97('0x80')](_0x481b3d[_0x8d97('0x85')]);_0x7c589a['where'](_0x3a1c59(_0x481b3d[_0x8d97('0x85')][_0x8d97('0x6d')]));}_0xa81e1a=_0x7c589a[_0x8d97('0x86')]();_0x7c589a['limit'](_0x242ccb);_0x7c589a[_0x8d97('0x1c')](0x0);return;}})['then'](function(){if(_0x2d65a5[_0x8d97('0x90')]===_0x8d97('0x91')){return null;}var _0x3ece5e=_[_0x8d97('0x43')](_0x2d65a5,{'name':_0x2d65a5[_0x8d97('0x92')]||_0x2d65a5['name']||_0x481b3d[_0x8d97('0x34')],'basename':_0x493eca,'savename':util[_0x8d97('0x7a')](_0x8d97('0x93'),_0x2d65a5[_0x8d97('0x34')]||_0x481b3d[_0x8d97('0x34')],require(_0x8d97('0x94'))[_0x8d97('0x95')](0x4),_0x2d65a5[_0x8d97('0x90')]||_0x8d97('0x96')),'reportId':_0x481b3d['id'],'reportType':_0x8d97('0x97')});return db[_0x8d97('0x98')][_0x8d97('0x4c')](_0x3ece5e,{'raw':!![]});})[_0x8d97('0x26')](function(_0x378df0){if(_0x481b3d[_0x8d97('0x74')]==='cdr'){_0xa81e1a['where'](_0x481b3d[_0x8d97('0x74')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2d65a5['startDate'],_0x2d65a5[_0x8d97('0x99')]);}else{_0xa81e1a[_0x8d97('0x40')](_0x481b3d[_0x8d97('0x74')]+_0x8d97('0x9a'),_0x2d65a5[_0x8d97('0x9b')],_0x2d65a5['endDate']);}if(_0x378df0){logger[_0x8d97('0x9c')](_0x8d97('0x9d'),_0xa81e1a['toString']());require('child_process')[_0x8d97('0x9e')](path[_0x8d97('0x57')](__dirname,_0x8d97('0x9f'),_0x378df0[_0x8d97('0x90')]),[_0x378df0['id'],_0xa81e1a[_0x8d97('0x89')](),path[_0x8d97('0x57')](__dirname,'../../files/reports',_0x378df0[_0x8d97('0xa0')]),_0x493eca]);return _0x378df0;}else{var _0x18ffc9=squel[_0x8d97('0x73')]();_0x18ffc9[_0x8d97('0xa1')]('('+_0xa81e1a[_0x8d97('0x89')]()+')',_0x8d97('0xa2'));_0x18ffc9[_0x8d97('0x77')](_0x8d97('0xa3'),_0x8d97('0x1e'));_0xa81e1a['limit'](_0x2d65a5['limit']||_0x242ccb);_0xa81e1a[_0x8d97('0x1c')](_0x2d65a5[_0x8d97('0x1c')]||0x0);return dbH[_0x8d97('0x88')][_0x8d97('0x35')](_0x18ffc9[_0x8d97('0x89')](),{'type':dbH[_0x8d97('0x88')][_0x8d97('0x8a')][_0x8d97('0x8b')]})[_0x8d97('0x26')](function(_0x309b42){if(!_0x309b42[_0x8d97('0x3b')]){_0x47f649=0x0;}else{_0x47f649=_0x309b42[0x0]['count']||0x0;}return dbH[_0x8d97('0x88')][_0x8d97('0x35')](_0xa81e1a[_0x8d97('0x89')](),{'type':dbH[_0x8d97('0x88')][_0x8d97('0x8a')][_0x8d97('0x8b')]});})[_0x8d97('0x26')](function(_0x552a52){return{'rows':_0x552a52||[],'count':_0x47f649};});}});}exports['run']=function(_0x52191c,_0x128cfb){return runReport(_0x52191c['params'],_0x52191c['query'],_0x52191c['options'])[_0x8d97('0x26')](respondWithResult(_0x128cfb,null))[_0x8d97('0x49')](handleError(_0x128cfb,null));};exports['runReport']=runReport;exports[_0x8d97('0x35')]=function(_0x5ec9e0,_0x1a9fc0){var _0x3812d7=0xa;var _0x4a626d=[_0x8d97('0x57'),_0x8d97('0x58'),'right_join',_0x8d97('0x5a')];var _0x27a903={'SUM':'SUM(%s)','COUNT':_0x8d97('0x5c'),'COUNT DISTINCT':_0x8d97('0x5d'),'MAX':_0x8d97('0x5e'),'MIN':_0x8d97('0x8c'),'AVG':_0x8d97('0x5f'),'GROUP_CONCAT':_0x8d97('0x60'),'GROUP_CONCAT ASC':_0x8d97('0x61'),'GROUP_CONCAT DESC':_0x8d97('0x62')};var _0x439d78={'SEC_TO_TIME':_0x8d97('0x63'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x8d97('0x66'),'UNIX_TIMESTAMP':_0x8d97('0x8d')};var _0x1eaab6=function(_0x5a103e){return!_[_0x8d97('0x67')]([_0x8d97('0x68'),'IS\x20NOT\x20NULL',_0x8d97('0x69'),_0x8d97('0x6a')],_0x5a103e);};var _0x3b6b38=function(_0x50d093){if(!_0x50d093||!_0x50d093[_0x8d97('0x6b')][_0x8d97('0x3b')]){return'';}for(var _0x2fba3a='(',_0x32dfb9=0x0;_0x32dfb9<_0x50d093['rules'][_0x8d97('0x3b')];_0x32dfb9+=0x1){_0x32dfb9>0x0&&(_0x2fba3a+='\x20'+_0x50d093[_0x8d97('0x6c')]+'\x20');_0x2fba3a+=_0x50d093[_0x8d97('0x6b')][_0x32dfb9][_0x8d97('0x6d')]?_0x3b6b38(_0x50d093[_0x8d97('0x6b')][_0x32dfb9]['group']):_0x50d093[_0x8d97('0x6b')][_0x32dfb9][_0x8d97('0x77')]+'\x20'+_0x50d093[_0x8d97('0x6b')][_0x32dfb9]['condition']+(_0x1eaab6(_0x50d093['rules'][_0x32dfb9][_0x8d97('0x6e')])?'\x20'+_0x50d093['rules'][_0x32dfb9]['value']:'');}return _0x2fba3a+')';};var _0x36d50a={'where':{'id':_0x5ec9e0[_0x8d97('0x55')]['id']}},_0x5824b4,_0x1261a3,_0x307f65,_0x4920d6,_0x9452b1;_0x36d50a=_[_0x8d97('0x43')]({},_0x36d50a,_0x5ec9e0[_0x8d97('0x45')]);return db[_0x8d97('0x2f')][_0x8d97('0x4b')](_0x36d50a)['then'](function(_0x39cc07){if(_0x39cc07){_0x5824b4=_0x39cc07;return _0x39cc07[_0x8d97('0x6f')]();}return null;})['then'](function(_0x29ebc){if(_0x29ebc){if(!_0x29ebc[_0x8d97('0x3b')]){throw new db['Sequelize']['ValidationErrorItem'](_0x8d97('0xa4'),0x193);}_0x1261a3=_0x29ebc;return db[_0x8d97('0x71')][_0x8d97('0x48')]({'raw':!![]});}return null;})[_0x8d97('0x26')](function(_0x106f4c){if(_0x106f4c){_0x307f65=_[_0x8d97('0x72')](_0x106f4c,'id');var _0x7af445;var _0x3f4464=squel['select']();_0x3f4464[_0x8d97('0xa1')](_0x5824b4[_0x8d97('0x74')]);for(var _0xc8c3a7=0x0;_0xc8c3a7<_0x1261a3[_0x8d97('0x3b')];_0xc8c3a7+=0x1){_0x7af445=_0x1261a3[_0xc8c3a7]['MetricId']?_0x307f65[_0x1261a3[_0xc8c3a7]['MetricId']]['metric']:_0x1261a3[_0xc8c3a7][_0x8d97('0x77')];_0x7af445=_0x1261a3[_0xc8c3a7]['function']?_['replace'](_0x27a903[_0x1261a3[_0xc8c3a7][_0x8d97('0x78')]],'%s',_0x7af445):_0x7af445;_0x7af445=_0x1261a3[_0xc8c3a7][_0x8d97('0x7a')]?_['replace'](_0x439d78[_0x1261a3[_0xc8c3a7]['format']],'%s',_0x7af445):_0x7af445;if(_0x1261a3[_0xc8c3a7]['groupBy']){_0x3f4464['group'](_0x7af445);}_0x1261a3[_0xc8c3a7]['orderBy']&&_0x3f4464[_0x8d97('0x3e')](_0x7af445,_0x1261a3[_0xc8c3a7][_0x8d97('0x7c')]==='DESC'?![]:!![]);_0x3f4464[_0x8d97('0x77')](_0x7af445,_0x1261a3[_0xc8c3a7][_0x8d97('0x7e')]||_0x7af445);}if(_0x5824b4[_0x8d97('0x7f')]){_0x5824b4[_0x8d97('0x7f')]=JSON[_0x8d97('0x80')](_0x5824b4['joins']);for(var _0xa568c3=0x0;_0xa568c3<_0x5824b4[_0x8d97('0x7f')][_0x8d97('0x3b')];_0xa568c3+=0x1){if(_0x5824b4[_0x8d97('0x7f')][_0xa568c3][_0x8d97('0x32')]&&_[_0x8d97('0x67')](_0x4a626d,_0x5824b4[_0x8d97('0x7f')][_0xa568c3][_0x8d97('0x32')])&&_0x5824b4[_0x8d97('0x7f')][_0xa568c3][_0x8d97('0x84')]&&_0x5824b4[_0x8d97('0x7f')][_0xa568c3][_0x8d97('0x81')]&&_0x5824b4['joins'][_0xa568c3][_0x8d97('0x82')]){_0x3f4464[_0x5824b4['joins'][_0xa568c3][_0x8d97('0x32')]](_0x5824b4[_0x8d97('0x7f')][_0xa568c3]['foreignTable'],null,util['format'](_0x8d97('0x83'),_0x5824b4[_0x8d97('0x74')],_0x5824b4['joins'][_0xa568c3][_0x8d97('0x84')],_0x5824b4[_0x8d97('0x7f')][_0xa568c3][_0x8d97('0x81')],_0x5824b4[_0x8d97('0x7f')][_0xa568c3][_0x8d97('0x82')]));}}}if(_0x5824b4[_0x8d97('0x85')]){_0x5824b4['conditions']=JSON[_0x8d97('0x80')](_0x5824b4[_0x8d97('0x85')]);_0x3f4464[_0x8d97('0x40')](_0x3b6b38(_0x5824b4['conditions']['group']));}_0x9452b1=_0x3f4464[_0x8d97('0x86')]();_0x3f4464[_0x8d97('0x1d')](_0x3812d7);_0x3f4464[_0x8d97('0x1c')](0x0);logger[_0x8d97('0x87')]('Limited\x20Query:',_0x3f4464[_0x8d97('0x89')]());return dbH['sequelize'][_0x8d97('0x35')](_0x3f4464[_0x8d97('0x89')](),{'type':dbH[_0x8d97('0x88')][_0x8d97('0x8a')]['SELECT']});}})[_0x8d97('0x26')](function(){return{'sql':_0x9452b1[_0x8d97('0x89')]()};})[_0x8d97('0x26')](respondWithResult(_0x1a9fc0,null))[_0x8d97('0x49')](handleError(_0x1a9fc0,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index d66eea9..14bef16 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 _0x76de=['../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0x485cba,_0x38a03a){var _0x5cdc63=function(_0x1abd9e){while(--_0x1abd9e){_0x485cba['push'](_0x485cba['shift']());}};_0x5cdc63(++_0x38a03a);}(_0x76de,0x1e9));var _0xe76d=function(_0x19afdd,_0x4f9937){_0x19afdd=_0x19afdd-0x0;var _0x1d44dc=_0x76de[_0x19afdd];return _0x1d44dc;};'use strict';var _=require(_0xe76d('0x0'));var util=require('util');var logger=require(_0xe76d('0x1'))(_0xe76d('0x2'));var moment=require(_0xe76d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe76d('0x4'));var rimraf=require(_0xe76d('0x5'));var config=require(_0xe76d('0x6'));var attributes=require(_0xe76d('0x7'));module[_0xe76d('0x8')]=function(_0x4ed8ee,_0x1eb55b){return _0x4ed8ee[_0xe76d('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xe76d('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab02=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports'];(function(_0x56497c,_0x2ad77f){var _0x18f66f=function(_0x460598){while(--_0x460598){_0x56497c['push'](_0x56497c['shift']());}};_0x18f66f(++_0x2ad77f);}(_0xab02,0x12c));var _0x2ab0=function(_0xeb450f,_0x483ac6){_0xeb450f=_0xeb450f-0x0;var _0xfad79f=_0xab02[_0xeb450f];return _0xfad79f;};'use strict';var _=require(_0x2ab0('0x0'));var util=require(_0x2ab0('0x1'));var logger=require(_0x2ab0('0x2'))(_0x2ab0('0x3'));var moment=require('moment');var BPromise=require(_0x2ab0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ab0('0x5'));var rimraf=require(_0x2ab0('0x6'));var config=require(_0x2ab0('0x7'));var attributes=require(_0x2ab0('0x8'));module[_0x2ab0('0x9')]=function(_0xab9099,_0x3f6462){return _0xab9099[_0x2ab0('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x2ab0('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 6d31736..cbc7786 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 _0xcd11=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x190308,_0x503649){var _0x3a50c1=function(_0x59711f){while(--_0x59711f){_0x190308['push'](_0x190308['shift']());}};_0x3a50c1(++_0x503649);}(_0xcd11,0x1a2));var _0x1cd1=function(_0x2e8955,_0x26f82a){_0x2e8955=_0x2e8955-0x0;var _0x4eb8ff=_0xcd11[_0x2e8955];return _0x4eb8ff;};'use strict';var _=require(_0x1cd1('0x0'));var util=require(_0x1cd1('0x1'));var moment=require(_0x1cd1('0x2'));var BPromise=require(_0x1cd1('0x3'));var rs=require(_0x1cd1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cd1('0x5'))['db'];var utils=require(_0x1cd1('0x6'));var logger=require(_0x1cd1('0x7'))(_0x1cd1('0x8'));var config=require(_0x1cd1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1cd1('0xa')][_0x1cd1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f37ef,_0x59b8d7,_0xd08e84){return new BPromise(function(_0xf6463e,_0x54b99f){return client['request'](_0x4f37ef,_0xd08e84)['then'](function(_0x409ac7){logger[_0x1cd1('0xc')](_0x1cd1('0xd'),_0x59b8d7,_0x1cd1('0xe'));logger[_0x1cd1('0xf')](_0x1cd1('0x10'),_0x59b8d7,_0x1cd1('0xe'),JSON[_0x1cd1('0x11')](_0x409ac7));if(_0x409ac7[_0x1cd1('0x12')]){if(_0x409ac7['error'][_0x1cd1('0x13')]===0x1f4){logger[_0x1cd1('0x12')](_0x1cd1('0xd'),_0x59b8d7,_0x409ac7[_0x1cd1('0x12')]['message']);return _0x54b99f(_0x409ac7['error']['message']);}logger[_0x1cd1('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x59b8d7,_0x409ac7[_0x1cd1('0x12')][_0x1cd1('0x14')]);return _0xf6463e(_0x409ac7['error'][_0x1cd1('0x14')]);}else{logger[_0x1cd1('0xc')](_0x1cd1('0xd'),_0x59b8d7,'request\x20sent');_0xf6463e(_0x409ac7[_0x1cd1('0x15')]['message']);}})['catch'](function(_0x24dfd1){logger['error'](_0x1cd1('0xd'),_0x59b8d7,_0x24dfd1);_0x54b99f(_0x24dfd1);});});}
\ No newline at end of file
+var _0xdc8c=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x517763,_0x3648a2){var _0x46d6f0=function(_0x9332e9){while(--_0x9332e9){_0x517763['push'](_0x517763['shift']());}};_0x46d6f0(++_0x3648a2);}(_0xdc8c,0x6d));var _0xcdc8=function(_0x8ae2ad,_0x5dece2){_0x8ae2ad=_0x8ae2ad-0x0;var _0xf971d3=_0xdc8c[_0x8ae2ad];return _0xf971d3;};'use strict';var _=require(_0xcdc8('0x0'));var util=require(_0xcdc8('0x1'));var moment=require(_0xcdc8('0x2'));var BPromise=require(_0xcdc8('0x3'));var rs=require(_0xcdc8('0x4'));var fs=require('fs');var Redis=require(_0xcdc8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdc8('0x6'));var logger=require(_0xcdc8('0x7'))(_0xcdc8('0x8'));var config=require(_0xcdc8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcdc8('0xa')][_0xcdc8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30d893,_0x559013,_0x514224){return new BPromise(function(_0xdf8c00,_0x4c4b9c){return client[_0xcdc8('0xc')](_0x30d893,_0x514224)[_0xcdc8('0xd')](function(_0x2d90a7){logger[_0xcdc8('0xe')](_0xcdc8('0xf'),_0x559013,'request\x20sent');logger[_0xcdc8('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x559013,_0xcdc8('0x11'),JSON[_0xcdc8('0x12')](_0x2d90a7));if(_0x2d90a7[_0xcdc8('0x13')]){if(_0x2d90a7[_0xcdc8('0x13')][_0xcdc8('0x14')]===0x1f4){logger[_0xcdc8('0x13')](_0xcdc8('0xf'),_0x559013,_0x2d90a7[_0xcdc8('0x13')]['message']);return _0x4c4b9c(_0x2d90a7['error'][_0xcdc8('0x15')]);}logger[_0xcdc8('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x559013,_0x2d90a7['error']['message']);return _0xdf8c00(_0x2d90a7[_0xcdc8('0x13')][_0xcdc8('0x15')]);}else{logger[_0xcdc8('0xe')](_0xcdc8('0xf'),_0x559013,'request\x20sent');_0xdf8c00(_0x2d90a7[_0xcdc8('0x16')]['message']);}})[_0xcdc8('0x17')](function(_0x121f2d){logger[_0xcdc8('0x13')](_0xcdc8('0xf'),_0x559013,_0x121f2d);_0x4c4b9c(_0x121f2d);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 6e2424a..b17e033 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 _0x8bc8=['../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','preview','/:id/run','run','query','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x54a7d8,_0x1817db){var _0x5425aa=function(_0x383909){while(--_0x383909){_0x54a7d8['push'](_0x54a7d8['shift']());}};_0x5425aa(++_0x1817db);}(_0x8bc8,0x99));var _0x88bc=function(_0x283b55,_0x279bee){_0x283b55=_0x283b55-0x0;var _0x192e58=_0x8bc8[_0x283b55];return _0x192e58;};'use strict';var multer=require(_0x88bc('0x0'));var util=require('util');var path=require(_0x88bc('0x1'));var timeout=require(_0x88bc('0x2'));var express=require(_0x88bc('0x3'));var router=express[_0x88bc('0x4')]();var fs_extra=require(_0x88bc('0x5'));var auth=require(_0x88bc('0x6'));var interaction=require(_0x88bc('0x7'));var config=require(_0x88bc('0x8'));var controller=require(_0x88bc('0x9'));router[_0x88bc('0xa')]('/',auth['isAuthenticated'](),controller[_0x88bc('0xb')]);router['get'](_0x88bc('0xc'),auth[_0x88bc('0xd')](),controller['show']);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0x88bc('0xe')]);router[_0x88bc('0xa')](_0x88bc('0xf'),auth[_0x88bc('0xd')](),controller[_0x88bc('0x10')]);router[_0x88bc('0xa')]('/:id/query',auth[_0x88bc('0xd')](),controller[_0x88bc('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x88bc('0x12')]);router[_0x88bc('0x13')](_0x88bc('0xc'),auth[_0x88bc('0xd')](),controller[_0x88bc('0x14')]);router['delete'](_0x88bc('0xc'),auth[_0x88bc('0xd')](),controller[_0x88bc('0x15')]);module[_0x88bc('0x16')]=router;
\ No newline at end of file
+var _0x6d5b=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','preview','/:id/run','run','create','delete','destroy'];(function(_0x1ac052,_0x3f8942){var _0x17dfe7=function(_0xec078b){while(--_0xec078b){_0x1ac052['push'](_0x1ac052['shift']());}};_0x17dfe7(++_0x3f8942);}(_0x6d5b,0xb5));var _0xb6d5=function(_0x3e10dc,_0x230393){_0x3e10dc=_0x3e10dc-0x0;var _0x20020c=_0x6d5b[_0x3e10dc];return _0x20020c;};'use strict';var multer=require('multer');var util=require(_0xb6d5('0x0'));var path=require(_0xb6d5('0x1'));var timeout=require(_0xb6d5('0x2'));var express=require(_0xb6d5('0x3'));var router=express[_0xb6d5('0x4')]();var fs_extra=require(_0xb6d5('0x5'));var auth=require(_0xb6d5('0x6'));var interaction=require(_0xb6d5('0x7'));var config=require(_0xb6d5('0x8'));var controller=require('./analyticCustomReport.controller');router[_0xb6d5('0x9')]('/',auth[_0xb6d5('0xa')](),controller['index']);router[_0xb6d5('0x9')](_0xb6d5('0xb'),auth[_0xb6d5('0xa')](),controller[_0xb6d5('0xc')]);router['get']('/:id/preview',auth[_0xb6d5('0xa')](),controller[_0xb6d5('0xd')]);router[_0xb6d5('0x9')](_0xb6d5('0xe'),auth[_0xb6d5('0xa')](),controller[_0xb6d5('0xf')]);router[_0xb6d5('0x9')]('/:id/query',auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0xb6d5('0xa')](),controller[_0xb6d5('0x10')]);router['put'](_0xb6d5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xb6d5('0x11')](_0xb6d5('0xb'),auth[_0xb6d5('0xa')](),controller[_0xb6d5('0x12')]);module[_0xb6d5('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 3cefcf8..cfcd9c2 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(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x46ed,0x168));var _0xd46e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x46ed[_0x4ae6ef];return _0x3cbb4e;};'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 _0x3eea=['STRING','TEXT','sequelize'];(function(_0x1652c9,_0x19e14d){var _0x14666e=function(_0x2567db){while(--_0x2567db){_0x1652c9['push'](_0x1652c9['shift']());}};_0x14666e(++_0x19e14d);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x5c12c4,_0x3bb03e){_0x5c12c4=_0x5c12c4-0x0;var _0x185df2=_0x3eea[_0x5c12c4];return _0x185df2;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 2af764c..f75afb9 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x1d480a,_0x5277fe){var _0x51f043=function(_0x524f20){while(--_0x524f20){_0x1d480a['push'](_0x1d480a['shift']());}};_0x51f043(++_0x5277fe);}(_0xba34,0x119));var _0x4ba3=function(_0x148fcb,_0x3e8c58){_0x148fcb=_0x148fcb-0x0;var _0x4dfb3a=_0xba34[_0x148fcb];return _0x4dfb3a;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
+var _0x2542=['getFields','ValidationErrorItem','metric','format','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','sequelize','SELECT','run','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','save','destroy','then','get','end','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','replace','function','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value'];(function(_0x3c74d7,_0x328e0f){var _0xf2cb29=function(_0x2f8675){while(--_0x2f8675){_0x3c74d7['push'](_0x3c74d7['shift']());}};_0xf2cb29(++_0x328e0f);}(_0x2542,0x169));var _0x2254=function(_0x2bf999,_0x4645b1){_0x2bf999=_0x2bf999-0x0;var _0x4cf8f8=_0x2542[_0x2bf999];return _0x4cf8f8;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];var dbH=require(_0x2254('0x19'))[_0x2254('0x1a')];function respondWithStatusCode(_0x3c326b,_0x381efe){_0x381efe=_0x381efe||0xcc;return function(_0x592a4f){if(_0x592a4f){return _0x3c326b[_0x2254('0x1b')](_0x381efe);}return _0x3c326b[_0x2254('0x1c')](_0x381efe)['end']();};}function respondWithResult(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xc8;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1c')](_0x1e582d)[_0x2254('0x1d')](_0xfb23cb);}};}function respondWithFilteredResult(_0xbc5548,_0x50f137){return function(_0x18baf4){if(_0x18baf4){var _0x57247a=typeof _0x50f137[_0x2254('0x1e')]===_0x2254('0x1f')&&typeof _0x50f137[_0x2254('0x20')]===_0x2254('0x1f');var _0x1ae11e=_0x18baf4[_0x2254('0x21')];var _0x497724=_0x57247a?0x0:_0x50f137['offset'];var _0x5ec98d=_0x57247a?_0x18baf4[_0x2254('0x21')]:_0x50f137[_0x2254('0x1e')]+_0x50f137[_0x2254('0x20')];var _0x1f1163;if(_0x5ec98d>=_0x1ae11e){_0x5ec98d=_0x1ae11e;_0x1f1163=0xc8;}else{_0x1f1163=0xce;}_0xbc5548[_0x2254('0x1c')](_0x1f1163);return _0xbc5548[_0x2254('0x22')]('Content-Range',_0x497724+'-'+_0x5ec98d+'/'+_0x1ae11e)[_0x2254('0x1d')](_0x18baf4);}return null;};}function patchUpdates(_0x16148d){return function(_0x906cde){try{jsonpatch['apply'](_0x906cde,_0x16148d,!![]);}catch(_0x52fedc){return BPromise['reject'](_0x52fedc);}return _0x906cde[_0x2254('0x23')]();};}function saveUpdates(_0x559af4,_0xf88b56){return function(_0x56b91e){if(_0x56b91e){return _0x56b91e['update'](_0x559af4)['then'](function(_0x540020){return _0x540020;});}return null;};}function removeEntity(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x24')]()[_0x2254('0x25')](function(){var _0x265467=_0x1aa71f[_0x2254('0x26')]({'plain':!![]});var _0x1349c9='DefaultReports';return db['UserProfileResource'][_0x2254('0x24')]({'where':{'type':_0x1349c9,'resourceId':_0x265467['id']}})['then'](function(){return _0x1aa71f;});})[_0x2254('0x25')](function(){_0x5e5edb[_0x2254('0x1c')](0xcc)[_0x2254('0x27')]();});}};}function handleEntityNotFound(_0x3aa0bd,_0x19043b){return function(_0x482688){if(!_0x482688){_0x3aa0bd[_0x2254('0x1b')](0x194);}return _0x482688;};}function handleError(_0x2a789b,_0x21285d){_0x21285d=_0x21285d||0x1f4;return function(_0x37af8b){logger[_0x2254('0x28')](_0x37af8b[_0x2254('0x29')]);if(_0x37af8b[_0x2254('0x2a')]){delete _0x37af8b[_0x2254('0x2a')];}_0x2a789b[_0x2254('0x1c')](_0x21285d)[_0x2254('0x2b')](_0x37af8b);};}exports[_0x2254('0x2c')]=function(_0xad7774,_0x220f2a){var _0x27d30a={},_0x4577f4={},_0x1b16c8={'count':0x0,'rows':[]};var _0x2c929f=_[_0x2254('0x2d')](db[_0x2254('0x2e')]['rawAttributes'],function(_0xe29526){return{'name':_0xe29526[_0x2254('0x2f')],'type':_0xe29526[_0x2254('0x30')][_0x2254('0x31')]};});_0x4577f4[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x2c929f,_0x2254('0x2a'));_0x4577f4[_0x2254('0x33')]=_[_0x2254('0x34')](_0xad7774['query']);_0x4577f4[_0x2254('0x35')]=_[_0x2254('0x36')](_0x4577f4['model'],_0x4577f4[_0x2254('0x33')]);_0x27d30a[_0x2254('0x37')]=_[_0x2254('0x36')](_0x4577f4[_0x2254('0x32')],qs['fields'](_0xad7774['query'][_0x2254('0x38')]));_0x27d30a['attributes']=_0x27d30a[_0x2254('0x37')][_0x2254('0x39')]?_0x27d30a[_0x2254('0x37')]:_0x4577f4[_0x2254('0x32')];if(!_0xad7774[_0x2254('0x33')][_0x2254('0x3a')](_0x2254('0x3b'))){_0x27d30a['limit']=qs[_0x2254('0x20')](_0xad7774[_0x2254('0x33')][_0x2254('0x20')]);_0x27d30a[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0xad7774[_0x2254('0x33')][_0x2254('0x1e')]);}_0x27d30a[_0x2254('0x3c')]=qs[_0x2254('0x3d')](_0xad7774[_0x2254('0x33')]['sort']);_0x27d30a[_0x2254('0x3e')]=qs[_0x2254('0x35')](_[_0x2254('0x3f')](_0xad7774[_0x2254('0x33')],_0x4577f4['filters']),_0x2c929f);if(_0xad7774[_0x2254('0x33')][_0x2254('0x40')]){_0x27d30a[_0x2254('0x3e')]=_[_0x2254('0x41')](_0x27d30a[_0x2254('0x3e')],{'$or':_[_0x2254('0x2d')](_0x2c929f,function(_0x423377){if(_0x423377[_0x2254('0x30')]!=='VIRTUAL'){var _0x362ad1={};_0x362ad1[_0x423377['name']]={'$like':'%'+_0xad7774[_0x2254('0x33')][_0x2254('0x40')]+'%'};return _0x362ad1;}})});}_0x27d30a=_[_0x2254('0x41')]({},_0x27d30a,_0xad7774[_0x2254('0x42')]);var _0x460bb3={'where':_0x27d30a[_0x2254('0x3e')]};return db[_0x2254('0x2e')]['count'](_0x460bb3)[_0x2254('0x25')](function(_0x2f1ff9){_0x1b16c8[_0x2254('0x21')]=_0x2f1ff9;if(_0xad7774[_0x2254('0x33')][_0x2254('0x43')]){_0x27d30a['include']=[{'all':!![]}];}return db[_0x2254('0x2e')][_0x2254('0x44')](_0x27d30a);})[_0x2254('0x25')](function(_0x135ed8){_0x1b16c8[_0x2254('0x45')]=_0x135ed8;return _0x1b16c8;})['then'](respondWithFilteredResult(_0x220f2a,_0x27d30a))[_0x2254('0x46')](handleError(_0x220f2a,null));};exports['show']=function(_0x91e091,_0x1ded9a){var _0xb4d042={'raw':!![],'where':{'id':_0x91e091[_0x2254('0x47')]['id']}},_0x31c31e={};_0x31c31e[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x48')]);_0x31c31e[_0x2254('0x33')]=_[_0x2254('0x34')](_0x91e091[_0x2254('0x33')]);_0x31c31e[_0x2254('0x35')]=_['intersection'](_0x31c31e[_0x2254('0x32')],_0x31c31e[_0x2254('0x33')]);_0xb4d042[_0x2254('0x37')]=_['intersection'](_0x31c31e[_0x2254('0x32')],qs[_0x2254('0x38')](_0x91e091[_0x2254('0x33')][_0x2254('0x38')]));_0xb4d042[_0x2254('0x37')]=_0xb4d042[_0x2254('0x37')][_0x2254('0x39')]?_0xb4d042[_0x2254('0x37')]:_0x31c31e[_0x2254('0x32')];if(_0x91e091['query'][_0x2254('0x43')]){_0xb4d042[_0x2254('0x49')]=[{'all':!![]}];}_0xb4d042=_[_0x2254('0x41')]({},_0xb4d042,_0x91e091[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0xb4d042)[_0x2254('0x25')](handleEntityNotFound(_0x1ded9a,null))[_0x2254('0x25')](respondWithResult(_0x1ded9a,null))[_0x2254('0x46')](handleError(_0x1ded9a,null));};exports[_0x2254('0x4b')]=function(_0x5b14c5,_0x36b977){return db[_0x2254('0x2e')]['create'](_0x5b14c5[_0x2254('0x4c')],{})[_0x2254('0x25')](function(_0x12e2ff){var _0x4331a9=_0x5b14c5['user'][_0x2254('0x26')]({'plain':!![]});if(!_0x4331a9)throw new Error(_0x2254('0x4d'));if(_0x4331a9['role']===_0x2254('0x4e')){var _0x3f0670=_0x12e2ff[_0x2254('0x26')]({'plain':!![]});var _0x43bb88='Reports';return db[_0x2254('0x4f')][_0x2254('0x4a')]({'where':{'name':_0x43bb88,'userProfileId':_0x4331a9[_0x2254('0x50')]},'raw':!![]})['then'](function(_0x4cc18a){if(_0x4cc18a&&_0x4cc18a[_0x2254('0x51')]===0x0){return db[_0x2254('0x52')]['create']({'name':_0x3f0670[_0x2254('0x2a')],'resourceId':_0x3f0670['id'],'type':'DefaultReports','sectionId':_0x4cc18a['id']},{})['then'](function(){return _0x12e2ff;});}else{return _0x12e2ff;}})[_0x2254('0x46')](function(_0x135962){logger[_0x2254('0x28')](_0x2254('0x53'),_0x135962);throw _0x135962;});}return _0x12e2ff;})[_0x2254('0x25')](respondWithResult(_0x36b977,0xc9))['catch'](handleError(_0x36b977,null));};exports['update']=function(_0x1bd988,_0x5e3fbc){if(_0x1bd988[_0x2254('0x4c')]['id']){delete _0x1bd988[_0x2254('0x4c')]['id'];}return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x1bd988['params']['id']}})[_0x2254('0x25')](handleEntityNotFound(_0x5e3fbc,null))[_0x2254('0x25')](saveUpdates(_0x1bd988['body'],null))['then'](respondWithResult(_0x5e3fbc,null))[_0x2254('0x46')](handleError(_0x5e3fbc,null));};exports['destroy']=function(_0x2cc59c,_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x2cc59c[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x305ace,null))['then'](removeEntity(_0x305ace,null))[_0x2254('0x46')](handleError(_0x305ace,null));};exports['preview']=function(_0x335c66,_0x510fe0){var _0x4da493=0xa;var _0x5999c8=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x13606e={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':_0x2254('0x5b'),'MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f391d={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x329378=function(_0xae171c){return!_[_0x2254('0x65')]([_0x2254('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2254('0x67')],_0xae171c);};var _0x423c17=function(_0x1d73a3){if(!_0x1d73a3||!_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x53b55b='(',_0x45b7bd=0x0;_0x45b7bd<_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')];_0x45b7bd+=0x1){_0x45b7bd>0x0&&(_0x53b55b+='\x20'+_0x1d73a3['operator']+'\x20');_0x53b55b+=_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]?_0x423c17(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]):_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['field']+'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd][_0x2254('0x6a')]+(_0x329378(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x6a')])?'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['value']:'');}return _0x53b55b+')';};var _0x5cc6bd={'where':{'id':_0x335c66['params']['id']}},_0xde4e7,_0xa159a4,_0x486b82,_0x506d95,_0x48406e;_0x5cc6bd=_[_0x2254('0x41')]({},_0x5cc6bd,_0x335c66['options']);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x5cc6bd)[_0x2254('0x25')](function(_0x1ed6b9){if(_0x1ed6b9){_0xde4e7=_0x1ed6b9;return _0x1ed6b9['getFields']();}return null;})[_0x2254('0x25')](function(_0x5ecf82){if(_0x5ecf82){if(!_0x5ecf82[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xa159a4=_0x5ecf82;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x3b3b20){if(_0x3b3b20){_0x486b82=_[_0x2254('0x6e')](_0x3b3b20,'id');var _0x3cefbe;var _0x4f77e5=squel[_0x2254('0x6f')]();_0x4f77e5[_0x2254('0x70')](_0xde4e7['table']);for(var _0x1ac8ff=0x0;_0x1ac8ff<_0xa159a4[_0x2254('0x39')];_0x1ac8ff+=0x1){_0x3cefbe=_0xa159a4[_0x1ac8ff]['MetricId']?_0x486b82[_0xa159a4[_0x1ac8ff][_0x2254('0x71')]]['metric']:_0xa159a4[_0x1ac8ff][_0x2254('0x72')];_0x3cefbe=_0xa159a4[_0x1ac8ff]['function']?_[_0x2254('0x73')](_0x13606e[_0xa159a4[_0x1ac8ff][_0x2254('0x74')]],'%s',_0x3cefbe):_0x3cefbe;_0x3cefbe=_0xa159a4[_0x1ac8ff]['format']?_[_0x2254('0x73')](_0x2f391d[_0xa159a4[_0x1ac8ff]['format']],'%s',_0x3cefbe):_0x3cefbe;if(_0xa159a4[_0x1ac8ff][_0x2254('0x75')]){_0x4f77e5[_0x2254('0x69')](_0x3cefbe);}_0xa159a4[_0x1ac8ff][_0x2254('0x76')]&&_0x4f77e5['order'](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x76')]==='DESC'?![]:!![]);_0x4f77e5[_0x2254('0x72')](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x77')]||_0x3cefbe);}if(_0xde4e7['joins']){_0xde4e7['joins']=JSON[_0x2254('0x78')](_0xde4e7[_0x2254('0x79')]);for(var _0x451520=0x0;_0x451520<_0xde4e7[_0x2254('0x79')]['length'];_0x451520+=0x1){if(_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x5999c8,_0xde4e7[_0x2254('0x79')][_0x451520]['type'])&&_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7a')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7b')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7c')]){_0x4f77e5[_0xde4e7['joins'][_0x451520]['type']](_0xde4e7['joins'][_0x451520][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0xde4e7[_0x2254('0x7e')],_0xde4e7['joins'][_0x451520][_0x2254('0x7a')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7b')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7c')]));}}}if(_0xde4e7[_0x2254('0x7f')]){_0xde4e7['conditions']=JSON['parse'](_0xde4e7[_0x2254('0x7f')]);_0x4f77e5[_0x2254('0x3e')](_0x423c17(_0xde4e7[_0x2254('0x7f')][_0x2254('0x69')]));}_0x48406e=_0x4f77e5[_0x2254('0x80')]();_0x4f77e5[_0x2254('0x20')](_0x4da493);_0x4f77e5[_0x2254('0x1e')](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4f77e5[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4f77e5[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')]['SELECT']});}})[_0x2254('0x25')](respondWithResult(_0x510fe0,null))[_0x2254('0x46')](handleError(_0x510fe0,null));};function runReport(_0x4dfcb4,_0x1c317b,_0x4e699c){var _0x2ad519=_0x1c317b[_0x2254('0x2a')];var _0x30f2c9=0xa;var _0x1f7a48=['join',_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x3a8d4f={'SUM':'SUM(%s)','COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f3650={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x251d70=function(_0x2c7705){return!_['includes']([_0x2254('0x66'),'IS\x20NOT\x20NULL',_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x2c7705);};var _0x36d121=function(_0x207a09){if(!_0x207a09||!_0x207a09[_0x2254('0x68')]['length']){return'';}for(var _0x8a3656='(',_0x1554f1=0x0;_0x1554f1<_0x207a09[_0x2254('0x68')][_0x2254('0x39')];_0x1554f1+=0x1){_0x1554f1>0x0&&(_0x8a3656+='\x20'+_0x207a09[_0x2254('0x87')]+'\x20');_0x8a3656+=_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]?_0x36d121(_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]):_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x72')]+'\x20'+_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x6a')]+(_0x251d70(_0x207a09['rules'][_0x1554f1][_0x2254('0x6a')])?'\x20'+_0x207a09['rules'][_0x1554f1][_0x2254('0x88')]:'');}return _0x8a3656+')';};var _0xb98b40={'where':{'id':_0x4dfcb4['id']}},_0x3b1d5c,_0x2c907a,_0x23b78c,_0x2b5dba,_0x30307a;_0xb98b40=_['merge']({},_0xb98b40,_0x4e699c);return db[_0x2254('0x2e')]['find'](_0xb98b40)[_0x2254('0x25')](function(_0x52712d){if(_0x52712d){_0x3b1d5c=_0x52712d;return _0x52712d[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x1d0c8f){if(_0x1d0c8f){if(!_0x1d0c8f['length']){throw new db[(_0x2254('0x6b'))][(_0x2254('0x8a'))](_0x2254('0x6c'),0x193);}_0x2c907a=_0x1d0c8f;return db[_0x2254('0x6d')][_0x2254('0x44')]({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x34185c){if(_0x34185c){_0x23b78c=_[_0x2254('0x6e')](_0x34185c,'id');var _0x5e94b6;var _0x56239e=squel[_0x2254('0x6f')]();_0x56239e['from'](_0x3b1d5c[_0x2254('0x7e')]);for(var _0x3a1365=0x0;_0x3a1365<_0x2c907a[_0x2254('0x39')];_0x3a1365+=0x1){_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x71')]?_0x23b78c[_0x2c907a[_0x3a1365][_0x2254('0x71')]][_0x2254('0x8b')]:_0x2c907a[_0x3a1365][_0x2254('0x72')];_0x5e94b6=_0x2c907a[_0x3a1365]['function']?_[_0x2254('0x73')](_0x3a8d4f[_0x2c907a[_0x3a1365][_0x2254('0x74')]],'%s',_0x5e94b6):_0x5e94b6;_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x8c')]?_['replace'](_0x2f3650[_0x2c907a[_0x3a1365][_0x2254('0x8c')]],'%s',_0x5e94b6):_0x5e94b6;if(_0x2c907a[_0x3a1365][_0x2254('0x75')]){_0x56239e[_0x2254('0x69')](_0x5e94b6);}_0x2c907a[_0x3a1365][_0x2254('0x76')]&&_0x56239e[_0x2254('0x3c')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x56239e[_0x2254('0x72')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x77')]||_0x5e94b6);}if(_0x3b1d5c['joins']){_0x3b1d5c[_0x2254('0x79')]=JSON[_0x2254('0x78')](_0x3b1d5c['joins']);for(var _0x4cec5b=0x0;_0x4cec5b<_0x3b1d5c[_0x2254('0x79')]['length'];_0x4cec5b+=0x1){if(_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x1f7a48,_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')])&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7a')]&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b]['foreignTable']&&_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7c')]){_0x56239e[_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]](_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1d5c[_0x2254('0x7e')],_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7a')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7c')]));}}}if(_0x3b1d5c[_0x2254('0x7f')]){_0x3b1d5c[_0x2254('0x7f')]=JSON['parse'](_0x3b1d5c[_0x2254('0x7f')]);_0x56239e[_0x2254('0x3e')](_0x36d121(_0x3b1d5c['conditions'][_0x2254('0x69')]));}_0x30307a=_0x56239e[_0x2254('0x80')]();_0x56239e[_0x2254('0x20')](_0x30f2c9);_0x56239e[_0x2254('0x1e')](0x0);return;}})[_0x2254('0x25')](function(){if(_0x1c317b[_0x2254('0x8e')]===_0x2254('0x8f')){return null;}var _0x38e2df=_[_0x2254('0x41')](_0x1c317b,{'name':_0x1c317b[_0x2254('0x90')]||_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c['name'],'basename':_0x2ad519,'savename':util[_0x2254('0x8c')](_0x2254('0x91'),_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c[_0x2254('0x2a')],require(_0x2254('0x92'))[_0x2254('0x93')](0x4),_0x1c317b[_0x2254('0x8e')]||'csv'),'reportId':_0x3b1d5c['id'],'reportType':_0x2254('0x94')});return db[_0x2254('0x95')][_0x2254('0x4b')](_0x38e2df,{'raw':!![]});})['then'](function(_0x60f5ac){if(_0x3b1d5c[_0x2254('0x7e')]===_0x2254('0x96')){_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x97'),_0x1c317b['startDate'],_0x1c317b[_0x2254('0x98')]);}else{_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x99'),_0x1c317b[_0x2254('0x9a')],_0x1c317b['endDate']);}if(_0x60f5ac){logger['info'](_0x2254('0x9b'),_0x30307a['toString']());require(_0x2254('0x9c'))[_0x2254('0x9d')](path[_0x2254('0x54')](__dirname,_0x2254('0x9e'),_0x60f5ac[_0x2254('0x8e')]),[_0x60f5ac['id'],_0x30307a[_0x2254('0x83')](),path['join'](__dirname,'../../files/reports',_0x60f5ac[_0x2254('0x9f')]),_0x2ad519]);return _0x60f5ac;}else{var _0x3317d4=squel[_0x2254('0x6f')]();_0x3317d4[_0x2254('0x70')]('('+_0x30307a['toString']()+')',_0x2254('0xa0'));_0x3317d4[_0x2254('0x72')](_0x2254('0xa1'),_0x2254('0x21'));_0x30307a[_0x2254('0x20')](_0x1c317b[_0x2254('0x20')]||_0x30f2c9);_0x30307a[_0x2254('0x1e')](_0x1c317b[_0x2254('0x1e')]||0x0);return dbH[_0x2254('0xa2')]['query'](_0x3317d4[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')]['SELECT']})[_0x2254('0x25')](function(_0xe38a28){if(!_0xe38a28[_0x2254('0x39')]){_0x2b5dba=0x0;}else{_0x2b5dba=_0xe38a28[0x0]['count']||0x0;}return dbH['sequelize'][_0x2254('0x33')](_0x30307a[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')][_0x2254('0xa3')]});})[_0x2254('0x25')](function(_0x4011de){return{'rows':_0x4011de||[],'count':_0x2b5dba};});}});}exports[_0x2254('0xa4')]=function(_0x5cb3d1,_0x1d8238){return runReport(_0x5cb3d1[_0x2254('0x47')],_0x5cb3d1[_0x2254('0x33')],_0x5cb3d1[_0x2254('0x42')])[_0x2254('0x25')](respondWithResult(_0x1d8238,null))[_0x2254('0x46')](handleError(_0x1d8238,null));};exports['runReport']=runReport;exports['query']=function(_0x40339d,_0x4b3b96){var _0x59b8af=0xa;var _0x408695=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),'cross_join'];var _0x596eae={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x739a29={'SEC_TO_TIME':_0x2254('0x61'),'DATE':'DATE(%s)','HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x243466=function(_0x1b8587){return!_[_0x2254('0x65')]([_0x2254('0x66'),_0x2254('0xa5'),_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x1b8587);};var _0xbec5d0=function(_0x18f841){if(!_0x18f841||!_0x18f841[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x275b56='(',_0x315add=0x0;_0x315add<_0x18f841['rules']['length'];_0x315add+=0x1){_0x315add>0x0&&(_0x275b56+='\x20'+_0x18f841[_0x2254('0x87')]+'\x20');_0x275b56+=_0x18f841['rules'][_0x315add][_0x2254('0x69')]?_0xbec5d0(_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x69')]):_0x18f841[_0x2254('0x68')][_0x315add]['field']+'\x20'+_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x6a')]+(_0x243466(_0x18f841[_0x2254('0x68')][_0x315add]['condition'])?'\x20'+_0x18f841['rules'][_0x315add][_0x2254('0x88')]:'');}return _0x275b56+')';};var _0x51b02a={'where':{'id':_0x40339d[_0x2254('0x47')]['id']}},_0x3e7642,_0xe1abb6,_0x1a44d0,_0x4af6a7,_0x539aba;_0x51b02a=_[_0x2254('0x41')]({},_0x51b02a,_0x40339d[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x51b02a)['then'](function(_0x34e28b){if(_0x34e28b){_0x3e7642=_0x34e28b;return _0x34e28b[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x5d373){if(_0x5d373){if(!_0x5d373[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xe1abb6=_0x5d373;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x56a7ce){if(_0x56a7ce){_0x1a44d0=_[_0x2254('0x6e')](_0x56a7ce,'id');var _0x34bf19;var _0x4965c7=squel[_0x2254('0x6f')]();_0x4965c7[_0x2254('0x70')](_0x3e7642[_0x2254('0x7e')]);for(var _0x45541b=0x0;_0x45541b<_0xe1abb6[_0x2254('0x39')];_0x45541b+=0x1){_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x71')]?_0x1a44d0[_0xe1abb6[_0x45541b][_0x2254('0x71')]][_0x2254('0x8b')]:_0xe1abb6[_0x45541b][_0x2254('0x72')];_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x74')]?_[_0x2254('0x73')](_0x596eae[_0xe1abb6[_0x45541b][_0x2254('0x74')]],'%s',_0x34bf19):_0x34bf19;_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x8c')]?_[_0x2254('0x73')](_0x739a29[_0xe1abb6[_0x45541b]['format']],'%s',_0x34bf19):_0x34bf19;if(_0xe1abb6[_0x45541b][_0x2254('0x75')]){_0x4965c7[_0x2254('0x69')](_0x34bf19);}_0xe1abb6[_0x45541b]['orderBy']&&_0x4965c7['order'](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x4965c7[_0x2254('0x72')](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x77')]||_0x34bf19);}if(_0x3e7642['joins']){_0x3e7642[_0x2254('0x79')]=JSON['parse'](_0x3e7642['joins']);for(var _0x40fec0=0x0;_0x40fec0<_0x3e7642[_0x2254('0x79')][_0x2254('0x39')];_0x40fec0+=0x1){if(_0x3e7642[_0x2254('0x79')][_0x40fec0]['type']&&_[_0x2254('0x65')](_0x408695,_0x3e7642['joins'][_0x40fec0][_0x2254('0x30')])&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]){_0x4965c7[_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x30')]](_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0x3e7642[_0x2254('0x7e')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]));}}}if(_0x3e7642['conditions']){_0x3e7642[_0x2254('0x7f')]=JSON[_0x2254('0x78')](_0x3e7642[_0x2254('0x7f')]);_0x4965c7[_0x2254('0x3e')](_0xbec5d0(_0x3e7642[_0x2254('0x7f')]['group']));}_0x539aba=_0x4965c7[_0x2254('0x80')]();_0x4965c7[_0x2254('0x20')](_0x59b8af);_0x4965c7['offset'](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4965c7[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4965c7[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')][_0x2254('0xa3')]});}})[_0x2254('0x25')](function(){return{'sql':_0x539aba[_0x2254('0x83')]()};})['then'](respondWithResult(_0x4b3b96,null))[_0x2254('0x46')](handleError(_0x4b3b96,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 48e63fc..74af804 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 _0x6dc5=['define','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x4e2ce2,_0x5d96b4){var _0x5a8d91=function(_0x3aefd1){while(--_0x3aefd1){_0x4e2ce2['push'](_0x4e2ce2['shift']());}};_0x5a8d91(++_0x5d96b4);}(_0x6dc5,0x1f0));var _0x56dc=function(_0x2f9a10,_0x234107){_0x2f9a10=_0x2f9a10-0x0;var _0x20d9bb=_0x6dc5[_0x2f9a10];return _0x20d9bb;};'use strict';var _=require(_0x56dc('0x0'));var util=require(_0x56dc('0x1'));var logger=require(_0x56dc('0x2'))(_0x56dc('0x3'));var moment=require(_0x56dc('0x4'));var BPromise=require(_0x56dc('0x5'));var rp=require(_0x56dc('0x6'));var fs=require('fs');var path=require(_0x56dc('0x7'));var rimraf=require('rimraf');var config=require(_0x56dc('0x8'));var attributes=require(_0x56dc('0x9'));module[_0x56dc('0xa')]=function(_0x308d34,_0x7a58fe){return _0x308d34[_0x56dc('0xb')](_0x56dc('0xc'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4335=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x1c8c45,_0x4c18b0){var _0x1e139a=function(_0x4b5719){while(--_0x4b5719){_0x1c8c45['push'](_0x1c8c45['shift']());}};_0x1e139a(++_0x4c18b0);}(_0x4335,0x108));var _0x5433=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x4335[_0x5ac84c];return _0x3c53d2;};'use strict';var _=require(_0x5433('0x0'));var util=require('util');var logger=require(_0x5433('0x1'))('api');var moment=require(_0x5433('0x2'));var BPromise=require(_0x5433('0x3'));var rp=require(_0x5433('0x4'));var fs=require('fs');var path=require(_0x5433('0x5'));var rimraf=require(_0x5433('0x6'));var config=require('../../config/environment');var attributes=require(_0x5433('0x7'));module['exports']=function(_0x11bb70,_0x2644b1){return _0x11bb70[_0x5433('0x8')](_0x5433('0x9'),attributes,{'tableName':_0x5433('0xa'),'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 52601c2..a1ff986 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 _0x92f1=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2b4aea,_0x19d8ae){var _0x164b9d=function(_0x4c8d4c){while(--_0x4c8d4c){_0x2b4aea['push'](_0x2b4aea['shift']());}};_0x164b9d(++_0x19d8ae);}(_0x92f1,0x149));var _0x192f=function(_0x5c0b91,_0x547a6d){_0x5c0b91=_0x5c0b91-0x0;var _0x106490=_0x92f1[_0x5c0b91];return _0x106490;};'use strict';var _=require(_0x192f('0x0'));var util=require('util');var moment=require(_0x192f('0x1'));var BPromise=require(_0x192f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x192f('0x3'));var db=require(_0x192f('0x4'))['db'];var utils=require(_0x192f('0x5'));var logger=require(_0x192f('0x6'))(_0x192f('0x7'));var config=require(_0x192f('0x8'));var jayson=require(_0x192f('0x9'));var client=jayson[_0x192f('0xa')][_0x192f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27c290,_0x141247,_0x18a67b){return new BPromise(function(_0x8bcbf2,_0x3d454c){return client['request'](_0x27c290,_0x18a67b)[_0x192f('0xc')](function(_0x4d6cc7){logger[_0x192f('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x141247,_0x192f('0xe'));logger[_0x192f('0xf')](_0x192f('0x10'),_0x141247,_0x192f('0xe'),JSON[_0x192f('0x11')](_0x4d6cc7));if(_0x4d6cc7['error']){if(_0x4d6cc7[_0x192f('0x12')][_0x192f('0x13')]===0x1f4){logger[_0x192f('0x12')](_0x192f('0x14'),_0x141247,_0x4d6cc7[_0x192f('0x12')][_0x192f('0x15')]);return _0x3d454c(_0x4d6cc7[_0x192f('0x12')][_0x192f('0x15')]);}logger['error'](_0x192f('0x14'),_0x141247,_0x4d6cc7[_0x192f('0x12')]['message']);return _0x8bcbf2(_0x4d6cc7[_0x192f('0x12')][_0x192f('0x15')]);}else{logger[_0x192f('0xd')](_0x192f('0x14'),_0x141247,'request\x20sent');_0x8bcbf2(_0x4d6cc7[_0x192f('0x16')][_0x192f('0x15')]);}})[_0x192f('0x17')](function(_0x5ae832){logger[_0x192f('0x12')](_0x192f('0x14'),_0x141247,_0x5ae832);_0x3d454c(_0x5ae832);});});}
\ No newline at end of file
+var _0xcaa7=['error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x586837,_0x4f9ed1){var _0xea18c3=function(_0x3682a6){while(--_0x3682a6){_0x586837['push'](_0x586837['shift']());}};_0xea18c3(++_0x4f9ed1);}(_0xcaa7,0x13e));var _0x7caa=function(_0x8e12a1,_0x1c6949){_0x8e12a1=_0x8e12a1-0x0;var _0x4ffbc7=_0xcaa7[_0x8e12a1];return _0x4ffbc7;};'use strict';var _=require(_0x7caa('0x0'));var util=require(_0x7caa('0x1'));var moment=require('moment');var BPromise=require(_0x7caa('0x2'));var rs=require(_0x7caa('0x3'));var fs=require('fs');var Redis=require(_0x7caa('0x4'));var db=require(_0x7caa('0x5'))['db'];var utils=require(_0x7caa('0x6'));var logger=require(_0x7caa('0x7'))(_0x7caa('0x8'));var config=require(_0x7caa('0x9'));var jayson=require(_0x7caa('0xa'));var client=jayson[_0x7caa('0xb')][_0x7caa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x503509,_0x49fe5b,_0x267f47){return new BPromise(function(_0x3318e7,_0x3c7d8c){return client[_0x7caa('0xd')](_0x503509,_0x267f47)[_0x7caa('0xe')](function(_0x531c5f){logger['info'](_0x7caa('0xf'),_0x49fe5b,_0x7caa('0x10'));logger[_0x7caa('0x11')](_0x7caa('0x12'),_0x49fe5b,_0x7caa('0x10'),JSON[_0x7caa('0x13')](_0x531c5f));if(_0x531c5f['error']){if(_0x531c5f[_0x7caa('0x14')][_0x7caa('0x15')]===0x1f4){logger[_0x7caa('0x14')](_0x7caa('0xf'),_0x49fe5b,_0x531c5f['error'][_0x7caa('0x16')]);return _0x3c7d8c(_0x531c5f[_0x7caa('0x14')]['message']);}logger[_0x7caa('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x49fe5b,_0x531c5f[_0x7caa('0x14')][_0x7caa('0x16')]);return _0x3318e7(_0x531c5f[_0x7caa('0x14')][_0x7caa('0x16')]);}else{logger[_0x7caa('0x17')](_0x7caa('0xf'),_0x49fe5b,_0x7caa('0x10'));_0x3318e7(_0x531c5f[_0x7caa('0x18')]['message']);}})[_0x7caa('0x19')](function(_0x3c800f){logger[_0x7caa('0x14')](_0x7caa('0xf'),_0x49fe5b,_0x3c800f);_0x3c7d8c(_0x3c800f);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index c2b86f7..83b9f8b 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 _0xa070=['update','delete','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/preview','preview','run','/:id/query','query','post','create','put'];(function(_0xddf23b,_0x3b3b77){var _0x100b75=function(_0x413058){while(--_0x413058){_0xddf23b['push'](_0xddf23b['shift']());}};_0x100b75(++_0x3b3b77);}(_0xa070,0x94));var _0x0a07=function(_0x1185e9,_0x34e1a5){_0x1185e9=_0x1185e9-0x0;var _0x91cf24=_0xa070[_0x1185e9];return _0x91cf24;};'use strict';var multer=require(_0x0a07('0x0'));var util=require(_0x0a07('0x1'));var path=require('path');var timeout=require(_0x0a07('0x2'));var express=require(_0x0a07('0x3'));var router=express[_0x0a07('0x4')]();var fs_extra=require(_0x0a07('0x5'));var auth=require(_0x0a07('0x6'));var interaction=require(_0x0a07('0x7'));var config=require(_0x0a07('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0x0a07('0x9')]('/',auth[_0x0a07('0xa')](),controller['index']);router[_0x0a07('0x9')]('/:id',auth[_0x0a07('0xa')](),controller[_0x0a07('0xb')]);router[_0x0a07('0x9')](_0x0a07('0xc'),auth['isAuthenticated'](),controller[_0x0a07('0xd')]);router['get']('/:id/run',auth[_0x0a07('0xa')](),controller[_0x0a07('0xe')]);router['get'](_0x0a07('0xf'),auth[_0x0a07('0xa')](),controller[_0x0a07('0x10')]);router[_0x0a07('0x11')]('/',auth[_0x0a07('0xa')](),controller[_0x0a07('0x12')]);router[_0x0a07('0x13')]('/:id',auth[_0x0a07('0xa')](),controller[_0x0a07('0x14')]);router[_0x0a07('0x15')](_0x0a07('0x16'),auth[_0x0a07('0xa')](),controller[_0x0a07('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x3139=['get','isAuthenticated','index','show','preview','/:id/run','run','query','post','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller'];(function(_0xedbd17,_0x2d79af){var _0x18b70e=function(_0x5f52d6){while(--_0x5f52d6){_0xedbd17['push'](_0xedbd17['shift']());}};_0x18b70e(++_0x2d79af);}(_0x3139,0x138));var _0x9313=function(_0x4ba1bf,_0x37cbdb){_0x4ba1bf=_0x4ba1bf-0x0;var _0x160d78=_0x3139[_0x4ba1bf];return _0x160d78;};'use strict';var multer=require(_0x9313('0x0'));var util=require(_0x9313('0x1'));var path=require(_0x9313('0x2'));var timeout=require(_0x9313('0x3'));var express=require('express');var router=express[_0x9313('0x4')]();var fs_extra=require(_0x9313('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9313('0x6'));var config=require('../../config/environment');var controller=require(_0x9313('0x7'));router[_0x9313('0x8')]('/',auth[_0x9313('0x9')](),controller[_0x9313('0xa')]);router['get']('/:id',auth[_0x9313('0x9')](),controller[_0x9313('0xb')]);router['get']('/:id/preview',auth[_0x9313('0x9')](),controller[_0x9313('0xc')]);router['get'](_0x9313('0xd'),auth[_0x9313('0x9')](),controller[_0x9313('0xe')]);router[_0x9313('0x8')]('/:id/query',auth[_0x9313('0x9')](),controller[_0x9313('0xf')]);router[_0x9313('0x10')]('/',auth[_0x9313('0x9')](),controller['create']);router['put'](_0x9313('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9313('0x11'),auth[_0x9313('0x9')](),controller[_0x9313('0x12')]);module[_0x9313('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 59c88a5..0fc65dc 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 _0xa6f4=['manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE'];(function(_0x2764a4,_0xe2816d){var _0x1100ed=function(_0x1b3794){while(--_0x1b3794){_0x2764a4['push'](_0x2764a4['shift']());}};_0x1100ed(++_0xe2816d);}(_0xa6f4,0x1f2));var _0x4a6f=function(_0x589fab,_0x114e95){_0x589fab=_0x589fab-0x0;var _0x454a2e=_0xa6f4[_0x589fab];return _0x454a2e;};'use strict';var Sequelize=require(_0x4a6f('0x0'));var moment=require(_0x4a6f('0x1'));module[_0x4a6f('0x2')]={'name':{'type':Sequelize[_0x4a6f('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x4a6f('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x4a6f('0x4')](_0x4a6f('0x5'),'pdf',_0x4a6f('0x6')),'allowNull':![],'defaultValue':_0x4a6f('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x4a6f('0x7')]},'endDate':{'type':Sequelize[_0x4a6f('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x4a6f('0x8'),_0x4a6f('0x9')),'allowNull':![],'defaultValue':_0x4a6f('0x8')},'reportId':{'type':Sequelize[_0x4a6f('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6f6e=['DATE','scheduled','INTEGER','UNSIGNED','sequelize','STRING','csv'];(function(_0xafa717,_0x597a44){var _0x2614b6=function(_0x289f64){while(--_0x289f64){_0xafa717['push'](_0xafa717['shift']());}};_0x2614b6(++_0x597a44);}(_0x6f6e,0x115));var _0xe6f6=function(_0x2aa886,_0x16b6a4){_0x2aa886=_0x2aa886-0x0;var _0xd6ff3a=_0x6f6e[_0x2aa886];return _0xd6ff3a;};'use strict';var Sequelize=require(_0xe6f6('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0xe6f6('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xe6f6('0x2'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xe6f6('0x3')]},'endDate':{'type':Sequelize[_0xe6f6('0x3')]},'status':{'type':Sequelize[_0xe6f6('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0xe6f6('0x4')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xe6f6('0x5')](0xb)[_0xe6f6('0x6')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index b03d9e4..81e33c1 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 _0x2bea=['mustache','sox','to-csv','ejs','fs-extra','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','join','server/files/reports','Sequelize','root','format','%s.%s','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x438207,_0x525a5b){var _0x106e22=function(_0x24bd32){while(--_0x24bd32){_0x438207['push'](_0x438207['shift']());}};_0x106e22(++_0x525a5b);}(_0x2bea,0x10d));var _0xa2be=function(_0x3bd9ed,_0x4d40b6){_0x3bd9ed=_0x3bd9ed-0x0;var _0x18e6c5=_0x2bea[_0x3bd9ed];return _0x18e6c5;};'use strict';var emlformat=require(_0xa2be('0x0'));var rimraf=require(_0xa2be('0x1'));var zipdir=require(_0xa2be('0x2'));var jsonpatch=require(_0xa2be('0x3'));var rp=require(_0xa2be('0x4'));var moment=require(_0xa2be('0x5'));var BPromise=require(_0xa2be('0x6'));var Mustache=require(_0xa2be('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa2be('0x8'));var csv=require(_0xa2be('0x9'));var ejs=require(_0xa2be('0xa'));var fs=require('fs');var fs_extra=require(_0xa2be('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa2be('0xc'));var toCsv=require(_0xa2be('0x9'));var querystring=require(_0xa2be('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa2be('0xe'));var as=require(_0xa2be('0xf'));var hardwareService=require(_0xa2be('0x10'));var logger=require(_0xa2be('0x11'))(_0xa2be('0x12'));var utils=require(_0xa2be('0x13'));var config=require(_0xa2be('0x14'));var licenseUtil=require(_0xa2be('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1976db,_0x10c072){_0x10c072=_0x10c072||0xcc;return function(_0x1b5086){if(_0x1b5086){return _0x1976db[_0xa2be('0x16')](_0x10c072);}return _0x1976db[_0xa2be('0x17')](_0x10c072)[_0xa2be('0x18')]();};}function respondWithResult(_0x5797a6,_0x4de4a3){_0x4de4a3=_0x4de4a3||0xc8;return function(_0xcd2fb8){if(_0xcd2fb8){return _0x5797a6[_0xa2be('0x17')](_0x4de4a3)[_0xa2be('0x19')](_0xcd2fb8);}};}function respondWithFilteredResult(_0x46fa89,_0x500e0d){return function(_0x4cec0c){if(_0x4cec0c){var _0x57c3ac=typeof _0x500e0d['offset']===_0xa2be('0x1a')&&typeof _0x500e0d[_0xa2be('0x1b')]===_0xa2be('0x1a');var _0x360098=_0x4cec0c['count'];var _0x88d53=_0x57c3ac?0x0:_0x500e0d['offset'];var _0x3497e2=_0x57c3ac?_0x4cec0c[_0xa2be('0x1c')]:_0x500e0d[_0xa2be('0x1d')]+_0x500e0d[_0xa2be('0x1b')];var _0x52b678;if(_0x3497e2>=_0x360098){_0x3497e2=_0x360098;_0x52b678=0xc8;}else{_0x52b678=0xce;}_0x46fa89[_0xa2be('0x17')](_0x52b678);return _0x46fa89['set'](_0xa2be('0x1e'),_0x88d53+'-'+_0x3497e2+'/'+_0x360098)[_0xa2be('0x19')](_0x4cec0c);}return null;};}function patchUpdates(_0x3bc248){return function(_0x5456f9){try{jsonpatch[_0xa2be('0x1f')](_0x5456f9,_0x3bc248,!![]);}catch(_0x334c93){return BPromise[_0xa2be('0x20')](_0x334c93);}return _0x5456f9[_0xa2be('0x21')]();};}function saveUpdates(_0x58975b,_0x1c0ecb){return function(_0x3999ca){if(_0x3999ca){return _0x3999ca[_0xa2be('0x22')](_0x58975b)[_0xa2be('0x23')](function(_0x3ffdcb){return _0x3ffdcb;});}return null;};}function removeEntity(_0x1944ee,_0x56d8c9){return function(_0x32afc6){if(_0x32afc6){return _0x32afc6[_0xa2be('0x24')]()[_0xa2be('0x23')](function(){var _0x4e9486=_0x32afc6[_0xa2be('0x25')]({'plain':!![]});var _0x5c2109='ExtractedReports';return db[_0xa2be('0x26')][_0xa2be('0x24')]({'where':{'type':_0x5c2109,'resourceId':_0x4e9486['id']}})[_0xa2be('0x23')](function(){return _0x32afc6;});})[_0xa2be('0x23')](function(){_0x1944ee[_0xa2be('0x17')](0xcc)[_0xa2be('0x18')]();});}};}function handleEntityNotFound(_0x56e465,_0x3b40a4){return function(_0x2fadec){if(!_0x2fadec){_0x56e465[_0xa2be('0x16')](0x194);}return _0x2fadec;};}function handleError(_0x26dd6d,_0x79ce88){_0x79ce88=_0x79ce88||0x1f4;return function(_0x1abcfa){logger[_0xa2be('0x27')](_0x1abcfa[_0xa2be('0x28')]);if(_0x1abcfa[_0xa2be('0x29')]){delete _0x1abcfa['name'];}_0x26dd6d['status'](_0x79ce88)[_0xa2be('0x2a')](_0x1abcfa);};}exports['index']=function(_0x4648fd,_0x5250d2){var _0x218ef0={},_0x423e29={},_0x2b3100={'count':0x0,'rows':[]};var _0x488bf8=_[_0xa2be('0x2b')](db[_0xa2be('0x2c')]['rawAttributes'],function(_0x2a25e2){return{'name':_0x2a25e2[_0xa2be('0x2d')],'type':_0x2a25e2[_0xa2be('0x2e')][_0xa2be('0x2f')]};});_0x423e29[_0xa2be('0x30')]=_[_0xa2be('0x2b')](_0x488bf8,'name');_0x423e29[_0xa2be('0x31')]=_['keys'](_0x4648fd[_0xa2be('0x31')]);_0x423e29[_0xa2be('0x32')]=_[_0xa2be('0x33')](_0x423e29[_0xa2be('0x30')],_0x423e29[_0xa2be('0x31')]);_0x218ef0[_0xa2be('0x34')]=_['intersection'](_0x423e29[_0xa2be('0x30')],qs['fields'](_0x4648fd[_0xa2be('0x31')][_0xa2be('0x35')]));_0x218ef0[_0xa2be('0x34')]=_0x218ef0[_0xa2be('0x34')][_0xa2be('0x36')]?_0x218ef0['attributes']:_0x423e29['model'];if(!_0x4648fd[_0xa2be('0x31')]['hasOwnProperty'](_0xa2be('0x37'))){_0x218ef0[_0xa2be('0x1b')]=qs[_0xa2be('0x1b')](_0x4648fd[_0xa2be('0x31')][_0xa2be('0x1b')]);_0x218ef0[_0xa2be('0x1d')]=qs[_0xa2be('0x1d')](_0x4648fd[_0xa2be('0x31')][_0xa2be('0x1d')]);}_0x218ef0[_0xa2be('0x38')]=qs[_0xa2be('0x39')](_0x4648fd['query'][_0xa2be('0x39')]);_0x218ef0['where']=qs[_0xa2be('0x32')](_[_0xa2be('0x3a')](_0x4648fd[_0xa2be('0x31')],_0x423e29[_0xa2be('0x32')]),_0x488bf8);if(_0x4648fd[_0xa2be('0x31')][_0xa2be('0x3b')]){_0x218ef0[_0xa2be('0x3c')]=_[_0xa2be('0x3d')](_0x218ef0[_0xa2be('0x3c')],{'$or':_['map'](_0x488bf8,function(_0x34578d){if(_0x34578d['type']!==_0xa2be('0x3e')){var _0x5bb0a6={};_0x5bb0a6[_0x34578d['name']]={'$like':'%'+_0x4648fd['query'][_0xa2be('0x3b')]+'%'};return _0x5bb0a6;}})});}_0x218ef0=_[_0xa2be('0x3d')]({},_0x218ef0,_0x4648fd[_0xa2be('0x3f')]);var _0x24dc88={'where':_0x218ef0[_0xa2be('0x3c')]};return db[_0xa2be('0x2c')][_0xa2be('0x1c')](_0x24dc88)[_0xa2be('0x23')](function(_0x263473){_0x2b3100[_0xa2be('0x1c')]=_0x263473;if(_0x4648fd[_0xa2be('0x31')]['includeAll']){_0x218ef0[_0xa2be('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xa2be('0x41')](_0x218ef0);})[_0xa2be('0x23')](function(_0x434133){_0x2b3100[_0xa2be('0x42')]=_0x434133;return _0x2b3100;})['then'](respondWithFilteredResult(_0x5250d2,_0x218ef0))[_0xa2be('0x43')](handleError(_0x5250d2,null));};exports[_0xa2be('0x44')]=function(_0x2cf4d7,_0x4eefd4){var _0x43614a={'raw':!![],'where':{'id':_0x2cf4d7['params']['id']}},_0x4c081b={};_0x4c081b['model']=_[_0xa2be('0x45')](db[_0xa2be('0x2c')][_0xa2be('0x46')]);_0x4c081b[_0xa2be('0x31')]=_[_0xa2be('0x45')](_0x2cf4d7[_0xa2be('0x31')]);_0x4c081b[_0xa2be('0x32')]=_[_0xa2be('0x33')](_0x4c081b['model'],_0x4c081b[_0xa2be('0x31')]);_0x43614a['attributes']=_['intersection'](_0x4c081b[_0xa2be('0x30')],qs['fields'](_0x2cf4d7[_0xa2be('0x31')][_0xa2be('0x35')]));_0x43614a['attributes']=_0x43614a['attributes']['length']?_0x43614a[_0xa2be('0x34')]:_0x4c081b[_0xa2be('0x30')];if(_0x2cf4d7[_0xa2be('0x31')]['includeAll']){_0x43614a[_0xa2be('0x40')]=[{'all':!![]}];}_0x43614a=_[_0xa2be('0x3d')]({},_0x43614a,_0x2cf4d7['options']);return db['AnalyticExtractedReport'][_0xa2be('0x47')](_0x43614a)[_0xa2be('0x23')](handleEntityNotFound(_0x4eefd4,null))['then'](respondWithResult(_0x4eefd4,null))[_0xa2be('0x43')](handleError(_0x4eefd4,null));};exports[_0xa2be('0x48')]=function(_0x174669,_0x31bb10){return db[_0xa2be('0x2c')]['create'](_0x174669[_0xa2be('0x49')],{})['then'](function(_0x5ed893){var _0xc75b70=_0x174669['user'][_0xa2be('0x25')]({'plain':!![]});if(!_0xc75b70)throw new Error(_0xa2be('0x4a'));if(_0xc75b70[_0xa2be('0x4b')]===_0xa2be('0x4c')){var _0x5a1202=_0x5ed893['get']({'plain':!![]});var _0x3f7686=_0xa2be('0x4d');return db[_0xa2be('0x4e')]['find']({'where':{'name':_0x3f7686,'userProfileId':_0xc75b70['userProfileId']},'raw':!![]})[_0xa2be('0x23')](function(_0x41e2ce){if(_0x41e2ce&&_0x41e2ce['autoAssociation']===0x0){return db['UserProfileResource'][_0xa2be('0x48')]({'name':_0x5a1202[_0xa2be('0x29')],'resourceId':_0x5a1202['id'],'type':_0x41e2ce['name'],'sectionId':_0x41e2ce['id']},{})['then'](function(){return _0x5ed893;});}else{return _0x5ed893;}})['catch'](function(_0x5edca7){logger[_0xa2be('0x27')](_0xa2be('0x4f'),_0x5edca7);throw _0x5edca7;});}return _0x5ed893;})[_0xa2be('0x23')](respondWithResult(_0x31bb10,0xc9))[_0xa2be('0x43')](handleError(_0x31bb10,null));};exports[_0xa2be('0x22')]=function(_0xe37b11,_0x46f635){if(_0xe37b11['body']['id']){delete _0xe37b11[_0xa2be('0x49')]['id'];}return db[_0xa2be('0x2c')][_0xa2be('0x47')]({'where':{'id':_0xe37b11[_0xa2be('0x50')]['id']}})[_0xa2be('0x23')](handleEntityNotFound(_0x46f635,null))[_0xa2be('0x23')](saveUpdates(_0xe37b11[_0xa2be('0x49')],null))[_0xa2be('0x23')](respondWithResult(_0x46f635,null))[_0xa2be('0x43')](handleError(_0x46f635,null));};exports[_0xa2be('0x24')]=function(_0x2fa181,_0x18c7db){return db['AnalyticExtractedReport'][_0xa2be('0x47')]({'where':{'id':_0x2fa181[_0xa2be('0x50')]['id']}})['then'](handleEntityNotFound(_0x18c7db,null))['then'](removeEntity(_0x18c7db,null))['catch'](handleError(_0x18c7db,null));};exports[_0xa2be('0x51')]=function(_0x1712ed,_0x28ae8c,_0x709b74){return db['AnalyticExtractedReport'][_0xa2be('0x47')]({'where':{'id':_0x1712ed[_0xa2be('0x50')]['id']},'attributes':[_0xa2be('0x29'),'basename',_0xa2be('0x52'),_0xa2be('0x53')],'raw':!![]})[_0xa2be('0x23')](handleEntityNotFound(_0x28ae8c,null))[_0xa2be('0x23')](function(_0x11b64e){if(_0x11b64e){if(!fs[_0xa2be('0x54')](path[_0xa2be('0x55')](config['root'],_0xa2be('0x56'),_0x11b64e['savename']))){throw new db[(_0xa2be('0x57'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x1712ed[_0xa2be('0x31')]['exists']){return _0x28ae8c['sendStatus'](0xc8);}return _0x28ae8c[_0xa2be('0x51')](path[_0xa2be('0x55')](config[_0xa2be('0x58')],'server/files/reports',_0x11b64e[_0xa2be('0x52')]),util[_0xa2be('0x59')](_0xa2be('0x5a'),_0x11b64e[_0xa2be('0x5b')]||_0x11b64e[_0xa2be('0x29')],_0x11b64e['output']['toLowerCase']()));}})[_0xa2be('0x43')](handleError(_0x28ae8c,null));};
\ No newline at end of file
+var _0xa828=['eml-format','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase'];(function(_0x9f709c,_0x4e4f4d){var _0x4d1c7c=function(_0x2ce156){while(--_0x2ce156){_0x9f709c['push'](_0x9f709c['shift']());}};_0x4d1c7c(++_0x4e4f4d);}(_0xa828,0x126));var _0x8a82=function(_0x49f42e,_0x4a370d){_0x49f42e=_0x49f42e-0x0;var _0xbb9128=_0xa828[_0x49f42e];return _0xbb9128;};'use strict';var emlformat=require(_0x8a82('0x0'));var rimraf=require(_0x8a82('0x1'));var zipdir=require(_0x8a82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8a82('0x3'));var Mustache=require(_0x8a82('0x4'));var util=require(_0x8a82('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8a82('0x6'));var ejs=require(_0x8a82('0x7'));var fs=require('fs');var fs_extra=require(_0x8a82('0x8'));var _=require(_0x8a82('0x9'));var squel=require(_0x8a82('0xa'));var crypto=require(_0x8a82('0xb'));var jsforce=require(_0x8a82('0xc'));var deskjs=require(_0x8a82('0xd'));var toCsv=require(_0x8a82('0x6'));var querystring=require('querystring');var Papa=require(_0x8a82('0xe'));var Redis=require(_0x8a82('0xf'));var authService=require(_0x8a82('0x10'));var qs=require(_0x8a82('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a82('0x12'));var logger=require(_0x8a82('0x13'))('api');var utils=require(_0x8a82('0x14'));var config=require(_0x8a82('0x15'));var licenseUtil=require(_0x8a82('0x16'));var db=require(_0x8a82('0x17'))['db'];function respondWithStatusCode(_0x48be57,_0x1b105e){_0x1b105e=_0x1b105e||0xcc;return function(_0x37dba6){if(_0x37dba6){return _0x48be57[_0x8a82('0x18')](_0x1b105e);}return _0x48be57['status'](_0x1b105e)[_0x8a82('0x19')]();};}function respondWithResult(_0x40d8ef,_0x36b379){_0x36b379=_0x36b379||0xc8;return function(_0x10477b){if(_0x10477b){return _0x40d8ef[_0x8a82('0x1a')](_0x36b379)[_0x8a82('0x1b')](_0x10477b);}};}function respondWithFilteredResult(_0xd4b1f4,_0x51751b){return function(_0x4023eb){if(_0x4023eb){var _0x414a74=typeof _0x51751b['offset']==='undefined'&&typeof _0x51751b['limit']==='undefined';var _0xf94f21=_0x4023eb['count'];var _0x1a058e=_0x414a74?0x0:_0x51751b[_0x8a82('0x1c')];var _0xae790f=_0x414a74?_0x4023eb[_0x8a82('0x1d')]:_0x51751b['offset']+_0x51751b['limit'];var _0x5e9a95;if(_0xae790f>=_0xf94f21){_0xae790f=_0xf94f21;_0x5e9a95=0xc8;}else{_0x5e9a95=0xce;}_0xd4b1f4[_0x8a82('0x1a')](_0x5e9a95);return _0xd4b1f4[_0x8a82('0x1e')](_0x8a82('0x1f'),_0x1a058e+'-'+_0xae790f+'/'+_0xf94f21)[_0x8a82('0x1b')](_0x4023eb);}return null;};}function patchUpdates(_0x16e831){return function(_0x545d14){try{jsonpatch[_0x8a82('0x20')](_0x545d14,_0x16e831,!![]);}catch(_0x4bb49c){return BPromise[_0x8a82('0x21')](_0x4bb49c);}return _0x545d14[_0x8a82('0x22')]();};}function saveUpdates(_0x4a940a,_0x202cb8){return function(_0x286af5){if(_0x286af5){return _0x286af5[_0x8a82('0x23')](_0x4a940a)[_0x8a82('0x24')](function(_0x530dad){return _0x530dad;});}return null;};}function removeEntity(_0x250241,_0x1b5e76){return function(_0x11e66c){if(_0x11e66c){return _0x11e66c[_0x8a82('0x25')]()[_0x8a82('0x24')](function(){var _0x433e65=_0x11e66c[_0x8a82('0x26')]({'plain':!![]});var _0x55597b=_0x8a82('0x27');return db[_0x8a82('0x28')]['destroy']({'where':{'type':_0x55597b,'resourceId':_0x433e65['id']}})['then'](function(){return _0x11e66c;});})['then'](function(){_0x250241[_0x8a82('0x1a')](0xcc)[_0x8a82('0x19')]();});}};}function handleEntityNotFound(_0x2f7378,_0x3d2baf){return function(_0x50012d){if(!_0x50012d){_0x2f7378[_0x8a82('0x18')](0x194);}return _0x50012d;};}function handleError(_0xb3d2cc,_0x2a1df7){_0x2a1df7=_0x2a1df7||0x1f4;return function(_0xf060d0){logger['error'](_0xf060d0[_0x8a82('0x29')]);if(_0xf060d0[_0x8a82('0x2a')]){delete _0xf060d0[_0x8a82('0x2a')];}_0xb3d2cc[_0x8a82('0x1a')](_0x2a1df7)['send'](_0xf060d0);};}exports['index']=function(_0x3edf47,_0x254284){var _0x5356e1={},_0x3882d1={},_0x53657c={'count':0x0,'rows':[]};var _0x5043c8=_[_0x8a82('0x2b')](db[_0x8a82('0x2c')][_0x8a82('0x2d')],function(_0x38de7e){return{'name':_0x38de7e[_0x8a82('0x2e')],'type':_0x38de7e[_0x8a82('0x2f')][_0x8a82('0x30')]};});_0x3882d1['model']=_[_0x8a82('0x2b')](_0x5043c8,'name');_0x3882d1[_0x8a82('0x31')]=_[_0x8a82('0x32')](_0x3edf47[_0x8a82('0x31')]);_0x3882d1[_0x8a82('0x33')]=_['intersection'](_0x3882d1[_0x8a82('0x34')],_0x3882d1['query']);_0x5356e1[_0x8a82('0x35')]=_[_0x8a82('0x36')](_0x3882d1[_0x8a82('0x34')],qs[_0x8a82('0x37')](_0x3edf47[_0x8a82('0x31')][_0x8a82('0x37')]));_0x5356e1[_0x8a82('0x35')]=_0x5356e1[_0x8a82('0x35')][_0x8a82('0x38')]?_0x5356e1[_0x8a82('0x35')]:_0x3882d1['model'];if(!_0x3edf47[_0x8a82('0x31')][_0x8a82('0x39')](_0x8a82('0x3a'))){_0x5356e1[_0x8a82('0x3b')]=qs['limit'](_0x3edf47[_0x8a82('0x31')][_0x8a82('0x3b')]);_0x5356e1['offset']=qs[_0x8a82('0x1c')](_0x3edf47[_0x8a82('0x31')][_0x8a82('0x1c')]);}_0x5356e1[_0x8a82('0x3c')]=qs[_0x8a82('0x3d')](_0x3edf47[_0x8a82('0x31')][_0x8a82('0x3d')]);_0x5356e1[_0x8a82('0x3e')]=qs['filters'](_[_0x8a82('0x3f')](_0x3edf47[_0x8a82('0x31')],_0x3882d1[_0x8a82('0x33')]),_0x5043c8);if(_0x3edf47[_0x8a82('0x31')][_0x8a82('0x40')]){_0x5356e1[_0x8a82('0x3e')]=_[_0x8a82('0x41')](_0x5356e1[_0x8a82('0x3e')],{'$or':_[_0x8a82('0x2b')](_0x5043c8,function(_0x4c8a12){if(_0x4c8a12['type']!==_0x8a82('0x42')){var _0x5049af={};_0x5049af[_0x4c8a12[_0x8a82('0x2a')]]={'$like':'%'+_0x3edf47[_0x8a82('0x31')][_0x8a82('0x40')]+'%'};return _0x5049af;}})});}_0x5356e1=_[_0x8a82('0x41')]({},_0x5356e1,_0x3edf47[_0x8a82('0x43')]);var _0x3838e9={'where':_0x5356e1[_0x8a82('0x3e')]};return db[_0x8a82('0x2c')][_0x8a82('0x1d')](_0x3838e9)['then'](function(_0x4094bf){_0x53657c['count']=_0x4094bf;if(_0x3edf47['query'][_0x8a82('0x44')]){_0x5356e1[_0x8a82('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8a82('0x46')](_0x5356e1);})[_0x8a82('0x24')](function(_0x4278a9){_0x53657c[_0x8a82('0x47')]=_0x4278a9;return _0x53657c;})['then'](respondWithFilteredResult(_0x254284,_0x5356e1))['catch'](handleError(_0x254284,null));};exports[_0x8a82('0x48')]=function(_0x523e97,_0x4ce275){var _0x4e252a={'raw':!![],'where':{'id':_0x523e97[_0x8a82('0x49')]['id']}},_0x1906c7={};_0x1906c7[_0x8a82('0x34')]=_['keys'](db['AnalyticExtractedReport'][_0x8a82('0x2d')]);_0x1906c7[_0x8a82('0x31')]=_[_0x8a82('0x32')](_0x523e97['query']);_0x1906c7['filters']=_[_0x8a82('0x36')](_0x1906c7['model'],_0x1906c7[_0x8a82('0x31')]);_0x4e252a[_0x8a82('0x35')]=_[_0x8a82('0x36')](_0x1906c7[_0x8a82('0x34')],qs[_0x8a82('0x37')](_0x523e97[_0x8a82('0x31')][_0x8a82('0x37')]));_0x4e252a['attributes']=_0x4e252a['attributes'][_0x8a82('0x38')]?_0x4e252a[_0x8a82('0x35')]:_0x1906c7['model'];if(_0x523e97['query'][_0x8a82('0x44')]){_0x4e252a[_0x8a82('0x45')]=[{'all':!![]}];}_0x4e252a=_[_0x8a82('0x41')]({},_0x4e252a,_0x523e97[_0x8a82('0x43')]);return db[_0x8a82('0x2c')][_0x8a82('0x4a')](_0x4e252a)[_0x8a82('0x24')](handleEntityNotFound(_0x4ce275,null))[_0x8a82('0x24')](respondWithResult(_0x4ce275,null))['catch'](handleError(_0x4ce275,null));};exports[_0x8a82('0x4b')]=function(_0x1df856,_0x16d2a1){return db['AnalyticExtractedReport'][_0x8a82('0x4b')](_0x1df856[_0x8a82('0x4c')],{})[_0x8a82('0x24')](function(_0x47ba21){var _0x2d1c6d=_0x1df856[_0x8a82('0x4d')][_0x8a82('0x26')]({'plain':!![]});if(!_0x2d1c6d)throw new Error(_0x8a82('0x4e'));if(_0x2d1c6d['role']===_0x8a82('0x4d')){var _0x4e7783=_0x47ba21['get']({'plain':!![]});var _0x3dc236=_0x8a82('0x27');return db['UserProfileSection'][_0x8a82('0x4a')]({'where':{'name':_0x3dc236,'userProfileId':_0x2d1c6d[_0x8a82('0x4f')]},'raw':!![]})[_0x8a82('0x24')](function(_0x5d7c7c){if(_0x5d7c7c&&_0x5d7c7c[_0x8a82('0x50')]===0x0){return db['UserProfileResource'][_0x8a82('0x4b')]({'name':_0x4e7783[_0x8a82('0x2a')],'resourceId':_0x4e7783['id'],'type':_0x5d7c7c[_0x8a82('0x2a')],'sectionId':_0x5d7c7c['id']},{})[_0x8a82('0x24')](function(){return _0x47ba21;});}else{return _0x47ba21;}})[_0x8a82('0x51')](function(_0x5799b0){logger['error'](_0x8a82('0x52'),_0x5799b0);throw _0x5799b0;});}return _0x47ba21;})[_0x8a82('0x24')](respondWithResult(_0x16d2a1,0xc9))[_0x8a82('0x51')](handleError(_0x16d2a1,null));};exports[_0x8a82('0x23')]=function(_0x469c94,_0x41eaf4){if(_0x469c94[_0x8a82('0x4c')]['id']){delete _0x469c94[_0x8a82('0x4c')]['id'];}return db[_0x8a82('0x2c')]['find']({'where':{'id':_0x469c94[_0x8a82('0x49')]['id']}})[_0x8a82('0x24')](handleEntityNotFound(_0x41eaf4,null))[_0x8a82('0x24')](saveUpdates(_0x469c94[_0x8a82('0x4c')],null))[_0x8a82('0x24')](respondWithResult(_0x41eaf4,null))[_0x8a82('0x51')](handleError(_0x41eaf4,null));};exports[_0x8a82('0x25')]=function(_0x14f9a6,_0x5e44ef){return db[_0x8a82('0x2c')][_0x8a82('0x4a')]({'where':{'id':_0x14f9a6[_0x8a82('0x49')]['id']}})[_0x8a82('0x24')](handleEntityNotFound(_0x5e44ef,null))[_0x8a82('0x24')](removeEntity(_0x5e44ef,null))['catch'](handleError(_0x5e44ef,null));};exports[_0x8a82('0x53')]=function(_0x2799d5,_0x327440,_0x1f08f7){return db['AnalyticExtractedReport'][_0x8a82('0x4a')]({'where':{'id':_0x2799d5[_0x8a82('0x49')]['id']},'attributes':['name',_0x8a82('0x54'),_0x8a82('0x55'),_0x8a82('0x56')],'raw':!![]})[_0x8a82('0x24')](handleEntityNotFound(_0x327440,null))[_0x8a82('0x24')](function(_0x34a0df){if(_0x34a0df){if(!fs[_0x8a82('0x57')](path[_0x8a82('0x58')](config[_0x8a82('0x59')],_0x8a82('0x5a'),_0x34a0df[_0x8a82('0x55')]))){throw new db[(_0x8a82('0x5b'))][(_0x8a82('0x5c'))](_0x8a82('0x5d'));}if(_0x2799d5[_0x8a82('0x31')][_0x8a82('0x5e')]){return _0x327440[_0x8a82('0x18')](0xc8);}return _0x327440[_0x8a82('0x53')](path[_0x8a82('0x58')](config['root'],_0x8a82('0x5a'),_0x34a0df[_0x8a82('0x55')]),util[_0x8a82('0x5f')](_0x8a82('0x60'),_0x34a0df[_0x8a82('0x54')]||_0x34a0df[_0x8a82('0x2a')],_0x34a0df['output'][_0x8a82('0x61')]()));}})[_0x8a82('0x51')](handleError(_0x327440,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 2730b4d..9d5e50a 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 _0x8878=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x254dc4,_0x32c927){var _0x21901a=function(_0x54f55a){while(--_0x54f55a){_0x254dc4['push'](_0x254dc4['shift']());}};_0x21901a(++_0x32c927);}(_0x8878,0xea));var _0x8887=function(_0xf3897e,_0x3ac8b7){_0xf3897e=_0xf3897e-0x0;var _0x26b187=_0x8878[_0xf3897e];return _0x26b187;};'use strict';var _=require('lodash');var util=require(_0x8887('0x0'));var logger=require('../../config/logger')(_0x8887('0x1'));var moment=require(_0x8887('0x2'));var BPromise=require(_0x8887('0x3'));var rp=require(_0x8887('0x4'));var fs=require('fs');var path=require(_0x8887('0x5'));var rimraf=require(_0x8887('0x6'));var config=require(_0x8887('0x7'));var attributes=require(_0x8887('0x8'));module[_0x8887('0x9')]=function(_0x5f2c25,_0x148d01){return _0x5f2c25[_0x8887('0xa')](_0x8887('0xb'),attributes,{'tableName':_0x8887('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x84cb=['analytics_extracted_reports','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0x84cb,0x90));var _0xb84c=function(_0x5ccfa9,_0x415e4d){_0x5ccfa9=_0x5ccfa9-0x0;var _0x228ced=_0x84cb[_0x5ccfa9];return _0x228ced;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb84c('0x0'))(_0xb84c('0x1'));var moment=require(_0xb84c('0x2'));var BPromise=require(_0xb84c('0x3'));var rp=require(_0xb84c('0x4'));var fs=require('fs');var path=require(_0xb84c('0x5'));var rimraf=require(_0xb84c('0x6'));var config=require(_0xb84c('0x7'));var attributes=require(_0xb84c('0x8'));module[_0xb84c('0x9')]=function(_0x7753a4,_0xc7f346){return _0x7753a4[_0xb84c('0xa')](_0xb84c('0xb'),attributes,{'tableName':_0xb84c('0xc'),'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 4530bd6..ee5b0bc 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 _0x4ac7=['http','request','then','request\x20sent','debug','stringify','code','AnalyticExtractedReport,\x20%s,\x20%s','error','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ac7,0x13b));var _0x74ac=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x4ac7[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x74ac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x74ac('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74ac('0x2'));var db=require(_0x74ac('0x3'))['db'];var utils=require(_0x74ac('0x4'));var logger=require('../../config/logger')(_0x74ac('0x5'));var config=require(_0x74ac('0x6'));var jayson=require(_0x74ac('0x7'));var client=jayson['client'][_0x74ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50e63c,_0x23e389,_0x28de45){return new BPromise(function(_0x3cc349,_0x6fcdcd){return client[_0x74ac('0x9')](_0x50e63c,_0x28de45)[_0x74ac('0xa')](function(_0x57d2f6){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x23e389,_0x74ac('0xb'));logger[_0x74ac('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x23e389,_0x74ac('0xb'),JSON[_0x74ac('0xd')](_0x57d2f6));if(_0x57d2f6['error']){if(_0x57d2f6['error'][_0x74ac('0xe')]===0x1f4){logger['error'](_0x74ac('0xf'),_0x23e389,_0x57d2f6[_0x74ac('0x10')]['message']);return _0x6fcdcd(_0x57d2f6[_0x74ac('0x10')]['message']);}logger[_0x74ac('0x10')](_0x74ac('0xf'),_0x23e389,_0x57d2f6['error'][_0x74ac('0x11')]);return _0x3cc349(_0x57d2f6[_0x74ac('0x10')]['message']);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x23e389,_0x74ac('0xb'));_0x3cc349(_0x57d2f6['result']['message']);}})[_0x74ac('0x12')](function(_0x3ece0d){logger[_0x74ac('0x10')](_0x74ac('0xf'),_0x23e389,_0x3ece0d);_0x6fcdcd(_0x3ece0d);});});}
\ No newline at end of file
+var _0x326a=['then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x5f51d9,_0x1d3214){var _0x2d05c7=function(_0x53fa2d){while(--_0x53fa2d){_0x5f51d9['push'](_0x5f51d9['shift']());}};_0x2d05c7(++_0x1d3214);}(_0x326a,0x136));var _0xa326=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x326a[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xa326('0x0'));var util=require(_0xa326('0x1'));var moment=require(_0xa326('0x2'));var BPromise=require('bluebird');var rs=require(_0xa326('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa326('0x4'));var logger=require(_0xa326('0x5'))('rpc');var config=require(_0xa326('0x6'));var jayson=require(_0xa326('0x7'));var client=jayson['client'][_0xa326('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d4185,_0x41c447,_0x7ee3ea){return new BPromise(function(_0x4af70d,_0x499388){return client[_0xa326('0x9')](_0x3d4185,_0x7ee3ea)[_0xa326('0xa')](function(_0x5247f7){logger['info'](_0xa326('0xb'),_0x41c447,_0xa326('0xc'));logger['debug'](_0xa326('0xd'),_0x41c447,_0xa326('0xc'),JSON[_0xa326('0xe')](_0x5247f7));if(_0x5247f7[_0xa326('0xf')]){if(_0x5247f7['error'][_0xa326('0x10')]===0x1f4){logger[_0xa326('0xf')](_0xa326('0xb'),_0x41c447,_0x5247f7[_0xa326('0xf')]['message']);return _0x499388(_0x5247f7[_0xa326('0xf')]['message']);}logger[_0xa326('0xf')](_0xa326('0xb'),_0x41c447,_0x5247f7['error'][_0xa326('0x11')]);return _0x4af70d(_0x5247f7[_0xa326('0xf')][_0xa326('0x11')]);}else{logger['info'](_0xa326('0xb'),_0x41c447,_0xa326('0xc'));_0x4af70d(_0x5247f7[_0xa326('0x12')][_0xa326('0x11')]);}})[_0xa326('0x13')](function(_0x578973){logger[_0xa326('0xf')](_0xa326('0xb'),_0x41c447,_0x578973);_0x499388(_0x578973);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e2fec4f..92d7282 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 _0x9753=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download'];(function(_0x3d5155,_0x159577){var _0xe38622=function(_0x936eba){while(--_0x936eba){_0x3d5155['push'](_0x3d5155['shift']());}};_0xe38622(++_0x159577);}(_0x9753,0x71));var _0x3975=function(_0x3211e8,_0x18da74){_0x3211e8=_0x3211e8-0x0;var _0x3db240=_0x9753[_0x3211e8];return _0x3db240;};'use strict';var multer=require(_0x3975('0x0'));var util=require(_0x3975('0x1'));var path=require(_0x3975('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3975('0x3')]();var fs_extra=require(_0x3975('0x4'));var auth=require(_0x3975('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3975('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x3975('0x7')]('/',auth[_0x3975('0x8')](),controller[_0x3975('0x9')]);router[_0x3975('0x7')]('/:id',auth[_0x3975('0x8')](),controller[_0x3975('0xa')]);router[_0x3975('0x7')](_0x3975('0xb'),auth[_0x3975('0x8')](),controller[_0x3975('0xc')]);router[_0x3975('0xd')]('/',auth[_0x3975('0x8')](),controller[_0x3975('0xe')]);router[_0x3975('0xf')](_0x3975('0x10'),auth[_0x3975('0x8')](),controller[_0x3975('0x11')]);router[_0x3975('0x12')](_0x3975('0x10'),auth['isAuthenticated'](),controller[_0x3975('0x13')]);module[_0x3975('0x14')]=router;
\ No newline at end of file
+var _0x393f=['index','/:id','show','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x14442e,_0x39111d){var _0x53b3d8=function(_0x277d0e){while(--_0x277d0e){_0x14442e['push'](_0x14442e['shift']());}};_0x53b3d8(++_0x39111d);}(_0x393f,0x114));var _0xf393=function(_0x5e1b44,_0x34006b){_0x5e1b44=_0x5e1b44-0x0;var _0x5cd72d=_0x393f[_0x5e1b44];return _0x5cd72d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf393('0x0'));var timeout=require('connect-timeout');var express=require(_0xf393('0x1'));var router=express[_0xf393('0x2')]();var fs_extra=require(_0xf393('0x3'));var auth=require(_0xf393('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf393('0x5'));var controller=require(_0xf393('0x6'));router[_0xf393('0x7')]('/',auth[_0xf393('0x8')](),controller[_0xf393('0x9')]);router[_0xf393('0x7')](_0xf393('0xa'),auth['isAuthenticated'](),controller[_0xf393('0xb')]);router[_0xf393('0x7')]('/:id/download',auth[_0xf393('0x8')](),controller['download']);router[_0xf393('0xc')]('/',auth['isAuthenticated'](),controller[_0xf393('0xd')]);router[_0xf393('0xe')](_0xf393('0xa'),auth[_0xf393('0x8')](),controller[_0xf393('0xf')]);router[_0xf393('0x10')](_0xf393('0xa'),auth[_0xf393('0x8')](),controller[_0xf393('0x11')]);module[_0xf393('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 69aa6ba..48d748c 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 _0x1558=['sequelize','STRING','BOOLEAN'];(function(_0x3064a3,_0x20e71a){var _0x4319b6=function(_0x2e5240){while(--_0x2e5240){_0x3064a3['push'](_0x3064a3['shift']());}};_0x4319b6(++_0x20e71a);}(_0x1558,0x1bc));var _0x8155=function(_0xee4c5f,_0x1bf72d){_0xee4c5f=_0xee4c5f-0x0;var _0x5accbc=_0x1558[_0xee4c5f];return _0x5accbc;};'use strict';var Sequelize=require(_0x8155('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x8155('0x1')]},'function':{'type':Sequelize[_0x8155('0x1')]},'format':{'type':Sequelize[_0x8155('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8155('0x1')]},'custom':{'type':Sequelize[_0x8155('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0118=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x0118,0x1b5));var _0x8011=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0118[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8011('0x0'));module['exports']={'field':{'type':Sequelize[_0x8011('0x1')]},'alias':{'type':Sequelize[_0x8011('0x2')]},'function':{'type':Sequelize[_0x8011('0x2')]},'format':{'type':Sequelize[_0x8011('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8011('0x2')]},'custom':{'type':Sequelize[_0x8011('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 d831432..0a22c85 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 _0x579c=['includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','ejs','fs-extra','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options'];(function(_0x547aa1,_0x2d2853){var _0x316512=function(_0x3012b8){while(--_0x3012b8){_0x547aa1['push'](_0x547aa1['shift']());}};_0x316512(++_0x2d2853);}(_0x579c,0x1dc));var _0xc579=function(_0x15bdd0,_0x12ff09){_0x15bdd0=_0x15bdd0-0x0;var _0x276d52=_0x579c[_0x15bdd0];return _0x276d52;};'use strict';var emlformat=require(_0xc579('0x0'));var rimraf=require(_0xc579('0x1'));var zipdir=require(_0xc579('0x2'));var jsonpatch=require(_0xc579('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc579('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc579('0x5'));var csv=require('to-csv');var ejs=require(_0xc579('0x6'));var fs=require('fs');var fs_extra=require(_0xc579('0x7'));var _=require('lodash');var squel=require(_0xc579('0x8'));var crypto=require(_0xc579('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc579('0xa'));var authService=require(_0xc579('0xb'));var qs=require(_0xc579('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc579('0xd'));var logger=require(_0xc579('0xe'))(_0xc579('0xf'));var utils=require(_0xc579('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57a41e,_0x484b3f){_0x484b3f=_0x484b3f||0xcc;return function(_0x57c92f){if(_0x57c92f){return _0x57a41e[_0xc579('0x11')](_0x484b3f);}return _0x57a41e[_0xc579('0x12')](_0x484b3f)[_0xc579('0x13')]();};}function respondWithResult(_0x3e1c5a,_0x585638){_0x585638=_0x585638||0xc8;return function(_0x28add6){if(_0x28add6){return _0x3e1c5a[_0xc579('0x12')](_0x585638)[_0xc579('0x14')](_0x28add6);}};}function respondWithFilteredResult(_0x1ef05a,_0x5b27e5){return function(_0x250423){if(_0x250423){var _0x10ed1e=typeof _0x5b27e5[_0xc579('0x15')]===_0xc579('0x16')&&typeof _0x5b27e5[_0xc579('0x17')]===_0xc579('0x16');var _0x57fddf=_0x250423['count'];var _0x2e68ed=_0x10ed1e?0x0:_0x5b27e5[_0xc579('0x15')];var _0x23a9eb=_0x10ed1e?_0x250423[_0xc579('0x18')]:_0x5b27e5[_0xc579('0x15')]+_0x5b27e5[_0xc579('0x17')];var _0x29ffb6;if(_0x23a9eb>=_0x57fddf){_0x23a9eb=_0x57fddf;_0x29ffb6=0xc8;}else{_0x29ffb6=0xce;}_0x1ef05a[_0xc579('0x12')](_0x29ffb6);return _0x1ef05a['set']('Content-Range',_0x2e68ed+'-'+_0x23a9eb+'/'+_0x57fddf)['json'](_0x250423);}return null;};}function patchUpdates(_0x5c44e3){return function(_0x303392){try{jsonpatch[_0xc579('0x19')](_0x303392,_0x5c44e3,!![]);}catch(_0x550959){return BPromise[_0xc579('0x1a')](_0x550959);}return _0x303392[_0xc579('0x1b')]();};}function saveUpdates(_0x59baa2,_0x1e7171){return function(_0x472759){if(_0x472759){return _0x472759['update'](_0x59baa2)[_0xc579('0x1c')](function(_0x467270){return _0x467270;});}return null;};}function removeEntity(_0x1ddd05,_0x2e83d4){return function(_0x453ef8){if(_0x453ef8){return _0x453ef8[_0xc579('0x1d')]()[_0xc579('0x1c')](function(){_0x1ddd05[_0xc579('0x12')](0xcc)[_0xc579('0x13')]();});}};}function handleEntityNotFound(_0x3df194,_0x222dd3){return function(_0x3f9c46){if(!_0x3f9c46){_0x3df194['sendStatus'](0x194);}return _0x3f9c46;};}function handleError(_0x4ca3b2,_0x532264){_0x532264=_0x532264||0x1f4;return function(_0x89bd7e){logger[_0xc579('0x1e')](_0x89bd7e['stack']);if(_0x89bd7e[_0xc579('0x1f')]){delete _0x89bd7e[_0xc579('0x1f')];}_0x4ca3b2['status'](_0x532264)[_0xc579('0x20')](_0x89bd7e);};}exports[_0xc579('0x21')]=function(_0x2a6851,_0x3db780){var _0x44651d={},_0x275ddf={},_0x37c9a8={'count':0x0,'rows':[]};var _0x329ada=_[_0xc579('0x22')](db[_0xc579('0x23')][_0xc579('0x24')],function(_0x8b0015){return{'name':_0x8b0015[_0xc579('0x25')],'type':_0x8b0015['type'][_0xc579('0x26')]};});_0x275ddf['model']=_[_0xc579('0x22')](_0x329ada,_0xc579('0x1f'));_0x275ddf[_0xc579('0x27')]=_[_0xc579('0x28')](_0x2a6851[_0xc579('0x27')]);_0x275ddf[_0xc579('0x29')]=_[_0xc579('0x2a')](_0x275ddf[_0xc579('0x2b')],_0x275ddf['query']);_0x44651d[_0xc579('0x2c')]=_[_0xc579('0x2a')](_0x275ddf[_0xc579('0x2b')],qs['fields'](_0x2a6851[_0xc579('0x27')][_0xc579('0x2d')]));_0x44651d['attributes']=_0x44651d[_0xc579('0x2c')][_0xc579('0x2e')]?_0x44651d[_0xc579('0x2c')]:_0x275ddf[_0xc579('0x2b')];if(!_0x2a6851[_0xc579('0x27')][_0xc579('0x2f')](_0xc579('0x30'))){_0x44651d[_0xc579('0x17')]=qs['limit'](_0x2a6851['query'][_0xc579('0x17')]);_0x44651d['offset']=qs[_0xc579('0x15')](_0x2a6851['query']['offset']);}_0x44651d[_0xc579('0x31')]=qs['sort'](_0x2a6851['query']['sort']);_0x44651d[_0xc579('0x32')]=qs[_0xc579('0x29')](_[_0xc579('0x33')](_0x2a6851[_0xc579('0x27')],_0x275ddf[_0xc579('0x29')]),_0x329ada);if(_0x2a6851[_0xc579('0x27')]['filter']){_0x44651d[_0xc579('0x32')]=_[_0xc579('0x34')](_0x44651d[_0xc579('0x32')],{'$or':_[_0xc579('0x22')](_0x329ada,function(_0x31acfd){if(_0x31acfd['type']!==_0xc579('0x35')){var _0x1f18f8={};_0x1f18f8[_0x31acfd[_0xc579('0x1f')]]={'$like':'%'+_0x2a6851[_0xc579('0x27')][_0xc579('0x36')]+'%'};return _0x1f18f8;}})});}_0x44651d=_[_0xc579('0x34')]({},_0x44651d,_0x2a6851[_0xc579('0x37')]);var _0x35e274={'where':_0x44651d[_0xc579('0x32')]};return db[_0xc579('0x23')][_0xc579('0x18')](_0x35e274)[_0xc579('0x1c')](function(_0x50c2c4){_0x37c9a8[_0xc579('0x18')]=_0x50c2c4;if(_0x2a6851[_0xc579('0x27')][_0xc579('0x38')]){_0x44651d[_0xc579('0x39')]=[{'all':!![]}];}return db[_0xc579('0x23')][_0xc579('0x3a')](_0x44651d);})[_0xc579('0x1c')](function(_0x1d5acc){_0x37c9a8[_0xc579('0x3b')]=_0x1d5acc;return _0x37c9a8;})[_0xc579('0x1c')](respondWithFilteredResult(_0x3db780,_0x44651d))[_0xc579('0x3c')](handleError(_0x3db780,null));};exports[_0xc579('0x3d')]=function(_0x4abdb1,_0x3145e6){var _0x36b7bc={'raw':![],'where':{'id':_0x4abdb1[_0xc579('0x3e')]['id']}},_0x29b363={};_0x29b363[_0xc579('0x2b')]=_[_0xc579('0x28')](db[_0xc579('0x23')][_0xc579('0x24')]);_0x29b363['query']=_[_0xc579('0x28')](_0x4abdb1[_0xc579('0x27')]);_0x29b363[_0xc579('0x29')]=_[_0xc579('0x2a')](_0x29b363[_0xc579('0x2b')],_0x29b363['query']);_0x36b7bc[_0xc579('0x2c')]=_[_0xc579('0x2a')](_0x29b363[_0xc579('0x2b')],qs[_0xc579('0x2d')](_0x4abdb1[_0xc579('0x27')][_0xc579('0x2d')]));_0x36b7bc[_0xc579('0x2c')]=_0x36b7bc[_0xc579('0x2c')][_0xc579('0x2e')]?_0x36b7bc['attributes']:_0x29b363['model'];if(_0x4abdb1['query']['includeAll']){_0x36b7bc[_0xc579('0x39')]=[{'all':!![]}];}_0x36b7bc=_[_0xc579('0x34')]({},_0x36b7bc,_0x4abdb1[_0xc579('0x37')]);return db[_0xc579('0x23')][_0xc579('0x3f')](_0x36b7bc)[_0xc579('0x1c')](handleEntityNotFound(_0x3145e6,null))[_0xc579('0x1c')](respondWithResult(_0x3145e6,null))['catch'](handleError(_0x3145e6,null));};exports[_0xc579('0x40')]=function(_0x52d82d,_0x1127e2){return db['AnalyticFieldReport'][_0xc579('0x40')](_0x52d82d[_0xc579('0x41')],{})[_0xc579('0x1c')](respondWithResult(_0x1127e2,0xc9))['catch'](handleError(_0x1127e2,null));};exports[_0xc579('0x42')]=function(_0x29d924,_0x2bbe01){return db[_0xc579('0x23')][_0xc579('0x42')](_0x29d924[_0xc579('0x41')],{'raw':![],'individualHooks':!![]})[_0xc579('0x1c')](respondWithResult(_0x2bbe01,0xc9))[_0xc579('0x3c')](handleError(_0x2bbe01,null));};exports[_0xc579('0x43')]=function(_0x2cbebc,_0x265cbe){if(_0x2cbebc[_0xc579('0x41')]['id']){delete _0x2cbebc[_0xc579('0x41')]['id'];}return db[_0xc579('0x23')][_0xc579('0x3f')]({'where':{'id':_0x2cbebc['params']['id']}})[_0xc579('0x1c')](handleEntityNotFound(_0x265cbe,null))[_0xc579('0x1c')](saveUpdates(_0x2cbebc[_0xc579('0x41')],null))[_0xc579('0x1c')](respondWithResult(_0x265cbe,null))[_0xc579('0x3c')](handleError(_0x265cbe,null));};exports[_0xc579('0x1d')]=function(_0x53152b,_0x55e11c){return db['AnalyticFieldReport']['find']({'where':{'id':_0x53152b[_0xc579('0x3e')]['id']}})[_0xc579('0x1c')](handleEntityNotFound(_0x55e11c,null))[_0xc579('0x1c')](removeEntity(_0x55e11c,null))[_0xc579('0x3c')](handleError(_0x55e11c,null));};exports[_0xc579('0x44')]=function(_0x31adee,_0x317d8e){return db['AnalyticFieldReport'][_0xc579('0x1d')]({'where':{'id':_0x31adee[_0xc579('0x27')][_0xc579('0x45')]||[]},'raw':![],'individualHooks':!![]})[_0xc579('0x1c')](respondWithResult(_0x317d8e,0xcc))[_0xc579('0x3c')](handleError(_0x317d8e,null));};exports[_0xc579('0x46')]=function(_0x4f9940,_0xa51059,_0x2d8d7d){return db[_0xc579('0x47')][_0xc579('0x48')]({'where':{'id':_0x4f9940[_0xc579('0x3e')]['id']}})[_0xc579('0x1c')](handleEntityNotFound(_0xa51059,null))[_0xc579('0x1c')](function(_0x2371b5){if(_0x2371b5){return db[_0xc579('0x49')][_0xc579('0x4a')](function(_0x1f2c5e){return db[_0xc579('0x23')][_0xc579('0x1d')]({'where':{'CustomReportId':_0x4f9940[_0xc579('0x3e')]['id']},'transaction':_0x1f2c5e})[_0xc579('0x1c')](function(_0x49764c){var _0x2853dc=_['map'](_0x4f9940[_0xc579('0x41')],function(_0x68c160){delete _0x68c160['id'];_0x68c160[_0xc579('0x4b')]=_0x4f9940['params']['id'];return _0x68c160;});return db[_0xc579('0x23')][_0xc579('0x42')](_0x2853dc,{'transaction':_0x1f2c5e});});})[_0xc579('0x1c')](function(){return db['AnalyticFieldReport'][_0xc579('0x3a')]({'where':{'CustomReportId':_0x4f9940[_0xc579('0x3e')]['id']}});});}})['then'](respondWithResult(_0xa51059,null))[_0xc579('0x3c')](handleError(_0xa51059,null));};
\ No newline at end of file
+var _0x85e7=['map','rawAttributes','fieldName','type','model','filters','intersection','attributes','fields','query','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','AnalyticFieldReport','findAll','rows','catch','show','params','keys','include','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','end','error','stack','name','index'];(function(_0x17be49,_0x48e399){var _0x1c9411=function(_0x2ff174){while(--_0x2ff174){_0x17be49['push'](_0x17be49['shift']());}};_0x1c9411(++_0x48e399);}(_0x85e7,0xcc));var _0x785e=function(_0x215488,_0x497875){_0x215488=_0x215488-0x0;var _0x13db01=_0x85e7[_0x215488];return _0x13db01;};'use strict';var emlformat=require(_0x785e('0x0'));var rimraf=require(_0x785e('0x1'));var zipdir=require(_0x785e('0x2'));var jsonpatch=require(_0x785e('0x3'));var rp=require(_0x785e('0x4'));var moment=require(_0x785e('0x5'));var BPromise=require(_0x785e('0x6'));var Mustache=require(_0x785e('0x7'));var util=require(_0x785e('0x8'));var path=require(_0x785e('0x9'));var sox=require(_0x785e('0xa'));var csv=require(_0x785e('0xb'));var ejs=require(_0x785e('0xc'));var fs=require('fs');var fs_extra=require(_0x785e('0xd'));var _=require(_0x785e('0xe'));var squel=require('squel');var crypto=require(_0x785e('0xf'));var jsforce=require(_0x785e('0x10'));var deskjs=require(_0x785e('0x11'));var toCsv=require(_0x785e('0xb'));var querystring=require(_0x785e('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x785e('0x13'));var qs=require(_0x785e('0x14'));var as=require(_0x785e('0x15'));var hardwareService=require(_0x785e('0x16'));var logger=require(_0x785e('0x17'))('api');var utils=require(_0x785e('0x18'));var config=require(_0x785e('0x19'));var licenseUtil=require(_0x785e('0x1a'));var db=require(_0x785e('0x1b'))['db'];function respondWithStatusCode(_0x141ec4,_0x4cbdc7){_0x4cbdc7=_0x4cbdc7||0xcc;return function(_0x12dd94){if(_0x12dd94){return _0x141ec4[_0x785e('0x1c')](_0x4cbdc7);}return _0x141ec4[_0x785e('0x1d')](_0x4cbdc7)['end']();};}function respondWithResult(_0x174b4f,_0x59497e){_0x59497e=_0x59497e||0xc8;return function(_0x17610f){if(_0x17610f){return _0x174b4f['status'](_0x59497e)[_0x785e('0x1e')](_0x17610f);}};}function respondWithFilteredResult(_0x32fe3f,_0x5dedcb){return function(_0x46b295){if(_0x46b295){var _0x2d77cf=typeof _0x5dedcb[_0x785e('0x1f')]==='undefined'&&typeof _0x5dedcb[_0x785e('0x20')]===_0x785e('0x21');var _0x25d86d=_0x46b295[_0x785e('0x22')];var _0x72066b=_0x2d77cf?0x0:_0x5dedcb['offset'];var _0x52b92a=_0x2d77cf?_0x46b295['count']:_0x5dedcb[_0x785e('0x1f')]+_0x5dedcb[_0x785e('0x20')];var _0xeb34cf;if(_0x52b92a>=_0x25d86d){_0x52b92a=_0x25d86d;_0xeb34cf=0xc8;}else{_0xeb34cf=0xce;}_0x32fe3f[_0x785e('0x1d')](_0xeb34cf);return _0x32fe3f[_0x785e('0x23')](_0x785e('0x24'),_0x72066b+'-'+_0x52b92a+'/'+_0x25d86d)[_0x785e('0x1e')](_0x46b295);}return null;};}function patchUpdates(_0x54f10b){return function(_0x565ee6){try{jsonpatch[_0x785e('0x25')](_0x565ee6,_0x54f10b,!![]);}catch(_0x538828){return BPromise['reject'](_0x538828);}return _0x565ee6['save']();};}function saveUpdates(_0x154870,_0x13cf70){return function(_0x5aadf9){if(_0x5aadf9){return _0x5aadf9[_0x785e('0x26')](_0x154870)[_0x785e('0x27')](function(_0xd7ec06){return _0xd7ec06;});}return null;};}function removeEntity(_0x1bf307,_0x18198c){return function(_0x498ed4){if(_0x498ed4){return _0x498ed4['destroy']()[_0x785e('0x27')](function(){_0x1bf307['status'](0xcc)[_0x785e('0x28')]();});}};}function handleEntityNotFound(_0x249af1,_0x254b54){return function(_0xffa6b3){if(!_0xffa6b3){_0x249af1[_0x785e('0x1c')](0x194);}return _0xffa6b3;};}function handleError(_0x2f9522,_0x34e906){_0x34e906=_0x34e906||0x1f4;return function(_0x40a2c4){logger[_0x785e('0x29')](_0x40a2c4[_0x785e('0x2a')]);if(_0x40a2c4['name']){delete _0x40a2c4[_0x785e('0x2b')];}_0x2f9522['status'](_0x34e906)['send'](_0x40a2c4);};}exports[_0x785e('0x2c')]=function(_0x256d0d,_0x2081d5){var _0x4aa5a4={},_0x43b850={},_0x14a09c={'count':0x0,'rows':[]};var _0x5753a0=_[_0x785e('0x2d')](db['AnalyticFieldReport'][_0x785e('0x2e')],function(_0x4761c6){return{'name':_0x4761c6[_0x785e('0x2f')],'type':_0x4761c6[_0x785e('0x30')]['key']};});_0x43b850[_0x785e('0x31')]=_['map'](_0x5753a0,_0x785e('0x2b'));_0x43b850['query']=_['keys'](_0x256d0d['query']);_0x43b850[_0x785e('0x32')]=_[_0x785e('0x33')](_0x43b850[_0x785e('0x31')],_0x43b850['query']);_0x4aa5a4[_0x785e('0x34')]=_[_0x785e('0x33')](_0x43b850[_0x785e('0x31')],qs[_0x785e('0x35')](_0x256d0d['query'][_0x785e('0x35')]));_0x4aa5a4[_0x785e('0x34')]=_0x4aa5a4[_0x785e('0x34')]['length']?_0x4aa5a4[_0x785e('0x34')]:_0x43b850[_0x785e('0x31')];if(!_0x256d0d[_0x785e('0x36')][_0x785e('0x37')]('nolimit')){_0x4aa5a4[_0x785e('0x20')]=qs['limit'](_0x256d0d[_0x785e('0x36')][_0x785e('0x20')]);_0x4aa5a4['offset']=qs[_0x785e('0x1f')](_0x256d0d[_0x785e('0x36')]['offset']);}_0x4aa5a4[_0x785e('0x38')]=qs[_0x785e('0x39')](_0x256d0d[_0x785e('0x36')][_0x785e('0x39')]);_0x4aa5a4[_0x785e('0x3a')]=qs[_0x785e('0x32')](_['pick'](_0x256d0d['query'],_0x43b850['filters']),_0x5753a0);if(_0x256d0d[_0x785e('0x36')][_0x785e('0x3b')]){_0x4aa5a4[_0x785e('0x3a')]=_[_0x785e('0x3c')](_0x4aa5a4[_0x785e('0x3a')],{'$or':_[_0x785e('0x2d')](_0x5753a0,function(_0x197f56){if(_0x197f56[_0x785e('0x30')]!==_0x785e('0x3d')){var _0x172061={};_0x172061[_0x197f56['name']]={'$like':'%'+_0x256d0d[_0x785e('0x36')][_0x785e('0x3b')]+'%'};return _0x172061;}})});}_0x4aa5a4=_[_0x785e('0x3c')]({},_0x4aa5a4,_0x256d0d[_0x785e('0x3e')]);var _0x204b47={'where':_0x4aa5a4[_0x785e('0x3a')]};return db['AnalyticFieldReport'][_0x785e('0x22')](_0x204b47)[_0x785e('0x27')](function(_0x4104b2){_0x14a09c['count']=_0x4104b2;if(_0x256d0d[_0x785e('0x36')][_0x785e('0x3f')]){_0x4aa5a4['include']=[{'all':!![]}];}return db[_0x785e('0x40')][_0x785e('0x41')](_0x4aa5a4);})['then'](function(_0x3d735e){_0x14a09c[_0x785e('0x42')]=_0x3d735e;return _0x14a09c;})[_0x785e('0x27')](respondWithFilteredResult(_0x2081d5,_0x4aa5a4))[_0x785e('0x43')](handleError(_0x2081d5,null));};exports[_0x785e('0x44')]=function(_0x2e92b8,_0x328624){var _0x11929f={'raw':![],'where':{'id':_0x2e92b8[_0x785e('0x45')]['id']}},_0x489905={};_0x489905[_0x785e('0x31')]=_[_0x785e('0x46')](db['AnalyticFieldReport'][_0x785e('0x2e')]);_0x489905['query']=_['keys'](_0x2e92b8['query']);_0x489905[_0x785e('0x32')]=_[_0x785e('0x33')](_0x489905['model'],_0x489905[_0x785e('0x36')]);_0x11929f['attributes']=_[_0x785e('0x33')](_0x489905['model'],qs['fields'](_0x2e92b8[_0x785e('0x36')][_0x785e('0x35')]));_0x11929f['attributes']=_0x11929f[_0x785e('0x34')]['length']?_0x11929f[_0x785e('0x34')]:_0x489905[_0x785e('0x31')];if(_0x2e92b8[_0x785e('0x36')][_0x785e('0x3f')]){_0x11929f[_0x785e('0x47')]=[{'all':!![]}];}_0x11929f=_['merge']({},_0x11929f,_0x2e92b8['options']);return db[_0x785e('0x40')][_0x785e('0x48')](_0x11929f)[_0x785e('0x27')](handleEntityNotFound(_0x328624,null))[_0x785e('0x27')](respondWithResult(_0x328624,null))['catch'](handleError(_0x328624,null));};exports[_0x785e('0x49')]=function(_0x3a9e3e,_0x57bb16){return db[_0x785e('0x40')][_0x785e('0x49')](_0x3a9e3e[_0x785e('0x4a')],{})[_0x785e('0x27')](respondWithResult(_0x57bb16,0xc9))[_0x785e('0x43')](handleError(_0x57bb16,null));};exports['bulkCreate']=function(_0x469f74,_0x498fd9){return db[_0x785e('0x40')][_0x785e('0x4b')](_0x469f74[_0x785e('0x4a')],{'raw':![],'individualHooks':!![]})[_0x785e('0x27')](respondWithResult(_0x498fd9,0xc9))[_0x785e('0x43')](handleError(_0x498fd9,null));};exports['update']=function(_0x3a6fbf,_0x26e56a){if(_0x3a6fbf[_0x785e('0x4a')]['id']){delete _0x3a6fbf[_0x785e('0x4a')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x3a6fbf[_0x785e('0x45')]['id']}})[_0x785e('0x27')](handleEntityNotFound(_0x26e56a,null))['then'](saveUpdates(_0x3a6fbf[_0x785e('0x4a')],null))[_0x785e('0x27')](respondWithResult(_0x26e56a,null))[_0x785e('0x43')](handleError(_0x26e56a,null));};exports[_0x785e('0x4c')]=function(_0x3b09ba,_0x40fea8){return db[_0x785e('0x40')]['find']({'where':{'id':_0x3b09ba[_0x785e('0x45')]['id']}})[_0x785e('0x27')](handleEntityNotFound(_0x40fea8,null))[_0x785e('0x27')](removeEntity(_0x40fea8,null))[_0x785e('0x43')](handleError(_0x40fea8,null));};exports[_0x785e('0x4d')]=function(_0xbd09a,_0x479c5e){return db[_0x785e('0x40')][_0x785e('0x4c')]({'where':{'id':_0xbd09a[_0x785e('0x36')][_0x785e('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x785e('0x27')](respondWithResult(_0x479c5e,0xcc))[_0x785e('0x43')](handleError(_0x479c5e,null));};exports[_0x785e('0x4f')]=function(_0x30f038,_0x24e51f,_0x188d7a){return db['AnalyticCustomReport'][_0x785e('0x50')]({'where':{'id':_0x30f038[_0x785e('0x45')]['id']}})['then'](handleEntityNotFound(_0x24e51f,null))['then'](function(_0x3a3120){if(_0x3a3120){return db[_0x785e('0x51')]['transaction'](function(_0x3e7536){return db[_0x785e('0x40')][_0x785e('0x4c')]({'where':{'CustomReportId':_0x30f038[_0x785e('0x45')]['id']},'transaction':_0x3e7536})[_0x785e('0x27')](function(_0x4c7b73){var _0x3f021d=_[_0x785e('0x2d')](_0x30f038[_0x785e('0x4a')],function(_0x1dc654){delete _0x1dc654['id'];_0x1dc654[_0x785e('0x52')]=_0x30f038[_0x785e('0x45')]['id'];return _0x1dc654;});return db[_0x785e('0x40')]['bulkCreate'](_0x3f021d,{'transaction':_0x3e7536});});})[_0x785e('0x27')](function(){return db['AnalyticFieldReport'][_0x785e('0x41')]({'where':{'CustomReportId':_0x30f038[_0x785e('0x45')]['id']}});});}})[_0x785e('0x27')](respondWithResult(_0x24e51f,null))['catch'](handleError(_0x24e51f,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 0eed0ce..05a3f2a 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 _0xff1a=['path','./analyticFieldReport.attributes','exports','define','analytics_report_fields','util','../../config/logger','api','moment','request-promise'];(function(_0x506a86,_0x41e1c9){var _0x5e1960=function(_0xbc7559){while(--_0xbc7559){_0x506a86['push'](_0x506a86['shift']());}};_0x5e1960(++_0x41e1c9);}(_0xff1a,0x18b));var _0xaff1=function(_0x2c45d8,_0x3c2ea6){_0x2c45d8=_0x2c45d8-0x0;var _0xe57dee=_0xff1a[_0x2c45d8];return _0xe57dee;};'use strict';var _=require('lodash');var util=require(_0xaff1('0x0'));var logger=require(_0xaff1('0x1'))(_0xaff1('0x2'));var moment=require(_0xaff1('0x3'));var BPromise=require('bluebird');var rp=require(_0xaff1('0x4'));var fs=require('fs');var path=require(_0xaff1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaff1('0x6'));module[_0xaff1('0x7')]=function(_0x179201,_0x297c40){return _0x179201[_0xaff1('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0xaff1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1dd5=['request-promise','path','rimraf','./analyticFieldReport.attributes','exports','analytics_report_fields','util','../../config/logger','bluebird'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x1dd5,0xde));var _0x51dd=function(_0xcc4532,_0x40cc5c){_0xcc4532=_0xcc4532-0x0;var _0x46c5bc=_0x1dd5[_0xcc4532];return _0x46c5bc;};'use strict';var _=require('lodash');var util=require(_0x51dd('0x0'));var logger=require(_0x51dd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x51dd('0x2'));var rp=require(_0x51dd('0x3'));var fs=require('fs');var path=require(_0x51dd('0x4'));var rimraf=require(_0x51dd('0x5'));var config=require('../../config/environment');var attributes=require(_0x51dd('0x6'));module[_0x51dd('0x7')]=function(_0x96b23d,_0x1170de){return _0x96b23d['define']('AnalyticFieldReport',attributes,{'tableName':_0x51dd('0x8'),'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 1a55492..289d505 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 _0x09e4=['jayson/promise','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','AnalyticFieldReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x487bd5,_0x15f486){var _0x3e32bf=function(_0x3a4d49){while(--_0x3a4d49){_0x487bd5['push'](_0x487bd5['shift']());}};_0x3e32bf(++_0x15f486);}(_0x09e4,0x127));var _0x409e=function(_0x2a60c0,_0x5f49db){_0x2a60c0=_0x2a60c0-0x0;var _0x1fdb20=_0x09e4[_0x2a60c0];return _0x1fdb20;};'use strict';var _=require('lodash');var util=require(_0x409e('0x0'));var moment=require(_0x409e('0x1'));var BPromise=require(_0x409e('0x2'));var rs=require(_0x409e('0x3'));var fs=require('fs');var Redis=require(_0x409e('0x4'));var db=require(_0x409e('0x5'))['db'];var utils=require(_0x409e('0x6'));var logger=require(_0x409e('0x7'))(_0x409e('0x8'));var config=require('../../config/environment');var jayson=require(_0x409e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x516942,_0x1f0e4a,_0x16f9c8){return new BPromise(function(_0x50f4fb,_0xf016b3){return client['request'](_0x516942,_0x16f9c8)[_0x409e('0xa')](function(_0x4b3004){logger[_0x409e('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f0e4a,_0x409e('0xc'));logger[_0x409e('0xd')](_0x409e('0xe'),_0x1f0e4a,'request\x20sent',JSON['stringify'](_0x4b3004));if(_0x4b3004[_0x409e('0xf')]){if(_0x4b3004[_0x409e('0xf')]['code']===0x1f4){logger[_0x409e('0xf')](_0x409e('0x10'),_0x1f0e4a,_0x4b3004['error'][_0x409e('0x11')]);return _0xf016b3(_0x4b3004['error'][_0x409e('0x11')]);}logger[_0x409e('0xf')](_0x409e('0x10'),_0x1f0e4a,_0x4b3004[_0x409e('0xf')][_0x409e('0x11')]);return _0x50f4fb(_0x4b3004['error']['message']);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x1f0e4a,_0x409e('0xc'));_0x50f4fb(_0x4b3004['result']['message']);}})[_0x409e('0x12')](function(_0x56a482){logger[_0x409e('0xf')](_0x409e('0x10'),_0x1f0e4a,_0x56a482);_0xf016b3(_0x56a482);});});}
\ No newline at end of file
+var _0x3deb=['message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1be79f,_0x4d5d55){var _0x3c58a9=function(_0x4b2137){while(--_0x4b2137){_0x1be79f['push'](_0x1be79f['shift']());}};_0x3c58a9(++_0x4d5d55);}(_0x3deb,0xdf));var _0xb3de=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x3deb[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xb3de('0x0'));var util=require(_0xb3de('0x1'));var moment=require(_0xb3de('0x2'));var BPromise=require(_0xb3de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3de('0x4'));var db=require(_0xb3de('0x5'))['db'];var utils=require(_0xb3de('0x6'));var logger=require(_0xb3de('0x7'))(_0xb3de('0x8'));var config=require('../../config/environment');var jayson=require(_0xb3de('0x9'));var client=jayson[_0xb3de('0xa')][_0xb3de('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18c6ce,_0x4183f7,_0xb752c7){return new BPromise(function(_0x2beb9c,_0x24ebd7){return client[_0xb3de('0xc')](_0x18c6ce,_0xb752c7)['then'](function(_0x3d2a6a){logger[_0xb3de('0xd')](_0xb3de('0xe'),_0x4183f7,'request\x20sent');logger['debug'](_0xb3de('0xf'),_0x4183f7,'request\x20sent',JSON[_0xb3de('0x10')](_0x3d2a6a));if(_0x3d2a6a[_0xb3de('0x11')]){if(_0x3d2a6a['error'][_0xb3de('0x12')]===0x1f4){logger[_0xb3de('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4183f7,_0x3d2a6a[_0xb3de('0x11')][_0xb3de('0x13')]);return _0x24ebd7(_0x3d2a6a[_0xb3de('0x11')][_0xb3de('0x13')]);}logger[_0xb3de('0x11')](_0xb3de('0xe'),_0x4183f7,_0x3d2a6a[_0xb3de('0x11')]['message']);return _0x2beb9c(_0x3d2a6a[_0xb3de('0x11')][_0xb3de('0x13')]);}else{logger['info'](_0xb3de('0xe'),_0x4183f7,_0xb3de('0x14'));_0x2beb9c(_0x3d2a6a['result'][_0xb3de('0x13')]);}})[_0xb3de('0x15')](function(_0x31b950){logger[_0xb3de('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4183f7,_0x31b950);_0x24ebd7(_0x31b950);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 612e037..a335f0e 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(_0x34e06e,_0x156409){var _0x7b8b3e=function(_0x4267aa){while(--_0x4267aa){_0x34e06e['push'](_0x34e06e['shift']());}};_0x7b8b3e(++_0x156409);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x5a40a1,_0x355774){var _0x4b1a7e=function(_0x4c1663){while(--_0x4c1663){_0x5a40a1['push'](_0x5a40a1['shift']());}};_0x4b1a7e(++_0x355774);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 236c012..8d2df7d 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 _0x1ebd=['sequelize','exports','STRING','TEXT'];(function(_0x29b100,_0x46e95f){var _0x341736=function(_0x232b3e){while(--_0x232b3e){_0x29b100['push'](_0x29b100['shift']());}};_0x341736(++_0x46e95f);}(_0x1ebd,0x64));var _0xd1eb=function(_0x33c04a,_0x15ffa0){_0x33c04a=_0x33c04a-0x0;var _0x1d87d0=_0x1ebd[_0x33c04a];return _0x1d87d0;};'use strict';var Sequelize=require(_0xd1eb('0x0'));module[_0xd1eb('0x1')]={'name':{'type':Sequelize[_0xd1eb('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xd1eb('0x2')]},'metric':{'type':Sequelize[_0xd1eb('0x3')]},'description':{'type':Sequelize[_0xd1eb('0x2')]}};
\ No newline at end of file
+var _0x976a=['sequelize','exports','STRING','TEXT'];(function(_0x23322e,_0x2cf32f){var _0x3ec2b4=function(_0x3c7321){while(--_0x3c7321){_0x23322e['push'](_0x23322e['shift']());}};_0x3ec2b4(++_0x2cf32f);}(_0x976a,0xf4));var _0xa976=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0x976a[_0x53afa6];return _0x51f86a;};'use strict';var Sequelize=require(_0xa976('0x0'));module[_0xa976('0x1')]={'name':{'type':Sequelize[_0xa976('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xa976('0x2')]},'metric':{'type':Sequelize[_0xa976('0x3')]},'description':{'type':Sequelize[_0xa976('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 6daf7dc..cc9124f 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 _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x449747,_0x3e0aed){var _0x230544=function(_0x2ece94){while(--_0x2ece94){_0x449747['push'](_0x449747['shift']());}};_0x230544(++_0x3e0aed);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x4b84[_0x1aba25];return _0x47d997;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x15570d,_0x3bdc08){var _0xbeffca=function(_0x4b5dbb){while(--_0x4b5dbb){_0x15570d['push'](_0x15570d['shift']());}};_0xbeffca(++_0x3bdc08);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x21b706,_0x1022f4){_0x21b706=_0x21b706-0x0;var _0x13b94a=_0xf2ca[_0x21b706];return _0x13b94a;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 414dfe4..60da42d 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 _0x2eb2=['moment','bluebird','request-promise','rimraf','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api'];(function(_0x451372,_0x49abd5){var _0x33fef3=function(_0x5b6215){while(--_0x5b6215){_0x451372['push'](_0x451372['shift']());}};_0x33fef3(++_0x49abd5);}(_0x2eb2,0x19f));var _0x22eb=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x2eb2[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b47=['bluebird','request-promise','path','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment'];(function(_0x4debf0,_0x34404b){var _0x37959d=function(_0x379f3d){while(--_0x379f3d){_0x4debf0['push'](_0x4debf0['shift']());}};_0x37959d(++_0x34404b);}(_0x4b47,0x1b4));var _0x74b4=function(_0x38c509,_0xd5e48b){_0x38c509=_0x38c509-0x0;var _0xfdfb73=_0x4b47[_0x38c509];return _0xfdfb73;};'use strict';var _=require(_0x74b4('0x0'));var util=require('util');var logger=require(_0x74b4('0x1'))(_0x74b4('0x2'));var moment=require(_0x74b4('0x3'));var BPromise=require(_0x74b4('0x4'));var rp=require(_0x74b4('0x5'));var fs=require('fs');var path=require(_0x74b4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x74b4('0x7'));module[_0x74b4('0x8')]=function(_0x4dc737,_0x4cd397){return _0x4dc737['define'](_0x74b4('0x9'),attributes,{'tableName':_0x74b4('0xa'),'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 2eb075d..b47e520 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 _0xeca4=['info','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x565228,_0x8d5181){var _0x11570f=function(_0x949dc0){while(--_0x949dc0){_0x565228['push'](_0x565228['shift']());}};_0x11570f(++_0x8d5181);}(_0xeca4,0x1b7));var _0x4eca=function(_0x42e15e,_0x267b5d){_0x42e15e=_0x42e15e-0x0;var _0x1fd377=_0xeca4[_0x42e15e];return _0x1fd377;};'use strict';var _=require(_0x4eca('0x0'));var util=require(_0x4eca('0x1'));var moment=require(_0x4eca('0x2'));var BPromise=require(_0x4eca('0x3'));var rs=require(_0x4eca('0x4'));var fs=require('fs');var Redis=require(_0x4eca('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4eca('0x6'));var config=require(_0x4eca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4eca('0x8')][_0x4eca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45bb29,_0xecd238,_0x2d725e){return new BPromise(function(_0x12164c,_0x50842e){return client[_0x4eca('0xa')](_0x45bb29,_0x2d725e)[_0x4eca('0xb')](function(_0xe8663a){logger['info'](_0x4eca('0xc'),_0xecd238,_0x4eca('0xd'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0xecd238,'request\x20sent',JSON[_0x4eca('0xe')](_0xe8663a));if(_0xe8663a['error']){if(_0xe8663a[_0x4eca('0xf')]['code']===0x1f4){logger[_0x4eca('0xf')](_0x4eca('0xc'),_0xecd238,_0xe8663a['error'][_0x4eca('0x10')]);return _0x50842e(_0xe8663a[_0x4eca('0xf')][_0x4eca('0x10')]);}logger[_0x4eca('0xf')](_0x4eca('0xc'),_0xecd238,_0xe8663a['error'][_0x4eca('0x10')]);return _0x12164c(_0xe8663a[_0x4eca('0xf')][_0x4eca('0x10')]);}else{logger[_0x4eca('0x11')](_0x4eca('0xc'),_0xecd238,'request\x20sent');_0x12164c(_0xe8663a[_0x4eca('0x12')][_0x4eca('0x10')]);}})['catch'](function(_0xac73a0){logger[_0x4eca('0xf')](_0x4eca('0xc'),_0xecd238,_0xac73a0);_0x50842e(_0xac73a0);});});}
\ No newline at end of file
+var _0xcf52=['error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4105d7,_0x2d1769){var _0x24b0f8=function(_0x4a8d52){while(--_0x4a8d52){_0x4105d7['push'](_0x4105d7['shift']());}};_0x24b0f8(++_0x2d1769);}(_0xcf52,0xf5));var _0x2cf5=function(_0x2175ca,_0x336f20){_0x2175ca=_0x2175ca-0x0;var _0x2b3b76=_0xcf52[_0x2175ca];return _0x2b3b76;};'use strict';var _=require(_0x2cf5('0x0'));var util=require('util');var moment=require(_0x2cf5('0x1'));var BPromise=require(_0x2cf5('0x2'));var rs=require(_0x2cf5('0x3'));var fs=require('fs');var Redis=require(_0x2cf5('0x4'));var db=require(_0x2cf5('0x5'))['db'];var utils=require(_0x2cf5('0x6'));var logger=require(_0x2cf5('0x7'))(_0x2cf5('0x8'));var config=require(_0x2cf5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2cf5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a9501,_0x10fdf3,_0x645c8c){return new BPromise(function(_0x411d86,_0x5dbc1c){return client[_0x2cf5('0xb')](_0x5a9501,_0x645c8c)[_0x2cf5('0xc')](function(_0xf5e23c){logger[_0x2cf5('0xd')](_0x2cf5('0xe'),_0x10fdf3,_0x2cf5('0xf'));logger[_0x2cf5('0x10')](_0x2cf5('0x11'),_0x10fdf3,'request\x20sent',JSON[_0x2cf5('0x12')](_0xf5e23c));if(_0xf5e23c['error']){if(_0xf5e23c[_0x2cf5('0x13')]['code']===0x1f4){logger['error'](_0x2cf5('0xe'),_0x10fdf3,_0xf5e23c['error'][_0x2cf5('0x14')]);return _0x5dbc1c(_0xf5e23c[_0x2cf5('0x13')][_0x2cf5('0x14')]);}logger['error'](_0x2cf5('0xe'),_0x10fdf3,_0xf5e23c[_0x2cf5('0x13')]['message']);return _0x411d86(_0xf5e23c['error'][_0x2cf5('0x14')]);}else{logger[_0x2cf5('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x10fdf3,_0x2cf5('0xf'));_0x411d86(_0xf5e23c['result'][_0x2cf5('0x14')]);}})[_0x2cf5('0x15')](function(_0x1e27ca){logger[_0x2cf5('0x13')](_0x2cf5('0xe'),_0x10fdf3,_0x1e27ca);_0x5dbc1c(_0x1e27ca);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index c11366d..c96e349 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 _0x46cb=['./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2e7b66,_0x5d1f12){var _0x49b719=function(_0x29c685){while(--_0x29c685){_0x2e7b66['push'](_0x2e7b66['shift']());}};_0x49b719(++_0x5d1f12);}(_0x46cb,0xd6));var _0xb46c=function(_0x2cd068,_0x7a0a83){_0x2cd068=_0x2cd068-0x0;var _0x1f2d00=_0x46cb[_0x2cd068];return _0x1f2d00;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb46c('0x0'));var express=require(_0xb46c('0x1'));var router=express[_0xb46c('0x2')]();var fs_extra=require(_0xb46c('0x3'));var auth=require(_0xb46c('0x4'));var interaction=require(_0xb46c('0x5'));var config=require(_0xb46c('0x6'));var controller=require(_0xb46c('0x7'));router[_0xb46c('0x8')]('/',auth[_0xb46c('0x9')](),controller[_0xb46c('0xa')]);router[_0xb46c('0x8')](_0xb46c('0xb'),auth[_0xb46c('0x9')](),controller['show']);router[_0xb46c('0xc')]('/',auth[_0xb46c('0x9')](),controller[_0xb46c('0xd')]);router[_0xb46c('0xe')](_0xb46c('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb46c('0xb'),auth[_0xb46c('0x9')](),controller[_0xb46c('0xf')]);module[_0xb46c('0x10')]=router;
\ No newline at end of file
+var _0xd9c8=['post','isAuthenticated','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','show'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd9c8[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var path=require('path');var timeout=require(_0x8d9c('0x2'));var express=require(_0x8d9c('0x3'));var router=express[_0x8d9c('0x4')]();var fs_extra=require(_0x8d9c('0x5'));var auth=require(_0x8d9c('0x6'));var interaction=require(_0x8d9c('0x7'));var config=require(_0x8d9c('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8d9c('0x9')]);router[_0x8d9c('0xa')](_0x8d9c('0xb'),auth['isAuthenticated'](),controller[_0x8d9c('0xc')]);router[_0x8d9c('0xd')]('/',auth[_0x8d9c('0xe')](),controller[_0x8d9c('0xf')]);router[_0x8d9c('0x10')](_0x8d9c('0xb'),auth[_0x8d9c('0xe')](),controller[_0x8d9c('0x11')]);router['delete'](_0x8d9c('0xb'),auth['isAuthenticated'](),controller[_0x8d9c('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 336a149..2bb4afd 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 _0x3a3c=['sequelize','exports','TEXT'];(function(_0x4e897b,_0x269c21){var _0x484a27=function(_0x26d361){while(--_0x26d361){_0x4e897b['push'](_0x4e897b['shift']());}};_0x484a27(++_0x269c21);}(_0x3a3c,0x102));var _0xc3a3=function(_0x238148,_0x29ca2d){_0x238148=_0x238148-0x0;var _0x42ab56=_0x3a3c[_0x238148];return _0x42ab56;};'use strict';var Sequelize=require(_0xc3a3('0x0'));module[_0xc3a3('0x1')]={'tree':{'type':Sequelize[_0xc3a3('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa11e=['TEXT','sequelize','exports'];(function(_0x19cd6c,_0x46de98){var _0x196b4e=function(_0x10e0e4){while(--_0x10e0e4){_0x19cd6c['push'](_0x19cd6c['shift']());}};_0x196b4e(++_0x46de98);}(_0xa11e,0xfa));var _0xea11=function(_0x58006e,_0x6c6cc1){_0x58006e=_0x58006e-0x0;var _0x2c07de=_0xa11e[_0x58006e];return _0x2c07de;};'use strict';var Sequelize=require(_0xea11('0x0'));module[_0xea11('0x1')]={'tree':{'type':Sequelize[_0xea11('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 64ae6c2..305c737 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 _0x134c=['jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','apply','reject','update','then','destroy','error','name','send','index','map','AnalyticTreeReport','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rawAttributes','create','body','catch','find','params','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x134c,0x1d1));var _0xc134=function(_0x50aea5,_0x5dd077){_0x50aea5=_0x50aea5-0x0;var _0x4657f1=_0x134c[_0x50aea5];return _0x4657f1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc134('0x0'));var jsonpatch=require(_0xc134('0x1'));var rp=require(_0xc134('0x2'));var moment=require('moment');var BPromise=require(_0xc134('0x3'));var Mustache=require('mustache');var util=require(_0xc134('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xc134('0x5'));var ejs=require(_0xc134('0x6'));var fs=require('fs');var fs_extra=require(_0xc134('0x7'));var _=require(_0xc134('0x8'));var squel=require(_0xc134('0x9'));var crypto=require(_0xc134('0xa'));var jsforce=require(_0xc134('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc134('0x5'));var querystring=require(_0xc134('0xc'));var Papa=require('papaparse');var Redis=require(_0xc134('0xd'));var authService=require(_0xc134('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc134('0xf'));var logger=require(_0xc134('0x10'))(_0xc134('0x11'));var utils=require(_0xc134('0x12'));var config=require(_0xc134('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc134('0x14'))['db'];function respondWithStatusCode(_0x58affe,_0x162892){_0x162892=_0x162892||0xcc;return function(_0x5d21bd){if(_0x5d21bd){return _0x58affe[_0xc134('0x15')](_0x162892);}return _0x58affe[_0xc134('0x16')](_0x162892)[_0xc134('0x17')]();};}function respondWithResult(_0x249fe9,_0x3629fb){_0x3629fb=_0x3629fb||0xc8;return function(_0x4f07ff){if(_0x4f07ff){return _0x249fe9[_0xc134('0x16')](_0x3629fb)[_0xc134('0x18')](_0x4f07ff);}};}function respondWithFilteredResult(_0x2ccb4f,_0x5a4a62){return function(_0x54629f){if(_0x54629f){var _0xfd2f4f=typeof _0x5a4a62['offset']==='undefined'&&typeof _0x5a4a62[_0xc134('0x19')]==='undefined';var _0xf225c4=_0x54629f[_0xc134('0x1a')];var _0x31dd0e=_0xfd2f4f?0x0:_0x5a4a62[_0xc134('0x1b')];var _0x2ae860=_0xfd2f4f?_0x54629f['count']:_0x5a4a62[_0xc134('0x1b')]+_0x5a4a62['limit'];var _0x3750bc;if(_0x2ae860>=_0xf225c4){_0x2ae860=_0xf225c4;_0x3750bc=0xc8;}else{_0x3750bc=0xce;}_0x2ccb4f[_0xc134('0x16')](_0x3750bc);return _0x2ccb4f[_0xc134('0x1c')]('Content-Range',_0x31dd0e+'-'+_0x2ae860+'/'+_0xf225c4)[_0xc134('0x18')](_0x54629f);}return null;};}function patchUpdates(_0x42133e){return function(_0x24e8ee){try{jsonpatch[_0xc134('0x1d')](_0x24e8ee,_0x42133e,!![]);}catch(_0xf83754){return BPromise[_0xc134('0x1e')](_0xf83754);}return _0x24e8ee['save']();};}function saveUpdates(_0x2cc862,_0x471eaf){return function(_0x460552){if(_0x460552){return _0x460552[_0xc134('0x1f')](_0x2cc862)[_0xc134('0x20')](function(_0x47a37f){return _0x47a37f;});}return null;};}function removeEntity(_0x5c21e0,_0x3374c3){return function(_0xb0b3ff){if(_0xb0b3ff){return _0xb0b3ff[_0xc134('0x21')]()[_0xc134('0x20')](function(){_0x5c21e0['status'](0xcc)[_0xc134('0x17')]();});}};}function handleEntityNotFound(_0xd4354e,_0x21fe6f){return function(_0x455156){if(!_0x455156){_0xd4354e[_0xc134('0x15')](0x194);}return _0x455156;};}function handleError(_0x5b284a,_0x1715d1){_0x1715d1=_0x1715d1||0x1f4;return function(_0x30b862){logger[_0xc134('0x22')](_0x30b862['stack']);if(_0x30b862[_0xc134('0x23')]){delete _0x30b862[_0xc134('0x23')];}_0x5b284a[_0xc134('0x16')](_0x1715d1)[_0xc134('0x24')](_0x30b862);};}exports[_0xc134('0x25')]=function(_0x5f1845,_0x3702ac){var _0xa84c6b={},_0x229ab3={},_0x298c06={'count':0x0,'rows':[]};var _0x59825d=_[_0xc134('0x26')](db[_0xc134('0x27')]['rawAttributes'],function(_0x5a2024){return{'name':_0x5a2024[_0xc134('0x28')],'type':_0x5a2024['type']['key']};});_0x229ab3[_0xc134('0x29')]=_[_0xc134('0x26')](_0x59825d,_0xc134('0x23'));_0x229ab3[_0xc134('0x2a')]=_[_0xc134('0x2b')](_0x5f1845[_0xc134('0x2a')]);_0x229ab3['filters']=_[_0xc134('0x2c')](_0x229ab3[_0xc134('0x29')],_0x229ab3[_0xc134('0x2a')]);_0xa84c6b[_0xc134('0x2d')]=_['intersection'](_0x229ab3[_0xc134('0x29')],qs[_0xc134('0x2e')](_0x5f1845['query'][_0xc134('0x2e')]));_0xa84c6b['attributes']=_0xa84c6b['attributes'][_0xc134('0x2f')]?_0xa84c6b[_0xc134('0x2d')]:_0x229ab3[_0xc134('0x29')];if(!_0x5f1845[_0xc134('0x2a')][_0xc134('0x30')](_0xc134('0x31'))){_0xa84c6b[_0xc134('0x19')]=qs[_0xc134('0x19')](_0x5f1845['query']['limit']);_0xa84c6b[_0xc134('0x1b')]=qs[_0xc134('0x1b')](_0x5f1845[_0xc134('0x2a')][_0xc134('0x1b')]);}_0xa84c6b['order']=qs[_0xc134('0x32')](_0x5f1845[_0xc134('0x2a')][_0xc134('0x32')]);_0xa84c6b[_0xc134('0x33')]=qs[_0xc134('0x34')](_[_0xc134('0x35')](_0x5f1845[_0xc134('0x2a')],_0x229ab3[_0xc134('0x34')]),_0x59825d);if(_0x5f1845[_0xc134('0x2a')][_0xc134('0x36')]){_0xa84c6b['where']=_[_0xc134('0x37')](_0xa84c6b[_0xc134('0x33')],{'$or':_[_0xc134('0x26')](_0x59825d,function(_0x391d4e){if(_0x391d4e[_0xc134('0x38')]!==_0xc134('0x39')){var _0x3c5e0c={};_0x3c5e0c[_0x391d4e[_0xc134('0x23')]]={'$like':'%'+_0x5f1845[_0xc134('0x2a')][_0xc134('0x36')]+'%'};return _0x3c5e0c;}})});}_0xa84c6b=_[_0xc134('0x37')]({},_0xa84c6b,_0x5f1845[_0xc134('0x3a')]);var _0x94a661={'where':_0xa84c6b[_0xc134('0x33')]};return db[_0xc134('0x27')][_0xc134('0x1a')](_0x94a661)[_0xc134('0x20')](function(_0x2ba6e7){_0x298c06['count']=_0x2ba6e7;if(_0x5f1845[_0xc134('0x2a')][_0xc134('0x3b')]){_0xa84c6b[_0xc134('0x3c')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xc134('0x3d')](_0xa84c6b);})[_0xc134('0x20')](function(_0x2b17ae){_0x298c06['rows']=_0x2b17ae;return _0x298c06;})['then'](respondWithFilteredResult(_0x3702ac,_0xa84c6b))['catch'](handleError(_0x3702ac,null));};exports['show']=function(_0x5b765a,_0x1d8c09){var _0x41f74a={'raw':!![],'where':{'id':_0x5b765a['params']['id']}},_0x4cc19b={};_0x4cc19b['model']=_[_0xc134('0x2b')](db['AnalyticTreeReport'][_0xc134('0x3e')]);_0x4cc19b[_0xc134('0x2a')]=_[_0xc134('0x2b')](_0x5b765a[_0xc134('0x2a')]);_0x4cc19b[_0xc134('0x34')]=_[_0xc134('0x2c')](_0x4cc19b[_0xc134('0x29')],_0x4cc19b[_0xc134('0x2a')]);_0x41f74a[_0xc134('0x2d')]=_['intersection'](_0x4cc19b[_0xc134('0x29')],qs['fields'](_0x5b765a[_0xc134('0x2a')][_0xc134('0x2e')]));_0x41f74a[_0xc134('0x2d')]=_0x41f74a[_0xc134('0x2d')]['length']?_0x41f74a[_0xc134('0x2d')]:_0x4cc19b[_0xc134('0x29')];if(_0x5b765a[_0xc134('0x2a')][_0xc134('0x3b')]){_0x41f74a[_0xc134('0x3c')]=[{'all':!![]}];}_0x41f74a=_[_0xc134('0x37')]({},_0x41f74a,_0x5b765a['options']);return db[_0xc134('0x27')]['find'](_0x41f74a)[_0xc134('0x20')](handleEntityNotFound(_0x1d8c09,null))[_0xc134('0x20')](respondWithResult(_0x1d8c09,null))['catch'](handleError(_0x1d8c09,null));};exports[_0xc134('0x3f')]=function(_0x16442e,_0x2a7bb5){return db[_0xc134('0x27')][_0xc134('0x3f')](_0x16442e[_0xc134('0x40')],{})['then'](respondWithResult(_0x2a7bb5,0xc9))[_0xc134('0x41')](handleError(_0x2a7bb5,null));};exports[_0xc134('0x1f')]=function(_0x3b4e78,_0x587d8d){if(_0x3b4e78['body']['id']){delete _0x3b4e78[_0xc134('0x40')]['id'];}return db[_0xc134('0x27')][_0xc134('0x42')]({'where':{'id':_0x3b4e78[_0xc134('0x43')]['id']}})[_0xc134('0x20')](handleEntityNotFound(_0x587d8d,null))[_0xc134('0x20')](saveUpdates(_0x3b4e78[_0xc134('0x40')],null))[_0xc134('0x20')](respondWithResult(_0x587d8d,null))[_0xc134('0x41')](handleError(_0x587d8d,null));};exports['destroy']=function(_0x8d17ed,_0x23b24a){return db[_0xc134('0x27')]['find']({'where':{'id':_0x8d17ed[_0xc134('0x43')]['id']}})['then'](handleEntityNotFound(_0x23b24a,null))[_0xc134('0x20')](removeEntity(_0x23b24a,null))[_0xc134('0x41')](handleError(_0x23b24a,null));};
\ No newline at end of file
+var _0x44e8=['sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x34b3c1,_0x1ec405){var _0x4c72f0=function(_0xcf8d2e){while(--_0xcf8d2e){_0x34b3c1['push'](_0x34b3c1['shift']());}};_0x4c72f0(++_0x1ec405);}(_0x44e8,0xf5));var _0x844e=function(_0x565957,_0x53c91a){_0x565957=_0x565957-0x0;var _0x4706b7=_0x44e8[_0x565957];return _0x4706b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x844e('0x0'));var zipdir=require(_0x844e('0x1'));var jsonpatch=require(_0x844e('0x2'));var rp=require(_0x844e('0x3'));var moment=require(_0x844e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x844e('0x5'));var util=require(_0x844e('0x6'));var path=require(_0x844e('0x7'));var sox=require(_0x844e('0x8'));var csv=require(_0x844e('0x9'));var ejs=require(_0x844e('0xa'));var fs=require('fs');var fs_extra=require(_0x844e('0xb'));var _=require(_0x844e('0xc'));var squel=require(_0x844e('0xd'));var crypto=require('crypto');var jsforce=require(_0x844e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x844e('0x9'));var querystring=require(_0x844e('0xf'));var Papa=require('papaparse');var Redis=require(_0x844e('0x10'));var authService=require(_0x844e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x844e('0x12'));var hardwareService=require(_0x844e('0x13'));var logger=require('../../config/logger')(_0x844e('0x14'));var utils=require(_0x844e('0x15'));var config=require(_0x844e('0x16'));var licenseUtil=require(_0x844e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c1bf5,_0xafbbf5){_0xafbbf5=_0xafbbf5||0xcc;return function(_0x512bea){if(_0x512bea){return _0x3c1bf5[_0x844e('0x18')](_0xafbbf5);}return _0x3c1bf5[_0x844e('0x19')](_0xafbbf5)[_0x844e('0x1a')]();};}function respondWithResult(_0x34d5f9,_0x27f7dd){_0x27f7dd=_0x27f7dd||0xc8;return function(_0x59347a){if(_0x59347a){return _0x34d5f9['status'](_0x27f7dd)[_0x844e('0x1b')](_0x59347a);}};}function respondWithFilteredResult(_0x828ab3,_0x598cb3){return function(_0x3f3a7f){if(_0x3f3a7f){var _0x2ac2a5=typeof _0x598cb3[_0x844e('0x1c')]==='undefined'&&typeof _0x598cb3[_0x844e('0x1d')]==='undefined';var _0x2638a9=_0x3f3a7f[_0x844e('0x1e')];var _0x1a7785=_0x2ac2a5?0x0:_0x598cb3[_0x844e('0x1c')];var _0x301788=_0x2ac2a5?_0x3f3a7f[_0x844e('0x1e')]:_0x598cb3['offset']+_0x598cb3[_0x844e('0x1d')];var _0x101cbe;if(_0x301788>=_0x2638a9){_0x301788=_0x2638a9;_0x101cbe=0xc8;}else{_0x101cbe=0xce;}_0x828ab3[_0x844e('0x19')](_0x101cbe);return _0x828ab3[_0x844e('0x1f')]('Content-Range',_0x1a7785+'-'+_0x301788+'/'+_0x2638a9)[_0x844e('0x1b')](_0x3f3a7f);}return null;};}function patchUpdates(_0x5214c9){return function(_0x1b6f32){try{jsonpatch[_0x844e('0x20')](_0x1b6f32,_0x5214c9,!![]);}catch(_0x3157b7){return BPromise[_0x844e('0x21')](_0x3157b7);}return _0x1b6f32[_0x844e('0x22')]();};}function saveUpdates(_0x4336a5,_0x4bf909){return function(_0x9c796c){if(_0x9c796c){return _0x9c796c[_0x844e('0x23')](_0x4336a5)[_0x844e('0x24')](function(_0x430c56){return _0x430c56;});}return null;};}function removeEntity(_0x6ff083,_0x1b6615){return function(_0xe7c01f){if(_0xe7c01f){return _0xe7c01f[_0x844e('0x25')]()['then'](function(){_0x6ff083[_0x844e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ae5c,_0x4149c7){return function(_0x28dc84){if(!_0x28dc84){_0x38ae5c['sendStatus'](0x194);}return _0x28dc84;};}function handleError(_0x1b83f9,_0x49a20a){_0x49a20a=_0x49a20a||0x1f4;return function(_0x5591be){logger[_0x844e('0x26')](_0x5591be[_0x844e('0x27')]);if(_0x5591be['name']){delete _0x5591be[_0x844e('0x28')];}_0x1b83f9[_0x844e('0x19')](_0x49a20a)[_0x844e('0x29')](_0x5591be);};}exports[_0x844e('0x2a')]=function(_0x4dfc7e,_0x1826f5){var _0x163f95={},_0x47d5c8={},_0x3867e8={'count':0x0,'rows':[]};var _0x4af8bb=_[_0x844e('0x2b')](db[_0x844e('0x2c')][_0x844e('0x2d')],function(_0x3e7e93){return{'name':_0x3e7e93[_0x844e('0x2e')],'type':_0x3e7e93[_0x844e('0x2f')][_0x844e('0x30')]};});_0x47d5c8[_0x844e('0x31')]=_[_0x844e('0x2b')](_0x4af8bb,_0x844e('0x28'));_0x47d5c8[_0x844e('0x32')]=_[_0x844e('0x33')](_0x4dfc7e[_0x844e('0x32')]);_0x47d5c8[_0x844e('0x34')]=_[_0x844e('0x35')](_0x47d5c8[_0x844e('0x31')],_0x47d5c8[_0x844e('0x32')]);_0x163f95[_0x844e('0x36')]=_['intersection'](_0x47d5c8[_0x844e('0x31')],qs[_0x844e('0x37')](_0x4dfc7e[_0x844e('0x32')][_0x844e('0x37')]));_0x163f95[_0x844e('0x36')]=_0x163f95['attributes']['length']?_0x163f95[_0x844e('0x36')]:_0x47d5c8[_0x844e('0x31')];if(!_0x4dfc7e[_0x844e('0x32')][_0x844e('0x38')](_0x844e('0x39'))){_0x163f95[_0x844e('0x1d')]=qs[_0x844e('0x1d')](_0x4dfc7e['query'][_0x844e('0x1d')]);_0x163f95[_0x844e('0x1c')]=qs[_0x844e('0x1c')](_0x4dfc7e[_0x844e('0x32')][_0x844e('0x1c')]);}_0x163f95[_0x844e('0x3a')]=qs[_0x844e('0x3b')](_0x4dfc7e[_0x844e('0x32')]['sort']);_0x163f95[_0x844e('0x3c')]=qs['filters'](_[_0x844e('0x3d')](_0x4dfc7e[_0x844e('0x32')],_0x47d5c8[_0x844e('0x34')]),_0x4af8bb);if(_0x4dfc7e[_0x844e('0x32')][_0x844e('0x3e')]){_0x163f95[_0x844e('0x3c')]=_[_0x844e('0x3f')](_0x163f95[_0x844e('0x3c')],{'$or':_[_0x844e('0x2b')](_0x4af8bb,function(_0x2a2679){if(_0x2a2679[_0x844e('0x2f')]!==_0x844e('0x40')){var _0x211d36={};_0x211d36[_0x2a2679[_0x844e('0x28')]]={'$like':'%'+_0x4dfc7e[_0x844e('0x32')][_0x844e('0x3e')]+'%'};return _0x211d36;}})});}_0x163f95=_[_0x844e('0x3f')]({},_0x163f95,_0x4dfc7e[_0x844e('0x41')]);var _0x4a2579={'where':_0x163f95[_0x844e('0x3c')]};return db['AnalyticTreeReport']['count'](_0x4a2579)[_0x844e('0x24')](function(_0x3ab978){_0x3867e8['count']=_0x3ab978;if(_0x4dfc7e[_0x844e('0x32')]['includeAll']){_0x163f95[_0x844e('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x844e('0x43')](_0x163f95);})[_0x844e('0x24')](function(_0x459ccd){_0x3867e8[_0x844e('0x44')]=_0x459ccd;return _0x3867e8;})[_0x844e('0x24')](respondWithFilteredResult(_0x1826f5,_0x163f95))[_0x844e('0x45')](handleError(_0x1826f5,null));};exports[_0x844e('0x46')]=function(_0x18071e,_0x5a97d7){var _0x11b519={'raw':!![],'where':{'id':_0x18071e[_0x844e('0x47')]['id']}},_0x823bd2={};_0x823bd2['model']=_[_0x844e('0x33')](db[_0x844e('0x2c')]['rawAttributes']);_0x823bd2[_0x844e('0x32')]=_[_0x844e('0x33')](_0x18071e['query']);_0x823bd2[_0x844e('0x34')]=_[_0x844e('0x35')](_0x823bd2[_0x844e('0x31')],_0x823bd2['query']);_0x11b519[_0x844e('0x36')]=_['intersection'](_0x823bd2['model'],qs[_0x844e('0x37')](_0x18071e['query'][_0x844e('0x37')]));_0x11b519['attributes']=_0x11b519['attributes'][_0x844e('0x48')]?_0x11b519[_0x844e('0x36')]:_0x823bd2[_0x844e('0x31')];if(_0x18071e[_0x844e('0x32')]['includeAll']){_0x11b519['include']=[{'all':!![]}];}_0x11b519=_[_0x844e('0x3f')]({},_0x11b519,_0x18071e[_0x844e('0x41')]);return db['AnalyticTreeReport'][_0x844e('0x49')](_0x11b519)[_0x844e('0x24')](handleEntityNotFound(_0x5a97d7,null))['then'](respondWithResult(_0x5a97d7,null))[_0x844e('0x45')](handleError(_0x5a97d7,null));};exports[_0x844e('0x4a')]=function(_0x3c9164,_0x5442ef){return db[_0x844e('0x2c')]['create'](_0x3c9164[_0x844e('0x4b')],{})[_0x844e('0x24')](respondWithResult(_0x5442ef,0xc9))[_0x844e('0x45')](handleError(_0x5442ef,null));};exports[_0x844e('0x23')]=function(_0x174a62,_0x598dae){if(_0x174a62[_0x844e('0x4b')]['id']){delete _0x174a62['body']['id'];}return db[_0x844e('0x2c')][_0x844e('0x49')]({'where':{'id':_0x174a62['params']['id']}})[_0x844e('0x24')](handleEntityNotFound(_0x598dae,null))['then'](saveUpdates(_0x174a62[_0x844e('0x4b')],null))[_0x844e('0x24')](respondWithResult(_0x598dae,null))[_0x844e('0x45')](handleError(_0x598dae,null));};exports['destroy']=function(_0x2acbef,_0x4e85f7){return db[_0x844e('0x2c')][_0x844e('0x49')]({'where':{'id':_0x2acbef[_0x844e('0x47')]['id']}})[_0x844e('0x24')](handleEntityNotFound(_0x4e85f7,null))[_0x844e('0x24')](removeEntity(_0x4e85f7,null))['catch'](handleError(_0x4e85f7,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index f3c3f50..7d68ba6 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 _0x4231=['api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','util','../../config/logger'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x4231,0x82));var _0x1423=function(_0xe5d54f,_0x143d93){_0xe5d54f=_0xe5d54f-0x0;var _0x2a74bf=_0x4231[_0xe5d54f];return _0x2a74bf;};'use strict';var _=require('lodash');var util=require(_0x1423('0x0'));var logger=require(_0x1423('0x1'))(_0x1423('0x2'));var moment=require('moment');var BPromise=require(_0x1423('0x3'));var rp=require(_0x1423('0x4'));var fs=require('fs');var path=require(_0x1423('0x5'));var rimraf=require(_0x1423('0x6'));var config=require(_0x1423('0x7'));var attributes=require(_0x1423('0x8'));module[_0x1423('0x9')]=function(_0x21fe37,_0x4f315e){return _0x21fe37['define'](_0x1423('0xa'),attributes,{'tableName':_0x1423('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf37d=['exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./analyticTreeReport.attributes'];(function(_0xf273f9,_0x486198){var _0xb4abcc=function(_0x2f9418){while(--_0x2f9418){_0xf273f9['push'](_0xf273f9['shift']());}};_0xb4abcc(++_0x486198);}(_0xf37d,0x16e));var _0xdf37=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0xf37d[_0x7791d5];return _0x5ce288;};'use strict';var _=require(_0xdf37('0x0'));var util=require(_0xdf37('0x1'));var logger=require(_0xdf37('0x2'))(_0xdf37('0x3'));var moment=require(_0xdf37('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf37('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf37('0x6'));var config=require('../../config/environment');var attributes=require(_0xdf37('0x7'));module[_0xdf37('0x8')]=function(_0x47b56c,_0x39c272){return _0x47b56c['define'](_0xdf37('0x9'),attributes,{'tableName':_0xdf37('0xa'),'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 d2d2d2e..fb0c082 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(_0x158e3b,_0x4534b){var _0x551a1d=function(_0x629c21){while(--_0x629c21){_0x158e3b['push'](_0x158e3b['shift']());}};_0x551a1d(++_0x4534b);}(_0xadb5,0xad));var _0x5adb=function(_0x28a760,_0x2ddce5){_0x28a760=_0x28a760-0x0;var _0x3bf44f=_0xadb5[_0x28a760];return _0x3bf44f;};'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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xf1ad4d,_0x6c476b){var _0x1275d4=function(_0x225a9d){while(--_0x225a9d){_0xf1ad4d['push'](_0xf1ad4d['shift']());}};_0x1275d4(++_0x6c476b);}(_0x2ef3,0xba));var _0x32ef=function(_0x145fdb,_0x47c911){_0x145fdb=_0x145fdb-0x0;var _0x4a6351=_0x2ef3[_0x145fdb];return _0x4a6351;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index c36d985..e864d9d 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 _0xee40=['put','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee40,0x147));var _0x0ee4=function(_0xed5501,_0x49643e){_0xed5501=_0xed5501-0x0;var _0x54dda5=_0xee40[_0xed5501];return _0x54dda5;};'use strict';var multer=require(_0x0ee4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0ee4('0x1'));var express=require(_0x0ee4('0x2'));var router=express[_0x0ee4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0ee4('0x4'));var interaction=require(_0x0ee4('0x5'));var config=require(_0x0ee4('0x6'));var controller=require(_0x0ee4('0x7'));router[_0x0ee4('0x8')]('/',auth[_0x0ee4('0x9')](),controller[_0x0ee4('0xa')]);router[_0x0ee4('0x8')](_0x0ee4('0xb'),auth[_0x0ee4('0x9')](),controller[_0x0ee4('0xc')]);router[_0x0ee4('0xd')]('/',auth[_0x0ee4('0x9')](),controller[_0x0ee4('0xe')]);router[_0x0ee4('0xf')]('/:id',auth[_0x0ee4('0x9')](),controller[_0x0ee4('0x10')]);router[_0x0ee4('0x11')](_0x0ee4('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x0ee4('0x12')]=router;
\ No newline at end of file
+var _0x555a=['multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x862827,_0x47138b){var _0x4bea04=function(_0x2536bf){while(--_0x2536bf){_0x862827['push'](_0x862827['shift']());}};_0x4bea04(++_0x47138b);}(_0x555a,0x1d4));var _0xa555=function(_0x368a7d,_0x190e80){_0x368a7d=_0x368a7d-0x0;var _0x271079=_0x555a[_0x368a7d];return _0x271079;};'use strict';var multer=require(_0xa555('0x0'));var util=require(_0xa555('0x1'));var path=require('path');var timeout=require(_0xa555('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa555('0x3'));var auth=require(_0xa555('0x4'));var interaction=require(_0xa555('0x5'));var config=require('../../config/environment');var controller=require(_0xa555('0x6'));router[_0xa555('0x7')]('/',auth[_0xa555('0x8')](),controller[_0xa555('0x9')]);router[_0xa555('0x7')](_0xa555('0xa'),auth[_0xa555('0x8')](),controller[_0xa555('0xb')]);router['post']('/',auth[_0xa555('0x8')](),controller[_0xa555('0xc')]);router[_0xa555('0xd')](_0xa555('0xa'),auth[_0xa555('0x8')](),controller[_0xa555('0xe')]);router[_0xa555('0xf')](_0xa555('0xa'),auth['isAuthenticated'](),controller[_0xa555('0x10')]);module[_0xa555('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 8420f8e..a3222ae 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 _0xa3e6=['sequelize','STRING'];(function(_0x3c9159,_0x58f463){var _0x3a6f26=function(_0x57c4f7){while(--_0x57c4f7){_0x3c9159['push'](_0x3c9159['shift']());}};_0x3a6f26(++_0x58f463);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x58cabf,_0x1bc95f){_0x58cabf=_0x58cabf-0x0;var _0x33bfe4=_0xa3e6[_0x58cabf];return _0x33bfe4;};'use strict';var Sequelize=require(_0x6a3e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a3e('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6a3e('0x1')]}};
\ No newline at end of file
+var _0x54da=['STRING','sequelize'];(function(_0x56de0b,_0x1c39c1){var _0x1c05f0=function(_0x5a6e7d){while(--_0x5a6e7d){_0x56de0b['push'](_0x56de0b['shift']());}};_0x1c05f0(++_0x1c39c1);}(_0x54da,0x9d));var _0xa54d=function(_0x5ba6e2,_0x48e57b){_0x5ba6e2=_0x5ba6e2-0x0;var _0x51c376=_0x54da[_0x5ba6e2];return _0x51c376;};'use strict';var Sequelize=require(_0xa54d('0x0'));module['exports']={'name':{'type':Sequelize[_0xa54d('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index afc8992..d4c2f3d 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 _0x08af=['mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','map','Attachment','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','clone','get','omit','updatedAt','body','createdAt','create','file','originalname','basename','filename'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x08af,0xb7));var _0xf08a=function(_0x1d850e,_0x723bc4){_0x1d850e=_0x1d850e-0x0;var _0x2efd1f=_0x08af[_0x1d850e];return _0x2efd1f;};'use strict';var emlformat=require(_0xf08a('0x0'));var rimraf=require(_0xf08a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf08a('0x2'));var rp=require(_0xf08a('0x3'));var moment=require(_0xf08a('0x4'));var BPromise=require(_0xf08a('0x5'));var Mustache=require('mustache');var util=require(_0xf08a('0x6'));var path=require('path');var sox=require(_0xf08a('0x7'));var csv=require(_0xf08a('0x8'));var ejs=require(_0xf08a('0x9'));var fs=require('fs');var fs_extra=require(_0xf08a('0xa'));var _=require(_0xf08a('0xb'));var squel=require(_0xf08a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf08a('0xd'));var toCsv=require(_0xf08a('0x8'));var querystring=require(_0xf08a('0xe'));var Papa=require(_0xf08a('0xf'));var Redis=require(_0xf08a('0x10'));var authService=require(_0xf08a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf08a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf08a('0x13'));var utils=require(_0xf08a('0x14'));var config=require(_0xf08a('0x15'));var licenseUtil=require(_0xf08a('0x16'));var db=require(_0xf08a('0x17'))['db'];function respondWithStatusCode(_0x48a7aa,_0x19ff42){_0x19ff42=_0x19ff42||0xcc;return function(_0x143751){if(_0x143751){return _0x48a7aa[_0xf08a('0x18')](_0x19ff42);}return _0x48a7aa[_0xf08a('0x19')](_0x19ff42)['end']();};}function respondWithResult(_0x307f77,_0x18df6e){_0x18df6e=_0x18df6e||0xc8;return function(_0x37dfa7){if(_0x37dfa7){return _0x307f77[_0xf08a('0x19')](_0x18df6e)[_0xf08a('0x1a')](_0x37dfa7);}};}function respondWithFilteredResult(_0x2e9a66,_0x1a9f6c){return function(_0x257309){if(_0x257309){var _0x23c301=typeof _0x1a9f6c['offset']===_0xf08a('0x1b')&&typeof _0x1a9f6c[_0xf08a('0x1c')]==='undefined';var _0x5c0572=_0x257309[_0xf08a('0x1d')];var _0x254c9d=_0x23c301?0x0:_0x1a9f6c[_0xf08a('0x1e')];var _0x30c6d0=_0x23c301?_0x257309['count']:_0x1a9f6c['offset']+_0x1a9f6c['limit'];var _0x5a02d8;if(_0x30c6d0>=_0x5c0572){_0x30c6d0=_0x5c0572;_0x5a02d8=0xc8;}else{_0x5a02d8=0xce;}_0x2e9a66[_0xf08a('0x19')](_0x5a02d8);return _0x2e9a66[_0xf08a('0x1f')](_0xf08a('0x20'),_0x254c9d+'-'+_0x30c6d0+'/'+_0x5c0572)[_0xf08a('0x1a')](_0x257309);}return null;};}function patchUpdates(_0xfa57b8){return function(_0x5c6e81){try{jsonpatch[_0xf08a('0x21')](_0x5c6e81,_0xfa57b8,!![]);}catch(_0x3000d4){return BPromise[_0xf08a('0x22')](_0x3000d4);}return _0x5c6e81['save']();};}function saveUpdates(_0x2c7413,_0x1812a6){return function(_0x24163e){if(_0x24163e){return _0x24163e[_0xf08a('0x23')](_0x2c7413)['then'](function(_0x253357){return _0x253357;});}return null;};}function removeEntity(_0x3031b7,_0x131507){return function(_0xccf5bc){if(_0xccf5bc){return _0xccf5bc[_0xf08a('0x24')]()[_0xf08a('0x25')](function(){_0x3031b7[_0xf08a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbfc6e8,_0x15b653){return function(_0xc47e86){if(!_0xc47e86){_0xbfc6e8['sendStatus'](0x194);}return _0xc47e86;};}function handleError(_0x3a6d7c,_0x1bf680){_0x1bf680=_0x1bf680||0x1f4;return function(_0x2df195){logger[_0xf08a('0x26')](_0x2df195[_0xf08a('0x27')]);if(_0x2df195[_0xf08a('0x28')]){delete _0x2df195[_0xf08a('0x28')];}_0x3a6d7c[_0xf08a('0x19')](_0x1bf680)['send'](_0x2df195);};}exports['index']=function(_0xb6a203,_0x1a3a54){var _0x1f192a={},_0x15df7c={},_0xf5c80e={'count':0x0,'rows':[]};var _0x5d71b8=_[_0xf08a('0x29')](db[_0xf08a('0x2a')][_0xf08a('0x2b')],function(_0x3de322){return{'name':_0x3de322['fieldName'],'type':_0x3de322[_0xf08a('0x2c')][_0xf08a('0x2d')]};});_0x15df7c[_0xf08a('0x2e')]=_[_0xf08a('0x29')](_0x5d71b8,_0xf08a('0x28'));_0x15df7c[_0xf08a('0x2f')]=_[_0xf08a('0x30')](_0xb6a203['query']);_0x15df7c['filters']=_[_0xf08a('0x31')](_0x15df7c['model'],_0x15df7c[_0xf08a('0x2f')]);_0x1f192a[_0xf08a('0x32')]=_[_0xf08a('0x31')](_0x15df7c[_0xf08a('0x2e')],qs[_0xf08a('0x33')](_0xb6a203['query'][_0xf08a('0x33')]));_0x1f192a[_0xf08a('0x32')]=_0x1f192a[_0xf08a('0x32')]['length']?_0x1f192a[_0xf08a('0x32')]:_0x15df7c[_0xf08a('0x2e')];if(!_0xb6a203[_0xf08a('0x2f')][_0xf08a('0x34')](_0xf08a('0x35'))){_0x1f192a[_0xf08a('0x1c')]=qs[_0xf08a('0x1c')](_0xb6a203[_0xf08a('0x2f')][_0xf08a('0x1c')]);_0x1f192a[_0xf08a('0x1e')]=qs[_0xf08a('0x1e')](_0xb6a203[_0xf08a('0x2f')][_0xf08a('0x1e')]);}_0x1f192a[_0xf08a('0x36')]=qs[_0xf08a('0x37')](_0xb6a203['query'][_0xf08a('0x37')]);_0x1f192a[_0xf08a('0x38')]=qs['filters'](_[_0xf08a('0x39')](_0xb6a203[_0xf08a('0x2f')],_0x15df7c['filters']),_0x5d71b8);if(_0xb6a203[_0xf08a('0x2f')][_0xf08a('0x3a')]){_0x1f192a[_0xf08a('0x38')]=_[_0xf08a('0x3b')](_0x1f192a[_0xf08a('0x38')],{'$or':_[_0xf08a('0x29')](_0x5d71b8,function(_0x105d31){if(_0x105d31['type']!=='VIRTUAL'){var _0x39d291={};_0x39d291[_0x105d31[_0xf08a('0x28')]]={'$like':'%'+_0xb6a203['query'][_0xf08a('0x3a')]+'%'};return _0x39d291;}})});}_0x1f192a=_['merge']({},_0x1f192a,_0xb6a203[_0xf08a('0x3c')]);var _0x339162={'where':_0x1f192a[_0xf08a('0x38')]};return db[_0xf08a('0x2a')][_0xf08a('0x1d')](_0x339162)['then'](function(_0x3cf1db){_0xf5c80e[_0xf08a('0x1d')]=_0x3cf1db;if(_0xb6a203[_0xf08a('0x2f')][_0xf08a('0x3d')]){_0x1f192a['include']=[{'all':!![]}];}return db[_0xf08a('0x2a')][_0xf08a('0x3e')](_0x1f192a);})[_0xf08a('0x25')](function(_0x5268d2){_0xf5c80e[_0xf08a('0x3f')]=_0x5268d2;return _0xf5c80e;})['then'](respondWithFilteredResult(_0x1a3a54,_0x1f192a))[_0xf08a('0x40')](handleError(_0x1a3a54,null));};exports[_0xf08a('0x41')]=function(_0x4f03f6,_0x4e8897){var _0x2e717e={'raw':!![],'where':{'id':_0x4f03f6[_0xf08a('0x42')]['id']}},_0x1c50aa={};_0x1c50aa[_0xf08a('0x2e')]=_[_0xf08a('0x30')](db[_0xf08a('0x2a')][_0xf08a('0x2b')]);_0x1c50aa['query']=_['keys'](_0x4f03f6['query']);_0x1c50aa['filters']=_[_0xf08a('0x31')](_0x1c50aa[_0xf08a('0x2e')],_0x1c50aa[_0xf08a('0x2f')]);_0x2e717e[_0xf08a('0x32')]=_[_0xf08a('0x31')](_0x1c50aa[_0xf08a('0x2e')],qs['fields'](_0x4f03f6['query'][_0xf08a('0x33')]));_0x2e717e[_0xf08a('0x32')]=_0x2e717e[_0xf08a('0x32')][_0xf08a('0x43')]?_0x2e717e[_0xf08a('0x32')]:_0x1c50aa[_0xf08a('0x2e')];if(_0x4f03f6[_0xf08a('0x2f')][_0xf08a('0x3d')]){_0x2e717e[_0xf08a('0x44')]=[{'all':!![]}];}_0x2e717e=_['merge']({},_0x2e717e,_0x4f03f6['options']);return db[_0xf08a('0x2a')][_0xf08a('0x45')](_0x2e717e)[_0xf08a('0x25')](handleEntityNotFound(_0x4e8897,null))['then'](respondWithResult(_0x4e8897,null))[_0xf08a('0x40')](handleError(_0x4e8897,null));};exports[_0xf08a('0x46')]=function(_0x458c75,_0x51b04e){var _0x3275db={'where':{'id':_0x458c75[_0xf08a('0x42')]['id']}},_0x3b3227={};_0x3b3227[_0xf08a('0x2e')]=_[_0xf08a('0x30')](db[_0xf08a('0x2a')][_0xf08a('0x2b')]);_0x3275db[_0xf08a('0x32')]=_[_0xf08a('0x31')](_0x3b3227[_0xf08a('0x2e')],qs[_0xf08a('0x33')](_0x458c75[_0xf08a('0x2f')]['fields']));_0x3275db[_0xf08a('0x32')]=_0x3275db[_0xf08a('0x32')][_0xf08a('0x43')]?_0x3275db[_0xf08a('0x32')]:_0x3b3227[_0xf08a('0x2e')];if(_0x458c75[_0xf08a('0x2f')][_0xf08a('0x3d')]){_0x3275db[_0xf08a('0x44')]=[{'all':!![]}];}_0x3275db=_[_0xf08a('0x3b')]({},_0x3275db,_0x458c75[_0xf08a('0x3c')]);return db[_0xf08a('0x2a')][_0xf08a('0x45')](_0x3275db)[_0xf08a('0x25')](handleEntityNotFound(_0x51b04e,null))['then'](function(_0x487222){if(_0x487222){var _0x312759=_0x487222[_0xf08a('0x47')]({'plain':!![]});_0x312759=qs[_0xf08a('0x48')](_0x312759,['id','createdAt',_0xf08a('0x49')]);_0x458c75[_0xf08a('0x4a')]=_[_0xf08a('0x48')](_0x458c75['body'],['id',_0xf08a('0x4b'),_0xf08a('0x49')]);return db[_0xf08a('0x2a')][_0xf08a('0x4c')](_[_0xf08a('0x3b')](_0x312759,_0x458c75[_0xf08a('0x4a')]),{'include':_0x458c75[_0xf08a('0x2f')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xf08a('0x25')](respondWithResult(_0x51b04e,0xc9))['catch'](handleError(_0x51b04e,null));};exports['update']=function(_0x1b095c,_0x53db28){if(_0x1b095c[_0xf08a('0x4a')]['id']){delete _0x1b095c[_0xf08a('0x4a')]['id'];}return db[_0xf08a('0x2a')][_0xf08a('0x45')]({'where':{'id':_0x1b095c[_0xf08a('0x42')]['id']}})[_0xf08a('0x25')](handleEntityNotFound(_0x53db28,null))[_0xf08a('0x25')](saveUpdates(_0x1b095c[_0xf08a('0x4a')],null))[_0xf08a('0x25')](respondWithResult(_0x53db28,null))[_0xf08a('0x40')](handleError(_0x53db28,null));};exports[_0xf08a('0x24')]=function(_0x13221d,_0x5b555a){return db[_0xf08a('0x2a')][_0xf08a('0x45')]({'where':{'id':_0x13221d[_0xf08a('0x42')]['id']}})[_0xf08a('0x25')](handleEntityNotFound(_0x5b555a,null))[_0xf08a('0x25')](removeEntity(_0x5b555a,null))['catch'](handleError(_0x5b555a,null));};exports[_0xf08a('0x4c')]=function(_0xe0307b,_0x33f2d6,_0x45b265){_0xe0307b[_0xf08a('0x4a')][_0xf08a('0x28')]=_0xe0307b[_0xf08a('0x4d')][_0xf08a('0x4e')];_0xe0307b['body'][_0xf08a('0x4f')]=_0xe0307b['file'][_0xf08a('0x50')];_0xe0307b[_0xf08a('0x4a')][_0xf08a('0x2c')]=_0xe0307b[_0xf08a('0x4d')][_0xf08a('0x51')];return db[_0xf08a('0x2a')][_0xf08a('0x4c')](_0xe0307b['body'])[_0xf08a('0x25')](respondWithResult(_0x33f2d6,0xc9))[_0xf08a('0x40')](handleError(_0x33f2d6,null));};exports[_0xf08a('0x52')]=function(_0x1a80bd,_0x2a77a8,_0x3c0526){return db[_0xf08a('0x2a')][_0xf08a('0x53')]({'where':{'id':_0x1a80bd[_0xf08a('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2a77a8,null))[_0xf08a('0x25')](function(_0x36b547){if(_0x36b547){var _0x118b48=_0x36b547[_0xf08a('0x54')]!==null;var _0x5122bd=path[_0xf08a('0x55')](config['root'],_0xf08a('0x56'));if(_0x118b48){_0x5122bd=path['join'](_0x5122bd,_0xf08a('0x57'));}var _0x42ff14=path[_0xf08a('0x55')](_0x5122bd,_0x36b547[_0xf08a('0x4f')]);return _0x2a77a8['download'](_0x42ff14);}})[_0xf08a('0x40')](handleError(_0x2a77a8,null));};
\ No newline at end of file
+var _0xed9e=['set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','Attachment','findAll','rows','catch','show','length','include','options','params','get','omit','updatedAt','body','createdAt','create','find','file','originalname','basename','filename','type','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count'];(function(_0x3fca6b,_0x2414eb){var _0x1fd4b5=function(_0x4331c8){while(--_0x4331c8){_0x3fca6b['push'](_0x3fca6b['shift']());}};_0x1fd4b5(++_0x2414eb);}(_0xed9e,0xf5));var _0xeed9=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0xed9e[_0x4c06a3];return _0x7ff53c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeed9('0x0'));var jsonpatch=require(_0xeed9('0x1'));var rp=require(_0xeed9('0x2'));var moment=require('moment');var BPromise=require(_0xeed9('0x3'));var Mustache=require(_0xeed9('0x4'));var util=require('util');var path=require(_0xeed9('0x5'));var sox=require(_0xeed9('0x6'));var csv=require(_0xeed9('0x7'));var ejs=require(_0xeed9('0x8'));var fs=require('fs');var fs_extra=require(_0xeed9('0x9'));var _=require(_0xeed9('0xa'));var squel=require(_0xeed9('0xb'));var crypto=require(_0xeed9('0xc'));var jsforce=require(_0xeed9('0xd'));var deskjs=require(_0xeed9('0xe'));var toCsv=require(_0xeed9('0x7'));var querystring=require('querystring');var Papa=require(_0xeed9('0xf'));var Redis=require('ioredis');var authService=require(_0xeed9('0x10'));var qs=require(_0xeed9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeed9('0x12'))(_0xeed9('0x13'));var utils=require(_0xeed9('0x14'));var config=require(_0xeed9('0x15'));var licenseUtil=require(_0xeed9('0x16'));var db=require(_0xeed9('0x17'))['db'];function respondWithStatusCode(_0x4dcaf9,_0x267b56){_0x267b56=_0x267b56||0xcc;return function(_0x2b5966){if(_0x2b5966){return _0x4dcaf9['sendStatus'](_0x267b56);}return _0x4dcaf9[_0xeed9('0x18')](_0x267b56)[_0xeed9('0x19')]();};}function respondWithResult(_0x5b205c,_0x5e4baf){_0x5e4baf=_0x5e4baf||0xc8;return function(_0x4d3224){if(_0x4d3224){return _0x5b205c[_0xeed9('0x18')](_0x5e4baf)[_0xeed9('0x1a')](_0x4d3224);}};}function respondWithFilteredResult(_0x41e6bf,_0x28b483){return function(_0x1f7e27){if(_0x1f7e27){var _0x5ee5ae=typeof _0x28b483[_0xeed9('0x1b')]==='undefined'&&typeof _0x28b483[_0xeed9('0x1c')]===_0xeed9('0x1d');var _0x4b3db6=_0x1f7e27[_0xeed9('0x1e')];var _0x2887a7=_0x5ee5ae?0x0:_0x28b483[_0xeed9('0x1b')];var _0x3b623b=_0x5ee5ae?_0x1f7e27[_0xeed9('0x1e')]:_0x28b483[_0xeed9('0x1b')]+_0x28b483[_0xeed9('0x1c')];var _0x53c4e4;if(_0x3b623b>=_0x4b3db6){_0x3b623b=_0x4b3db6;_0x53c4e4=0xc8;}else{_0x53c4e4=0xce;}_0x41e6bf['status'](_0x53c4e4);return _0x41e6bf[_0xeed9('0x1f')](_0xeed9('0x20'),_0x2887a7+'-'+_0x3b623b+'/'+_0x4b3db6)[_0xeed9('0x1a')](_0x1f7e27);}return null;};}function patchUpdates(_0x5a49de){return function(_0x1713f5){try{jsonpatch[_0xeed9('0x21')](_0x1713f5,_0x5a49de,!![]);}catch(_0x107d5e){return BPromise['reject'](_0x107d5e);}return _0x1713f5[_0xeed9('0x22')]();};}function saveUpdates(_0x209426,_0x30b56e){return function(_0x49fd35){if(_0x49fd35){return _0x49fd35[_0xeed9('0x23')](_0x209426)[_0xeed9('0x24')](function(_0x4f7f27){return _0x4f7f27;});}return null;};}function removeEntity(_0xe46346,_0x2dff0){return function(_0x5b6069){if(_0x5b6069){return _0x5b6069[_0xeed9('0x25')]()[_0xeed9('0x24')](function(){_0xe46346[_0xeed9('0x18')](0xcc)[_0xeed9('0x19')]();});}};}function handleEntityNotFound(_0x247d1a,_0xc40b1d){return function(_0xe40997){if(!_0xe40997){_0x247d1a[_0xeed9('0x26')](0x194);}return _0xe40997;};}function handleError(_0x50b074,_0x5435e1){_0x5435e1=_0x5435e1||0x1f4;return function(_0x43fed1){logger[_0xeed9('0x27')](_0x43fed1[_0xeed9('0x28')]);if(_0x43fed1[_0xeed9('0x29')]){delete _0x43fed1[_0xeed9('0x29')];}_0x50b074['status'](_0x5435e1)[_0xeed9('0x2a')](_0x43fed1);};}exports[_0xeed9('0x2b')]=function(_0x3dcc33,_0x2b0dec){var _0x113358={},_0x4ad7ce={},_0x3746aa={'count':0x0,'rows':[]};var _0x27cc14=_[_0xeed9('0x2c')](db['Attachment'][_0xeed9('0x2d')],function(_0x4f9fec){return{'name':_0x4f9fec[_0xeed9('0x2e')],'type':_0x4f9fec['type'][_0xeed9('0x2f')]};});_0x4ad7ce[_0xeed9('0x30')]=_['map'](_0x27cc14,'name');_0x4ad7ce[_0xeed9('0x31')]=_[_0xeed9('0x32')](_0x3dcc33[_0xeed9('0x31')]);_0x4ad7ce[_0xeed9('0x33')]=_['intersection'](_0x4ad7ce[_0xeed9('0x30')],_0x4ad7ce[_0xeed9('0x31')]);_0x113358[_0xeed9('0x34')]=_[_0xeed9('0x35')](_0x4ad7ce[_0xeed9('0x30')],qs['fields'](_0x3dcc33[_0xeed9('0x31')][_0xeed9('0x36')]));_0x113358[_0xeed9('0x34')]=_0x113358[_0xeed9('0x34')]['length']?_0x113358['attributes']:_0x4ad7ce[_0xeed9('0x30')];if(!_0x3dcc33[_0xeed9('0x31')]['hasOwnProperty']('nolimit')){_0x113358['limit']=qs[_0xeed9('0x1c')](_0x3dcc33[_0xeed9('0x31')][_0xeed9('0x1c')]);_0x113358['offset']=qs[_0xeed9('0x1b')](_0x3dcc33['query'][_0xeed9('0x1b')]);}_0x113358[_0xeed9('0x37')]=qs[_0xeed9('0x38')](_0x3dcc33[_0xeed9('0x31')]['sort']);_0x113358['where']=qs[_0xeed9('0x33')](_[_0xeed9('0x39')](_0x3dcc33['query'],_0x4ad7ce['filters']),_0x27cc14);if(_0x3dcc33[_0xeed9('0x31')][_0xeed9('0x3a')]){_0x113358[_0xeed9('0x3b')]=_[_0xeed9('0x3c')](_0x113358[_0xeed9('0x3b')],{'$or':_[_0xeed9('0x2c')](_0x27cc14,function(_0xa8a1b7){if(_0xa8a1b7['type']!==_0xeed9('0x3d')){var _0x5efa6f={};_0x5efa6f[_0xa8a1b7[_0xeed9('0x29')]]={'$like':'%'+_0x3dcc33[_0xeed9('0x31')][_0xeed9('0x3a')]+'%'};return _0x5efa6f;}})});}_0x113358=_[_0xeed9('0x3c')]({},_0x113358,_0x3dcc33['options']);var _0x39294c={'where':_0x113358[_0xeed9('0x3b')]};return db['Attachment'][_0xeed9('0x1e')](_0x39294c)[_0xeed9('0x24')](function(_0x8880a8){_0x3746aa['count']=_0x8880a8;if(_0x3dcc33['query'][_0xeed9('0x3e')]){_0x113358['include']=[{'all':!![]}];}return db[_0xeed9('0x3f')][_0xeed9('0x40')](_0x113358);})[_0xeed9('0x24')](function(_0x3c73c5){_0x3746aa[_0xeed9('0x41')]=_0x3c73c5;return _0x3746aa;})[_0xeed9('0x24')](respondWithFilteredResult(_0x2b0dec,_0x113358))[_0xeed9('0x42')](handleError(_0x2b0dec,null));};exports[_0xeed9('0x43')]=function(_0x1467c3,_0x178bf2){var _0x1ad890={'raw':!![],'where':{'id':_0x1467c3['params']['id']}},_0x4f7f95={};_0x4f7f95['model']=_['keys'](db['Attachment'][_0xeed9('0x2d')]);_0x4f7f95[_0xeed9('0x31')]=_[_0xeed9('0x32')](_0x1467c3[_0xeed9('0x31')]);_0x4f7f95[_0xeed9('0x33')]=_[_0xeed9('0x35')](_0x4f7f95[_0xeed9('0x30')],_0x4f7f95['query']);_0x1ad890[_0xeed9('0x34')]=_[_0xeed9('0x35')](_0x4f7f95[_0xeed9('0x30')],qs[_0xeed9('0x36')](_0x1467c3[_0xeed9('0x31')][_0xeed9('0x36')]));_0x1ad890[_0xeed9('0x34')]=_0x1ad890[_0xeed9('0x34')][_0xeed9('0x44')]?_0x1ad890[_0xeed9('0x34')]:_0x4f7f95['model'];if(_0x1467c3[_0xeed9('0x31')]['includeAll']){_0x1ad890[_0xeed9('0x45')]=[{'all':!![]}];}_0x1ad890=_[_0xeed9('0x3c')]({},_0x1ad890,_0x1467c3[_0xeed9('0x46')]);return db[_0xeed9('0x3f')]['find'](_0x1ad890)[_0xeed9('0x24')](handleEntityNotFound(_0x178bf2,null))[_0xeed9('0x24')](respondWithResult(_0x178bf2,null))['catch'](handleError(_0x178bf2,null));};exports['clone']=function(_0x3f3584,_0x4a229f){var _0x2dbd59={'where':{'id':_0x3f3584[_0xeed9('0x47')]['id']}},_0x478502={};_0x478502[_0xeed9('0x30')]=_[_0xeed9('0x32')](db[_0xeed9('0x3f')][_0xeed9('0x2d')]);_0x2dbd59[_0xeed9('0x34')]=_[_0xeed9('0x35')](_0x478502[_0xeed9('0x30')],qs['fields'](_0x3f3584[_0xeed9('0x31')]['fields']));_0x2dbd59[_0xeed9('0x34')]=_0x2dbd59['attributes'][_0xeed9('0x44')]?_0x2dbd59[_0xeed9('0x34')]:_0x478502[_0xeed9('0x30')];if(_0x3f3584[_0xeed9('0x31')]['includeAll']){_0x2dbd59['include']=[{'all':!![]}];}_0x2dbd59=_[_0xeed9('0x3c')]({},_0x2dbd59,_0x3f3584[_0xeed9('0x46')]);return db[_0xeed9('0x3f')]['find'](_0x2dbd59)[_0xeed9('0x24')](handleEntityNotFound(_0x4a229f,null))['then'](function(_0x3975e3){if(_0x3975e3){var _0x201ba8=_0x3975e3[_0xeed9('0x48')]({'plain':!![]});_0x201ba8=qs[_0xeed9('0x49')](_0x201ba8,['id','createdAt',_0xeed9('0x4a')]);_0x3f3584[_0xeed9('0x4b')]=_['omit'](_0x3f3584[_0xeed9('0x4b')],['id',_0xeed9('0x4c'),'updatedAt']);return db['Attachment'][_0xeed9('0x4d')](_[_0xeed9('0x3c')](_0x201ba8,_0x3f3584['body']),{'include':_0x3f3584[_0xeed9('0x31')][_0xeed9('0x3e')]?[{'all':!![]}]:undefined});}})[_0xeed9('0x24')](respondWithResult(_0x4a229f,0xc9))[_0xeed9('0x42')](handleError(_0x4a229f,null));};exports[_0xeed9('0x23')]=function(_0x5628bb,_0x32b3be){if(_0x5628bb['body']['id']){delete _0x5628bb[_0xeed9('0x4b')]['id'];}return db[_0xeed9('0x3f')][_0xeed9('0x4e')]({'where':{'id':_0x5628bb[_0xeed9('0x47')]['id']}})[_0xeed9('0x24')](handleEntityNotFound(_0x32b3be,null))['then'](saveUpdates(_0x5628bb[_0xeed9('0x4b')],null))[_0xeed9('0x24')](respondWithResult(_0x32b3be,null))[_0xeed9('0x42')](handleError(_0x32b3be,null));};exports[_0xeed9('0x25')]=function(_0x12f009,_0x2b0fe3){return db[_0xeed9('0x3f')]['find']({'where':{'id':_0x12f009[_0xeed9('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b0fe3,null))[_0xeed9('0x24')](removeEntity(_0x2b0fe3,null))[_0xeed9('0x42')](handleError(_0x2b0fe3,null));};exports['create']=function(_0x52836e,_0x57cf6d,_0x33f99a){_0x52836e[_0xeed9('0x4b')][_0xeed9('0x29')]=_0x52836e[_0xeed9('0x4f')][_0xeed9('0x50')];_0x52836e[_0xeed9('0x4b')][_0xeed9('0x51')]=_0x52836e['file'][_0xeed9('0x52')];_0x52836e[_0xeed9('0x4b')][_0xeed9('0x53')]=_0x52836e[_0xeed9('0x4f')][_0xeed9('0x54')];return db[_0xeed9('0x3f')][_0xeed9('0x4d')](_0x52836e[_0xeed9('0x4b')])[_0xeed9('0x24')](respondWithResult(_0x57cf6d,0xc9))['catch'](handleError(_0x57cf6d,null));};exports[_0xeed9('0x55')]=function(_0x2515a0,_0x195d3e,_0x1972d5){return db['Attachment'][_0xeed9('0x56')]({'where':{'id':_0x2515a0['params']['id']},'raw':!![]})[_0xeed9('0x24')](handleEntityNotFound(_0x195d3e,null))['then'](function(_0x4d1d4f){if(_0x4d1d4f){var _0x1fc151=_0x4d1d4f[_0xeed9('0x57')]!==null;var _0x4e24a1=path[_0xeed9('0x58')](config[_0xeed9('0x59')],_0xeed9('0x5a'));if(_0x1fc151){_0x4e24a1=path[_0xeed9('0x58')](_0x4e24a1,_0xeed9('0x5b'));}var _0xd454ee=path[_0xeed9('0x58')](_0x4e24a1,_0x4d1d4f['basename']);return _0x195d3e[_0xeed9('0x55')](_0xd454ee);}})[_0xeed9('0x42')](handleError(_0x195d3e,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 1956fb4..a8e7e84 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 _0x8c5d=['./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1268f3,_0x581d88){var _0x27789e=function(_0x5ec676){while(--_0x5ec676){_0x1268f3['push'](_0x1268f3['shift']());}};_0x27789e(++_0x581d88);}(_0x8c5d,0xad));var _0xd8c5=function(_0x14c945,_0x11d713){_0x14c945=_0x14c945-0x0;var _0x3ed9be=_0x8c5d[_0x14c945];return _0x3ed9be;};'use strict';var _=require(_0xd8c5('0x0'));var util=require(_0xd8c5('0x1'));var logger=require(_0xd8c5('0x2'))(_0xd8c5('0x3'));var moment=require(_0xd8c5('0x4'));var BPromise=require(_0xd8c5('0x5'));var rp=require(_0xd8c5('0x6'));var fs=require('fs');var path=require(_0xd8c5('0x7'));var rimraf=require(_0xd8c5('0x8'));var config=require('../../config/environment');var attributes=require(_0xd8c5('0x9'));module[_0xd8c5('0xa')]=function(_0x3811de,_0x5baa6d){return _0x3811de[_0xd8c5('0xb')](_0xd8c5('0xc'),attributes,{'tableName':_0xd8c5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe022=['attachments','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x668d5b,_0x47e921){var _0x26b714=function(_0x50261a){while(--_0x50261a){_0x668d5b['push'](_0x668d5b['shift']());}};_0x26b714(++_0x47e921);}(_0xe022,0x6d));var _0x2e02=function(_0x4f6c83,_0x4cec92){_0x4f6c83=_0x4f6c83-0x0;var _0x33cb29=_0xe022[_0x4f6c83];return _0x33cb29;};'use strict';var _=require(_0x2e02('0x0'));var util=require('util');var logger=require(_0x2e02('0x1'))(_0x2e02('0x2'));var moment=require('moment');var BPromise=require(_0x2e02('0x3'));var rp=require(_0x2e02('0x4'));var fs=require('fs');var path=require(_0x2e02('0x5'));var rimraf=require('rimraf');var config=require(_0x2e02('0x6'));var attributes=require(_0x2e02('0x7'));module[_0x2e02('0x8')]=function(_0x2bb714,_0x4b2b70){return _0x2bb714[_0x2e02('0x9')](_0x2e02('0xa'),attributes,{'tableName':_0x2e02('0xb'),'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 b34f797..2c36d9d 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 _0xb377=['catch','CreateAttachment','Attachment','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4c94d1,_0x573a4f){var _0x48c2c3=function(_0x326bcc){while(--_0x326bcc){_0x4c94d1['push'](_0x4c94d1['shift']());}};_0x48c2c3(++_0x573a4f);}(_0xb377,0x1b6));var _0x7b37=function(_0x54986a,_0x1bbed2){_0x54986a=_0x54986a-0x0;var _0x4ac7d9=_0xb377[_0x54986a];return _0x4ac7d9;};'use strict';var _=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var moment=require(_0x7b37('0x2'));var BPromise=require(_0x7b37('0x3'));var rs=require(_0x7b37('0x4'));var fs=require('fs');var Redis=require(_0x7b37('0x5'));var db=require(_0x7b37('0x6'))['db'];var utils=require(_0x7b37('0x7'));var logger=require(_0x7b37('0x8'))(_0x7b37('0x9'));var config=require(_0x7b37('0xa'));var jayson=require(_0x7b37('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x409d34,_0x4cb89b,_0x5afdb8){return new BPromise(function(_0x3de992,_0x3df40f){return client[_0x7b37('0xc')](_0x409d34,_0x5afdb8)[_0x7b37('0xd')](function(_0x1d435b){logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));logger['debug'](_0x7b37('0x11'),_0x4cb89b,_0x7b37('0x10'),JSON['stringify'](_0x1d435b));if(_0x1d435b['error']){if(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x13')]===0x1f4){logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3df40f(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3de992(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}else{logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));_0x3de992(_0x1d435b['result']['message']);}})[_0x7b37('0x15')](function(_0x5b06f9){logger['error'](_0x7b37('0xf'),_0x4cb89b,_0x5b06f9);_0x3df40f(_0x5b06f9);});});}exports[_0x7b37('0x16')]=function(_0x1447aa){var _0x487f5c=this;return new Promise(function(_0x29a9dd,_0x46955a){return db[_0x7b37('0x17')]['create'](_0x1447aa['body'],{'raw':_0x1447aa[_0x7b37('0x18')]?_0x1447aa[_0x7b37('0x18')][_0x7b37('0x19')]===undefined?!![]:![]:!![]})[_0x7b37('0xd')](function(_0x30bf66){logger['info']('CreateAttachment',_0x1447aa);logger['debug'](_0x7b37('0x16'),_0x1447aa,JSON[_0x7b37('0x1a')](_0x30bf66));_0x29a9dd(_0x30bf66);})[_0x7b37('0x15')](function(_0x200f17){logger[_0x7b37('0x12')](_0x7b37('0x16'),_0x200f17[_0x7b37('0x14')],_0x1447aa);_0x46955a(_0x487f5c['error'](0x1f4,_0x200f17[_0x7b37('0x14')]));});});};
\ No newline at end of file
+var _0xe13a=['request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateAttachment','Attachment','body','options','raw','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x119260,_0x565904){var _0x341137=function(_0x488905){while(--_0x488905){_0x119260['push'](_0x119260['shift']());}};_0x341137(++_0x565904);}(_0xe13a,0x178));var _0xae13=function(_0x59c7f3,_0x4f5e95){_0x59c7f3=_0x59c7f3-0x0;var _0x2c6aa0=_0xe13a[_0x59c7f3];return _0x2c6aa0;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var moment=require(_0xae13('0x1'));var BPromise=require(_0xae13('0x2'));var rs=require(_0xae13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae13('0x4'))['db'];var utils=require(_0xae13('0x5'));var logger=require(_0xae13('0x6'))(_0xae13('0x7'));var config=require(_0xae13('0x8'));var jayson=require(_0xae13('0x9'));var client=jayson[_0xae13('0xa')][_0xae13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341ba4,_0x4ae51f,_0x2f6d10){return new BPromise(function(_0x2b2e1f,_0x27fefd){return client[_0xae13('0xc')](_0x341ba4,_0x2f6d10)[_0xae13('0xd')](function(_0x41bf44){logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));logger['debug'](_0xae13('0x11'),_0x4ae51f,_0xae13('0x10'),JSON[_0xae13('0x12')](_0x41bf44));if(_0x41bf44[_0xae13('0x13')]){if(_0x41bf44[_0xae13('0x13')][_0xae13('0x14')]===0x1f4){logger[_0xae13('0x13')]('Attachment,\x20%s,\x20%s',_0x4ae51f,_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);return _0x27fefd(_0x41bf44['error']['message']);}logger['error']('Attachment,\x20%s,\x20%s',_0x4ae51f,_0x41bf44['error'][_0xae13('0x15')]);return _0x2b2e1f(_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);}else{logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));_0x2b2e1f(_0x41bf44['result'][_0xae13('0x15')]);}})['catch'](function(_0xe10aab){logger[_0xae13('0x13')](_0xae13('0xf'),_0x4ae51f,_0xe10aab);_0x27fefd(_0xe10aab);});});}exports[_0xae13('0x16')]=function(_0x1a9c07){var _0x1b33b7=this;return new Promise(function(_0x32dcbe,_0x326471){return db[_0xae13('0x17')]['create'](_0x1a9c07[_0xae13('0x18')],{'raw':_0x1a9c07['options']?_0x1a9c07[_0xae13('0x19')][_0xae13('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x25a195){logger[_0xae13('0xe')](_0xae13('0x16'),_0x1a9c07);logger[_0xae13('0x1b')](_0xae13('0x16'),_0x1a9c07,JSON[_0xae13('0x12')](_0x25a195));_0x32dcbe(_0x25a195);})['catch'](function(_0x520692){logger[_0xae13('0x13')](_0xae13('0x16'),_0x520692['message'],_0x1a9c07);_0x326471(_0x1b33b7[_0xae13('0x13')](0x1f4,_0x520692['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 3299c91..aeb59f0 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5dc97b,_0x511ec5){var _0xb3c53d=function(_0x1b9c64){while(--_0x1b9c64){_0x5dc97b['push'](_0x5dc97b['shift']());}};_0xb3c53d(++_0x511ec5);}(_0x2032,0xd9));var _0x2203=function(_0x35e3e7,_0x39f60a){_0x35e3e7=_0x35e3e7-0x0;var _0x4bc020=_0x2032[_0x35e3e7];return _0x4bc020;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x3b708e,_0x35fbbc){var _0x268e60=function(_0x240369){while(--_0x240369){_0x3b708e['push'](_0x3b708e['shift']());}};_0x268e60(++_0x35fbbc);}(_0xb10b,0x12a));var _0xbb10=function(_0x521e8d,_0x23a290){_0x521e8d=_0x521e8d-0x0;var _0x518bbd=_0xb10b[_0x521e8d];return _0x518bbd;};'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')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 9cd4d98..b2d3111 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 _0x5b47=['util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','name','clearBlockUser','getLicense','catch','status','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','activedirectory2','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b47,0x11c));var _0x75b4=function(_0xcfff55,_0x38cf58){_0xcfff55=_0xcfff55-0x0;var _0x4513f6=_0x5b47[_0xcfff55];return _0x4513f6;};'use strict';var passport=require(_0x75b4('0x0'));var LocalStrategy=require(_0x75b4('0x1'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x75b4('0x2'));var BPromise=require(_0x75b4('0x3'));var util=require(_0x75b4('0x4'));var db=require(_0x75b4('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x75b4('0x6'));var config=require(_0x75b4('0x7'));var logger=require(_0x75b4('0x8'))(_0x75b4('0x9'));function isActiveDirectoryConfigured(_0x3f0cc9){var _0x4ecc87=![];if(typeof _0x3f0cc9['activedirectory']!==_0x75b4('0xa')){_0x4ecc87=_0x3f0cc9[_0x75b4('0xb')][_0x75b4('0xc')]&&_0x3f0cc9['activedirectory'][_0x75b4('0xd')]&&_0x3f0cc9[_0x75b4('0xb')][_0x75b4('0xe')];}return _0x4ecc87;}function adAuthenticate(_0x306bb7,_0x28a122,_0x26dbef){return new BPromise(function(_0x7a0784,_0x3f9944){try{var _0x1cb5bb=new ActiveDirectory(_0x306bb7);_0x1cb5bb['authenticate'](_0x28a122,_0x26dbef,function(_0x379e05,_0x4a7ca2){if(_0x379e05){logger[_0x75b4('0xf')](_0x75b4('0x10'),_0x28a122,util[_0x75b4('0x11')](_0x379e05,{'showHidden':![],'depth':null}));_0x3f9944(_0x75b4('0x12'));}else if(!_0x4a7ca2){logger[_0x75b4('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x28a122);_0x3f9944(_0x75b4('0x12'));}else{_0x7a0784(_0x4a7ca2);}});}catch(_0x655eef){_0x3f9944(_0x655eef);}});}function ActiveDirectoryAuthenticate(_0x4a3c44,_0x401fb4,_0x3c0673,_0x116bc4){var _0x3d373a,_0x27617d;if(!isActiveDirectoryConfigured(config)){logger[_0x75b4('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x401fb4);return _0x116bc4(null,![],{'message':_0x75b4('0x12')});}return db[_0x75b4('0x13')][_0x75b4('0x14')]({'where':{'id':0x1},'attributes':[_0x75b4('0x15'),_0x75b4('0x16')],'raw':!![]})[_0x75b4('0x17')](function(_0x43213b){_0x3d373a=_0x43213b;if(!_0x3d373a[_0x75b4('0x15')]){logger[_0x75b4('0xf')](_0x75b4('0x18'),_0x401fb4);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x4a3c44[_0x75b4('0x14')]({'attributes':['id','name',_0x75b4('0x19'),_0x75b4('0x1a'),_0x75b4('0x1b'),_0x75b4('0x1c'),_0x75b4('0x1d'),_0x75b4('0x1e'),_0x75b4('0x1f')],'where':{'name':_0x401fb4,'role':{'$or':[_0x75b4('0x20'),'user',_0x75b4('0x21')]},'adSsoEnabled':!![]}});})[_0x75b4('0x17')](function(_0x44e223){if(!_0x44e223||_0x44e223&&_0x44e223[_0x75b4('0x22')]!==_0x401fb4){throw new Error(_0x75b4('0x12'));}_0x27617d=_0x44e223;var _0x2bba8f=_0x27617d[_0x75b4('0x22')]+'@'+config['activedirectory'][_0x75b4('0xe')];return adAuthenticate(config[_0x75b4('0xb')],_0x2bba8f,_0x3c0673);})[_0x75b4('0x17')](function(_0x3e9194){if(_0x27617d[_0x75b4('0x1c')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x3d373a['blockDuration']>0x0){if(_0x27617d[_0x75b4('0x1d')]){if(moment(_0x27617d[_0x75b4('0x1e')])['add'](_0x3d373a[_0x75b4('0x16')],'minutes')>moment()){throw new Error(_0x75b4('0x12'));}return utils[_0x75b4('0x23')](_0x27617d,0x0,![],null)[_0x75b4('0x17')](function(){return utils[_0x75b4('0x24')](_0x27617d);})[_0x75b4('0x17')](function(){return _0x116bc4(null,_0x27617d);});}else{return utils[_0x75b4('0x24')](_0x27617d)[_0x75b4('0x17')](function(){return _0x116bc4(null,_0x27617d);});}}else{return utils['getLicense'](_0x27617d)['then'](function(){return _0x116bc4(null,_0x27617d);});}})[_0x75b4('0x25')](function(_0x509a9e){return _0x116bc4(null,![],_0x509a9e);});}function handleError(_0x26f831,_0x54880b,_0x10c47e){return _0x26f831[_0x75b4('0x26')](_0x54880b||0x1f4)[_0x75b4('0x27')]({'message':_0x10c47e?_0x10c47e[_0x75b4('0x28')]||_0x10c47e:''});}exports[_0x75b4('0x29')]=function(_0x90b082,_0x17bd95,_0x5a5f24){passport[_0x75b4('0x2a')](_0x75b4('0x2b'),function(_0x22db87,_0x235a8e,_0x13e253){var _0x53681f=_0x22db87||_0x13e253;if(_0x53681f){return handleError(_0x17bd95,0x191,_0x53681f);}if(!_0x235a8e){return handleError(_0x17bd95,0x194,{'message':_0x75b4('0x2c')});}else{var _0x22b3d9={'payload':{'id':_0x235a8e['id'],'role':_0x235a8e[_0x75b4('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x75b4('0x2d')](_0x22b3d9)['then'](function(_0x156708){_0x17bd95['json']({'id':_0x235a8e['id'],'token':_0x156708,'statusCall':'','isAlreadyLogged':_0x235a8e[_0x75b4('0x1f')]});});}})(_0x90b082,_0x17bd95,_0x5a5f24);};passport[_0x75b4('0x2e')](_0x75b4('0x2b'),new LocalStrategy({'usernameField':_0x75b4('0x22'),'passwordField':_0x75b4('0x19')},function(_0x299063,_0x2989c6,_0x356177){return ActiveDirectoryAuthenticate(db[_0x75b4('0x2f')],_0x299063,_0x2989c6,_0x356177);}));
\ No newline at end of file
+var _0x98d8=['Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','minutes','getLicense','catch','send','message','login','signToken','use','ad-login','passport','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','adSsoEnabled','blockDuration','then'];(function(_0x1f223b,_0x2c8afd){var _0x2ed524=function(_0x3b527d){while(--_0x3b527d){_0x1f223b['push'](_0x1f223b['shift']());}};_0x2ed524(++_0x2c8afd);}(_0x98d8,0xcd));var _0x898d=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0x98d8[_0x2a453b];return _0x132f79;};'use strict';var passport=require(_0x898d('0x0'));var LocalStrategy=require('passport-local')[_0x898d('0x1')];var moment=require(_0x898d('0x2'));var ActiveDirectory=require(_0x898d('0x3'));var BPromise=require(_0x898d('0x4'));var util=require('util');var db=require(_0x898d('0x5'))['db'];var authService=require(_0x898d('0x6'));var utils=require('../../config/utils');var config=require(_0x898d('0x7'));var logger=require(_0x898d('0x8'))(_0x898d('0x9'));function isActiveDirectoryConfigured(_0x474b36){var _0xc7814c=![];if(typeof _0x474b36[_0x898d('0xa')]!==_0x898d('0xb')){_0xc7814c=_0x474b36[_0x898d('0xa')][_0x898d('0xc')]&&_0x474b36[_0x898d('0xa')][_0x898d('0xd')]&&_0x474b36[_0x898d('0xa')][_0x898d('0xe')];}return _0xc7814c;}function adAuthenticate(_0xd4a544,_0xe201f9,_0x4615f9){return new BPromise(function(_0x195422,_0x49970b){try{var _0x24abbd=new ActiveDirectory(_0xd4a544);_0x24abbd[_0x898d('0xf')](_0xe201f9,_0x4615f9,function(_0x2adebb,_0xfd905){if(_0x2adebb){logger[_0x898d('0x10')](_0x898d('0x11'),_0xe201f9,util[_0x898d('0x12')](_0x2adebb,{'showHidden':![],'depth':null}));_0x49970b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0xfd905){logger[_0x898d('0x10')](_0x898d('0x13'),_0xe201f9);_0x49970b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x195422(_0xfd905);}});}catch(_0x5e2b6b){_0x49970b(_0x5e2b6b);}});}function ActiveDirectoryAuthenticate(_0xeb81f0,_0x436d27,_0x5d17ea,_0x2a7e2f){var _0x162e8f,_0x1d92c2;if(!isActiveDirectoryConfigured(config)){logger[_0x898d('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x436d27);return _0x2a7e2f(null,![],{'message':_0x898d('0x14')});}return db[_0x898d('0x15')]['findOne']({'where':{'id':0x1},'attributes':[_0x898d('0x16'),_0x898d('0x17')],'raw':!![]})[_0x898d('0x18')](function(_0x192de9){_0x162e8f=_0x192de9;if(!_0x162e8f[_0x898d('0x16')]){logger['error'](_0x898d('0x19'),_0x436d27);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0xeb81f0[_0x898d('0x1a')]({'attributes':['id',_0x898d('0x1b'),_0x898d('0x1c'),_0x898d('0x1d'),_0x898d('0x1e'),_0x898d('0x1f'),_0x898d('0x20'),_0x898d('0x21'),_0x898d('0x22')],'where':{'name':_0x436d27,'role':{'$or':[_0x898d('0x23'),_0x898d('0x24'),'agent']},'adSsoEnabled':!![]}});})[_0x898d('0x18')](function(_0x2ce81a){if(!_0x2ce81a||_0x2ce81a&&_0x2ce81a[_0x898d('0x1b')]!==_0x436d27){throw new Error(_0x898d('0x14'));}_0x1d92c2=_0x2ce81a;var _0x17d1eb=_0x1d92c2[_0x898d('0x1b')]+'@'+config['activedirectory'][_0x898d('0xe')];return adAuthenticate(config['activedirectory'],_0x17d1eb,_0x5d17ea);})[_0x898d('0x18')](function(_0x48181a){if(_0x1d92c2[_0x898d('0x1f')]){throw new Error(_0x898d('0x14'));}if(_0x162e8f[_0x898d('0x17')]>0x0){if(_0x1d92c2[_0x898d('0x20')]){if(moment(_0x1d92c2[_0x898d('0x21')])['add'](_0x162e8f[_0x898d('0x17')],_0x898d('0x25'))>moment()){throw new Error(_0x898d('0x14'));}return utils['clearBlockUser'](_0x1d92c2,0x0,![],null)['then'](function(){return utils[_0x898d('0x26')](_0x1d92c2);})[_0x898d('0x18')](function(){return _0x2a7e2f(null,_0x1d92c2);});}else{return utils[_0x898d('0x26')](_0x1d92c2)['then'](function(){return _0x2a7e2f(null,_0x1d92c2);});}}else{return utils[_0x898d('0x26')](_0x1d92c2)[_0x898d('0x18')](function(){return _0x2a7e2f(null,_0x1d92c2);});}})[_0x898d('0x27')](function(_0x43a5b3){return _0x2a7e2f(null,![],_0x43a5b3);});}function handleError(_0x53f2e5,_0x4bf267,_0x1fdb06){return _0x53f2e5['status'](_0x4bf267||0x1f4)[_0x898d('0x28')]({'message':_0x1fdb06?_0x1fdb06[_0x898d('0x29')]||_0x1fdb06:''});}exports[_0x898d('0x2a')]=function(_0x4e09b4,_0x1b1be5,_0x4c91dd){passport[_0x898d('0xf')]('ad-login',function(_0x55dae8,_0x45d2e3,_0x376530){var _0x4ca995=_0x55dae8||_0x376530;if(_0x4ca995){return handleError(_0x1b1be5,0x191,_0x4ca995);}if(!_0x45d2e3){return handleError(_0x1b1be5,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3a0ac5={'payload':{'id':_0x45d2e3['id'],'role':_0x45d2e3[_0x898d('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0x898d('0x2b')](_0x3a0ac5)[_0x898d('0x18')](function(_0x324f46){_0x1b1be5['json']({'id':_0x45d2e3['id'],'token':_0x324f46,'statusCall':'','isAlreadyLogged':_0x45d2e3['online']});});}})(_0x4e09b4,_0x1b1be5,_0x4c91dd);};passport[_0x898d('0x2c')](_0x898d('0x2d'),new LocalStrategy({'usernameField':_0x898d('0x1b'),'passwordField':_0x898d('0x1c')},function(_0x54b2f9,_0x3e6348,_0x26c605){return ActiveDirectoryAuthenticate(db['User'],_0x54b2f9,_0x3e6348,_0x26c605);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 9512d87..1b890dc 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 _0xed14=['express','post','login'];(function(_0x4622c0,_0xd0eeec){var _0x23d32b=function(_0x539eae){while(--_0x539eae){_0x4622c0['push'](_0x4622c0['shift']());}};_0x23d32b(++_0xd0eeec);}(_0xed14,0x1e6));var _0x4ed1=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xed14[_0x2dadb9];return _0x2f0097;};'use strict';var express=require(_0x4ed1('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0x4ed1('0x1')]('/',controller[_0x4ed1('0x2')]);module['exports']=router;
\ No newline at end of file
+var _0x2c27=['./authActiveDirectory.controller','post','login','exports','Router'];(function(_0x33e5d1,_0x55e417){var _0x418fe0=function(_0x4ce8b8){while(--_0x4ce8b8){_0x33e5d1['push'](_0x33e5d1['shift']());}};_0x418fe0(++_0x55e417);}(_0x2c27,0x117));var _0x72c2=function(_0x6af9c4,_0x3ac976){_0x6af9c4=_0x6af9c4-0x0;var _0x573dce=_0x2c27[_0x6af9c4];return _0x573dce;};'use strict';var express=require('express');var router=express[_0x72c2('0x0')]();var controller=require(_0x72c2('0x1'));router[_0x72c2('0x2')]('/',controller[_0x72c2('0x3')]);module[_0x72c2('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index f2969ac..699628e 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x7a54,0x106));var _0x47a5=function(_0x14acc9,_0x186477){_0x14acc9=_0x14acc9-0x0;var _0x3b2efb=_0x7a54[_0x14acc9];return _0x3b2efb;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _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(_0x902e0b,_0x1aa5fa){var _0x9696a8=function(_0x3abe1d){while(--_0x3abe1d){_0x902e0b['push'](_0x902e0b['shift']());}};_0x9696a8(++_0x1aa5fa);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 6b2c71c..4e5afd3 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 _0x6214=['isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback'];(function(_0x1584a1,_0x34371a){var _0x14fb5e=function(_0x2c9ce3){while(--_0x2c9ce3){_0x1584a1['push'](_0x1584a1['shift']());}};_0x14fb5e(++_0x34371a);}(_0x6214,0xda));var _0x4621=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x6214[_0x45bf86];return _0x1f02b7;};'use strict';var express=require(_0x4621('0x0'));var passport=require(_0x4621('0x1'));var router=express[_0x4621('0x2')]();var controller=require(_0x4621('0x3'));var userController=require(_0x4621('0x4'));var authService=require(_0x4621('0x5'));router['get']('/',controller[_0x4621('0x6')]);router[_0x4621('0x7')](_0x4621('0x8'),controller[_0x4621('0x9')],authService[_0x4621('0xa')],userController[_0x4621('0x6')],authService[_0x4621('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xe78c=['setTokenCookie','exports','passport','../user/user.controller.js','get','login'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xe78c,0xaa));var _0xce78=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe78c[_0x57b54c];return _0x59cc19;};'use strict';var express=require('express');var passport=require(_0xce78('0x0'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xce78('0x1'));var authService=require('../../components/auth/service');router[_0xce78('0x2')]('/',controller[_0xce78('0x3')]);router['get']('/callback',controller['callback'],authService['isMiddleware'],userController[_0xce78('0x3')],authService[_0xce78('0x4')]);module[_0xce78('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index deb68be..bb5ede4 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 _0x9860=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','save','Password\x20reset!','util','passport','passport-local','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','password','salt','disabled','blocked','loginAttempts','admin','user','then','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','message','status','send','login','local-login','role','signToken','online','forgot','body','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x2ce307,_0x26f21d){var _0x54cda2=function(_0x382935){while(--_0x382935){_0x2ce307['push'](_0x2ce307['shift']());}};_0x54cda2(++_0x26f21d);}(_0x9860,0x117));var _0x0986=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9860[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x0986('0x0'));var passport=require(_0x0986('0x1'));var LocalStrategy=require(_0x0986('0x2'))['Strategy'];var jayson=require(_0x0986('0x3'));var _=require('lodash');var rs=require(_0x0986('0x4'));var moment=require(_0x0986('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x0986('0x6'));var utils=require(_0x0986('0x7'));var client=jayson[_0x0986('0x8')][_0x0986('0x9')]({'port':0x232b});function localAuthenticate(_0x1de4f4,_0x3fe208,_0x1ccd41,_0x487407){var _0x3b7e9f,_0xda0ee7;return db['Setting'][_0x0986('0xa')]({'where':{'id':0x1},'attributes':[_0x0986('0xb'),_0x0986('0xc')],'raw':!![]})['then'](function(_0x4c3d13){_0x3b7e9f=_0x4c3d13;return _0x1de4f4['findOne']({'attributes':['id','name',_0x0986('0xd'),_0x0986('0xe'),'role',_0x0986('0xf'),_0x0986('0x10'),'blockedAt',_0x0986('0x11')],'where':{'name':_0x3fe208,'role':{'$or':[_0x0986('0x12'),_0x0986('0x13'),'agent']}}});})[_0x0986('0x14')](function(_0x118ff2){if(!_0x118ff2||_0x118ff2&&_0x118ff2[_0x0986('0x15')]!==_0x3fe208){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xda0ee7=_0x118ff2;return _0xda0ee7;}})[_0x0986('0x14')](function(){_0xda0ee7[_0x0986('0x16')](_0x1ccd41,function(_0x2c9f75,_0x37f77c){var _0x5e6ecf=_0xda0ee7[_0x0986('0x11')]+0x1;if(_0x2c9f75){return _0x487407(_0x2c9f75);}else if(!_0x37f77c){if(_0xda0ee7['disabled']){return _0x487407(null,![],{'message':_0x0986('0x17')});}else if(_0x3b7e9f[_0x0986('0xb')]>0x0){if(_0xda0ee7[_0x0986('0x10')]){if(_0x3b7e9f[_0x0986('0xc')]>0x0){if(moment(_0xda0ee7[_0x0986('0x18')])[_0x0986('0x19')](_0x3b7e9f['blockDuration'],_0x0986('0x1a'))>moment()){return _0x487407(null,![],{'message':_0x0986('0x17')});}else{return utils[_0x0986('0x1b')](_0xda0ee7,_0x5e6ecf,![],null)[_0x0986('0x14')](function(){return _0x487407(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x487407(null,![],{'message':_0x0986('0x17')});}}else{if(_0x5e6ecf>=_0x3b7e9f[_0x0986('0xb')]){return utils[_0x0986('0x1b')](_0xda0ee7,0x0,!![],moment())[_0x0986('0x14')](function(){return _0x487407(null,![],{'message':_0x0986('0x17')});});}else{return utils['clearBlockUser'](_0xda0ee7,_0x5e6ecf,![],null)[_0x0986('0x14')](function(){return _0x487407(null,![],{'message':_0x0986('0x17')});});}}}else{return _0x487407(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xda0ee7[_0x0986('0xf')]){return _0x487407(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3b7e9f[_0x0986('0xb')]>0x0){if(_0xda0ee7[_0x0986('0x10')]){if(_0x3b7e9f[_0x0986('0xc')]>0x0){if(moment(_0xda0ee7[_0x0986('0x18')])['add'](_0x3b7e9f[_0x0986('0xc')],'minutes')>moment()){return _0x487407(null,![],{'message':_0x0986('0x17')});}else{return utils[_0x0986('0x1b')](_0xda0ee7,0x0,![],null)[_0x0986('0x14')](function(){return utils[_0x0986('0x1c')](_0xda0ee7);})['then'](function(){return _0x487407(null,_0xda0ee7);});}}else{return _0x487407(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0986('0x1b')](_0xda0ee7,0x0,![],null)['then'](function(){return utils['getLicense'](_0xda0ee7);})['then'](function(){return _0x487407(null,_0xda0ee7);})[_0x0986('0x1d')](function(_0x2dae62){return _0x487407(null,![],_0x2dae62);});}}else{if(_0xda0ee7[_0x0986('0x10')]){return _0x487407(null,![],{'message':_0x0986('0x17')});}else{return utils[_0x0986('0x1c')](_0xda0ee7)[_0x0986('0x14')](function(){return _0x487407(null,_0xda0ee7);});}}}});})['catch'](function(_0x547991){return _0x487407(null,![],_0x547991);});}function sendServiceMail(_0x1c6d2e){return db[_0x0986('0x1e')][_0x0986('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x0986('0x20')],'include':[{'model':db[_0x0986('0x21')],'as':_0x0986('0x22'),'include':[{'model':db[_0x0986('0x23')],'as':'CloudProvider'}]}]})['then'](function(_0x584563){if(!_0x584563){throw new Error(_0x0986('0x24'));}var _0x57ab3c=_0x584563[_0x0986('0x25')]();var _0x51a59b={'account':_0x57ab3c,'message':_[_0x0986('0x26')]({'from':util['format'](_0x0986('0x27'),_0x584563[_0x0986('0x15')],_0x584563[_0x0986('0x20')]||_0x584563[_0x0986('0x22')][_0x0986('0x13')])},_0x1c6d2e)};return client[_0x0986('0x28')](_0x0986('0x29'),_0x51a59b);})[_0x0986('0x14')](function(_0x2aa445){if(_0x2aa445[_0x0986('0x2a')]){throw new Error(util[_0x0986('0x2b')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2aa445['error'][_0x0986('0x2c')]||JSON['stringify'](_0x2aa445[_0x0986('0x2a')])));}return!![];});}function handleError(_0x444df9,_0x160751,_0x43644e){return _0x444df9[_0x0986('0x2d')](_0x160751||0x1f4)[_0x0986('0x2e')]({'message':_0x43644e?_0x43644e[_0x0986('0x2c')]||_0x43644e:''});}exports[_0x0986('0x2f')]=function(_0xb48c46,_0x5d3d5d,_0x49fe25){passport[_0x0986('0x16')](_0x0986('0x30'),function(_0x4e18c0,_0x58b3d9,_0x543e27){var _0x31fd56=_0x4e18c0||_0x543e27;if(_0x31fd56){return handleError(_0x5d3d5d,0x191,_0x31fd56);}if(!_0x58b3d9){return handleError(_0x5d3d5d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x32ee69={'payload':{'id':_0x58b3d9['id'],'role':_0x58b3d9[_0x0986('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x0986('0x32')](_0x32ee69)[_0x0986('0x14')](function(_0x321965){_0x5d3d5d['json']({'id':_0x58b3d9['id'],'token':_0x321965,'statusCall':'','isAlreadyLogged':_0x58b3d9[_0x0986('0x33')]});});}})(_0xb48c46,_0x5d3d5d,_0x49fe25);};exports[_0x0986('0x34')]=function(_0x52cd5c,_0x3e2b15){if(!_0x52cd5c[_0x0986('0x35')][_0x0986('0x20')]){return handleError(_0x3e2b15,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x186a97=rs[_0x0986('0x36')]();_0x52cd5c[_0x0986('0x35')]['email']=_0x52cd5c['body']['email'][_0x0986('0x37')]()[_0x0986('0x38')]();var _0x20bf1b;return db[_0x0986('0x39')][_0x0986('0xa')]({'where':{'id':0x1},'attributes':[_0x0986('0xb'),_0x0986('0xc')],'raw':!![]})[_0x0986('0x14')](function(_0x29a259){_0x20bf1b=_0x29a259;return db[_0x0986('0x3a')][_0x0986('0x1f')]({'where':{'email':_0x52cd5c[_0x0986('0x35')]['email']}});})[_0x0986('0x14')](function(_0x2b5db3){if(!_0x2b5db3){throw new Error(_0x0986('0x3b'));}if(_0x2b5db3[_0x0986('0xf')]){throw new Error(_0x0986('0x3c'));}if(_0x2b5db3[_0x0986('0x10')]){if(moment(_0x2b5db3['blockedAt'])[_0x0986('0x19')](_0x20bf1b[_0x0986('0xc')],_0x0986('0x1a'))>moment()){throw new Error(_0x0986('0x3d'));}else{_0x2b5db3['blocked']=![];_0x2b5db3[_0x0986('0x18')]=null;}}_0x2b5db3[_0x0986('0x3e')]=_0x186a97;_0x2b5db3['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x2b5db3['save']();})[_0x0986('0x14')](function(){return sendServiceMail({'to':_0x52cd5c[_0x0986('0x35')][_0x0986('0x20')],'subject':_0x0986('0x3f'),'text':_0x0986('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x0986('0x41')+_0x52cd5c[_0x0986('0x42')][_0x0986('0x43')]+_0x0986('0x44')+_0x186a97+'\x0a\x0a'+_0x0986('0x45')});})[_0x0986('0x14')](function(){_0x3e2b15['status'](0xc8)[_0x0986('0x2e')]({'message':_0x0986('0x46')});})[_0x0986('0x1d')](function(_0x386dfe){return handleError(_0x3e2b15,0x1f4,_0x386dfe);});};exports[_0x0986('0x47')]=function(_0x344e10,_0x58d1a4){return db['User'][_0x0986('0x1f')]({'where':{'resetPasswordToken':_0x344e10[_0x0986('0x48')][_0x0986('0x49')],'resetPasswordExpires':{'$gt':Date[_0x0986('0x4a')]()}}})[_0x0986('0x14')](function(_0x4ec42c){if(!_0x4ec42c){throw new Error(_0x0986('0x4b'));}return db[_0x0986('0x39')][_0x0986('0xa')]({'attributes':['id',_0x0986('0x4c'),_0x0986('0x4d'),_0x0986('0x4e')]})[_0x0986('0x14')](function(_0x25a3b3){if(_0x25a3b3[_0x0986('0x4c')])authService[_0x0986('0x4f')](_0x344e10[_0x0986('0x35')][_0x0986('0xd')]);if(!_0x25a3b3[_0x0986('0x4d')]||!_0x4ec42c[_0x0986('0x50')])return _0x4ec42c;authService[_0x0986('0x51')](_0x344e10['body'][_0x0986('0xd')],_0x4ec42c[_0x0986('0x50')],_0x25a3b3['passwordHistoryLimit']);return _0x4ec42c;})[_0x0986('0x14')](function(){_0x4ec42c[_0x0986('0xd')]=_0x344e10[_0x0986('0x35')][_0x0986('0xd')];_0x4ec42c[_0x0986('0x3e')]=null;_0x4ec42c[_0x0986('0x52')]=null;return _0x4ec42c[_0x0986('0x53')]();});})[_0x0986('0x14')](function(){_0x58d1a4[_0x0986('0x2d')](0xc8)[_0x0986('0x2e')]({'message':_0x0986('0x54')});})[_0x0986('0x1d')](function(_0x57688f){return handleError(_0x58d1a4,0x1f4,_0x57688f);});};passport['use'](_0x0986('0x30'),new LocalStrategy({'usernameField':_0x0986('0x15'),'passwordField':_0x0986('0xd')},function(_0xc1af0c,_0x45bae8,_0x2002db){return localAuthenticate(db['User'],_0xc1af0c,_0x45bae8,_0x2002db);}));
\ No newline at end of file
+var _0xdcfd=['name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','getSmtpOptions','merge','format','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','use','local-login','passport','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','Setting','findOne','allowedLoginAttempts','blockDuration'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xdcfd,0x1ce));var _0xddcf=function(_0x34b87f,_0x28aef2){_0x34b87f=_0x34b87f-0x0;var _0x449805=_0xdcfd[_0x34b87f];return _0x449805;};'use strict';var util=require('util');var passport=require(_0xddcf('0x0'));var LocalStrategy=require('passport-local')[_0xddcf('0x1')];var jayson=require(_0xddcf('0x2'));var _=require('lodash');var rs=require(_0xddcf('0x3'));var moment=require(_0xddcf('0x4'));var db=require(_0xddcf('0x5'))['db'];var authService=require(_0xddcf('0x6'));var utils=require(_0xddcf('0x7'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x2b4324,_0x54b285,_0x5bdd1c,_0x54d408){var _0x5a3129,_0x33c460;return db[_0xddcf('0x8')][_0xddcf('0x9')]({'where':{'id':0x1},'attributes':[_0xddcf('0xa'),_0xddcf('0xb')],'raw':!![]})['then'](function(_0x2500b5){_0x5a3129=_0x2500b5;return _0x2b4324['findOne']({'attributes':['id',_0xddcf('0xc'),_0xddcf('0xd'),_0xddcf('0xe'),_0xddcf('0xf'),_0xddcf('0x10'),_0xddcf('0x11'),_0xddcf('0x12'),_0xddcf('0x13')],'where':{'name':_0x54b285,'role':{'$or':['admin',_0xddcf('0x14'),'agent']}}});})[_0xddcf('0x15')](function(_0x170eba){if(!_0x170eba||_0x170eba&&_0x170eba[_0xddcf('0xc')]!==_0x54b285){throw new Error(_0xddcf('0x16'));}else{_0x33c460=_0x170eba;return _0x33c460;}})[_0xddcf('0x15')](function(){_0x33c460['authenticate'](_0x5bdd1c,function(_0x1ef5fc,_0x4f5d01){var _0x31cf5e=_0x33c460['loginAttempts']+0x1;if(_0x1ef5fc){return _0x54d408(_0x1ef5fc);}else if(!_0x4f5d01){if(_0x33c460[_0xddcf('0x10')]){return _0x54d408(null,![],{'message':_0xddcf('0x16')});}else if(_0x5a3129['allowedLoginAttempts']>0x0){if(_0x33c460[_0xddcf('0x11')]){if(_0x5a3129[_0xddcf('0xb')]>0x0){if(moment(_0x33c460[_0xddcf('0x12')])['add'](_0x5a3129[_0xddcf('0xb')],_0xddcf('0x17'))>moment()){return _0x54d408(null,![],{'message':_0xddcf('0x16')});}else{return utils[_0xddcf('0x18')](_0x33c460,_0x31cf5e,![],null)[_0xddcf('0x15')](function(){return _0x54d408(null,![],{'message':_0xddcf('0x16')});});}}else{return _0x54d408(null,![],{'message':_0xddcf('0x16')});}}else{if(_0x31cf5e>=_0x5a3129[_0xddcf('0xa')]){return utils[_0xddcf('0x18')](_0x33c460,0x0,!![],moment())[_0xddcf('0x15')](function(){return _0x54d408(null,![],{'message':_0xddcf('0x16')});});}else{return utils[_0xddcf('0x18')](_0x33c460,_0x31cf5e,![],null)[_0xddcf('0x15')](function(){return _0x54d408(null,![],{'message':_0xddcf('0x16')});});}}}else{return _0x54d408(null,![],{'message':_0xddcf('0x16')});}}else{if(_0x33c460[_0xddcf('0x10')]){return _0x54d408(null,![],{'message':_0xddcf('0x16')});}else if(_0x5a3129[_0xddcf('0xa')]>0x0){if(_0x33c460[_0xddcf('0x11')]){if(_0x5a3129['blockDuration']>0x0){if(moment(_0x33c460[_0xddcf('0x12')])[_0xddcf('0x19')](_0x5a3129[_0xddcf('0xb')],_0xddcf('0x17'))>moment()){return _0x54d408(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xddcf('0x18')](_0x33c460,0x0,![],null)['then'](function(){return utils[_0xddcf('0x1a')](_0x33c460);})[_0xddcf('0x15')](function(){return _0x54d408(null,_0x33c460);});}}else{return _0x54d408(null,![],{'message':_0xddcf('0x16')});}}else{return utils[_0xddcf('0x18')](_0x33c460,0x0,![],null)['then'](function(){return utils[_0xddcf('0x1a')](_0x33c460);})['then'](function(){return _0x54d408(null,_0x33c460);})[_0xddcf('0x1b')](function(_0x386960){return _0x54d408(null,![],_0x386960);});}}else{if(_0x33c460[_0xddcf('0x11')]){return _0x54d408(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xddcf('0x1a')](_0x33c460)[_0xddcf('0x15')](function(){return _0x54d408(null,_0x33c460);});}}}});})[_0xddcf('0x1b')](function(_0x3a04e3){return _0x54d408(null,![],_0x3a04e3);});}function sendServiceMail(_0x2c2cfe){return db[_0xddcf('0x1c')][_0xddcf('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0xddcf('0x1e')],'include':[{'model':db[_0xddcf('0x1f')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xddcf('0x20')}]}]})[_0xddcf('0x15')](function(_0x49e9e6){if(!_0x49e9e6){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3d68fb=_0x49e9e6[_0xddcf('0x21')]();var _0x311304={'account':_0x3d68fb,'message':_[_0xddcf('0x22')]({'from':util[_0xddcf('0x23')]('\x22%s\x22\x20<%s>',_0x49e9e6[_0xddcf('0xc')],_0x49e9e6['email']||_0x49e9e6[_0xddcf('0x24')]['user'])},_0x2c2cfe)};return client[_0xddcf('0x25')](_0xddcf('0x26'),_0x311304);})[_0xddcf('0x15')](function(_0xa9c7be){if(_0xa9c7be[_0xddcf('0x27')]){throw new Error(util[_0xddcf('0x23')](_0xddcf('0x28'),_0xa9c7be[_0xddcf('0x27')][_0xddcf('0x29')]||JSON[_0xddcf('0x2a')](_0xa9c7be[_0xddcf('0x27')])));}return!![];});}function handleError(_0x54d3e2,_0x35de1a,_0x19f52a){return _0x54d3e2[_0xddcf('0x2b')](_0x35de1a||0x1f4)[_0xddcf('0x2c')]({'message':_0x19f52a?_0x19f52a[_0xddcf('0x29')]||_0x19f52a:''});}exports[_0xddcf('0x2d')]=function(_0x33a487,_0x1eff80,_0x4d8fa4){passport['authenticate']('local-login',function(_0x5d3119,_0x22be19,_0x13f140){var _0x32a599=_0x5d3119||_0x13f140;if(_0x32a599){return handleError(_0x1eff80,0x191,_0x32a599);}if(!_0x22be19){return handleError(_0x1eff80,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2d0501={'payload':{'id':_0x22be19['id'],'role':_0x22be19[_0xddcf('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xddcf('0x2e')](_0x2d0501)['then'](function(_0x4b1b92){_0x1eff80[_0xddcf('0x2f')]({'id':_0x22be19['id'],'token':_0x4b1b92,'statusCall':'','isAlreadyLogged':_0x22be19[_0xddcf('0x30')]});});}})(_0x33a487,_0x1eff80,_0x4d8fa4);};exports[_0xddcf('0x31')]=function(_0x1fc746,_0x40bfc7){if(!_0x1fc746[_0xddcf('0x32')][_0xddcf('0x1e')]){return handleError(_0x40bfc7,0x1f4,{'message':_0xddcf('0x33')});}var _0x1d89e6=rs[_0xddcf('0x34')]();_0x1fc746[_0xddcf('0x32')][_0xddcf('0x1e')]=_0x1fc746[_0xddcf('0x32')]['email'][_0xddcf('0x35')]()['toLowerCase']();var _0x1466c5;return db[_0xddcf('0x8')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xddcf('0x15')](function(_0x243b65){_0x1466c5=_0x243b65;return db[_0xddcf('0x36')][_0xddcf('0x1d')]({'where':{'email':_0x1fc746['body'][_0xddcf('0x1e')]}});})[_0xddcf('0x15')](function(_0x2dfc46){if(!_0x2dfc46){throw new Error(_0xddcf('0x37'));}if(_0x2dfc46['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2dfc46[_0xddcf('0x11')]){if(moment(_0x2dfc46['blockedAt'])[_0xddcf('0x19')](_0x1466c5[_0xddcf('0xb')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2dfc46[_0xddcf('0x11')]=![];_0x2dfc46[_0xddcf('0x12')]=null;}}_0x2dfc46['resetPasswordToken']=_0x1d89e6;_0x2dfc46['resetPasswordExpires']=Date[_0xddcf('0x38')]()+0x36ee80;return _0x2dfc46[_0xddcf('0x39')]();})['then'](function(){return sendServiceMail({'to':_0x1fc746['body'][_0xddcf('0x1e')],'subject':_0xddcf('0x3a'),'text':_0xddcf('0x3b')+_0xddcf('0x3c')+_0xddcf('0x3d')+_0x1fc746[_0xddcf('0x3e')][_0xddcf('0x3f')]+_0xddcf('0x40')+_0x1d89e6+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xddcf('0x15')](function(){_0x40bfc7[_0xddcf('0x2b')](0xc8)['send']({'message':_0xddcf('0x41')});})[_0xddcf('0x1b')](function(_0x372616){return handleError(_0x40bfc7,0x1f4,_0x372616);});};exports[_0xddcf('0x42')]=function(_0x363ac8,_0x5afb49){return db[_0xddcf('0x36')][_0xddcf('0x1d')]({'where':{'resetPasswordToken':_0x363ac8[_0xddcf('0x43')]['token'],'resetPasswordExpires':{'$gt':Date[_0xddcf('0x38')]()}}})['then'](function(_0x1c9499){if(!_0x1c9499){throw new Error(_0xddcf('0x44'));}return db[_0xddcf('0x8')][_0xddcf('0x9')]({'attributes':['id',_0xddcf('0x45'),'enforcePasswordHistory',_0xddcf('0x46')]})[_0xddcf('0x15')](function(_0x42af7d){if(_0x42af7d[_0xddcf('0x45')])authService[_0xddcf('0x47')](_0x363ac8['body'][_0xddcf('0xd')]);if(!_0x42af7d[_0xddcf('0x48')]||!_0x1c9499[_0xddcf('0x49')])return _0x1c9499;authService[_0xddcf('0x4a')](_0x363ac8[_0xddcf('0x32')][_0xddcf('0xd')],_0x1c9499['previousPasswords'],_0x42af7d[_0xddcf('0x46')]);return _0x1c9499;})[_0xddcf('0x15')](function(){_0x1c9499[_0xddcf('0xd')]=_0x363ac8[_0xddcf('0x32')][_0xddcf('0xd')];_0x1c9499[_0xddcf('0x4b')]=null;_0x1c9499[_0xddcf('0x4c')]=null;return _0x1c9499[_0xddcf('0x39')]();});})[_0xddcf('0x15')](function(){_0x5afb49['status'](0xc8)[_0xddcf('0x2c')]({'message':'Password\x20reset!'});})[_0xddcf('0x1b')](function(_0x4e60e8){return handleError(_0x5afb49,0x1f4,_0x4e60e8);});};passport[_0xddcf('0x4d')](_0xddcf('0x4e'),new LocalStrategy({'usernameField':_0xddcf('0xc'),'passwordField':_0xddcf('0xd')},function(_0x4f7649,_0x38e808,_0xc135c7){return localAuthenticate(db[_0xddcf('0x36')],_0x4f7649,_0x38e808,_0xc135c7);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 545543f..d75c258 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 _0xedc1=['login','/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post'];(function(_0x598996,_0x2670b6){var _0x427d39=function(_0x104fc7){while(--_0x104fc7){_0x598996['push'](_0x598996['shift']());}};_0x427d39(++_0x2670b6);}(_0xedc1,0x177));var _0x1edc=function(_0x2924d3,_0x43216b){_0x2924d3=_0x2924d3-0x0;var _0x4be4e4=_0xedc1[_0x2924d3];return _0x4be4e4;};'use strict';var express=require('express');var router=express[_0x1edc('0x0')]();var controller=require(_0x1edc('0x1'));router[_0x1edc('0x2')]('/',controller[_0x1edc('0x3')]);router[_0x1edc('0x2')](_0x1edc('0x4'),controller[_0x1edc('0x5')]);router[_0x1edc('0x2')](_0x1edc('0x6'),controller[_0x1edc('0x7')]);module[_0x1edc('0x8')]=router;
\ No newline at end of file
+var _0x7688=['post','login','/forgot','/reset/:token','reset','Router','./authLocal.controller'];(function(_0xf6bb70,_0x3b21a1){var _0x46ed1d=function(_0x4a1ba3){while(--_0x4a1ba3){_0xf6bb70['push'](_0xf6bb70['shift']());}};_0x46ed1d(++_0x3b21a1);}(_0x7688,0x155));var _0x8768=function(_0x41fcd7,_0xca7c47){_0x41fcd7=_0x41fcd7-0x0;var _0x326630=_0x7688[_0x41fcd7];return _0x326630;};'use strict';var express=require('express');var router=express[_0x8768('0x0')]();var controller=require(_0x8768('0x1'));router[_0x8768('0x2')]('/',controller[_0x8768('0x3')]);router['post'](_0x8768('0x4'),controller['forgot']);router[_0x8768('0x2')](_0x8768('0x5'),controller[_0x8768('0x6')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 4332419..737cdaa 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 _0x857f=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x857f,0x16c));var _0xf857=function(_0x427cb4,_0x3c154b){_0x427cb4=_0x427cb4-0x0;var _0x43f775=_0x857f[_0x427cb4];return _0x43f775;};'use strict';var Sequelize=require(_0xf857('0x0'));module[_0xf857('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xf857('0x2')]},'description':{'type':Sequelize[_0xf857('0x2')]},'status':{'type':Sequelize[_0xf857('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf857('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x169b=['INTEGER','sequelize','exports','STRING'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0x169b,0x159));var _0xb169=function(_0x2a7b20,_0x1faf56){_0x2a7b20=_0x2a7b20-0x0;var _0x591f38=_0x169b[_0x2a7b20];return _0x591f38;};'use strict';var Sequelize=require(_0xb169('0x0'));module[_0xb169('0x1')]={'name':{'type':Sequelize[_0xb169('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb169('0x2')]},'description':{'type':Sequelize[_0xb169('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb169('0x3')],'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 8bf90dd..c67f3c9 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 _0x17cd=['Automation','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','show','params','keys','find','create','body','addConditions','ids','getConditions','findOne','hasOwnProperty','addActions','omit','getActions','Action','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','then','name','index','map'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0x17cd,0x16b));var _0xd17c=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x17cd[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0xd17c('0x0'));var rimraf=require(_0xd17c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd17c('0x2'));var moment=require(_0xd17c('0x3'));var BPromise=require(_0xd17c('0x4'));var Mustache=require('mustache');var util=require(_0xd17c('0x5'));var path=require(_0xd17c('0x6'));var sox=require('sox');var csv=require(_0xd17c('0x7'));var ejs=require(_0xd17c('0x8'));var fs=require('fs');var fs_extra=require(_0xd17c('0x9'));var _=require(_0xd17c('0xa'));var squel=require(_0xd17c('0xb'));var crypto=require(_0xd17c('0xc'));var jsforce=require(_0xd17c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd17c('0x7'));var querystring=require(_0xd17c('0xe'));var Papa=require(_0xd17c('0xf'));var Redis=require(_0xd17c('0x10'));var authService=require(_0xd17c('0x11'));var qs=require(_0xd17c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd17c('0x13'));var logger=require(_0xd17c('0x14'))('api');var utils=require(_0xd17c('0x15'));var config=require(_0xd17c('0x16'));var licenseUtil=require(_0xd17c('0x17'));var db=require(_0xd17c('0x18'))['db'];function respondWithStatusCode(_0xc2271b,_0x3316be){_0x3316be=_0x3316be||0xcc;return function(_0x15642b){if(_0x15642b){return _0xc2271b[_0xd17c('0x19')](_0x3316be);}return _0xc2271b[_0xd17c('0x1a')](_0x3316be)[_0xd17c('0x1b')]();};}function respondWithResult(_0xd64a7c,_0x4cd737){_0x4cd737=_0x4cd737||0xc8;return function(_0x5814de){if(_0x5814de){return _0xd64a7c[_0xd17c('0x1a')](_0x4cd737)[_0xd17c('0x1c')](_0x5814de);}};}function respondWithFilteredResult(_0x4bcf67,_0x146e74){return function(_0x32dc7e){if(_0x32dc7e){var _0x25698c=typeof _0x146e74[_0xd17c('0x1d')]===_0xd17c('0x1e')&&typeof _0x146e74['limit']===_0xd17c('0x1e');var _0x5e5880=_0x32dc7e[_0xd17c('0x1f')];var _0x8121e8=_0x25698c?0x0:_0x146e74[_0xd17c('0x1d')];var _0xfb0519=_0x25698c?_0x32dc7e[_0xd17c('0x1f')]:_0x146e74[_0xd17c('0x1d')]+_0x146e74[_0xd17c('0x20')];var _0x4306f9;if(_0xfb0519>=_0x5e5880){_0xfb0519=_0x5e5880;_0x4306f9=0xc8;}else{_0x4306f9=0xce;}_0x4bcf67['status'](_0x4306f9);return _0x4bcf67[_0xd17c('0x21')]('Content-Range',_0x8121e8+'-'+_0xfb0519+'/'+_0x5e5880)['json'](_0x32dc7e);}return null;};}function patchUpdates(_0x4ecd27){return function(_0x160f9c){try{jsonpatch[_0xd17c('0x22')](_0x160f9c,_0x4ecd27,!![]);}catch(_0x149640){return BPromise['reject'](_0x149640);}return _0x160f9c[_0xd17c('0x23')]();};}function saveUpdates(_0x162155,_0x62efc0){return function(_0x34f677){if(_0x34f677){return _0x34f677[_0xd17c('0x24')](_0x162155)['then'](function(_0x125926){return _0x125926;});}return null;};}function removeEntity(_0x5763d0,_0x2c66b4){return function(_0x392ae9){if(_0x392ae9){return _0x392ae9[_0xd17c('0x25')]()[_0xd17c('0x26')](function(){_0x5763d0[_0xd17c('0x1a')](0xcc)[_0xd17c('0x1b')]();});}};}function handleEntityNotFound(_0x3f0e3f,_0x7830c9){return function(_0x2d3734){if(!_0x2d3734){_0x3f0e3f['sendStatus'](0x194);}return _0x2d3734;};}function handleError(_0x504252,_0x28c532){_0x28c532=_0x28c532||0x1f4;return function(_0x2c3983){logger['error'](_0x2c3983['stack']);if(_0x2c3983[_0xd17c('0x27')]){delete _0x2c3983['name'];}_0x504252[_0xd17c('0x1a')](_0x28c532)['send'](_0x2c3983);};}exports[_0xd17c('0x28')]=function(_0x5b6047,_0x56083c){var _0x45605b={},_0x5e7e89={},_0x23c109={'count':0x0,'rows':[]};var _0x27e2b3=_[_0xd17c('0x29')](db[_0xd17c('0x2a')][_0xd17c('0x2b')],function(_0x4be1f8){return{'name':_0x4be1f8[_0xd17c('0x2c')],'type':_0x4be1f8['type'][_0xd17c('0x2d')]};});_0x5e7e89[_0xd17c('0x2e')]=_[_0xd17c('0x29')](_0x27e2b3,_0xd17c('0x27'));_0x5e7e89[_0xd17c('0x2f')]=_['keys'](_0x5b6047['query']);_0x5e7e89[_0xd17c('0x30')]=_[_0xd17c('0x31')](_0x5e7e89[_0xd17c('0x2e')],_0x5e7e89[_0xd17c('0x2f')]);_0x45605b[_0xd17c('0x32')]=_[_0xd17c('0x31')](_0x5e7e89['model'],qs['fields'](_0x5b6047[_0xd17c('0x2f')][_0xd17c('0x33')]));_0x45605b[_0xd17c('0x32')]=_0x45605b['attributes'][_0xd17c('0x34')]?_0x45605b[_0xd17c('0x32')]:_0x5e7e89[_0xd17c('0x2e')];if(!_0x5b6047[_0xd17c('0x2f')]['hasOwnProperty'](_0xd17c('0x35'))){_0x45605b['limit']=qs[_0xd17c('0x20')](_0x5b6047['query'][_0xd17c('0x20')]);_0x45605b['offset']=qs[_0xd17c('0x1d')](_0x5b6047[_0xd17c('0x2f')][_0xd17c('0x1d')]);}_0x45605b[_0xd17c('0x36')]=qs[_0xd17c('0x37')](_0x5b6047[_0xd17c('0x2f')]['sort']);_0x45605b[_0xd17c('0x38')]=qs['filters'](_[_0xd17c('0x39')](_0x5b6047[_0xd17c('0x2f')],_0x5e7e89[_0xd17c('0x30')]),_0x27e2b3);if(_0x5b6047['query']['filter']){_0x45605b[_0xd17c('0x38')]=_[_0xd17c('0x3a')](_0x45605b[_0xd17c('0x38')],{'$or':_[_0xd17c('0x29')](_0x27e2b3,function(_0x1f00da){if(_0x1f00da[_0xd17c('0x3b')]!==_0xd17c('0x3c')){var _0x27be42={};_0x27be42[_0x1f00da['name']]={'$like':'%'+_0x5b6047['query'][_0xd17c('0x3d')]+'%'};return _0x27be42;}})});}_0x45605b=_['merge']({},_0x45605b,_0x5b6047[_0xd17c('0x3e')]);var _0xe00c08={'where':_0x45605b[_0xd17c('0x38')]};return db[_0xd17c('0x2a')][_0xd17c('0x1f')](_0xe00c08)[_0xd17c('0x26')](function(_0x296177){_0x23c109[_0xd17c('0x1f')]=_0x296177;if(_0x5b6047[_0xd17c('0x2f')][_0xd17c('0x3f')]){_0x45605b[_0xd17c('0x40')]=[{'all':!![]}];}return db[_0xd17c('0x2a')]['findAll'](_0x45605b);})[_0xd17c('0x26')](function(_0x462734){_0x23c109['rows']=_0x462734;return _0x23c109;})['then'](respondWithFilteredResult(_0x56083c,_0x45605b))[_0xd17c('0x41')](handleError(_0x56083c,null));};exports[_0xd17c('0x42')]=function(_0x114a09,_0x589509){var _0x5126e1={'raw':![],'where':{'id':_0x114a09[_0xd17c('0x43')]['id']}},_0x2d13d4={};_0x2d13d4[_0xd17c('0x2e')]=_[_0xd17c('0x44')](db[_0xd17c('0x2a')]['rawAttributes']);_0x2d13d4[_0xd17c('0x2f')]=_[_0xd17c('0x44')](_0x114a09[_0xd17c('0x2f')]);_0x2d13d4[_0xd17c('0x30')]=_[_0xd17c('0x31')](_0x2d13d4[_0xd17c('0x2e')],_0x2d13d4[_0xd17c('0x2f')]);_0x5126e1[_0xd17c('0x32')]=_[_0xd17c('0x31')](_0x2d13d4[_0xd17c('0x2e')],qs['fields'](_0x114a09[_0xd17c('0x2f')][_0xd17c('0x33')]));_0x5126e1[_0xd17c('0x32')]=_0x5126e1[_0xd17c('0x32')]['length']?_0x5126e1[_0xd17c('0x32')]:_0x2d13d4[_0xd17c('0x2e')];if(_0x114a09[_0xd17c('0x2f')][_0xd17c('0x3f')]){_0x5126e1[_0xd17c('0x40')]=[{'all':!![]}];}_0x5126e1=_['merge']({},_0x5126e1,_0x114a09[_0xd17c('0x3e')]);return db[_0xd17c('0x2a')][_0xd17c('0x45')](_0x5126e1)['then'](handleEntityNotFound(_0x589509,null))['then'](respondWithResult(_0x589509,null))[_0xd17c('0x41')](handleError(_0x589509,null));};exports[_0xd17c('0x46')]=function(_0x2ea574,_0x3a2298){return db[_0xd17c('0x2a')][_0xd17c('0x46')](_0x2ea574[_0xd17c('0x47')],{})[_0xd17c('0x26')](respondWithResult(_0x3a2298,0xc9))[_0xd17c('0x41')](handleError(_0x3a2298,null));};exports[_0xd17c('0x24')]=function(_0x1e035b,_0x582cfc){if(_0x1e035b[_0xd17c('0x47')]['id']){delete _0x1e035b[_0xd17c('0x47')]['id'];}return db[_0xd17c('0x2a')][_0xd17c('0x45')]({'where':{'id':_0x1e035b['params']['id']}})[_0xd17c('0x26')](handleEntityNotFound(_0x582cfc,null))[_0xd17c('0x26')](saveUpdates(_0x1e035b[_0xd17c('0x47')],null))[_0xd17c('0x26')](respondWithResult(_0x582cfc,null))[_0xd17c('0x41')](handleError(_0x582cfc,null));};exports[_0xd17c('0x25')]=function(_0x5cddc5,_0x4e5a13){return db[_0xd17c('0x2a')]['find']({'where':{'id':_0x5cddc5[_0xd17c('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e5a13,null))['then'](removeEntity(_0x4e5a13,null))[_0xd17c('0x41')](handleError(_0x4e5a13,null));};exports[_0xd17c('0x48')]=function(_0x48f093,_0x14a987,_0x23e0b1){return db['Condition'][_0xd17c('0x45')]({'where':{'id':_0x48f093[_0xd17c('0x43')]['id']}})[_0xd17c('0x26')](handleEntityNotFound(_0x14a987,null))['then'](function(_0x461f84){if(_0x461f84){return _0x461f84[_0xd17c('0x48')](_0x48f093[_0xd17c('0x47')][_0xd17c('0x49')],_['omit'](_0x48f093[_0xd17c('0x47')],[_0xd17c('0x49'),'id'])||{});}})[_0xd17c('0x26')](respondWithResult(_0x14a987,null))[_0xd17c('0x41')](handleError(_0x14a987,null));};exports[_0xd17c('0x4a')]=function(_0x2df753,_0x3a9f41,_0x5e21d3){var _0x42edc4={};var _0x18f3ca={};var _0x4d5cb2;var _0x2d8f38;return db[_0xd17c('0x2a')][_0xd17c('0x4b')]({'where':{'id':_0x2df753[_0xd17c('0x43')]['id']}})[_0xd17c('0x26')](handleEntityNotFound(_0x3a9f41,null))[_0xd17c('0x26')](function(_0x47200f){if(_0x47200f){_0x4d5cb2=_0x47200f;_0x18f3ca[_0xd17c('0x2e')]=_[_0xd17c('0x44')](db['Condition'][_0xd17c('0x2b')]);_0x18f3ca[_0xd17c('0x2f')]=_[_0xd17c('0x44')](_0x2df753[_0xd17c('0x2f')]);_0x18f3ca[_0xd17c('0x30')]=_['intersection'](_0x18f3ca[_0xd17c('0x2e')],_0x18f3ca[_0xd17c('0x2f')]);_0x42edc4[_0xd17c('0x32')]=_[_0xd17c('0x31')](_0x18f3ca['model'],qs[_0xd17c('0x33')](_0x2df753[_0xd17c('0x2f')][_0xd17c('0x33')]));_0x42edc4[_0xd17c('0x32')]=_0x42edc4[_0xd17c('0x32')][_0xd17c('0x34')]?_0x42edc4[_0xd17c('0x32')]:_0x18f3ca[_0xd17c('0x2e')];_0x42edc4[_0xd17c('0x36')]=qs['sort'](_0x2df753[_0xd17c('0x2f')][_0xd17c('0x37')]);_0x42edc4[_0xd17c('0x38')]=qs[_0xd17c('0x30')](_['pick'](_0x2df753[_0xd17c('0x2f')],_0x18f3ca['filters']));if(_0x2df753[_0xd17c('0x2f')][_0xd17c('0x3d')]){_0x42edc4[_0xd17c('0x38')]=_['merge'](_0x42edc4[_0xd17c('0x38')],{'$or':_[_0xd17c('0x29')](_0x42edc4[_0xd17c('0x32')],function(_0x211f77){var _0x3fdd1e={};_0x3fdd1e[_0x211f77]={'$like':'%'+_0x2df753['query'][_0xd17c('0x3d')]+'%'};return _0x3fdd1e;})});}_0x42edc4=_[_0xd17c('0x3a')]({},_0x42edc4,_0x2df753[_0xd17c('0x3e')]);return _0x4d5cb2[_0xd17c('0x4a')](_0x42edc4);}})[_0xd17c('0x26')](function(_0x201915){if(_0x201915){_0x2d8f38=_0x201915['length'];if(!_0x2df753['query'][_0xd17c('0x4c')](_0xd17c('0x35'))){_0x42edc4[_0xd17c('0x20')]=qs[_0xd17c('0x20')](_0x2df753[_0xd17c('0x2f')]['limit']);_0x42edc4[_0xd17c('0x1d')]=qs[_0xd17c('0x1d')](_0x2df753[_0xd17c('0x2f')][_0xd17c('0x1d')]);}return _0x4d5cb2[_0xd17c('0x4a')](_0x42edc4);}})[_0xd17c('0x26')](function(_0x33c1ae){if(_0x33c1ae){return _0x33c1ae?{'count':_0x2d8f38,'rows':_0x33c1ae}:null;}})[_0xd17c('0x26')](respondWithResult(_0x3a9f41,null))['catch'](handleError(_0x3a9f41,null));};exports[_0xd17c('0x4d')]=function(_0x55cc4c,_0x87b6b2,_0x5d99be){return db['Action'][_0xd17c('0x45')]({'where':{'id':_0x55cc4c[_0xd17c('0x43')]['id']}})[_0xd17c('0x26')](handleEntityNotFound(_0x87b6b2,null))['then'](function(_0x221676){if(_0x221676){return _0x221676[_0xd17c('0x4d')](_0x55cc4c['body'][_0xd17c('0x49')],_[_0xd17c('0x4e')](_0x55cc4c[_0xd17c('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x87b6b2,null))[_0xd17c('0x41')](handleError(_0x87b6b2,null));};exports[_0xd17c('0x4f')]=function(_0x4dc3d4,_0xd7a66a,_0x57f535){var _0x22b8b2={};var _0x4c8678={};var _0x28e904;var _0x5d34e8;return db[_0xd17c('0x2a')]['findOne']({'where':{'id':_0x4dc3d4[_0xd17c('0x43')]['id']}})[_0xd17c('0x26')](handleEntityNotFound(_0xd7a66a,null))[_0xd17c('0x26')](function(_0x118436){if(_0x118436){_0x28e904=_0x118436;_0x4c8678[_0xd17c('0x2e')]=_['keys'](db[_0xd17c('0x50')][_0xd17c('0x2b')]);_0x4c8678['query']=_[_0xd17c('0x44')](_0x4dc3d4[_0xd17c('0x2f')]);_0x4c8678[_0xd17c('0x30')]=_[_0xd17c('0x31')](_0x4c8678[_0xd17c('0x2e')],_0x4c8678[_0xd17c('0x2f')]);_0x22b8b2['attributes']=_[_0xd17c('0x31')](_0x4c8678['model'],qs[_0xd17c('0x33')](_0x4dc3d4[_0xd17c('0x2f')][_0xd17c('0x33')]));_0x22b8b2[_0xd17c('0x32')]=_0x22b8b2['attributes']['length']?_0x22b8b2['attributes']:_0x4c8678['model'];_0x22b8b2[_0xd17c('0x36')]=qs[_0xd17c('0x37')](_0x4dc3d4['query'][_0xd17c('0x37')]);_0x22b8b2['where']=qs[_0xd17c('0x30')](_['pick'](_0x4dc3d4[_0xd17c('0x2f')],_0x4c8678['filters']));if(_0x4dc3d4[_0xd17c('0x2f')]['filter']){_0x22b8b2['where']=_[_0xd17c('0x3a')](_0x22b8b2[_0xd17c('0x38')],{'$or':_[_0xd17c('0x29')](_0x22b8b2[_0xd17c('0x32')],function(_0x8c700f){var _0x4451c4={};_0x4451c4[_0x8c700f]={'$like':'%'+_0x4dc3d4['query'][_0xd17c('0x3d')]+'%'};return _0x4451c4;})});}_0x22b8b2=_[_0xd17c('0x3a')]({},_0x22b8b2,_0x4dc3d4[_0xd17c('0x3e')]);return _0x28e904[_0xd17c('0x4f')](_0x22b8b2);}})[_0xd17c('0x26')](function(_0x4f8a2a){if(_0x4f8a2a){_0x5d34e8=_0x4f8a2a[_0xd17c('0x34')];if(!_0x4dc3d4[_0xd17c('0x2f')][_0xd17c('0x4c')](_0xd17c('0x35'))){_0x22b8b2[_0xd17c('0x20')]=qs['limit'](_0x4dc3d4[_0xd17c('0x2f')][_0xd17c('0x20')]);_0x22b8b2[_0xd17c('0x1d')]=qs['offset'](_0x4dc3d4[_0xd17c('0x2f')][_0xd17c('0x1d')]);}return _0x28e904[_0xd17c('0x4f')](_0x22b8b2);}})['then'](function(_0x360a62){if(_0x360a62){return _0x360a62?{'count':_0x5d34e8,'rows':_0x360a62}:null;}})[_0xd17c('0x26')](respondWithResult(_0xd7a66a,null))[_0xd17c('0x41')](handleError(_0xd7a66a,null));};
\ No newline at end of file
+var _0x96e4=['ids','omit','findOne','options','getConditions','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','map','Automation','rawAttributes','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','include','rows','catch','show','includeAll','find','create','body','params','addConditions','Condition'];(function(_0x507018,_0x3f8257){var _0x34d677=function(_0x17e529){while(--_0x17e529){_0x507018['push'](_0x507018['shift']());}};_0x34d677(++_0x3f8257);}(_0x96e4,0x144));var _0x496e=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0x96e4[_0x43776a];return _0x18eb8f;};'use strict';var emlformat=require(_0x496e('0x0'));var rimraf=require(_0x496e('0x1'));var zipdir=require(_0x496e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x496e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x496e('0x4'));var path=require(_0x496e('0x5'));var sox=require(_0x496e('0x6'));var csv=require(_0x496e('0x7'));var ejs=require(_0x496e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x496e('0x9'));var squel=require(_0x496e('0xa'));var crypto=require(_0x496e('0xb'));var jsforce=require(_0x496e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x496e('0x7'));var querystring=require(_0x496e('0xd'));var Papa=require(_0x496e('0xe'));var Redis=require('ioredis');var authService=require(_0x496e('0xf'));var qs=require(_0x496e('0x10'));var as=require(_0x496e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x496e('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x496e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x496e('0x14'))['db'];function respondWithStatusCode(_0x42f815,_0x56d36d){_0x56d36d=_0x56d36d||0xcc;return function(_0x45349c){if(_0x45349c){return _0x42f815['sendStatus'](_0x56d36d);}return _0x42f815[_0x496e('0x15')](_0x56d36d)[_0x496e('0x16')]();};}function respondWithResult(_0x45ab4f,_0x152197){_0x152197=_0x152197||0xc8;return function(_0x32851e){if(_0x32851e){return _0x45ab4f[_0x496e('0x15')](_0x152197)[_0x496e('0x17')](_0x32851e);}};}function respondWithFilteredResult(_0x474689,_0x495599){return function(_0x2f5bba){if(_0x2f5bba){var _0x56c218=typeof _0x495599[_0x496e('0x18')]===_0x496e('0x19')&&typeof _0x495599[_0x496e('0x1a')]===_0x496e('0x19');var _0x37d0ab=_0x2f5bba[_0x496e('0x1b')];var _0xd155a=_0x56c218?0x0:_0x495599['offset'];var _0x452b7f=_0x56c218?_0x2f5bba['count']:_0x495599[_0x496e('0x18')]+_0x495599['limit'];var _0x33202d;if(_0x452b7f>=_0x37d0ab){_0x452b7f=_0x37d0ab;_0x33202d=0xc8;}else{_0x33202d=0xce;}_0x474689[_0x496e('0x15')](_0x33202d);return _0x474689[_0x496e('0x1c')](_0x496e('0x1d'),_0xd155a+'-'+_0x452b7f+'/'+_0x37d0ab)[_0x496e('0x17')](_0x2f5bba);}return null;};}function patchUpdates(_0x195c07){return function(_0x11b8d6){try{jsonpatch[_0x496e('0x1e')](_0x11b8d6,_0x195c07,!![]);}catch(_0x40eb1d){return BPromise[_0x496e('0x1f')](_0x40eb1d);}return _0x11b8d6['save']();};}function saveUpdates(_0x57af2d,_0x16753e){return function(_0x12eb62){if(_0x12eb62){return _0x12eb62[_0x496e('0x20')](_0x57af2d)[_0x496e('0x21')](function(_0x58ab8b){return _0x58ab8b;});}return null;};}function removeEntity(_0x25b058,_0x4dad6b){return function(_0xa8dd78){if(_0xa8dd78){return _0xa8dd78[_0x496e('0x22')]()[_0x496e('0x21')](function(){_0x25b058[_0x496e('0x15')](0xcc)[_0x496e('0x16')]();});}};}function handleEntityNotFound(_0x23be52,_0x4f689a){return function(_0x3edb3d){if(!_0x3edb3d){_0x23be52[_0x496e('0x23')](0x194);}return _0x3edb3d;};}function handleError(_0x4245e9,_0x17ed92){_0x17ed92=_0x17ed92||0x1f4;return function(_0x31a5f4){logger['error'](_0x31a5f4[_0x496e('0x24')]);if(_0x31a5f4['name']){delete _0x31a5f4['name'];}_0x4245e9['status'](_0x17ed92)['send'](_0x31a5f4);};}exports['index']=function(_0x9098ec,_0x35145e){var _0x5d2ca7={},_0x19f286={},_0x3fe068={'count':0x0,'rows':[]};var _0x2db3da=_[_0x496e('0x25')](db[_0x496e('0x26')][_0x496e('0x27')],function(_0x398bb2){return{'name':_0x398bb2['fieldName'],'type':_0x398bb2[_0x496e('0x28')][_0x496e('0x29')]};});_0x19f286['model']=_['map'](_0x2db3da,_0x496e('0x2a'));_0x19f286[_0x496e('0x2b')]=_[_0x496e('0x2c')](_0x9098ec[_0x496e('0x2b')]);_0x19f286['filters']=_[_0x496e('0x2d')](_0x19f286[_0x496e('0x2e')],_0x19f286[_0x496e('0x2b')]);_0x5d2ca7[_0x496e('0x2f')]=_[_0x496e('0x2d')](_0x19f286[_0x496e('0x2e')],qs[_0x496e('0x30')](_0x9098ec[_0x496e('0x2b')][_0x496e('0x30')]));_0x5d2ca7['attributes']=_0x5d2ca7[_0x496e('0x2f')][_0x496e('0x31')]?_0x5d2ca7[_0x496e('0x2f')]:_0x19f286[_0x496e('0x2e')];if(!_0x9098ec[_0x496e('0x2b')][_0x496e('0x32')](_0x496e('0x33'))){_0x5d2ca7[_0x496e('0x1a')]=qs['limit'](_0x9098ec[_0x496e('0x2b')][_0x496e('0x1a')]);_0x5d2ca7[_0x496e('0x18')]=qs[_0x496e('0x18')](_0x9098ec['query'][_0x496e('0x18')]);}_0x5d2ca7[_0x496e('0x34')]=qs[_0x496e('0x35')](_0x9098ec[_0x496e('0x2b')][_0x496e('0x35')]);_0x5d2ca7['where']=qs[_0x496e('0x36')](_[_0x496e('0x37')](_0x9098ec['query'],_0x19f286[_0x496e('0x36')]),_0x2db3da);if(_0x9098ec[_0x496e('0x2b')][_0x496e('0x38')]){_0x5d2ca7[_0x496e('0x39')]=_[_0x496e('0x3a')](_0x5d2ca7[_0x496e('0x39')],{'$or':_['map'](_0x2db3da,function(_0xb48bc9){if(_0xb48bc9[_0x496e('0x28')]!==_0x496e('0x3b')){var _0x51f5b4={};_0x51f5b4[_0xb48bc9[_0x496e('0x2a')]]={'$like':'%'+_0x9098ec['query'][_0x496e('0x38')]+'%'};return _0x51f5b4;}})});}_0x5d2ca7=_[_0x496e('0x3a')]({},_0x5d2ca7,_0x9098ec['options']);var _0xbab247={'where':_0x5d2ca7['where']};return db[_0x496e('0x26')]['count'](_0xbab247)[_0x496e('0x21')](function(_0x3e21e7){_0x3fe068[_0x496e('0x1b')]=_0x3e21e7;if(_0x9098ec[_0x496e('0x2b')]['includeAll']){_0x5d2ca7[_0x496e('0x3c')]=[{'all':!![]}];}return db[_0x496e('0x26')]['findAll'](_0x5d2ca7);})[_0x496e('0x21')](function(_0x4c97b8){_0x3fe068[_0x496e('0x3d')]=_0x4c97b8;return _0x3fe068;})[_0x496e('0x21')](respondWithFilteredResult(_0x35145e,_0x5d2ca7))[_0x496e('0x3e')](handleError(_0x35145e,null));};exports[_0x496e('0x3f')]=function(_0x495460,_0x584c70){var _0xdf20b3={'raw':![],'where':{'id':_0x495460['params']['id']}},_0x1c5fb8={};_0x1c5fb8['model']=_[_0x496e('0x2c')](db['Automation']['rawAttributes']);_0x1c5fb8[_0x496e('0x2b')]=_['keys'](_0x495460[_0x496e('0x2b')]);_0x1c5fb8[_0x496e('0x36')]=_[_0x496e('0x2d')](_0x1c5fb8['model'],_0x1c5fb8[_0x496e('0x2b')]);_0xdf20b3['attributes']=_['intersection'](_0x1c5fb8['model'],qs[_0x496e('0x30')](_0x495460[_0x496e('0x2b')][_0x496e('0x30')]));_0xdf20b3[_0x496e('0x2f')]=_0xdf20b3[_0x496e('0x2f')][_0x496e('0x31')]?_0xdf20b3[_0x496e('0x2f')]:_0x1c5fb8[_0x496e('0x2e')];if(_0x495460[_0x496e('0x2b')][_0x496e('0x40')]){_0xdf20b3[_0x496e('0x3c')]=[{'all':!![]}];}_0xdf20b3=_[_0x496e('0x3a')]({},_0xdf20b3,_0x495460['options']);return db[_0x496e('0x26')][_0x496e('0x41')](_0xdf20b3)[_0x496e('0x21')](handleEntityNotFound(_0x584c70,null))[_0x496e('0x21')](respondWithResult(_0x584c70,null))[_0x496e('0x3e')](handleError(_0x584c70,null));};exports[_0x496e('0x42')]=function(_0x450988,_0x4fbd6a){return db[_0x496e('0x26')]['create'](_0x450988['body'],{})[_0x496e('0x21')](respondWithResult(_0x4fbd6a,0xc9))[_0x496e('0x3e')](handleError(_0x4fbd6a,null));};exports['update']=function(_0x351b1c,_0x3bef51){if(_0x351b1c['body']['id']){delete _0x351b1c[_0x496e('0x43')]['id'];}return db[_0x496e('0x26')][_0x496e('0x41')]({'where':{'id':_0x351b1c[_0x496e('0x44')]['id']}})[_0x496e('0x21')](handleEntityNotFound(_0x3bef51,null))[_0x496e('0x21')](saveUpdates(_0x351b1c[_0x496e('0x43')],null))[_0x496e('0x21')](respondWithResult(_0x3bef51,null))['catch'](handleError(_0x3bef51,null));};exports[_0x496e('0x22')]=function(_0x305006,_0x4a0f60){return db[_0x496e('0x26')][_0x496e('0x41')]({'where':{'id':_0x305006[_0x496e('0x44')]['id']}})[_0x496e('0x21')](handleEntityNotFound(_0x4a0f60,null))[_0x496e('0x21')](removeEntity(_0x4a0f60,null))['catch'](handleError(_0x4a0f60,null));};exports[_0x496e('0x45')]=function(_0x163285,_0x435984,_0x56809d){return db[_0x496e('0x46')][_0x496e('0x41')]({'where':{'id':_0x163285[_0x496e('0x44')]['id']}})[_0x496e('0x21')](handleEntityNotFound(_0x435984,null))['then'](function(_0x20aa6f){if(_0x20aa6f){return _0x20aa6f[_0x496e('0x45')](_0x163285['body'][_0x496e('0x47')],_[_0x496e('0x48')](_0x163285[_0x496e('0x43')],['ids','id'])||{});}})[_0x496e('0x21')](respondWithResult(_0x435984,null))[_0x496e('0x3e')](handleError(_0x435984,null));};exports['getConditions']=function(_0x628b82,_0x33a623,_0x2d1c23){var _0x1d4e19={};var _0x19e5db={};var _0x24fd29;var _0x13c646;return db[_0x496e('0x26')][_0x496e('0x49')]({'where':{'id':_0x628b82[_0x496e('0x44')]['id']}})[_0x496e('0x21')](handleEntityNotFound(_0x33a623,null))[_0x496e('0x21')](function(_0x5939b5){if(_0x5939b5){_0x24fd29=_0x5939b5;_0x19e5db[_0x496e('0x2e')]=_[_0x496e('0x2c')](db[_0x496e('0x46')][_0x496e('0x27')]);_0x19e5db[_0x496e('0x2b')]=_['keys'](_0x628b82['query']);_0x19e5db[_0x496e('0x36')]=_[_0x496e('0x2d')](_0x19e5db['model'],_0x19e5db['query']);_0x1d4e19[_0x496e('0x2f')]=_[_0x496e('0x2d')](_0x19e5db[_0x496e('0x2e')],qs[_0x496e('0x30')](_0x628b82[_0x496e('0x2b')][_0x496e('0x30')]));_0x1d4e19[_0x496e('0x2f')]=_0x1d4e19[_0x496e('0x2f')]['length']?_0x1d4e19['attributes']:_0x19e5db['model'];_0x1d4e19[_0x496e('0x34')]=qs[_0x496e('0x35')](_0x628b82[_0x496e('0x2b')]['sort']);_0x1d4e19[_0x496e('0x39')]=qs[_0x496e('0x36')](_[_0x496e('0x37')](_0x628b82[_0x496e('0x2b')],_0x19e5db[_0x496e('0x36')]));if(_0x628b82[_0x496e('0x2b')][_0x496e('0x38')]){_0x1d4e19[_0x496e('0x39')]=_[_0x496e('0x3a')](_0x1d4e19[_0x496e('0x39')],{'$or':_[_0x496e('0x25')](_0x1d4e19[_0x496e('0x2f')],function(_0x404e17){var _0x10c7b3={};_0x10c7b3[_0x404e17]={'$like':'%'+_0x628b82[_0x496e('0x2b')]['filter']+'%'};return _0x10c7b3;})});}_0x1d4e19=_['merge']({},_0x1d4e19,_0x628b82[_0x496e('0x4a')]);return _0x24fd29[_0x496e('0x4b')](_0x1d4e19);}})[_0x496e('0x21')](function(_0x4b62c3){if(_0x4b62c3){_0x13c646=_0x4b62c3[_0x496e('0x31')];if(!_0x628b82[_0x496e('0x2b')][_0x496e('0x32')]('nolimit')){_0x1d4e19[_0x496e('0x1a')]=qs[_0x496e('0x1a')](_0x628b82[_0x496e('0x2b')][_0x496e('0x1a')]);_0x1d4e19[_0x496e('0x18')]=qs[_0x496e('0x18')](_0x628b82[_0x496e('0x2b')][_0x496e('0x18')]);}return _0x24fd29[_0x496e('0x4b')](_0x1d4e19);}})['then'](function(_0x266e9c){if(_0x266e9c){return _0x266e9c?{'count':_0x13c646,'rows':_0x266e9c}:null;}})[_0x496e('0x21')](respondWithResult(_0x33a623,null))[_0x496e('0x3e')](handleError(_0x33a623,null));};exports[_0x496e('0x4c')]=function(_0x3757e7,_0x387ad4,_0x2f7a4f){return db[_0x496e('0x4d')][_0x496e('0x41')]({'where':{'id':_0x3757e7[_0x496e('0x44')]['id']}})[_0x496e('0x21')](handleEntityNotFound(_0x387ad4,null))[_0x496e('0x21')](function(_0x5b47eb){if(_0x5b47eb){return _0x5b47eb[_0x496e('0x4c')](_0x3757e7[_0x496e('0x43')][_0x496e('0x47')],_[_0x496e('0x48')](_0x3757e7['body'],[_0x496e('0x47'),'id'])||{});}})['then'](respondWithResult(_0x387ad4,null))['catch'](handleError(_0x387ad4,null));};exports[_0x496e('0x4e')]=function(_0x51fdfc,_0x1bc498,_0xff5695){var _0x8fbff6={};var _0x255639={};var _0x118a51;var _0x413734;return db['Automation'][_0x496e('0x49')]({'where':{'id':_0x51fdfc[_0x496e('0x44')]['id']}})[_0x496e('0x21')](handleEntityNotFound(_0x1bc498,null))[_0x496e('0x21')](function(_0x20cdac){if(_0x20cdac){_0x118a51=_0x20cdac;_0x255639[_0x496e('0x2e')]=_['keys'](db[_0x496e('0x4d')]['rawAttributes']);_0x255639[_0x496e('0x2b')]=_[_0x496e('0x2c')](_0x51fdfc[_0x496e('0x2b')]);_0x255639[_0x496e('0x36')]=_[_0x496e('0x2d')](_0x255639[_0x496e('0x2e')],_0x255639[_0x496e('0x2b')]);_0x8fbff6[_0x496e('0x2f')]=_[_0x496e('0x2d')](_0x255639[_0x496e('0x2e')],qs['fields'](_0x51fdfc['query'][_0x496e('0x30')]));_0x8fbff6[_0x496e('0x2f')]=_0x8fbff6[_0x496e('0x2f')][_0x496e('0x31')]?_0x8fbff6[_0x496e('0x2f')]:_0x255639[_0x496e('0x2e')];_0x8fbff6[_0x496e('0x34')]=qs[_0x496e('0x35')](_0x51fdfc[_0x496e('0x2b')][_0x496e('0x35')]);_0x8fbff6[_0x496e('0x39')]=qs[_0x496e('0x36')](_[_0x496e('0x37')](_0x51fdfc[_0x496e('0x2b')],_0x255639[_0x496e('0x36')]));if(_0x51fdfc[_0x496e('0x2b')][_0x496e('0x38')]){_0x8fbff6[_0x496e('0x39')]=_[_0x496e('0x3a')](_0x8fbff6[_0x496e('0x39')],{'$or':_['map'](_0x8fbff6[_0x496e('0x2f')],function(_0x34a50a){var _0x5920a0={};_0x5920a0[_0x34a50a]={'$like':'%'+_0x51fdfc[_0x496e('0x2b')]['filter']+'%'};return _0x5920a0;})});}_0x8fbff6=_[_0x496e('0x3a')]({},_0x8fbff6,_0x51fdfc[_0x496e('0x4a')]);return _0x118a51[_0x496e('0x4e')](_0x8fbff6);}})['then'](function(_0x56445b){if(_0x56445b){_0x413734=_0x56445b[_0x496e('0x31')];if(!_0x51fdfc[_0x496e('0x2b')][_0x496e('0x32')](_0x496e('0x33'))){_0x8fbff6[_0x496e('0x1a')]=qs[_0x496e('0x1a')](_0x51fdfc[_0x496e('0x2b')]['limit']);_0x8fbff6[_0x496e('0x18')]=qs['offset'](_0x51fdfc['query'][_0x496e('0x18')]);}return _0x118a51[_0x496e('0x4e')](_0x8fbff6);}})['then'](function(_0x50ae72){if(_0x50ae72){return _0x50ae72?{'count':_0x413734,'rows':_0x50ae72}:null;}})[_0x496e('0x21')](respondWithResult(_0x1bc498,null))[_0x496e('0x3e')](handleError(_0x1bc498,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 7c45bd7..d2b251c 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 _0x438e=['path','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations','util','../../config/logger','api','bluebird','request-promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x438e,0x1f3));var _0xe438=function(_0x3b56c0,_0xe100d8){_0x3b56c0=_0x3b56c0-0x0;var _0x377efe=_0x438e[_0x3b56c0];return _0x377efe;};'use strict';var _=require('lodash');var util=require(_0xe438('0x0'));var logger=require(_0xe438('0x1'))(_0xe438('0x2'));var moment=require('moment');var BPromise=require(_0xe438('0x3'));var rp=require(_0xe438('0x4'));var fs=require('fs');var path=require(_0xe438('0x5'));var rimraf=require(_0xe438('0x6'));var config=require(_0xe438('0x7'));var attributes=require(_0xe438('0x8'));module[_0xe438('0x9')]=function(_0x309d97,_0x2655c7){return _0x309d97[_0xe438('0xa')]('Automation',attributes,{'tableName':_0xe438('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa991=['api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','define','Automation','util'];(function(_0x398447,_0x18df90){var _0x5d2094=function(_0x3c42a8){while(--_0x3c42a8){_0x398447['push'](_0x398447['shift']());}};_0x5d2094(++_0x18df90);}(_0xa991,0x6d));var _0x1a99=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xa991[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0x1a99('0x0'));var logger=require('../../config/logger')(_0x1a99('0x1'));var moment=require(_0x1a99('0x2'));var BPromise=require(_0x1a99('0x3'));var rp=require(_0x1a99('0x4'));var fs=require('fs');var path=require(_0x1a99('0x5'));var rimraf=require('rimraf');var config=require(_0x1a99('0x6'));var attributes=require(_0x1a99('0x7'));module[_0x1a99('0x8')]=function(_0x5dea29,_0x19c92d){return _0x5dea29[_0x1a99('0x9')](_0x1a99('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index f954ca9..49c9ed9 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 _0x6372=['lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch'];(function(_0x360cc7,_0x2373f4){var _0x36c3b7=function(_0x112d09){while(--_0x112d09){_0x360cc7['push'](_0x360cc7['shift']());}};_0x36c3b7(++_0x2373f4);}(_0x6372,0x1b8));var _0x2637=function(_0x24b876,_0x38534c){_0x24b876=_0x24b876-0x0;var _0x8e7099=_0x6372[_0x24b876];return _0x8e7099;};'use strict';var _=require(_0x2637('0x0'));var util=require('util');var moment=require(_0x2637('0x1'));var BPromise=require('bluebird');var rs=require(_0x2637('0x2'));var fs=require('fs');var Redis=require(_0x2637('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2637('0x4'));var logger=require(_0x2637('0x5'))(_0x2637('0x6'));var config=require(_0x2637('0x7'));var jayson=require(_0x2637('0x8'));var client=jayson['client'][_0x2637('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54bdd1,_0x4f8521,_0x49383d){return new BPromise(function(_0x30abde,_0x5a4748){return client['request'](_0x54bdd1,_0x49383d)[_0x2637('0xa')](function(_0x2dbcb5){logger[_0x2637('0xb')]('Automation,\x20%s,\x20%s',_0x4f8521,'request\x20sent');logger[_0x2637('0xc')](_0x2637('0xd'),_0x4f8521,_0x2637('0xe'),JSON[_0x2637('0xf')](_0x2dbcb5));if(_0x2dbcb5[_0x2637('0x10')]){if(_0x2dbcb5[_0x2637('0x10')][_0x2637('0x11')]===0x1f4){logger[_0x2637('0x10')](_0x2637('0x12'),_0x4f8521,_0x2dbcb5['error'][_0x2637('0x13')]);return _0x5a4748(_0x2dbcb5[_0x2637('0x10')][_0x2637('0x13')]);}logger['error'](_0x2637('0x12'),_0x4f8521,_0x2dbcb5[_0x2637('0x10')][_0x2637('0x13')]);return _0x30abde(_0x2dbcb5[_0x2637('0x10')]['message']);}else{logger[_0x2637('0xb')](_0x2637('0x12'),_0x4f8521,_0x2637('0xe'));_0x30abde(_0x2dbcb5[_0x2637('0x14')][_0x2637('0x13')]);}})[_0x2637('0x15')](function(_0x567d3c){logger['error'](_0x2637('0x12'),_0x4f8521,_0x567d3c);_0x5a4748(_0x567d3c);});});}
\ No newline at end of file
+var _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch'];(function(_0x2b72d8,_0x2fd8bf){var _0x1ec104=function(_0x7af0ec){while(--_0x7af0ec){_0x2b72d8['push'](_0x2b72d8['shift']());}};_0x1ec104(++_0x2fd8bf);}(_0x2272,0xd8));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('Automation,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 55fee2d..55505db 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 _0x9efb=['getActions','post','addConditions','/:id/actions','addActions','put','/:id','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id/conditions','getConditions'];(function(_0x3f08ca,_0x10bca6){var _0x4bdd9c=function(_0x2bc9a9){while(--_0x2bc9a9){_0x3f08ca['push'](_0x3f08ca['shift']());}};_0x4bdd9c(++_0x10bca6);}(_0x9efb,0x143));var _0xb9ef=function(_0x306950,_0x1d665d){_0x306950=_0x306950-0x0;var _0x5df637=_0x9efb[_0x306950];return _0x5df637;};'use strict';var multer=require('multer');var util=require(_0xb9ef('0x0'));var path=require(_0xb9ef('0x1'));var timeout=require('connect-timeout');var express=require(_0xb9ef('0x2'));var router=express[_0xb9ef('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb9ef('0x4'));var interaction=require(_0xb9ef('0x5'));var config=require(_0xb9ef('0x6'));var controller=require(_0xb9ef('0x7'));router[_0xb9ef('0x8')]('/',auth[_0xb9ef('0x9')](),controller[_0xb9ef('0xa')]);router['get']('/:id',auth[_0xb9ef('0x9')](),controller['show']);router['get'](_0xb9ef('0xb'),auth[_0xb9ef('0x9')](),controller[_0xb9ef('0xc')]);router[_0xb9ef('0x8')]('/:id/actions',auth[_0xb9ef('0x9')](),controller[_0xb9ef('0xd')]);router[_0xb9ef('0xe')]('/',auth[_0xb9ef('0x9')](),controller['create']);router[_0xb9ef('0xe')](_0xb9ef('0xb'),auth[_0xb9ef('0x9')](),controller[_0xb9ef('0xf')]);router[_0xb9ef('0xe')](_0xb9ef('0x10'),auth[_0xb9ef('0x9')](),controller[_0xb9ef('0x11')]);router[_0xb9ef('0x12')](_0xb9ef('0x13'),auth['isAuthenticated'](),controller[_0xb9ef('0x14')]);router[_0xb9ef('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xb9ef('0x16')]);module[_0xb9ef('0x17')]=router;
\ No newline at end of file
+var _0x48ea=['../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x48ea,0x9c));var _0xa48e=function(_0x19950d,_0x448522){_0x19950d=_0x19950d-0x0;var _0x44d84f=_0x48ea[_0x19950d];return _0x44d84f;};'use strict';var multer=require(_0xa48e('0x0'));var util=require('util');var path=require(_0xa48e('0x1'));var timeout=require(_0xa48e('0x2'));var express=require(_0xa48e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa48e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa48e('0x5'));var controller=require(_0xa48e('0x6'));router[_0xa48e('0x7')]('/',auth[_0xa48e('0x8')](),controller[_0xa48e('0x9')]);router[_0xa48e('0x7')](_0xa48e('0xa'),auth[_0xa48e('0x8')](),controller[_0xa48e('0xb')]);router[_0xa48e('0x7')](_0xa48e('0xc'),auth[_0xa48e('0x8')](),controller[_0xa48e('0xd')]);router[_0xa48e('0x7')](_0xa48e('0xe'),auth['isAuthenticated'](),controller[_0xa48e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa48e('0x10')](_0xa48e('0xc'),auth[_0xa48e('0x8')](),controller[_0xa48e('0x11')]);router['post'](_0xa48e('0xe'),auth[_0xa48e('0x8')](),controller[_0xa48e('0x12')]);router[_0xa48e('0x13')](_0xa48e('0xa'),auth[_0xa48e('0x8')](),controller[_0xa48e('0x14')]);router['delete'](_0xa48e('0xa'),auth[_0xa48e('0x8')](),controller[_0xa48e('0x15')]);module[_0xa48e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e83a912..856a7be 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 _0x8e70=['sequelize','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#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)'];(function(_0x9bef43,_0x22812d){var _0x68828d=function(_0x1cae7){while(--_0x1cae7){_0x9bef43['push'](_0x9bef43['shift']());}};_0x68828d(++_0x22812d);}(_0x8e70,0xa0));var _0x08e7=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x8e70[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require(_0x08e7('0x0'));module[_0x08e7('0x1')]={'name':{'type':Sequelize[_0x08e7('0x2')],'unique':_0x08e7('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x08e7('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x08e7('0x5')},'description':{'type':Sequelize[_0x08e7('0x2')]},'active':{'type':Sequelize[_0x08e7('0x6')],'defaultValue':0x0,'comment':_0x08e7('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x08e7('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x08e7('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x08e7('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x08e7('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x08e7('0xa')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x08e7('0xa')](0x3)[_0x08e7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08e7('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x08e7('0xa')](0x5)[_0x08e7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08e7('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x08e7('0xa')](0x3)[_0x08e7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08e7('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x08e7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x08e7('0xa')](0x3)[_0x08e7('0x8')],'defaultValue':0x3,'comment':_0x08e7('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x08e7('0xa')](0x5)[_0x08e7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x08e7('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x08e7('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x08e7('0x2')],'defaultValue':_0x08e7('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x08e7('0x4')](_0x08e7('0x11'),_0x08e7('0x12'),_0x08e7('0x13')),'defaultValue':_0x08e7('0x11')},'dialAMDActive':{'type':Sequelize[_0x08e7('0x6')],'defaultValue':0x0,'comment':_0x08e7('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x08e7('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x08e7('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x08e7('0xa')](0x9)[_0x08e7('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x08e7('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x08e7('0xa')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x08e7('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x08e7('0xa')](0x9)[_0x08e7('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x08e7('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x08e7('0xa')](0x9)[_0x08e7('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x08e7('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x08e7('0xa')](0x5)[_0x08e7('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x08e7('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x08e7('0xa')](0x9)[_0x08e7('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x08e7('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x08e7('0x4')]('DESC',_0x08e7('0x1c')),'defaultValue':_0x08e7('0x1d')},'dialPrefix':{'type':Sequelize[_0x08e7('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x08e7('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x08e7('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x08e7('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x08e7('0xa')](0x3)[_0x08e7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08e7('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x08e7('0xa')](0x5)[_0x08e7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08e7('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x08e7('0xa')](0x3)[_0x08e7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08e7('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x08e7('0xa')](0x5)[_0x08e7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08e7('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x08e7('0xa')](0x3)[_0x08e7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08e7('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x08e7('0xa')](0x5)[_0x08e7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x08e7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x08e7('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x08e7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08e7('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x08e7('0xa')](0x3)[_0x08e7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x08e7('0xa')](0x5)[_0x08e7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x08e7('0x27')}};
\ No newline at end of file
+var _0xe386=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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)','exports','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#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','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x140240,_0x101ef5){var _0x54fe10=function(_0x38fca4){while(--_0x38fca4){_0x140240['push'](_0x140240['shift']());}};_0x54fe10(++_0x101ef5);}(_0xe386,0x1db));var _0x6e38=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe386[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0x6e38('0x0')]={'name':{'type':Sequelize[_0x6e38('0x1')],'unique':_0x6e38('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x6e38('0x3')),'allowNull':![],'defaultValue':_0x6e38('0x3')},'description':{'type':Sequelize[_0x6e38('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x6e38('0x4')},'limitCalls':{'type':Sequelize[_0x6e38('0x5')](0x4)[_0x6e38('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6e38('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6e38('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6e38('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x6e38('0x5')](0x3)[_0x6e38('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6e38('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6e38('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6e38('0x5')](0x5)[_0x6e38('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6e38('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x6e38('0x5')](0x3)[_0x6e38('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6e38('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6e38('0x5')](0x5)[_0x6e38('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6e38('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6e38('0x6')],'defaultValue':0x3,'comment':_0x6e38('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6e38('0x5')](0x5)[_0x6e38('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x6e38('0x5')](0x3)[_0x6e38('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6e38('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x6e38('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x6e38('0x10')]('always',_0x6e38('0x11'),_0x6e38('0x12')),'defaultValue':_0x6e38('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x6e38('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6e38('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x6e38('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6e38('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6e38('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6e38('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6e38('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6e38('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6e38('0x5')](0x9)[_0x6e38('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6e38('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6e38('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6e38('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6e38('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6e38('0x5')](0x9)[_0x6e38('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6e38('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6e38('0x10')]('DESC',_0x6e38('0x1c')),'defaultValue':_0x6e38('0x1d')},'dialPrefix':{'type':Sequelize[_0x6e38('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6e38('0x5')](0x3)[_0x6e38('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6e38('0x1e')},'dialCutDigit':{'type':Sequelize[_0x6e38('0x5')](0x3)[_0x6e38('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6e38('0x5')](0x3)[_0x6e38('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6e38('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6e38('0x5')](0x5)[_0x6e38('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6e38('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x6e38('0x5')](0x3)[_0x6e38('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6e38('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x6e38('0x5')](0x5)[_0x6e38('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6e38('0x5')](0x3)[_0x6e38('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6e38('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6e38('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6e38('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x6e38('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6e38('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6e38('0x5')](0x5)[_0x6e38('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6e38('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6e38('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6e38('0x5')](0x5)[_0x6e38('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6e38('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index b7de1bc..90b067b 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 _0x0427=['insert','into','ContactId','NOW()','cm_contacts','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','map','Campaign','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','update','getHoppers','CmHopper','order','CampaignId','rows','getHopperHistories','findOne','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','cm_hopper','fromQuery','ListId','select','field','phone','scheduledAt','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x0427,0x137));var _0x7042=function(_0x3fb462,_0x5ae278){_0x3fb462=_0x3fb462-0x0;var _0x1b3ebb=_0x0427[_0x3fb462];return _0x1b3ebb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7042('0x0'));var jsonpatch=require(_0x7042('0x1'));var rp=require('request-promise');var moment=require(_0x7042('0x2'));var BPromise=require(_0x7042('0x3'));var Mustache=require(_0x7042('0x4'));var util=require(_0x7042('0x5'));var path=require(_0x7042('0x6'));var sox=require(_0x7042('0x7'));var csv=require(_0x7042('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7042('0x9'));var _=require(_0x7042('0xa'));var squel=require(_0x7042('0xb'));var crypto=require(_0x7042('0xc'));var jsforce=require(_0x7042('0xd'));var deskjs=require(_0x7042('0xe'));var toCsv=require(_0x7042('0x8'));var querystring=require(_0x7042('0xf'));var Papa=require(_0x7042('0x10'));var Redis=require('ioredis');var authService=require(_0x7042('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7042('0x12'));var utils=require('../../config/utils');var config=require(_0x7042('0x13'));var licenseUtil=require(_0x7042('0x14'));var db=require(_0x7042('0x15'))['db'];function respondWithStatusCode(_0x5629f2,_0x5c06f0){_0x5c06f0=_0x5c06f0||0xcc;return function(_0x292c4a){if(_0x292c4a){return _0x5629f2[_0x7042('0x16')](_0x5c06f0);}return _0x5629f2[_0x7042('0x17')](_0x5c06f0)[_0x7042('0x18')]();};}function respondWithResult(_0x25dfe5,_0xee4c2){_0xee4c2=_0xee4c2||0xc8;return function(_0x5def25){if(_0x5def25){return _0x25dfe5[_0x7042('0x17')](_0xee4c2)[_0x7042('0x19')](_0x5def25);}};}function respondWithFilteredResult(_0x6ed505,_0x5c1ef0){return function(_0x4c68c4){if(_0x4c68c4){var _0xc7e44e=typeof _0x5c1ef0['offset']===_0x7042('0x1a')&&typeof _0x5c1ef0['limit']==='undefined';var _0x28add7=_0x4c68c4[_0x7042('0x1b')];var _0x1e69aa=_0xc7e44e?0x0:_0x5c1ef0[_0x7042('0x1c')];var _0x6e18fb=_0xc7e44e?_0x4c68c4['count']:_0x5c1ef0[_0x7042('0x1c')]+_0x5c1ef0[_0x7042('0x1d')];var _0x34fda6;if(_0x6e18fb>=_0x28add7){_0x6e18fb=_0x28add7;_0x34fda6=0xc8;}else{_0x34fda6=0xce;}_0x6ed505[_0x7042('0x17')](_0x34fda6);return _0x6ed505[_0x7042('0x1e')]('Content-Range',_0x1e69aa+'-'+_0x6e18fb+'/'+_0x28add7)[_0x7042('0x19')](_0x4c68c4);}return null;};}function patchUpdates(_0x580f84){return function(_0x363f3c){try{jsonpatch['apply'](_0x363f3c,_0x580f84,!![]);}catch(_0x3b8203){return BPromise[_0x7042('0x1f')](_0x3b8203);}return _0x363f3c[_0x7042('0x20')]();};}function saveUpdates(_0x456dfc,_0x484c82){return function(_0x5a224b){if(_0x5a224b){return _0x5a224b['update'](_0x456dfc)[_0x7042('0x21')](function(_0x30a722){return _0x30a722;});}return null;};}function removeEntity(_0x3af8bc,_0x1949fe){return function(_0x48d529){if(_0x48d529){return _0x48d529[_0x7042('0x22')]()[_0x7042('0x21')](function(){var _0x4611f9=_0x48d529[_0x7042('0x23')]({'plain':!![]});var _0x459ff6='IvrCampaigns';return db[_0x7042('0x24')][_0x7042('0x22')]({'where':{'type':_0x459ff6,'resourceId':_0x4611f9['id']}})[_0x7042('0x21')](function(){return _0x48d529;});})[_0x7042('0x21')](function(){_0x3af8bc[_0x7042('0x17')](0xcc)[_0x7042('0x18')]();});}};}function handleEntityNotFound(_0x162ac7,_0x26543a){return function(_0x4568ec){if(!_0x4568ec){_0x162ac7[_0x7042('0x16')](0x194);}return _0x4568ec;};}function handleError(_0xa9ca06,_0x36fec4){_0x36fec4=_0x36fec4||0x1f4;return function(_0x88c156){logger[_0x7042('0x25')](_0x88c156[_0x7042('0x26')]);if(_0x88c156[_0x7042('0x27')]){delete _0x88c156[_0x7042('0x27')];}_0xa9ca06[_0x7042('0x17')](_0x36fec4)[_0x7042('0x28')](_0x88c156);};}exports['index']=function(_0x519e79,_0x37cf52){var _0x160af6={},_0x300be2={},_0x253a8b={'count':0x0,'rows':[]};var _0x2620c3=_[_0x7042('0x29')](db[_0x7042('0x2a')]['rawAttributes'],function(_0x4823c3){return{'name':_0x4823c3[_0x7042('0x2b')],'type':_0x4823c3[_0x7042('0x2c')]['key']};});_0x300be2[_0x7042('0x2d')]=_[_0x7042('0x29')](_0x2620c3,'name');_0x300be2[_0x7042('0x2e')]=_[_0x7042('0x2f')](_0x519e79[_0x7042('0x2e')]);_0x300be2[_0x7042('0x30')]=_[_0x7042('0x31')](_0x300be2['model'],_0x300be2[_0x7042('0x2e')]);_0x160af6['attributes']=_['intersection'](_0x300be2[_0x7042('0x2d')],qs['fields'](_0x519e79[_0x7042('0x2e')][_0x7042('0x32')]));_0x160af6['attributes']=_0x160af6[_0x7042('0x33')]['length']?_0x160af6[_0x7042('0x33')]:_0x300be2[_0x7042('0x2d')];if(!_0x519e79[_0x7042('0x2e')][_0x7042('0x34')](_0x7042('0x35'))){_0x160af6[_0x7042('0x1d')]=qs[_0x7042('0x1d')](_0x519e79[_0x7042('0x2e')][_0x7042('0x1d')]);_0x160af6['offset']=qs[_0x7042('0x1c')](_0x519e79[_0x7042('0x2e')][_0x7042('0x1c')]);}_0x160af6['order']=qs['sort'](_0x519e79[_0x7042('0x2e')][_0x7042('0x36')]);_0x160af6['where']=qs[_0x7042('0x30')](_[_0x7042('0x37')](_0x519e79[_0x7042('0x2e')],_0x300be2[_0x7042('0x30')]),_0x2620c3);if(_0x519e79[_0x7042('0x2e')][_0x7042('0x38')]){_0x160af6[_0x7042('0x39')]=_[_0x7042('0x3a')](_0x160af6[_0x7042('0x39')],{'$or':_[_0x7042('0x29')](_0x2620c3,function(_0x2b8669){if(_0x2b8669[_0x7042('0x2c')]!==_0x7042('0x3b')){var _0x53a424={};_0x53a424[_0x2b8669['name']]={'$like':'%'+_0x519e79[_0x7042('0x2e')][_0x7042('0x38')]+'%'};return _0x53a424;}})});}_0x160af6=_[_0x7042('0x3a')]({},_0x160af6,_0x519e79[_0x7042('0x3c')]);var _0x4b138b={'where':_0x160af6[_0x7042('0x39')]};return db[_0x7042('0x2a')]['count'](_0x4b138b)['then'](function(_0x1f8e68){_0x253a8b[_0x7042('0x1b')]=_0x1f8e68;if(_0x519e79[_0x7042('0x2e')][_0x7042('0x3d')]){_0x160af6[_0x7042('0x3e')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x160af6);})[_0x7042('0x21')](function(_0x3897fc){_0x253a8b['rows']=_0x3897fc;return _0x253a8b;})[_0x7042('0x21')](respondWithFilteredResult(_0x37cf52,_0x160af6))[_0x7042('0x3f')](handleError(_0x37cf52,null));};exports[_0x7042('0x40')]=function(_0x59568d,_0x5cffc0){var _0x9c4981={'raw':![],'where':{'id':_0x59568d[_0x7042('0x41')]['id']}},_0x44413e={};_0x44413e['model']=_[_0x7042('0x2f')](db[_0x7042('0x2a')]['rawAttributes']);_0x44413e[_0x7042('0x2e')]=_[_0x7042('0x2f')](_0x59568d[_0x7042('0x2e')]);_0x44413e[_0x7042('0x30')]=_[_0x7042('0x31')](_0x44413e[_0x7042('0x2d')],_0x44413e[_0x7042('0x2e')]);_0x9c4981['attributes']=_[_0x7042('0x31')](_0x44413e[_0x7042('0x2d')],qs['fields'](_0x59568d[_0x7042('0x2e')][_0x7042('0x32')]));_0x9c4981[_0x7042('0x33')]=_0x9c4981[_0x7042('0x33')][_0x7042('0x42')]?_0x9c4981[_0x7042('0x33')]:_0x44413e['model'];if(_0x59568d['query']['includeAll']){_0x9c4981[_0x7042('0x3e')]=[{'all':!![]}];}_0x9c4981=_['merge']({},_0x9c4981,_0x59568d['options']);return db[_0x7042('0x2a')]['find'](_0x9c4981)[_0x7042('0x21')](handleEntityNotFound(_0x5cffc0,null))[_0x7042('0x21')](respondWithResult(_0x5cffc0,null))[_0x7042('0x3f')](handleError(_0x5cffc0,null));};exports[_0x7042('0x43')]=function(_0x1a22d5,_0x11e7ce){return db[_0x7042('0x2a')][_0x7042('0x43')](_0x1a22d5[_0x7042('0x44')],{})[_0x7042('0x21')](function(_0x103d68){var _0x14d11a=_0x1a22d5[_0x7042('0x45')]['get']({'plain':!![]});if(!_0x14d11a)throw new Error(_0x7042('0x46'));if(_0x14d11a[_0x7042('0x47')]===_0x7042('0x45')){var _0x81b898=_0x103d68[_0x7042('0x23')]({'plain':!![]});var _0x288a11=_0x7042('0x48');return db[_0x7042('0x49')][_0x7042('0x4a')]({'where':{'name':_0x288a11,'userProfileId':_0x14d11a[_0x7042('0x4b')]},'raw':!![]})[_0x7042('0x21')](function(_0x445689){if(_0x445689&&_0x445689[_0x7042('0x4c')]===0x0){return db['UserProfileResource'][_0x7042('0x43')]({'name':_0x81b898['name'],'resourceId':_0x81b898['id'],'type':_0x445689[_0x7042('0x27')],'sectionId':_0x445689['id']},{})[_0x7042('0x21')](function(){return _0x103d68;});}else{return _0x103d68;}})[_0x7042('0x3f')](function(_0x5a0c85){logger['error'](_0x7042('0x4d'),_0x5a0c85);throw _0x5a0c85;});}return _0x103d68;})[_0x7042('0x21')](respondWithResult(_0x11e7ce,0xc9))[_0x7042('0x3f')](handleError(_0x11e7ce,null));};exports[_0x7042('0x4e')]=function(_0x58f2f2,_0x497188){var _0x280a41={'where':{'id':_0x58f2f2['params']['id']}},_0x3b4d27={};_0x3b4d27[_0x7042('0x2d')]=_[_0x7042('0x2f')](db['Campaign'][_0x7042('0x4f')]);_0x280a41[_0x7042('0x33')]=_['intersection'](_0x3b4d27[_0x7042('0x2d')],qs[_0x7042('0x32')](_0x58f2f2[_0x7042('0x2e')]['fields']));_0x280a41[_0x7042('0x33')]=_0x280a41[_0x7042('0x33')][_0x7042('0x42')]?_0x280a41[_0x7042('0x33')]:_0x3b4d27[_0x7042('0x2d')];if(_0x58f2f2[_0x7042('0x2e')][_0x7042('0x3d')]){_0x280a41[_0x7042('0x3e')]=[{'all':!![]}];}_0x280a41=_[_0x7042('0x3a')]({},_0x280a41,_0x58f2f2[_0x7042('0x3c')]);return db[_0x7042('0x2a')][_0x7042('0x4a')](_0x280a41)['then'](handleEntityNotFound(_0x497188,null))[_0x7042('0x21')](function(_0x318fd5){if(_0x318fd5){var _0x5d41f6=_0x318fd5[_0x7042('0x23')]({'plain':!![]});_0x5d41f6=qs[_0x7042('0x50')](_0x5d41f6,['id',_0x7042('0x51'),'updatedAt']);_0x58f2f2[_0x7042('0x44')]=_[_0x7042('0x50')](_0x58f2f2[_0x7042('0x44')],['id','createdAt',_0x7042('0x52')]);return db[_0x7042('0x2a')][_0x7042('0x43')](_[_0x7042('0x3a')](_0x5d41f6,_0x58f2f2[_0x7042('0x44')]),{'include':_0x58f2f2[_0x7042('0x2e')][_0x7042('0x3d')]?[{'all':!![]}]:undefined})[_0x7042('0x21')](function(_0x4bc8e9){var _0x2d7dbc=_0x58f2f2[_0x7042('0x45')][_0x7042('0x23')]({'plain':!![]});if(!_0x2d7dbc)throw new Error(_0x7042('0x46'));if(_0x2d7dbc[_0x7042('0x47')]===_0x7042('0x45')){var _0x253936=_0x4bc8e9['get']({'plain':!![]});var _0x1872c7='IvrCampaigns';return db[_0x7042('0x49')][_0x7042('0x4a')]({'where':{'name':_0x1872c7,'userProfileId':_0x2d7dbc[_0x7042('0x4b')]},'raw':!![]})[_0x7042('0x21')](function(_0x50f7c5){if(_0x50f7c5&&_0x50f7c5['autoAssociation']===0x0){return db[_0x7042('0x24')][_0x7042('0x43')]({'name':_0x253936['name'],'resourceId':_0x253936['id'],'type':_0x50f7c5[_0x7042('0x27')],'sectionId':_0x50f7c5['id']},{})[_0x7042('0x21')](function(){return _0x4bc8e9;});}else{return _0x4bc8e9;}})[_0x7042('0x3f')](function(_0x195f08){logger[_0x7042('0x25')](_0x7042('0x4d'),_0x195f08);throw _0x195f08;});}return _0x4bc8e9;});}})[_0x7042('0x21')](respondWithResult(_0x497188,0xc9))[_0x7042('0x3f')](handleError(_0x497188,null));};exports[_0x7042('0x53')]=function(_0x5c14ca,_0x2185f3){if(_0x5c14ca[_0x7042('0x44')]['id']){delete _0x5c14ca[_0x7042('0x44')]['id'];}return db[_0x7042('0x2a')]['find']({'where':{'id':_0x5c14ca[_0x7042('0x41')]['id']}})['then'](handleEntityNotFound(_0x2185f3,null))[_0x7042('0x21')](saveUpdates(_0x5c14ca[_0x7042('0x44')],null))['then'](respondWithResult(_0x2185f3,null))['catch'](handleError(_0x2185f3,null));};exports[_0x7042('0x22')]=function(_0x5ba91e,_0xc51212){return db[_0x7042('0x2a')][_0x7042('0x4a')]({'where':{'id':_0x5ba91e['params']['id']}})['then'](handleEntityNotFound(_0xc51212,null))['then'](removeEntity(_0xc51212,null))[_0x7042('0x3f')](handleError(_0xc51212,null));};exports[_0x7042('0x54')]=function(_0x5158b6,_0x2256d3,_0x10d2d8){var _0x331b54={'raw':!![],'where':{}};var _0x4c70f4={};var _0x245201={'count':0x0,'rows':[]};return db[_0x7042('0x2a')]['findOne']({'where':{'id':_0x5158b6['params']['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x2256d3,null))['then'](function(_0x59bb93){if(_0x59bb93){_0x4c70f4[_0x7042('0x2d')]=_[_0x7042('0x2f')](db[_0x7042('0x55')][_0x7042('0x4f')]);_0x4c70f4[_0x7042('0x2e')]=_[_0x7042('0x2f')](_0x5158b6[_0x7042('0x2e')]);_0x4c70f4[_0x7042('0x30')]=_['intersection'](_0x4c70f4['model'],_0x4c70f4[_0x7042('0x2e')]);_0x331b54[_0x7042('0x33')]=_[_0x7042('0x31')](_0x4c70f4['model'],qs['fields'](_0x5158b6[_0x7042('0x2e')]['fields']));_0x331b54[_0x7042('0x33')]=_0x331b54[_0x7042('0x33')][_0x7042('0x42')]?_0x331b54['attributes']:_0x4c70f4[_0x7042('0x2d')];if(!_0x5158b6[_0x7042('0x2e')]['hasOwnProperty'](_0x7042('0x35'))){_0x331b54[_0x7042('0x1d')]=qs['limit'](_0x5158b6['query'][_0x7042('0x1d')]);_0x331b54[_0x7042('0x1c')]=qs['offset'](_0x5158b6[_0x7042('0x2e')][_0x7042('0x1c')]);}_0x331b54[_0x7042('0x56')]=qs[_0x7042('0x36')](_0x5158b6[_0x7042('0x2e')][_0x7042('0x36')]);_0x331b54[_0x7042('0x39')]=qs[_0x7042('0x30')](_[_0x7042('0x37')](_0x5158b6[_0x7042('0x2e')],_0x4c70f4['filters']));_0x331b54[_0x7042('0x39')][_0x7042('0x57')]=_0x59bb93['id'];if(_0x5158b6[_0x7042('0x2e')][_0x7042('0x38')]){_0x331b54['where']=_[_0x7042('0x3a')](_0x331b54[_0x7042('0x39')],{'$or':_[_0x7042('0x29')](_0x331b54[_0x7042('0x33')],function(_0x5e758c){var _0x10bb7a={};_0x10bb7a[_0x5e758c]={'$like':'%'+_0x5158b6[_0x7042('0x2e')][_0x7042('0x38')]+'%'};return _0x10bb7a;})});}_0x331b54=_[_0x7042('0x3a')]({},_0x331b54,_0x5158b6[_0x7042('0x3c')]);return db['CmHopper']['count']({'where':_0x331b54[_0x7042('0x39')]})['then'](function(_0x29fa20){_0x245201[_0x7042('0x1b')]=_0x29fa20;if(_0x5158b6[_0x7042('0x2e')][_0x7042('0x3d')]){_0x331b54[_0x7042('0x3e')]=[{'all':!![]}];}return db[_0x7042('0x55')]['findAll'](_0x331b54);})[_0x7042('0x21')](function(_0x5317c0){_0x245201[_0x7042('0x58')]=_0x5317c0;return _0x245201;});}})[_0x7042('0x21')](respondWithFilteredResult(_0x2256d3,_0x331b54))['catch'](handleError(_0x2256d3,null));};exports[_0x7042('0x59')]=function(_0x400004,_0x29c861,_0x271a62){var _0x54a65a={'raw':!![],'where':{}};var _0x2b3fb1={};var _0x462bb5={'count':0x0,'rows':[]};return db[_0x7042('0x2a')][_0x7042('0x5a')]({'where':{'id':_0x400004[_0x7042('0x41')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x29c861,null))[_0x7042('0x21')](function(_0x356841){if(_0x356841){_0x2b3fb1[_0x7042('0x2d')]=_['keys'](db[_0x7042('0x5b')][_0x7042('0x4f')]);_0x2b3fb1[_0x7042('0x2e')]=_['keys'](_0x400004[_0x7042('0x2e')]);_0x2b3fb1['filters']=_['intersection'](_0x2b3fb1[_0x7042('0x2d')],_0x2b3fb1[_0x7042('0x2e')]);_0x54a65a[_0x7042('0x33')]=_['intersection'](_0x2b3fb1[_0x7042('0x2d')],qs[_0x7042('0x32')](_0x400004[_0x7042('0x2e')]['fields']));_0x54a65a[_0x7042('0x33')]=_0x54a65a[_0x7042('0x33')][_0x7042('0x42')]?_0x54a65a[_0x7042('0x33')]:_0x2b3fb1[_0x7042('0x2d')];if(!_0x400004[_0x7042('0x2e')][_0x7042('0x34')]('nolimit')){_0x54a65a['limit']=qs[_0x7042('0x1d')](_0x400004['query'][_0x7042('0x1d')]);_0x54a65a[_0x7042('0x1c')]=qs['offset'](_0x400004['query'][_0x7042('0x1c')]);}_0x54a65a[_0x7042('0x56')]=qs['sort'](_0x400004[_0x7042('0x2e')][_0x7042('0x36')]);_0x54a65a[_0x7042('0x39')]=qs[_0x7042('0x30')](_[_0x7042('0x37')](_0x400004[_0x7042('0x2e')],_0x2b3fb1['filters']));_0x54a65a[_0x7042('0x39')][_0x7042('0x57')]=_0x356841['id'];if(_0x400004['query']['filter']){_0x54a65a[_0x7042('0x39')]=_['merge'](_0x54a65a[_0x7042('0x39')],{'$or':_[_0x7042('0x29')](_0x54a65a[_0x7042('0x33')],function(_0x5dd90d){var _0x5e8535={};_0x5e8535[_0x5dd90d]={'$like':'%'+_0x400004['query']['filter']+'%'};return _0x5e8535;})});}_0x54a65a=_[_0x7042('0x3a')]({},_0x54a65a,_0x400004[_0x7042('0x3c')]);return db[_0x7042('0x5b')][_0x7042('0x1b')]({'where':_0x54a65a[_0x7042('0x39')]})[_0x7042('0x21')](function(_0x392343){_0x462bb5['count']=_0x392343;if(_0x400004[_0x7042('0x2e')][_0x7042('0x3d')]){_0x54a65a['include']=[{'all':!![]}];}return db[_0x7042('0x5b')][_0x7042('0x5c')](_0x54a65a);})[_0x7042('0x21')](function(_0xfc46ac){_0x462bb5['rows']=_0xfc46ac;return _0x462bb5;});}})['then'](respondWithFilteredResult(_0x29c861,_0x54a65a))['catch'](handleError(_0x29c861,null));};exports[_0x7042('0x5d')]=function(_0x501a3e,_0x234cba,_0x2314fc){var _0x1ce11d={'raw':!![],'where':{}};var _0x50058b={};var _0x94ea96={'count':0x0,'rows':[]};return db[_0x7042('0x2a')][_0x7042('0x5a')]({'where':{'id':_0x501a3e[_0x7042('0x41')]['id']}})['then'](handleEntityNotFound(_0x234cba,null))[_0x7042('0x21')](function(_0x3bdb8b){if(_0x3bdb8b){_0x50058b['model']=_['keys'](db[_0x7042('0x5e')][_0x7042('0x4f')]);_0x50058b[_0x7042('0x2e')]=_['keys'](_0x501a3e[_0x7042('0x2e')]);_0x50058b['filters']=_[_0x7042('0x31')](_0x50058b[_0x7042('0x2d')],_0x50058b[_0x7042('0x2e')]);_0x1ce11d[_0x7042('0x33')]=_[_0x7042('0x31')](_0x50058b[_0x7042('0x2d')],qs[_0x7042('0x32')](_0x501a3e[_0x7042('0x2e')]['fields']));_0x1ce11d[_0x7042('0x33')]=_0x1ce11d[_0x7042('0x33')][_0x7042('0x42')]?_0x1ce11d[_0x7042('0x33')]:_0x50058b[_0x7042('0x2d')];if(!_0x501a3e[_0x7042('0x2e')]['hasOwnProperty']('nolimit')){_0x1ce11d[_0x7042('0x1d')]=qs[_0x7042('0x1d')](_0x501a3e[_0x7042('0x2e')][_0x7042('0x1d')]);_0x1ce11d[_0x7042('0x1c')]=qs[_0x7042('0x1c')](_0x501a3e[_0x7042('0x2e')][_0x7042('0x1c')]);}_0x1ce11d[_0x7042('0x56')]=qs['sort'](_0x501a3e[_0x7042('0x2e')][_0x7042('0x36')]);_0x1ce11d['where']=qs[_0x7042('0x30')](_[_0x7042('0x37')](_0x501a3e[_0x7042('0x2e')],_0x50058b[_0x7042('0x30')]));_0x1ce11d[_0x7042('0x39')][_0x7042('0x57')]=_0x3bdb8b['id'];if(_0x501a3e['query'][_0x7042('0x38')]){_0x1ce11d[_0x7042('0x39')]=_['merge'](_0x1ce11d[_0x7042('0x39')],{'$or':_[_0x7042('0x29')](_0x1ce11d[_0x7042('0x33')],function(_0x25dd26){var _0x28dbdc={};_0x28dbdc[_0x25dd26]={'$like':'%'+_0x501a3e['query'][_0x7042('0x38')]+'%'};return _0x28dbdc;})});}_0x1ce11d=_[_0x7042('0x3a')]({},_0x1ce11d,_0x501a3e['options']);return db[_0x7042('0x5e')][_0x7042('0x1b')]({'where':_0x1ce11d[_0x7042('0x39')]})[_0x7042('0x21')](function(_0xf85af2){_0x94ea96['count']=_0xf85af2;if(_0x501a3e[_0x7042('0x2e')][_0x7042('0x3d')]){_0x1ce11d[_0x7042('0x3e')]=[{'all':!![]}];}return db[_0x7042('0x5e')][_0x7042('0x5c')](_0x1ce11d);})[_0x7042('0x21')](function(_0x3e2077){_0x94ea96[_0x7042('0x58')]=_0x3e2077;return _0x94ea96;});}})[_0x7042('0x21')](respondWithFilteredResult(_0x234cba,_0x1ce11d))[_0x7042('0x3f')](handleError(_0x234cba,null));};exports[_0x7042('0x5f')]=function(_0x34a64d,_0x39c85e,_0x5b5f1a){var _0x4a834e={'raw':!![],'where':{}};var _0x5ab8b5={};var _0x60717c={'count':0x0,'rows':[]};return db[_0x7042('0x2a')]['findOne']({'where':{'id':_0x34a64d[_0x7042('0x41')]['id']}})['then'](handleEntityNotFound(_0x39c85e,null))[_0x7042('0x21')](function(_0x5a3095){if(_0x5a3095){_0x5ab8b5[_0x7042('0x2d')]=_[_0x7042('0x2f')](db[_0x7042('0x60')][_0x7042('0x4f')]);_0x5ab8b5['query']=_['keys'](_0x34a64d[_0x7042('0x2e')]);_0x5ab8b5[_0x7042('0x30')]=_[_0x7042('0x31')](_0x5ab8b5[_0x7042('0x2d')],_0x5ab8b5[_0x7042('0x2e')]);_0x4a834e['attributes']=_[_0x7042('0x31')](_0x5ab8b5[_0x7042('0x2d')],qs['fields'](_0x34a64d['query'][_0x7042('0x32')]));_0x4a834e[_0x7042('0x33')]=_0x4a834e[_0x7042('0x33')][_0x7042('0x42')]?_0x4a834e[_0x7042('0x33')]:_0x5ab8b5[_0x7042('0x2d')];if(!_0x34a64d[_0x7042('0x2e')][_0x7042('0x34')](_0x7042('0x35'))){_0x4a834e['limit']=qs[_0x7042('0x1d')](_0x34a64d[_0x7042('0x2e')][_0x7042('0x1d')]);_0x4a834e[_0x7042('0x1c')]=qs[_0x7042('0x1c')](_0x34a64d['query']['offset']);}_0x4a834e['order']=qs[_0x7042('0x36')](_0x34a64d[_0x7042('0x2e')]['sort']);_0x4a834e[_0x7042('0x39')]=qs[_0x7042('0x30')](_[_0x7042('0x37')](_0x34a64d[_0x7042('0x2e')],_0x5ab8b5['filters']));_0x4a834e[_0x7042('0x39')][_0x7042('0x57')]=_0x5a3095['id'];if(_0x34a64d[_0x7042('0x2e')][_0x7042('0x38')]){_0x4a834e['where']=_[_0x7042('0x3a')](_0x4a834e[_0x7042('0x39')],{'$or':_['map'](_0x4a834e['attributes'],function(_0x31f374){var _0x34dd15={};_0x34dd15[_0x31f374]={'$like':'%'+_0x34a64d[_0x7042('0x2e')][_0x7042('0x38')]+'%'};return _0x34dd15;})});}_0x4a834e=_[_0x7042('0x3a')]({},_0x4a834e,_0x34a64d[_0x7042('0x3c')]);return db[_0x7042('0x60')][_0x7042('0x1b')]({'where':_0x4a834e[_0x7042('0x39')]})[_0x7042('0x21')](function(_0x333ea4){_0x60717c[_0x7042('0x1b')]=_0x333ea4;if(_0x34a64d[_0x7042('0x2e')][_0x7042('0x3d')]){_0x4a834e[_0x7042('0x3e')]=[{'all':!![]}];}return db[_0x7042('0x60')][_0x7042('0x5c')](_0x4a834e);})[_0x7042('0x21')](function(_0x2935dc){_0x60717c[_0x7042('0x58')]=_0x2935dc;return _0x60717c;});}})[_0x7042('0x21')](respondWithFilteredResult(_0x39c85e,_0x4a834e))[_0x7042('0x3f')](handleError(_0x39c85e,null));};exports['getLists']=function(_0x3f3cd1,_0x268042,_0x60ba4f){var _0x5c9a48={};var _0x75fbfe={};var _0x11d0d8;var _0x44d4b6;return db['Campaign'][_0x7042('0x5a')]({'where':{'id':_0x3f3cd1[_0x7042('0x41')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x268042,null))[_0x7042('0x21')](function(_0x56ad5b){if(_0x56ad5b){_0x11d0d8=_0x56ad5b;_0x75fbfe[_0x7042('0x2d')]=_[_0x7042('0x2f')](db[_0x7042('0x61')][_0x7042('0x4f')]);_0x75fbfe[_0x7042('0x2e')]=_[_0x7042('0x2f')](_0x3f3cd1[_0x7042('0x2e')]);_0x75fbfe[_0x7042('0x30')]=_[_0x7042('0x31')](_0x75fbfe[_0x7042('0x2d')],_0x75fbfe[_0x7042('0x2e')]);_0x5c9a48[_0x7042('0x33')]=_['intersection'](_0x75fbfe[_0x7042('0x2d')],qs[_0x7042('0x32')](_0x3f3cd1[_0x7042('0x2e')][_0x7042('0x32')]));_0x5c9a48[_0x7042('0x33')]=_0x5c9a48['attributes'][_0x7042('0x42')]?_0x5c9a48[_0x7042('0x33')]:_0x75fbfe['model'];_0x5c9a48[_0x7042('0x56')]=qs[_0x7042('0x36')](_0x3f3cd1[_0x7042('0x2e')]['sort']);_0x5c9a48[_0x7042('0x39')]=qs[_0x7042('0x30')](_['pick'](_0x3f3cd1[_0x7042('0x2e')],_0x75fbfe[_0x7042('0x30')]));if(_0x3f3cd1[_0x7042('0x2e')]['filter']){_0x5c9a48[_0x7042('0x39')]=_[_0x7042('0x3a')](_0x5c9a48[_0x7042('0x39')],{'$or':_['map'](_0x5c9a48[_0x7042('0x33')],function(_0x15226f){var _0x51c9da={};_0x51c9da[_0x15226f]={'$like':'%'+_0x3f3cd1[_0x7042('0x2e')]['filter']+'%'};return _0x51c9da;})});}_0x5c9a48=_[_0x7042('0x3a')]({},_0x5c9a48,_0x3f3cd1['options']);return _0x11d0d8['getLists'](_0x5c9a48);}})['then'](function(_0xf0ff98){if(_0xf0ff98){_0x44d4b6=_0xf0ff98['length'];if(!_0x3f3cd1[_0x7042('0x2e')][_0x7042('0x34')](_0x7042('0x35'))){_0x5c9a48[_0x7042('0x1d')]=qs['limit'](_0x3f3cd1[_0x7042('0x2e')][_0x7042('0x1d')]);_0x5c9a48[_0x7042('0x1c')]=qs[_0x7042('0x1c')](_0x3f3cd1[_0x7042('0x2e')][_0x7042('0x1c')]);}return _0x11d0d8[_0x7042('0x62')](_0x5c9a48);}})[_0x7042('0x21')](function(_0x1a4da8){if(_0x1a4da8){return _0x1a4da8?{'count':_0x44d4b6,'rows':_0x1a4da8}:null;}})[_0x7042('0x21')](respondWithResult(_0x268042,null))[_0x7042('0x3f')](handleError(_0x268042,null));};exports[_0x7042('0x63')]=function(_0x484a5e,_0x1ffa4a,_0x29cc7e){var _0x59fe22,_0x5b5c52;var _0x9dfcce=[];var _0x241ef6=moment()[_0x7042('0x64')](_0x7042('0x65'));return db[_0x7042('0x2a')][_0x7042('0x4a')]({'where':{'id':_0x484a5e[_0x7042('0x41')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x1ffa4a,null))[_0x7042('0x21')](function(_0x2502fe){if(_0x2502fe){_0x5b5c52=_0x2502fe;return _0x2502fe[_0x7042('0x63')](_0x484a5e['body'][_0x7042('0x66')],_['omit'](_0x484a5e[_0x7042('0x44')],[_0x7042('0x66'),'id'])||{});}return null;})['spread'](function(_0x526699){var _0x305f11;var _0x112e5c;_0x59fe22=_0x526699||[];var _0x291172=[];if(_0x526699){for(var _0x564e1e=0x0;_0x564e1e<_0x526699[_0x7042('0x42')];_0x564e1e+=0x1){var _0x13f8ec=_0x526699[_0x564e1e][_0x7042('0x23')]({'plain':!![]});_0x5b5c52[_0x7042('0x67')]=_0x484a5e[_0x7042('0x44')][_0x7042('0x67')]?_0x484a5e[_0x7042('0x44')]['dialCheckDuplicateType']:_0x5b5c52[_0x7042('0x67')];switch(_0x5b5c52[_0x7042('0x67')]){case _0x7042('0x68'):_0x305f11=squel['insert']()['into'](_0x7042('0x69'))[_0x7042('0x6a')](['phone','scheduledAt','ContactId',_0x7042('0x6b'),_0x7042('0x57'),_0x7042('0x51'),_0x7042('0x52')],squel[_0x7042('0x6c')]()[_0x7042('0x6d')](_0x7042('0x6e'),_0x7042('0x6e'))[_0x7042('0x6d')]('NOW()',_0x7042('0x6f'))[_0x7042('0x6d')]('id','ContactId')[_0x7042('0x6d')](_0x13f8ec['CmListId'][_0x7042('0x70')](),'ListId')[_0x7042('0x6d')](_0x484a5e[_0x7042('0x41')]['id'][_0x7042('0x70')](),_0x7042('0x57'))['field']('\x27'+_0x241ef6+'\x27',_0x7042('0x51'))[_0x7042('0x6d')]('\x27'+_0x241ef6+'\x27',_0x7042('0x52'))[_0x7042('0x71')]('cm_contacts')[_0x7042('0x39')](_0x7042('0x72'))[_0x7042('0x39')](_0x7042('0x73'),_0x13f8ec[_0x7042('0x74')][_0x7042('0x70')]())[_0x7042('0x39')](_0x7042('0x75'))[_0x7042('0x39')](_0x7042('0x76'),squel[_0x7042('0x6c')]()['field'](_0x7042('0x77'))[_0x7042('0x71')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x484a5e['params']['id']['toString']()))['where'](_0x7042('0x76'),squel['select']()[_0x7042('0x6d')](_0x7042('0x78'))[_0x7042('0x71')](_0x7042('0x69'))[_0x7042('0x39')]('CampaignId\x20=\x20?',_0x484a5e[_0x7042('0x41')]['id'][_0x7042('0x70')]())))[_0x7042('0x70')]();break;case'onlyIfOpen':_0x305f11=squel[_0x7042('0x79')]()[_0x7042('0x7a')]('cm_hopper')[_0x7042('0x6a')]([_0x7042('0x6e'),_0x7042('0x6f'),_0x7042('0x7b'),_0x7042('0x6b'),_0x7042('0x57'),_0x7042('0x51'),'updatedAt'],squel[_0x7042('0x6c')]()[_0x7042('0x6d')](_0x7042('0x6e'),'phone')['field'](_0x7042('0x7c'),_0x7042('0x6f'))['field']('id','ContactId')[_0x7042('0x6d')](_0x13f8ec[_0x7042('0x74')][_0x7042('0x70')](),_0x7042('0x6b'))['field'](_0x484a5e[_0x7042('0x41')]['id'][_0x7042('0x70')](),_0x7042('0x57'))[_0x7042('0x6d')]('\x27'+_0x241ef6+'\x27',_0x7042('0x51'))[_0x7042('0x6d')]('\x27'+_0x241ef6+'\x27','updatedAt')[_0x7042('0x71')](_0x7042('0x7d'))[_0x7042('0x39')](_0x7042('0x72'))[_0x7042('0x39')](_0x7042('0x73'),_0x13f8ec[_0x7042('0x74')][_0x7042('0x70')]())['where'](_0x7042('0x75'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x7042('0x6c')]()['field'](_0x7042('0x78'))[_0x7042('0x71')](_0x7042('0x69'))[_0x7042('0x39')](_0x7042('0x7e'),_0x484a5e[_0x7042('0x41')]['id'][_0x7042('0x70')]())))[_0x7042('0x70')]();break;default:_0x305f11=squel[_0x7042('0x79')]()['into'](_0x7042('0x69'))[_0x7042('0x6a')]([_0x7042('0x6e'),'scheduledAt',_0x7042('0x7b'),'ListId','CampaignId',_0x7042('0x51'),_0x7042('0x52')],squel['select']()[_0x7042('0x6d')]('phone',_0x7042('0x6e'))[_0x7042('0x6d')](_0x7042('0x7c'),_0x7042('0x6f'))[_0x7042('0x6d')]('id',_0x7042('0x7b'))[_0x7042('0x6d')](_0x13f8ec[_0x7042('0x74')][_0x7042('0x70')](),'ListId')['field'](_0x484a5e[_0x7042('0x41')]['id']['toString'](),_0x7042('0x57'))[_0x7042('0x6d')]('\x27'+_0x241ef6+'\x27',_0x7042('0x51'))[_0x7042('0x6d')]('\x27'+_0x241ef6+'\x27',_0x7042('0x52'))['from']('cm_contacts')['where'](_0x7042('0x72'))['where'](_0x7042('0x73'),_0x13f8ec['CmListId']['toString']())['where'](_0x7042('0x75')))[_0x7042('0x70')]();}_0x112e5c=squel[_0x7042('0x79')]()[_0x7042('0x7a')](_0x7042('0x7f'))[_0x7042('0x6a')]([_0x7042('0x80'),_0x7042('0x6f'),_0x7042('0x6e'),'OrderBy',_0x7042('0x51'),_0x7042('0x52')],squel[_0x7042('0x6c')]()[_0x7042('0x6d')]('h.id','id')[_0x7042('0x6d')]('NOW()',_0x7042('0x6f'))[_0x7042('0x6d')]('ci.item',_0x7042('0x6e'))[_0x7042('0x6d')](_0x7042('0x81'),'OrderBy')[_0x7042('0x6d')]('\x27'+_0x241ef6+'\x27',_0x7042('0x51'))[_0x7042('0x6d')]('\x27'+_0x241ef6+'\x27',_0x7042('0x52'))[_0x7042('0x71')](_0x7042('0x82'),'ci')[_0x7042('0x83')](_0x7042('0x69'),'h',_0x7042('0x84'))[_0x7042('0x39')]('h.ListId\x20=\x20?',_0x13f8ec['CmListId'][_0x7042('0x70')]())[_0x7042('0x39')](_0x7042('0x85'),_0x484a5e[_0x7042('0x41')]['id'][_0x7042('0x70')]())[_0x7042('0x39')](_0x7042('0x86'),_0x241ef6))[_0x7042('0x70')]();_0x291172[_0x7042('0x87')](db[_0x7042('0x88')][_0x7042('0x2e')](_0x305f11));_0x9dfcce[_0x7042('0x87')](db[_0x7042('0x88')][_0x7042('0x2e')](_0x112e5c));}return BPromise[_0x7042('0x89')](_0x291172);}})[_0x7042('0x21')](function(){return BPromise[_0x7042('0x89')](_0x9dfcce);})['then'](function(){return _0x59fe22;})['then'](respondWithResult(_0x1ffa4a,null))[_0x7042('0x3f')](handleError(_0x1ffa4a,null));};exports['removeLists']=function(_0x3b407b,_0x3432f7,_0x314db7){return db[_0x7042('0x2a')][_0x7042('0x4a')]({'where':{'id':_0x3b407b[_0x7042('0x41')]['id']}})['then'](handleEntityNotFound(_0x3432f7,null))[_0x7042('0x21')](function(_0x43162e){if(_0x43162e){return _0x43162e[_0x7042('0x8a')](_0x3b407b[_0x7042('0x2e')][_0x7042('0x66')]);}})[_0x7042('0x21')](function(_0x5c66fa){if(_0x5c66fa){return db[_0x7042('0x55')]['destroy']({'where':{'ListId':_0x3b407b['query'][_0x7042('0x66')],'CampaignId':_0x3b407b[_0x7042('0x41')]['id']}})[_0x7042('0x21')](function(){return _0x5c66fa;});}})[_0x7042('0x21')](respondWithStatusCode(_0x3432f7,null))[_0x7042('0x3f')](handleError(_0x3432f7,null));};exports[_0x7042('0x8b')]=function(_0x302339,_0x2ab49a,_0x3b37e9){var _0x218b75={};var _0x4fc9e7={};var _0x392ab5;var _0x591d6d;return db[_0x7042('0x2a')][_0x7042('0x5a')]({'where':{'id':_0x302339[_0x7042('0x41')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x2ab49a,null))['then'](function(_0x10a106){if(_0x10a106){_0x392ab5=_0x10a106;_0x4fc9e7[_0x7042('0x2d')]=_['keys'](db[_0x7042('0x61')][_0x7042('0x4f')]);_0x4fc9e7[_0x7042('0x2e')]=_[_0x7042('0x2f')](_0x302339[_0x7042('0x2e')]);_0x4fc9e7['filters']=_['intersection'](_0x4fc9e7['model'],_0x4fc9e7[_0x7042('0x2e')]);_0x218b75[_0x7042('0x33')]=_[_0x7042('0x31')](_0x4fc9e7['model'],qs['fields'](_0x302339[_0x7042('0x2e')]['fields']));_0x218b75['attributes']=_0x218b75[_0x7042('0x33')][_0x7042('0x42')]?_0x218b75[_0x7042('0x33')]:_0x4fc9e7[_0x7042('0x2d')];_0x218b75[_0x7042('0x56')]=qs[_0x7042('0x36')](_0x302339['query'][_0x7042('0x36')]);_0x218b75[_0x7042('0x39')]=qs[_0x7042('0x30')](_[_0x7042('0x37')](_0x302339[_0x7042('0x2e')],_0x4fc9e7[_0x7042('0x30')]));if(_0x302339['query'][_0x7042('0x38')]){_0x218b75[_0x7042('0x39')]=_[_0x7042('0x3a')](_0x218b75[_0x7042('0x39')],{'$or':_[_0x7042('0x29')](_0x218b75[_0x7042('0x33')],function(_0x5a4529){var _0x57357e={};_0x57357e[_0x5a4529]={'$like':'%'+_0x302339[_0x7042('0x2e')][_0x7042('0x38')]+'%'};return _0x57357e;})});}_0x218b75=_[_0x7042('0x3a')]({},_0x218b75,_0x302339[_0x7042('0x3c')]);return _0x392ab5['getBlackLists'](_0x218b75);}})[_0x7042('0x21')](function(_0xfba18d){if(_0xfba18d){_0x591d6d=_0xfba18d['length'];if(!_0x302339[_0x7042('0x2e')][_0x7042('0x34')]('nolimit')){_0x218b75[_0x7042('0x1d')]=qs[_0x7042('0x1d')](_0x302339[_0x7042('0x2e')]['limit']);_0x218b75['offset']=qs[_0x7042('0x1c')](_0x302339[_0x7042('0x2e')][_0x7042('0x1c')]);}return _0x392ab5['getBlackLists'](_0x218b75);}})['then'](function(_0x55c18b){if(_0x55c18b){return _0x55c18b?{'count':_0x591d6d,'rows':_0x55c18b}:null;}})[_0x7042('0x21')](respondWithResult(_0x2ab49a,null))[_0x7042('0x3f')](handleError(_0x2ab49a,null));};exports[_0x7042('0x8c')]=function(_0x3239cd,_0x14d90e,_0x310266){var _0x589aed,_0x426ba5;var _0x4fce5a=[];var _0x567233=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x7042('0x2a')]['find']({'where':{'id':_0x3239cd[_0x7042('0x41')]['id']}})['then'](handleEntityNotFound(_0x14d90e,null))[_0x7042('0x21')](function(_0x3e7c8e){if(_0x3e7c8e){_0x426ba5=_0x3e7c8e;return _0x3e7c8e[_0x7042('0x8c')](_0x3239cd[_0x7042('0x44')][_0x7042('0x66')],_[_0x7042('0x50')](_0x3239cd['body'],[_0x7042('0x66'),'id'])||{});}return null;})[_0x7042('0x8d')](function(_0x109a24){var _0x464080;var _0x42242b;_0x589aed=_0x109a24||[];var _0x295a93=[];if(_0x109a24){for(var _0x59b1ef=0x0;_0x59b1ef<_0x109a24[_0x7042('0x42')];_0x59b1ef+=0x1){var _0x1aeb73=_0x109a24[_0x59b1ef][_0x7042('0x23')]({'plain':!![]});_0x464080=squel['insert']()['into'](_0x7042('0x8e'))['fromQuery'](['phone',_0x7042('0x7b'),'ListId',_0x7042('0x57'),_0x7042('0x51'),_0x7042('0x52')],squel[_0x7042('0x6c')]()['field']('phone','phone')[_0x7042('0x6d')]('id',_0x7042('0x7b'))[_0x7042('0x6d')](_0x1aeb73[_0x7042('0x74')][_0x7042('0x70')](),_0x7042('0x6b'))[_0x7042('0x6d')](_0x3239cd[_0x7042('0x41')]['id'][_0x7042('0x70')](),_0x7042('0x57'))[_0x7042('0x6d')](_0x7042('0x7c'),_0x7042('0x51'))[_0x7042('0x6d')](_0x7042('0x7c'),_0x7042('0x52'))[_0x7042('0x71')](_0x7042('0x7d'))['where'](_0x7042('0x72'))['where']('ListId\x20=\x20?',_0x1aeb73[_0x7042('0x74')][_0x7042('0x70')]())[_0x7042('0x39')](_0x7042('0x75')))[_0x7042('0x70')]();_0x295a93[_0x7042('0x87')](db[_0x7042('0x88')][_0x7042('0x2e')](_0x464080));}return BPromise[_0x7042('0x89')](_0x295a93);}})['then'](function(){return _0x589aed;})[_0x7042('0x21')](respondWithResult(_0x14d90e,null))[_0x7042('0x3f')](handleError(_0x14d90e,null));};exports['removeBlackLists']=function(_0x18b18d,_0x4aed19,_0x36d558){return db[_0x7042('0x2a')][_0x7042('0x4a')]({'where':{'id':_0x18b18d[_0x7042('0x41')]['id']}})['then'](handleEntityNotFound(_0x4aed19,null))[_0x7042('0x21')](function(_0x5cfdaf){if(_0x5cfdaf){return _0x5cfdaf[_0x7042('0x8f')](_0x18b18d['query']['ids']);}})[_0x7042('0x21')](function(_0x3929db){if(_0x3929db){return db[_0x7042('0x60')][_0x7042('0x22')]({'where':{'ListId':_0x18b18d[_0x7042('0x2e')][_0x7042('0x66')],'CampaignId':_0x18b18d[_0x7042('0x41')]['id']}})[_0x7042('0x21')](function(){return _0x3929db;});}})['then'](respondWithStatusCode(_0x4aed19,null))['catch'](handleError(_0x4aed19,null));};
\ No newline at end of file
+var _0xf269=['params','omit','createdAt','updatedAt','body','getHoppers','CampaignId','CmHopper','findOne','CmHopperHistory','filter','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','spread','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone'];(function(_0x9fce47,_0x38c3e6){var _0x29e671=function(_0x1f4a62){while(--_0x1f4a62){_0x9fce47['push'](_0x9fce47['shift']());}};_0x29e671(++_0x38c3e6);}(_0xf269,0xd2));var _0x9f26=function(_0x34ed48,_0x2cc995){_0x34ed48=_0x34ed48-0x0;var _0x37da5c=_0xf269[_0x34ed48];return _0x37da5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f26('0x0'));var zipdir=require(_0x9f26('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f26('0x2'));var moment=require(_0x9f26('0x3'));var BPromise=require(_0x9f26('0x4'));var Mustache=require('mustache');var util=require(_0x9f26('0x5'));var path=require('path');var sox=require(_0x9f26('0x6'));var csv=require(_0x9f26('0x7'));var ejs=require(_0x9f26('0x8'));var fs=require('fs');var fs_extra=require(_0x9f26('0x9'));var _=require(_0x9f26('0xa'));var squel=require(_0x9f26('0xb'));var crypto=require(_0x9f26('0xc'));var jsforce=require(_0x9f26('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f26('0xe'));var Redis=require(_0x9f26('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9f26('0x10'));var hardwareService=require(_0x9f26('0x11'));var logger=require(_0x9f26('0x12'))(_0x9f26('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9f26('0x14'))['db'];function respondWithStatusCode(_0x2f2c78,_0x4f24f4){_0x4f24f4=_0x4f24f4||0xcc;return function(_0xc464ee){if(_0xc464ee){return _0x2f2c78[_0x9f26('0x15')](_0x4f24f4);}return _0x2f2c78[_0x9f26('0x16')](_0x4f24f4)[_0x9f26('0x17')]();};}function respondWithResult(_0x1718f8,_0x511228){_0x511228=_0x511228||0xc8;return function(_0x259395){if(_0x259395){return _0x1718f8[_0x9f26('0x16')](_0x511228)[_0x9f26('0x18')](_0x259395);}};}function respondWithFilteredResult(_0x5f2dfa,_0x307cb4){return function(_0x71944f){if(_0x71944f){var _0x212c4e=typeof _0x307cb4[_0x9f26('0x19')]===_0x9f26('0x1a')&&typeof _0x307cb4['limit']===_0x9f26('0x1a');var _0x25c021=_0x71944f[_0x9f26('0x1b')];var _0x126996=_0x212c4e?0x0:_0x307cb4[_0x9f26('0x19')];var _0x2a0f6d=_0x212c4e?_0x71944f['count']:_0x307cb4['offset']+_0x307cb4[_0x9f26('0x1c')];var _0x573636;if(_0x2a0f6d>=_0x25c021){_0x2a0f6d=_0x25c021;_0x573636=0xc8;}else{_0x573636=0xce;}_0x5f2dfa[_0x9f26('0x16')](_0x573636);return _0x5f2dfa[_0x9f26('0x1d')](_0x9f26('0x1e'),_0x126996+'-'+_0x2a0f6d+'/'+_0x25c021)[_0x9f26('0x18')](_0x71944f);}return null;};}function patchUpdates(_0xa2a523){return function(_0x2c9bb3){try{jsonpatch[_0x9f26('0x1f')](_0x2c9bb3,_0xa2a523,!![]);}catch(_0x5a7ace){return BPromise[_0x9f26('0x20')](_0x5a7ace);}return _0x2c9bb3[_0x9f26('0x21')]();};}function saveUpdates(_0x12defd,_0x38af34){return function(_0x4503c9){if(_0x4503c9){return _0x4503c9[_0x9f26('0x22')](_0x12defd)[_0x9f26('0x23')](function(_0x1d47e7){return _0x1d47e7;});}return null;};}function removeEntity(_0xd38c5,_0x298510){return function(_0xe9d254){if(_0xe9d254){return _0xe9d254[_0x9f26('0x24')]()['then'](function(){var _0x3e7b54=_0xe9d254[_0x9f26('0x25')]({'plain':!![]});var _0x6da052=_0x9f26('0x26');return db[_0x9f26('0x27')][_0x9f26('0x24')]({'where':{'type':_0x6da052,'resourceId':_0x3e7b54['id']}})['then'](function(){return _0xe9d254;});})[_0x9f26('0x23')](function(){_0xd38c5[_0x9f26('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f1973,_0x100fb5){return function(_0x53f00d){if(!_0x53f00d){_0x5f1973[_0x9f26('0x15')](0x194);}return _0x53f00d;};}function handleError(_0x55e50f,_0x44a51e){_0x44a51e=_0x44a51e||0x1f4;return function(_0x25168b){logger[_0x9f26('0x28')](_0x25168b[_0x9f26('0x29')]);if(_0x25168b[_0x9f26('0x2a')]){delete _0x25168b[_0x9f26('0x2a')];}_0x55e50f[_0x9f26('0x16')](_0x44a51e)[_0x9f26('0x2b')](_0x25168b);};}exports[_0x9f26('0x2c')]=function(_0x2ad80b,_0x2cc229){var _0x3844ab={},_0x2dbdf9={},_0x24fcec={'count':0x0,'rows':[]};var _0x1ad5d5=_[_0x9f26('0x2d')](db[_0x9f26('0x2e')][_0x9f26('0x2f')],function(_0x41bc57){return{'name':_0x41bc57[_0x9f26('0x30')],'type':_0x41bc57[_0x9f26('0x31')][_0x9f26('0x32')]};});_0x2dbdf9[_0x9f26('0x33')]=_[_0x9f26('0x2d')](_0x1ad5d5,'name');_0x2dbdf9[_0x9f26('0x34')]=_[_0x9f26('0x35')](_0x2ad80b[_0x9f26('0x34')]);_0x2dbdf9[_0x9f26('0x36')]=_[_0x9f26('0x37')](_0x2dbdf9[_0x9f26('0x33')],_0x2dbdf9['query']);_0x3844ab['attributes']=_['intersection'](_0x2dbdf9[_0x9f26('0x33')],qs[_0x9f26('0x38')](_0x2ad80b['query'][_0x9f26('0x38')]));_0x3844ab[_0x9f26('0x39')]=_0x3844ab[_0x9f26('0x39')][_0x9f26('0x3a')]?_0x3844ab[_0x9f26('0x39')]:_0x2dbdf9[_0x9f26('0x33')];if(!_0x2ad80b['query'][_0x9f26('0x3b')](_0x9f26('0x3c'))){_0x3844ab['limit']=qs[_0x9f26('0x1c')](_0x2ad80b['query'][_0x9f26('0x1c')]);_0x3844ab[_0x9f26('0x19')]=qs[_0x9f26('0x19')](_0x2ad80b[_0x9f26('0x34')]['offset']);}_0x3844ab[_0x9f26('0x3d')]=qs[_0x9f26('0x3e')](_0x2ad80b[_0x9f26('0x34')]['sort']);_0x3844ab[_0x9f26('0x3f')]=qs[_0x9f26('0x36')](_[_0x9f26('0x40')](_0x2ad80b[_0x9f26('0x34')],_0x2dbdf9[_0x9f26('0x36')]),_0x1ad5d5);if(_0x2ad80b[_0x9f26('0x34')]['filter']){_0x3844ab[_0x9f26('0x3f')]=_['merge'](_0x3844ab[_0x9f26('0x3f')],{'$or':_[_0x9f26('0x2d')](_0x1ad5d5,function(_0x4aa8a7){if(_0x4aa8a7[_0x9f26('0x31')]!=='VIRTUAL'){var _0xaf8c0f={};_0xaf8c0f[_0x4aa8a7['name']]={'$like':'%'+_0x2ad80b[_0x9f26('0x34')]['filter']+'%'};return _0xaf8c0f;}})});}_0x3844ab=_[_0x9f26('0x41')]({},_0x3844ab,_0x2ad80b[_0x9f26('0x42')]);var _0x34e1f6={'where':_0x3844ab[_0x9f26('0x3f')]};return db[_0x9f26('0x2e')]['count'](_0x34e1f6)[_0x9f26('0x23')](function(_0x2c5245){_0x24fcec['count']=_0x2c5245;if(_0x2ad80b['query'][_0x9f26('0x43')]){_0x3844ab[_0x9f26('0x44')]=[{'all':!![]}];}return db[_0x9f26('0x2e')][_0x9f26('0x45')](_0x3844ab);})['then'](function(_0x343801){_0x24fcec[_0x9f26('0x46')]=_0x343801;return _0x24fcec;})[_0x9f26('0x23')](respondWithFilteredResult(_0x2cc229,_0x3844ab))[_0x9f26('0x47')](handleError(_0x2cc229,null));};exports['show']=function(_0x433d25,_0x57cb8e){var _0x5d54ef={'raw':![],'where':{'id':_0x433d25['params']['id']}},_0x5ef94a={};_0x5ef94a[_0x9f26('0x33')]=_[_0x9f26('0x35')](db[_0x9f26('0x2e')]['rawAttributes']);_0x5ef94a['query']=_[_0x9f26('0x35')](_0x433d25['query']);_0x5ef94a['filters']=_['intersection'](_0x5ef94a[_0x9f26('0x33')],_0x5ef94a[_0x9f26('0x34')]);_0x5d54ef[_0x9f26('0x39')]=_[_0x9f26('0x37')](_0x5ef94a[_0x9f26('0x33')],qs[_0x9f26('0x38')](_0x433d25['query']['fields']));_0x5d54ef[_0x9f26('0x39')]=_0x5d54ef[_0x9f26('0x39')][_0x9f26('0x3a')]?_0x5d54ef[_0x9f26('0x39')]:_0x5ef94a['model'];if(_0x433d25[_0x9f26('0x34')][_0x9f26('0x43')]){_0x5d54ef['include']=[{'all':!![]}];}_0x5d54ef=_['merge']({},_0x5d54ef,_0x433d25[_0x9f26('0x42')]);return db[_0x9f26('0x2e')][_0x9f26('0x48')](_0x5d54ef)[_0x9f26('0x23')](handleEntityNotFound(_0x57cb8e,null))[_0x9f26('0x23')](respondWithResult(_0x57cb8e,null))[_0x9f26('0x47')](handleError(_0x57cb8e,null));};exports['create']=function(_0x1861dc,_0x2504f){return db[_0x9f26('0x2e')]['create'](_0x1861dc['body'],{})[_0x9f26('0x23')](function(_0x3ac946){var _0x1b6468=_0x1861dc[_0x9f26('0x49')][_0x9f26('0x25')]({'plain':!![]});if(!_0x1b6468)throw new Error(_0x9f26('0x4a'));if(_0x1b6468[_0x9f26('0x4b')]==='user'){var _0x3e0c28=_0x3ac946['get']({'plain':!![]});var _0x4722ad=_0x9f26('0x26');return db[_0x9f26('0x4c')][_0x9f26('0x48')]({'where':{'name':_0x4722ad,'userProfileId':_0x1b6468[_0x9f26('0x4d')]},'raw':!![]})[_0x9f26('0x23')](function(_0x1c024b){if(_0x1c024b&&_0x1c024b[_0x9f26('0x4e')]===0x0){return db[_0x9f26('0x27')][_0x9f26('0x4f')]({'name':_0x3e0c28['name'],'resourceId':_0x3e0c28['id'],'type':_0x1c024b[_0x9f26('0x2a')],'sectionId':_0x1c024b['id']},{})[_0x9f26('0x23')](function(){return _0x3ac946;});}else{return _0x3ac946;}})[_0x9f26('0x47')](function(_0x31566a){logger[_0x9f26('0x28')](_0x9f26('0x50'),_0x31566a);throw _0x31566a;});}return _0x3ac946;})['then'](respondWithResult(_0x2504f,0xc9))[_0x9f26('0x47')](handleError(_0x2504f,null));};exports[_0x9f26('0x51')]=function(_0x2dbf08,_0x110750){var _0x121685={'where':{'id':_0x2dbf08[_0x9f26('0x52')]['id']}},_0x416fa5={};_0x416fa5[_0x9f26('0x33')]=_['keys'](db[_0x9f26('0x2e')][_0x9f26('0x2f')]);_0x121685['attributes']=_[_0x9f26('0x37')](_0x416fa5['model'],qs[_0x9f26('0x38')](_0x2dbf08['query'][_0x9f26('0x38')]));_0x121685[_0x9f26('0x39')]=_0x121685[_0x9f26('0x39')][_0x9f26('0x3a')]?_0x121685['attributes']:_0x416fa5['model'];if(_0x2dbf08[_0x9f26('0x34')][_0x9f26('0x43')]){_0x121685['include']=[{'all':!![]}];}_0x121685=_[_0x9f26('0x41')]({},_0x121685,_0x2dbf08[_0x9f26('0x42')]);return db[_0x9f26('0x2e')][_0x9f26('0x48')](_0x121685)[_0x9f26('0x23')](handleEntityNotFound(_0x110750,null))['then'](function(_0x448c58){if(_0x448c58){var _0x25c1ba=_0x448c58[_0x9f26('0x25')]({'plain':!![]});_0x25c1ba=qs[_0x9f26('0x53')](_0x25c1ba,['id',_0x9f26('0x54'),_0x9f26('0x55')]);_0x2dbf08['body']=_[_0x9f26('0x53')](_0x2dbf08[_0x9f26('0x56')],['id',_0x9f26('0x54'),_0x9f26('0x55')]);return db['Campaign'][_0x9f26('0x4f')](_[_0x9f26('0x41')](_0x25c1ba,_0x2dbf08[_0x9f26('0x56')]),{'include':_0x2dbf08[_0x9f26('0x34')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x171cec){var _0x200020=_0x2dbf08['user'][_0x9f26('0x25')]({'plain':!![]});if(!_0x200020)throw new Error(_0x9f26('0x4a'));if(_0x200020[_0x9f26('0x4b')]===_0x9f26('0x49')){var _0x320950=_0x171cec['get']({'plain':!![]});var _0x271c83=_0x9f26('0x26');return db[_0x9f26('0x4c')]['find']({'where':{'name':_0x271c83,'userProfileId':_0x200020['userProfileId']},'raw':!![]})[_0x9f26('0x23')](function(_0x39c1e5){if(_0x39c1e5&&_0x39c1e5[_0x9f26('0x4e')]===0x0){return db[_0x9f26('0x27')]['create']({'name':_0x320950[_0x9f26('0x2a')],'resourceId':_0x320950['id'],'type':_0x39c1e5[_0x9f26('0x2a')],'sectionId':_0x39c1e5['id']},{})[_0x9f26('0x23')](function(){return _0x171cec;});}else{return _0x171cec;}})[_0x9f26('0x47')](function(_0x175293){logger[_0x9f26('0x28')](_0x9f26('0x50'),_0x175293);throw _0x175293;});}return _0x171cec;});}})[_0x9f26('0x23')](respondWithResult(_0x110750,0xc9))[_0x9f26('0x47')](handleError(_0x110750,null));};exports[_0x9f26('0x22')]=function(_0x281a61,_0x3c2926){if(_0x281a61[_0x9f26('0x56')]['id']){delete _0x281a61[_0x9f26('0x56')]['id'];}return db['Campaign'][_0x9f26('0x48')]({'where':{'id':_0x281a61[_0x9f26('0x52')]['id']}})[_0x9f26('0x23')](handleEntityNotFound(_0x3c2926,null))[_0x9f26('0x23')](saveUpdates(_0x281a61[_0x9f26('0x56')],null))[_0x9f26('0x23')](respondWithResult(_0x3c2926,null))['catch'](handleError(_0x3c2926,null));};exports['destroy']=function(_0x27fd0f,_0x5aba94){return db[_0x9f26('0x2e')][_0x9f26('0x48')]({'where':{'id':_0x27fd0f[_0x9f26('0x52')]['id']}})['then'](handleEntityNotFound(_0x5aba94,null))[_0x9f26('0x23')](removeEntity(_0x5aba94,null))[_0x9f26('0x47')](handleError(_0x5aba94,null));};exports[_0x9f26('0x57')]=function(_0x5e91da,_0x455859,_0x412dd8){var _0x4655b8={'raw':!![],'where':{}};var _0x244c89={};var _0x240306={'count':0x0,'rows':[]};return db[_0x9f26('0x2e')]['findOne']({'where':{'id':_0x5e91da[_0x9f26('0x52')]['id']}})['then'](handleEntityNotFound(_0x455859,null))['then'](function(_0x267a33){if(_0x267a33){_0x244c89[_0x9f26('0x33')]=_[_0x9f26('0x35')](db['CmHopper'][_0x9f26('0x2f')]);_0x244c89[_0x9f26('0x34')]=_[_0x9f26('0x35')](_0x5e91da[_0x9f26('0x34')]);_0x244c89[_0x9f26('0x36')]=_[_0x9f26('0x37')](_0x244c89[_0x9f26('0x33')],_0x244c89[_0x9f26('0x34')]);_0x4655b8[_0x9f26('0x39')]=_[_0x9f26('0x37')](_0x244c89['model'],qs['fields'](_0x5e91da[_0x9f26('0x34')][_0x9f26('0x38')]));_0x4655b8[_0x9f26('0x39')]=_0x4655b8[_0x9f26('0x39')][_0x9f26('0x3a')]?_0x4655b8['attributes']:_0x244c89[_0x9f26('0x33')];if(!_0x5e91da[_0x9f26('0x34')][_0x9f26('0x3b')]('nolimit')){_0x4655b8[_0x9f26('0x1c')]=qs['limit'](_0x5e91da[_0x9f26('0x34')][_0x9f26('0x1c')]);_0x4655b8['offset']=qs[_0x9f26('0x19')](_0x5e91da[_0x9f26('0x34')]['offset']);}_0x4655b8[_0x9f26('0x3d')]=qs[_0x9f26('0x3e')](_0x5e91da[_0x9f26('0x34')]['sort']);_0x4655b8[_0x9f26('0x3f')]=qs[_0x9f26('0x36')](_[_0x9f26('0x40')](_0x5e91da[_0x9f26('0x34')],_0x244c89['filters']));_0x4655b8[_0x9f26('0x3f')][_0x9f26('0x58')]=_0x267a33['id'];if(_0x5e91da[_0x9f26('0x34')]['filter']){_0x4655b8[_0x9f26('0x3f')]=_['merge'](_0x4655b8['where'],{'$or':_[_0x9f26('0x2d')](_0x4655b8['attributes'],function(_0x3fb2c3){var _0x3639c4={};_0x3639c4[_0x3fb2c3]={'$like':'%'+_0x5e91da[_0x9f26('0x34')]['filter']+'%'};return _0x3639c4;})});}_0x4655b8=_['merge']({},_0x4655b8,_0x5e91da['options']);return db[_0x9f26('0x59')]['count']({'where':_0x4655b8[_0x9f26('0x3f')]})[_0x9f26('0x23')](function(_0x40e736){_0x240306['count']=_0x40e736;if(_0x5e91da['query'][_0x9f26('0x43')]){_0x4655b8[_0x9f26('0x44')]=[{'all':!![]}];}return db[_0x9f26('0x59')]['findAll'](_0x4655b8);})[_0x9f26('0x23')](function(_0x4c7a80){_0x240306[_0x9f26('0x46')]=_0x4c7a80;return _0x240306;});}})[_0x9f26('0x23')](respondWithFilteredResult(_0x455859,_0x4655b8))[_0x9f26('0x47')](handleError(_0x455859,null));};exports['getHopperHistories']=function(_0x147f6d,_0x3e9309,_0x490c1a){var _0x495341={'raw':!![],'where':{}};var _0x31921f={};var _0x16d8ca={'count':0x0,'rows':[]};return db['Campaign'][_0x9f26('0x5a')]({'where':{'id':_0x147f6d['params']['id']}})[_0x9f26('0x23')](handleEntityNotFound(_0x3e9309,null))[_0x9f26('0x23')](function(_0x591713){if(_0x591713){_0x31921f[_0x9f26('0x33')]=_[_0x9f26('0x35')](db[_0x9f26('0x5b')]['rawAttributes']);_0x31921f[_0x9f26('0x34')]=_['keys'](_0x147f6d[_0x9f26('0x34')]);_0x31921f[_0x9f26('0x36')]=_[_0x9f26('0x37')](_0x31921f[_0x9f26('0x33')],_0x31921f[_0x9f26('0x34')]);_0x495341['attributes']=_[_0x9f26('0x37')](_0x31921f[_0x9f26('0x33')],qs[_0x9f26('0x38')](_0x147f6d[_0x9f26('0x34')][_0x9f26('0x38')]));_0x495341['attributes']=_0x495341[_0x9f26('0x39')][_0x9f26('0x3a')]?_0x495341[_0x9f26('0x39')]:_0x31921f['model'];if(!_0x147f6d[_0x9f26('0x34')][_0x9f26('0x3b')](_0x9f26('0x3c'))){_0x495341[_0x9f26('0x1c')]=qs[_0x9f26('0x1c')](_0x147f6d[_0x9f26('0x34')]['limit']);_0x495341[_0x9f26('0x19')]=qs['offset'](_0x147f6d[_0x9f26('0x34')][_0x9f26('0x19')]);}_0x495341[_0x9f26('0x3d')]=qs[_0x9f26('0x3e')](_0x147f6d[_0x9f26('0x34')][_0x9f26('0x3e')]);_0x495341[_0x9f26('0x3f')]=qs[_0x9f26('0x36')](_[_0x9f26('0x40')](_0x147f6d[_0x9f26('0x34')],_0x31921f[_0x9f26('0x36')]));_0x495341['where']['CampaignId']=_0x591713['id'];if(_0x147f6d[_0x9f26('0x34')][_0x9f26('0x5c')]){_0x495341[_0x9f26('0x3f')]=_['merge'](_0x495341['where'],{'$or':_[_0x9f26('0x2d')](_0x495341[_0x9f26('0x39')],function(_0xe5f90){var _0x5c77b4={};_0x5c77b4[_0xe5f90]={'$like':'%'+_0x147f6d[_0x9f26('0x34')]['filter']+'%'};return _0x5c77b4;})});}_0x495341=_[_0x9f26('0x41')]({},_0x495341,_0x147f6d['options']);return db[_0x9f26('0x5b')][_0x9f26('0x1b')]({'where':_0x495341[_0x9f26('0x3f')]})[_0x9f26('0x23')](function(_0x14301a){_0x16d8ca[_0x9f26('0x1b')]=_0x14301a;if(_0x147f6d['query'][_0x9f26('0x43')]){_0x495341[_0x9f26('0x44')]=[{'all':!![]}];}return db[_0x9f26('0x5b')]['findAll'](_0x495341);})[_0x9f26('0x23')](function(_0x10182){_0x16d8ca[_0x9f26('0x46')]=_0x10182;return _0x16d8ca;});}})['then'](respondWithFilteredResult(_0x3e9309,_0x495341))[_0x9f26('0x47')](handleError(_0x3e9309,null));};exports[_0x9f26('0x5d')]=function(_0x265bfe,_0x4cd276,_0xca1075){var _0x191c8d={'raw':!![],'where':{}};var _0x362da3={};var _0x5b6383={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x265bfe['params']['id']}})[_0x9f26('0x23')](handleEntityNotFound(_0x4cd276,null))[_0x9f26('0x23')](function(_0x3a78cc){if(_0x3a78cc){_0x362da3[_0x9f26('0x33')]=_['keys'](db[_0x9f26('0x5e')][_0x9f26('0x2f')]);_0x362da3['query']=_[_0x9f26('0x35')](_0x265bfe[_0x9f26('0x34')]);_0x362da3[_0x9f26('0x36')]=_[_0x9f26('0x37')](_0x362da3[_0x9f26('0x33')],_0x362da3[_0x9f26('0x34')]);_0x191c8d['attributes']=_[_0x9f26('0x37')](_0x362da3[_0x9f26('0x33')],qs[_0x9f26('0x38')](_0x265bfe['query'][_0x9f26('0x38')]));_0x191c8d['attributes']=_0x191c8d[_0x9f26('0x39')]['length']?_0x191c8d[_0x9f26('0x39')]:_0x362da3[_0x9f26('0x33')];if(!_0x265bfe[_0x9f26('0x34')][_0x9f26('0x3b')](_0x9f26('0x3c'))){_0x191c8d[_0x9f26('0x1c')]=qs[_0x9f26('0x1c')](_0x265bfe[_0x9f26('0x34')]['limit']);_0x191c8d['offset']=qs[_0x9f26('0x19')](_0x265bfe[_0x9f26('0x34')]['offset']);}_0x191c8d[_0x9f26('0x3d')]=qs[_0x9f26('0x3e')](_0x265bfe[_0x9f26('0x34')][_0x9f26('0x3e')]);_0x191c8d[_0x9f26('0x3f')]=qs[_0x9f26('0x36')](_[_0x9f26('0x40')](_0x265bfe[_0x9f26('0x34')],_0x362da3['filters']));_0x191c8d['where'][_0x9f26('0x58')]=_0x3a78cc['id'];if(_0x265bfe['query']['filter']){_0x191c8d[_0x9f26('0x3f')]=_[_0x9f26('0x41')](_0x191c8d[_0x9f26('0x3f')],{'$or':_[_0x9f26('0x2d')](_0x191c8d[_0x9f26('0x39')],function(_0x4d2719){var _0x261a04={};_0x261a04[_0x4d2719]={'$like':'%'+_0x265bfe['query'][_0x9f26('0x5c')]+'%'};return _0x261a04;})});}_0x191c8d=_[_0x9f26('0x41')]({},_0x191c8d,_0x265bfe[_0x9f26('0x42')]);return db[_0x9f26('0x5e')]['count']({'where':_0x191c8d[_0x9f26('0x3f')]})[_0x9f26('0x23')](function(_0x595f35){_0x5b6383['count']=_0x595f35;if(_0x265bfe[_0x9f26('0x34')][_0x9f26('0x43')]){_0x191c8d[_0x9f26('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x9f26('0x45')](_0x191c8d);})[_0x9f26('0x23')](function(_0x16c281){_0x5b6383[_0x9f26('0x46')]=_0x16c281;return _0x5b6383;});}})[_0x9f26('0x23')](respondWithFilteredResult(_0x4cd276,_0x191c8d))['catch'](handleError(_0x4cd276,null));};exports['getHopperBlacks']=function(_0x40e8b5,_0x10fca9,_0x12d63a){var _0x379749={'raw':!![],'where':{}};var _0x40b9fd={};var _0x121968={'count':0x0,'rows':[]};return db['Campaign'][_0x9f26('0x5a')]({'where':{'id':_0x40e8b5['params']['id']}})[_0x9f26('0x23')](handleEntityNotFound(_0x10fca9,null))[_0x9f26('0x23')](function(_0x22da40){if(_0x22da40){_0x40b9fd['model']=_[_0x9f26('0x35')](db[_0x9f26('0x5f')][_0x9f26('0x2f')]);_0x40b9fd['query']=_[_0x9f26('0x35')](_0x40e8b5[_0x9f26('0x34')]);_0x40b9fd[_0x9f26('0x36')]=_[_0x9f26('0x37')](_0x40b9fd[_0x9f26('0x33')],_0x40b9fd['query']);_0x379749[_0x9f26('0x39')]=_[_0x9f26('0x37')](_0x40b9fd[_0x9f26('0x33')],qs['fields'](_0x40e8b5[_0x9f26('0x34')][_0x9f26('0x38')]));_0x379749['attributes']=_0x379749[_0x9f26('0x39')][_0x9f26('0x3a')]?_0x379749[_0x9f26('0x39')]:_0x40b9fd[_0x9f26('0x33')];if(!_0x40e8b5['query']['hasOwnProperty']('nolimit')){_0x379749['limit']=qs[_0x9f26('0x1c')](_0x40e8b5[_0x9f26('0x34')][_0x9f26('0x1c')]);_0x379749[_0x9f26('0x19')]=qs[_0x9f26('0x19')](_0x40e8b5[_0x9f26('0x34')][_0x9f26('0x19')]);}_0x379749[_0x9f26('0x3d')]=qs['sort'](_0x40e8b5[_0x9f26('0x34')][_0x9f26('0x3e')]);_0x379749[_0x9f26('0x3f')]=qs[_0x9f26('0x36')](_[_0x9f26('0x40')](_0x40e8b5[_0x9f26('0x34')],_0x40b9fd['filters']));_0x379749[_0x9f26('0x3f')][_0x9f26('0x58')]=_0x22da40['id'];if(_0x40e8b5[_0x9f26('0x34')][_0x9f26('0x5c')]){_0x379749[_0x9f26('0x3f')]=_[_0x9f26('0x41')](_0x379749[_0x9f26('0x3f')],{'$or':_[_0x9f26('0x2d')](_0x379749[_0x9f26('0x39')],function(_0x369fcd){var _0x567a48={};_0x567a48[_0x369fcd]={'$like':'%'+_0x40e8b5[_0x9f26('0x34')][_0x9f26('0x5c')]+'%'};return _0x567a48;})});}_0x379749=_[_0x9f26('0x41')]({},_0x379749,_0x40e8b5[_0x9f26('0x42')]);return db['CmHopperBlack'][_0x9f26('0x1b')]({'where':_0x379749['where']})[_0x9f26('0x23')](function(_0x160367){_0x121968[_0x9f26('0x1b')]=_0x160367;if(_0x40e8b5['query']['includeAll']){_0x379749[_0x9f26('0x44')]=[{'all':!![]}];}return db[_0x9f26('0x5f')][_0x9f26('0x45')](_0x379749);})[_0x9f26('0x23')](function(_0x3d5f0d){_0x121968[_0x9f26('0x46')]=_0x3d5f0d;return _0x121968;});}})[_0x9f26('0x23')](respondWithFilteredResult(_0x10fca9,_0x379749))[_0x9f26('0x47')](handleError(_0x10fca9,null));};exports[_0x9f26('0x60')]=function(_0x3fdeb3,_0x136c4a,_0xffa336){var _0xa8cc10={};var _0x167a2f={};var _0x12be76;var _0x5bc39c;return db['Campaign']['findOne']({'where':{'id':_0x3fdeb3[_0x9f26('0x52')]['id']}})[_0x9f26('0x23')](handleEntityNotFound(_0x136c4a,null))[_0x9f26('0x23')](function(_0x1f4be5){if(_0x1f4be5){_0x12be76=_0x1f4be5;_0x167a2f[_0x9f26('0x33')]=_[_0x9f26('0x35')](db[_0x9f26('0x61')][_0x9f26('0x2f')]);_0x167a2f[_0x9f26('0x34')]=_['keys'](_0x3fdeb3[_0x9f26('0x34')]);_0x167a2f[_0x9f26('0x36')]=_['intersection'](_0x167a2f[_0x9f26('0x33')],_0x167a2f['query']);_0xa8cc10[_0x9f26('0x39')]=_['intersection'](_0x167a2f[_0x9f26('0x33')],qs[_0x9f26('0x38')](_0x3fdeb3['query'][_0x9f26('0x38')]));_0xa8cc10['attributes']=_0xa8cc10[_0x9f26('0x39')][_0x9f26('0x3a')]?_0xa8cc10[_0x9f26('0x39')]:_0x167a2f[_0x9f26('0x33')];_0xa8cc10[_0x9f26('0x3d')]=qs[_0x9f26('0x3e')](_0x3fdeb3[_0x9f26('0x34')]['sort']);_0xa8cc10[_0x9f26('0x3f')]=qs[_0x9f26('0x36')](_['pick'](_0x3fdeb3[_0x9f26('0x34')],_0x167a2f['filters']));if(_0x3fdeb3['query'][_0x9f26('0x5c')]){_0xa8cc10[_0x9f26('0x3f')]=_[_0x9f26('0x41')](_0xa8cc10[_0x9f26('0x3f')],{'$or':_[_0x9f26('0x2d')](_0xa8cc10[_0x9f26('0x39')],function(_0x4ec9e5){var _0x40d9b8={};_0x40d9b8[_0x4ec9e5]={'$like':'%'+_0x3fdeb3[_0x9f26('0x34')][_0x9f26('0x5c')]+'%'};return _0x40d9b8;})});}_0xa8cc10=_[_0x9f26('0x41')]({},_0xa8cc10,_0x3fdeb3['options']);return _0x12be76['getLists'](_0xa8cc10);}})[_0x9f26('0x23')](function(_0x176243){if(_0x176243){_0x5bc39c=_0x176243['length'];if(!_0x3fdeb3[_0x9f26('0x34')][_0x9f26('0x3b')](_0x9f26('0x3c'))){_0xa8cc10[_0x9f26('0x1c')]=qs[_0x9f26('0x1c')](_0x3fdeb3[_0x9f26('0x34')][_0x9f26('0x1c')]);_0xa8cc10['offset']=qs[_0x9f26('0x19')](_0x3fdeb3[_0x9f26('0x34')][_0x9f26('0x19')]);}return _0x12be76[_0x9f26('0x60')](_0xa8cc10);}})['then'](function(_0xe6d1d5){if(_0xe6d1d5){return _0xe6d1d5?{'count':_0x5bc39c,'rows':_0xe6d1d5}:null;}})[_0x9f26('0x23')](respondWithResult(_0x136c4a,null))[_0x9f26('0x47')](handleError(_0x136c4a,null));};exports[_0x9f26('0x62')]=function(_0x53c5cb,_0x46c0d6,_0x199287){var _0x12d09e,_0x5b3419;var _0x1a6551=[];var _0x23d8a3=moment()[_0x9f26('0x63')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x9f26('0x2e')][_0x9f26('0x48')]({'where':{'id':_0x53c5cb[_0x9f26('0x52')]['id']}})['then'](handleEntityNotFound(_0x46c0d6,null))[_0x9f26('0x23')](function(_0x434dd4){if(_0x434dd4){_0x5b3419=_0x434dd4;return _0x434dd4[_0x9f26('0x62')](_0x53c5cb[_0x9f26('0x56')][_0x9f26('0x64')],_[_0x9f26('0x53')](_0x53c5cb[_0x9f26('0x56')],[_0x9f26('0x64'),'id'])||{});}return null;})['spread'](function(_0x2ca1bf){var _0x2d2ce0;var _0x416300;_0x12d09e=_0x2ca1bf||[];var _0x241145=[];if(_0x2ca1bf){for(var _0x4a88e3=0x0;_0x4a88e3<_0x2ca1bf[_0x9f26('0x3a')];_0x4a88e3+=0x1){var _0x18429a=_0x2ca1bf[_0x4a88e3]['get']({'plain':!![]});_0x5b3419[_0x9f26('0x65')]=_0x53c5cb['body']['dialCheckDuplicateType']?_0x53c5cb[_0x9f26('0x56')][_0x9f26('0x65')]:_0x5b3419[_0x9f26('0x65')];switch(_0x5b3419['dialCheckDuplicateType']){case'always':_0x2d2ce0=squel[_0x9f26('0x66')]()[_0x9f26('0x67')](_0x9f26('0x68'))[_0x9f26('0x69')]([_0x9f26('0x6a'),_0x9f26('0x6b'),_0x9f26('0x6c'),_0x9f26('0x6d'),_0x9f26('0x58'),_0x9f26('0x54'),_0x9f26('0x55')],squel[_0x9f26('0x6e')]()[_0x9f26('0x6f')](_0x9f26('0x6a'),'phone')[_0x9f26('0x6f')](_0x9f26('0x70'),_0x9f26('0x6b'))[_0x9f26('0x6f')]('id','ContactId')[_0x9f26('0x6f')](_0x18429a['CmListId'][_0x9f26('0x71')](),'ListId')[_0x9f26('0x6f')](_0x53c5cb[_0x9f26('0x52')]['id']['toString'](),_0x9f26('0x58'))[_0x9f26('0x6f')]('\x27'+_0x23d8a3+'\x27',_0x9f26('0x54'))[_0x9f26('0x6f')]('\x27'+_0x23d8a3+'\x27','updatedAt')[_0x9f26('0x72')](_0x9f26('0x73'))[_0x9f26('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0x9f26('0x74'),_0x18429a[_0x9f26('0x75')]['toString']())[_0x9f26('0x3f')](_0x9f26('0x76'))[_0x9f26('0x3f')](_0x9f26('0x77'),squel['select']()[_0x9f26('0x6f')](_0x9f26('0x78'))['from']('cm_hopper_final')[_0x9f26('0x3f')](_0x9f26('0x79'),_0x53c5cb[_0x9f26('0x52')]['id'][_0x9f26('0x71')]()))[_0x9f26('0x3f')](_0x9f26('0x77'),squel[_0x9f26('0x6e')]()[_0x9f26('0x6f')](_0x9f26('0x7a'))[_0x9f26('0x72')](_0x9f26('0x68'))['where'](_0x9f26('0x79'),_0x53c5cb['params']['id']['toString']())))[_0x9f26('0x71')]();break;case _0x9f26('0x7b'):_0x2d2ce0=squel[_0x9f26('0x66')]()['into'](_0x9f26('0x68'))[_0x9f26('0x69')](['phone','scheduledAt',_0x9f26('0x6c'),'ListId','CampaignId',_0x9f26('0x54'),_0x9f26('0x55')],squel[_0x9f26('0x6e')]()[_0x9f26('0x6f')]('phone',_0x9f26('0x6a'))[_0x9f26('0x6f')](_0x9f26('0x70'),_0x9f26('0x6b'))[_0x9f26('0x6f')]('id','ContactId')[_0x9f26('0x6f')](_0x18429a[_0x9f26('0x75')][_0x9f26('0x71')](),_0x9f26('0x6d'))[_0x9f26('0x6f')](_0x53c5cb[_0x9f26('0x52')]['id'][_0x9f26('0x71')](),_0x9f26('0x58'))[_0x9f26('0x6f')]('\x27'+_0x23d8a3+'\x27',_0x9f26('0x54'))[_0x9f26('0x6f')]('\x27'+_0x23d8a3+'\x27',_0x9f26('0x55'))[_0x9f26('0x72')]('cm_contacts')[_0x9f26('0x3f')](_0x9f26('0x7c'))['where'](_0x9f26('0x74'),_0x18429a['CmListId'][_0x9f26('0x71')]())[_0x9f26('0x3f')](_0x9f26('0x76'))[_0x9f26('0x3f')](_0x9f26('0x77'),squel[_0x9f26('0x6e')]()['field'](_0x9f26('0x7a'))[_0x9f26('0x72')]('cm_hopper')[_0x9f26('0x3f')](_0x9f26('0x79'),_0x53c5cb[_0x9f26('0x52')]['id'][_0x9f26('0x71')]())))[_0x9f26('0x71')]();break;default:_0x2d2ce0=squel[_0x9f26('0x66')]()['into'](_0x9f26('0x68'))[_0x9f26('0x69')]([_0x9f26('0x6a'),_0x9f26('0x6b'),_0x9f26('0x6c'),'ListId',_0x9f26('0x58'),_0x9f26('0x54'),_0x9f26('0x55')],squel[_0x9f26('0x6e')]()[_0x9f26('0x6f')](_0x9f26('0x6a'),'phone')['field'](_0x9f26('0x70'),_0x9f26('0x6b'))[_0x9f26('0x6f')]('id','ContactId')['field'](_0x18429a[_0x9f26('0x75')][_0x9f26('0x71')](),_0x9f26('0x6d'))[_0x9f26('0x6f')](_0x53c5cb[_0x9f26('0x52')]['id'][_0x9f26('0x71')](),_0x9f26('0x58'))[_0x9f26('0x6f')]('\x27'+_0x23d8a3+'\x27',_0x9f26('0x54'))[_0x9f26('0x6f')]('\x27'+_0x23d8a3+'\x27',_0x9f26('0x55'))[_0x9f26('0x72')](_0x9f26('0x73'))[_0x9f26('0x3f')](_0x9f26('0x7c'))[_0x9f26('0x3f')](_0x9f26('0x74'),_0x18429a[_0x9f26('0x75')][_0x9f26('0x71')]())[_0x9f26('0x3f')](_0x9f26('0x76')))['toString']();}_0x416300=squel[_0x9f26('0x66')]()[_0x9f26('0x67')](_0x9f26('0x7d'))[_0x9f26('0x69')]([_0x9f26('0x7e'),_0x9f26('0x6b'),_0x9f26('0x6a'),_0x9f26('0x7f'),_0x9f26('0x54'),_0x9f26('0x55')],squel['select']()[_0x9f26('0x6f')](_0x9f26('0x80'),'id')[_0x9f26('0x6f')](_0x9f26('0x70'),_0x9f26('0x6b'))['field'](_0x9f26('0x81'),_0x9f26('0x6a'))['field'](_0x9f26('0x82'),_0x9f26('0x7f'))[_0x9f26('0x6f')]('\x27'+_0x23d8a3+'\x27',_0x9f26('0x54'))['field']('\x27'+_0x23d8a3+'\x27',_0x9f26('0x55'))[_0x9f26('0x72')](_0x9f26('0x83'),'ci')[_0x9f26('0x84')]('cm_hopper','h',_0x9f26('0x85'))[_0x9f26('0x3f')](_0x9f26('0x86'),_0x18429a[_0x9f26('0x75')][_0x9f26('0x71')]())[_0x9f26('0x3f')](_0x9f26('0x87'),_0x53c5cb[_0x9f26('0x52')]['id'][_0x9f26('0x71')]())[_0x9f26('0x3f')](_0x9f26('0x88'),_0x23d8a3))['toString']();_0x241145['push'](db[_0x9f26('0x89')][_0x9f26('0x34')](_0x2d2ce0));_0x1a6551[_0x9f26('0x8a')](db[_0x9f26('0x89')][_0x9f26('0x34')](_0x416300));}return BPromise[_0x9f26('0x8b')](_0x241145);}})[_0x9f26('0x23')](function(){return BPromise['all'](_0x1a6551);})['then'](function(){return _0x12d09e;})[_0x9f26('0x23')](respondWithResult(_0x46c0d6,null))['catch'](handleError(_0x46c0d6,null));};exports[_0x9f26('0x8c')]=function(_0x52e353,_0x5da317,_0x430476){return db['Campaign'][_0x9f26('0x48')]({'where':{'id':_0x52e353[_0x9f26('0x52')]['id']}})[_0x9f26('0x23')](handleEntityNotFound(_0x5da317,null))[_0x9f26('0x23')](function(_0x571e36){if(_0x571e36){return _0x571e36['removeLists'](_0x52e353[_0x9f26('0x34')][_0x9f26('0x64')]);}})[_0x9f26('0x23')](function(_0x44e8ee){if(_0x44e8ee){return db['CmHopper'][_0x9f26('0x24')]({'where':{'ListId':_0x52e353[_0x9f26('0x34')][_0x9f26('0x64')],'CampaignId':_0x52e353[_0x9f26('0x52')]['id']}})['then'](function(){return _0x44e8ee;});}})[_0x9f26('0x23')](respondWithStatusCode(_0x5da317,null))[_0x9f26('0x47')](handleError(_0x5da317,null));};exports[_0x9f26('0x8d')]=function(_0x161591,_0x42b360,_0x1f8191){var _0x34d7f5={};var _0x275450={};var _0x5704d1;var _0x48d436;return db['Campaign'][_0x9f26('0x5a')]({'where':{'id':_0x161591[_0x9f26('0x52')]['id']}})[_0x9f26('0x23')](handleEntityNotFound(_0x42b360,null))[_0x9f26('0x23')](function(_0x37a50e){if(_0x37a50e){_0x5704d1=_0x37a50e;_0x275450[_0x9f26('0x33')]=_[_0x9f26('0x35')](db['CmList'][_0x9f26('0x2f')]);_0x275450['query']=_['keys'](_0x161591[_0x9f26('0x34')]);_0x275450['filters']=_[_0x9f26('0x37')](_0x275450[_0x9f26('0x33')],_0x275450[_0x9f26('0x34')]);_0x34d7f5['attributes']=_[_0x9f26('0x37')](_0x275450['model'],qs['fields'](_0x161591[_0x9f26('0x34')][_0x9f26('0x38')]));_0x34d7f5['attributes']=_0x34d7f5[_0x9f26('0x39')][_0x9f26('0x3a')]?_0x34d7f5[_0x9f26('0x39')]:_0x275450[_0x9f26('0x33')];_0x34d7f5[_0x9f26('0x3d')]=qs[_0x9f26('0x3e')](_0x161591['query'][_0x9f26('0x3e')]);_0x34d7f5[_0x9f26('0x3f')]=qs[_0x9f26('0x36')](_[_0x9f26('0x40')](_0x161591[_0x9f26('0x34')],_0x275450['filters']));if(_0x161591[_0x9f26('0x34')][_0x9f26('0x5c')]){_0x34d7f5['where']=_[_0x9f26('0x41')](_0x34d7f5[_0x9f26('0x3f')],{'$or':_[_0x9f26('0x2d')](_0x34d7f5[_0x9f26('0x39')],function(_0x27ee68){var _0x181ffb={};_0x181ffb[_0x27ee68]={'$like':'%'+_0x161591[_0x9f26('0x34')][_0x9f26('0x5c')]+'%'};return _0x181ffb;})});}_0x34d7f5=_[_0x9f26('0x41')]({},_0x34d7f5,_0x161591[_0x9f26('0x42')]);return _0x5704d1['getBlackLists'](_0x34d7f5);}})[_0x9f26('0x23')](function(_0x1a99e0){if(_0x1a99e0){_0x48d436=_0x1a99e0[_0x9f26('0x3a')];if(!_0x161591[_0x9f26('0x34')][_0x9f26('0x3b')](_0x9f26('0x3c'))){_0x34d7f5[_0x9f26('0x1c')]=qs['limit'](_0x161591['query'][_0x9f26('0x1c')]);_0x34d7f5[_0x9f26('0x19')]=qs[_0x9f26('0x19')](_0x161591[_0x9f26('0x34')][_0x9f26('0x19')]);}return _0x5704d1[_0x9f26('0x8d')](_0x34d7f5);}})[_0x9f26('0x23')](function(_0x58a6a8){if(_0x58a6a8){return _0x58a6a8?{'count':_0x48d436,'rows':_0x58a6a8}:null;}})[_0x9f26('0x23')](respondWithResult(_0x42b360,null))[_0x9f26('0x47')](handleError(_0x42b360,null));};exports[_0x9f26('0x8e')]=function(_0x4315c8,_0x1adcec,_0x33676b){var _0xbb3531,_0x3f880e;var _0x437a7c=[];var _0x1bf17b=moment()[_0x9f26('0x63')](_0x9f26('0x8f'));return db[_0x9f26('0x2e')][_0x9f26('0x48')]({'where':{'id':_0x4315c8[_0x9f26('0x52')]['id']}})[_0x9f26('0x23')](handleEntityNotFound(_0x1adcec,null))[_0x9f26('0x23')](function(_0x59ea7a){if(_0x59ea7a){_0x3f880e=_0x59ea7a;return _0x59ea7a[_0x9f26('0x8e')](_0x4315c8[_0x9f26('0x56')][_0x9f26('0x64')],_[_0x9f26('0x53')](_0x4315c8[_0x9f26('0x56')],[_0x9f26('0x64'),'id'])||{});}return null;})[_0x9f26('0x90')](function(_0x2e4ba9){var _0x451109;var _0x398950;_0xbb3531=_0x2e4ba9||[];var _0x2dec34=[];if(_0x2e4ba9){for(var _0x1e9320=0x0;_0x1e9320<_0x2e4ba9[_0x9f26('0x3a')];_0x1e9320+=0x1){var _0x5ba09f=_0x2e4ba9[_0x1e9320][_0x9f26('0x25')]({'plain':!![]});_0x451109=squel[_0x9f26('0x66')]()['into']('cm_hopper_black')[_0x9f26('0x69')]([_0x9f26('0x6a'),_0x9f26('0x6c'),_0x9f26('0x6d'),_0x9f26('0x58'),_0x9f26('0x54'),'updatedAt'],squel['select']()[_0x9f26('0x6f')](_0x9f26('0x6a'),'phone')[_0x9f26('0x6f')]('id',_0x9f26('0x6c'))['field'](_0x5ba09f['CmListId'][_0x9f26('0x71')](),_0x9f26('0x6d'))[_0x9f26('0x6f')](_0x4315c8[_0x9f26('0x52')]['id'][_0x9f26('0x71')](),_0x9f26('0x58'))[_0x9f26('0x6f')](_0x9f26('0x70'),_0x9f26('0x54'))[_0x9f26('0x6f')](_0x9f26('0x70'),_0x9f26('0x55'))[_0x9f26('0x72')](_0x9f26('0x73'))[_0x9f26('0x3f')](_0x9f26('0x7c'))['where'](_0x9f26('0x74'),_0x5ba09f[_0x9f26('0x75')][_0x9f26('0x71')]())[_0x9f26('0x3f')](_0x9f26('0x76')))[_0x9f26('0x71')]();_0x2dec34[_0x9f26('0x8a')](db[_0x9f26('0x89')][_0x9f26('0x34')](_0x451109));}return BPromise[_0x9f26('0x8b')](_0x2dec34);}})[_0x9f26('0x23')](function(){return _0xbb3531;})['then'](respondWithResult(_0x1adcec,null))[_0x9f26('0x47')](handleError(_0x1adcec,null));};exports[_0x9f26('0x91')]=function(_0x5560df,_0x21a298,_0x32d4ed){return db[_0x9f26('0x2e')][_0x9f26('0x48')]({'where':{'id':_0x5560df[_0x9f26('0x52')]['id']}})[_0x9f26('0x23')](handleEntityNotFound(_0x21a298,null))['then'](function(_0x3e09e9){if(_0x3e09e9){return _0x3e09e9[_0x9f26('0x91')](_0x5560df['query'][_0x9f26('0x64')]);}})[_0x9f26('0x23')](function(_0x233ce0){if(_0x233ce0){return db[_0x9f26('0x5f')][_0x9f26('0x24')]({'where':{'ListId':_0x5560df[_0x9f26('0x34')][_0x9f26('0x64')],'CampaignId':_0x5560df[_0x9f26('0x52')]['id']}})[_0x9f26('0x23')](function(){return _0x233ce0;});}})[_0x9f26('0x23')](respondWithStatusCode(_0x21a298,null))[_0x9f26('0x47')](handleError(_0x21a298,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index b217381..80030c4 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x49a3b7,_0x5d2586){var _0x569e43=function(_0x4ddf94){while(--_0x4ddf94){_0x49a3b7['push'](_0x49a3b7['shift']());}};_0x569e43(++_0x5d2586);}(_0x7a54,0x106));var _0x47a5=function(_0x2417c1,_0x4205c5){_0x2417c1=_0x2417c1-0x0;var _0x49ed2a=_0x7a54[_0x2417c1];return _0x49ed2a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x13724c,_0x4f92b2){var _0x1866d0=function(_0x5e4628){while(--_0x5e4628){_0x13724c['push'](_0x13724c['shift']());}};_0x1866d0(++_0x4f92b2);}(_0x7a54,0x106));var _0x47a5=function(_0x3cef50,_0x3c5227){_0x3cef50=_0x3cef50-0x0;var _0x5a2bfb=_0x7a54[_0x3cef50];return _0x5a2bfb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index c98a7ef..ed8e6d7 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 _0x8fed=['include','model','map','then','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetCampaign','options','where','attributes','limit'];(function(_0x2a878c,_0x18d5a9){var _0x5f53af=function(_0x51006f){while(--_0x51006f){_0x2a878c['push'](_0x2a878c['shift']());}};_0x5f53af(++_0x18d5a9);}(_0x8fed,0xf5));var _0xd8fe=function(_0x52863c,_0x1498a6){_0x52863c=_0x52863c-0x0;var _0x21872d=_0x8fed[_0x52863c];return _0x21872d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd8fe('0x0'));var BPromise=require(_0xd8fe('0x1'));var rs=require(_0xd8fe('0x2'));var fs=require('fs');var Redis=require(_0xd8fe('0x3'));var db=require(_0xd8fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd8fe('0x5'))(_0xd8fe('0x6'));var config=require(_0xd8fe('0x7'));var jayson=require(_0xd8fe('0x8'));var client=jayson[_0xd8fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7e3b94,_0x1747b3,_0xa33e22){return new BPromise(function(_0x26d33d,_0x5e48f9){return client[_0xd8fe('0xa')](_0x7e3b94,_0xa33e22)['then'](function(_0x410d44){logger[_0xd8fe('0xb')](_0xd8fe('0xc'),_0x1747b3,_0xd8fe('0xd'));logger[_0xd8fe('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1747b3,_0xd8fe('0xd'),JSON[_0xd8fe('0xf')](_0x410d44));if(_0x410d44[_0xd8fe('0x10')]){if(_0x410d44['error'][_0xd8fe('0x11')]===0x1f4){logger['error'](_0xd8fe('0xc'),_0x1747b3,_0x410d44[_0xd8fe('0x10')][_0xd8fe('0x12')]);return _0x5e48f9(_0x410d44[_0xd8fe('0x10')][_0xd8fe('0x12')]);}logger['error'](_0xd8fe('0xc'),_0x1747b3,_0x410d44[_0xd8fe('0x10')]['message']);return _0x26d33d(_0x410d44[_0xd8fe('0x10')][_0xd8fe('0x12')]);}else{logger[_0xd8fe('0xb')](_0xd8fe('0xc'),_0x1747b3,_0xd8fe('0xd'));_0x26d33d(_0x410d44[_0xd8fe('0x13')][_0xd8fe('0x12')]);}})['catch'](function(_0x260a7f){logger['error'](_0xd8fe('0xc'),_0x1747b3,_0x260a7f);_0x5e48f9(_0x260a7f);});});}exports[_0xd8fe('0x14')]=function(_0x4cfb98){var _0x31a5d7=this;return new Promise(function(_0x4b7d9e,_0x52a8b6){return db['Campaign']['findAll']({'raw':_0x4cfb98['options']?_0x4cfb98[_0xd8fe('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4cfb98[_0xd8fe('0x15')]?_0x4cfb98['options'][_0xd8fe('0x16')]||null:null,'attributes':_0x4cfb98['options']?_0x4cfb98[_0xd8fe('0x15')][_0xd8fe('0x17')]||null:null,'limit':_0x4cfb98[_0xd8fe('0x15')]?_0x4cfb98[_0xd8fe('0x15')][_0xd8fe('0x18')]||null:null,'include':_0x4cfb98[_0xd8fe('0x15')]?_0x4cfb98[_0xd8fe('0x15')][_0xd8fe('0x19')]?_['map'](_0x4cfb98[_0xd8fe('0x15')][_0xd8fe('0x19')],function(_0x19d4d1){return{'model':db[_0x19d4d1[_0xd8fe('0x1a')]],'as':_0x19d4d1['as'],'attributes':_0x19d4d1['attributes'],'include':_0x19d4d1[_0xd8fe('0x19')]?_[_0xd8fe('0x1b')](_0x19d4d1[_0xd8fe('0x19')],function(_0x130c16){return{'model':db[_0x130c16[_0xd8fe('0x1a')]],'as':_0x130c16['as'],'attributes':_0x130c16[_0xd8fe('0x17')],'include':_0x130c16['include']?_['map'](_0x130c16[_0xd8fe('0x19')],function(_0x22ef87){return{'model':db[_0x22ef87[_0xd8fe('0x1a')]],'as':_0x22ef87['as'],'attributes':_0x22ef87[_0xd8fe('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd8fe('0x1c')](function(_0x1666e4){logger[_0xd8fe('0xb')](_0xd8fe('0x14'),_0x4cfb98);logger[_0xd8fe('0xe')](_0xd8fe('0x14'),_0x4cfb98,JSON[_0xd8fe('0xf')](_0x1666e4));_0x4b7d9e(_0x1666e4);})[_0xd8fe('0x1d')](function(_0x2c2767){logger[_0xd8fe('0x10')]('GetCampaign',_0x2c2767[_0xd8fe('0x12')],_0x4cfb98);_0x52a8b6(_0x31a5d7[_0xd8fe('0x10')](0x1f4,_0x2c2767[_0xd8fe('0x12')]));});});};
\ No newline at end of file
+var _0x9234=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','map','include','model','lodash','moment','bluebird'];(function(_0x377c42,_0xa66fd5){var _0x597ae5=function(_0x37e8c6){while(--_0x37e8c6){_0x377c42['push'](_0x377c42['shift']());}};_0x597ae5(++_0xa66fd5);}(_0x9234,0x1bd));var _0x4923=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x9234[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0x4923('0x0'));var util=require('util');var moment=require(_0x4923('0x1'));var BPromise=require(_0x4923('0x2'));var rs=require(_0x4923('0x3'));var fs=require('fs');var Redis=require(_0x4923('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4923('0x5'));var logger=require(_0x4923('0x6'))('rpc');var config=require(_0x4923('0x7'));var jayson=require(_0x4923('0x8'));var client=jayson[_0x4923('0x9')][_0x4923('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17b854,_0x133b0d,_0x2de396){return new BPromise(function(_0x548676,_0x1fffc2){return client['request'](_0x17b854,_0x2de396)[_0x4923('0xb')](function(_0x2c4057){logger[_0x4923('0xc')]('Campaign,\x20%s,\x20%s',_0x133b0d,_0x4923('0xd'));logger[_0x4923('0xe')](_0x4923('0xf'),_0x133b0d,_0x4923('0xd'),JSON[_0x4923('0x10')](_0x2c4057));if(_0x2c4057[_0x4923('0x11')]){if(_0x2c4057[_0x4923('0x11')][_0x4923('0x12')]===0x1f4){logger[_0x4923('0x11')](_0x4923('0x13'),_0x133b0d,_0x2c4057['error']['message']);return _0x1fffc2(_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);}logger[_0x4923('0x11')]('Campaign,\x20%s,\x20%s',_0x133b0d,_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);return _0x548676(_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);}else{logger[_0x4923('0xc')](_0x4923('0x13'),_0x133b0d,_0x4923('0xd'));_0x548676(_0x2c4057[_0x4923('0x15')][_0x4923('0x14')]);}})[_0x4923('0x16')](function(_0x559e4a){logger[_0x4923('0x11')](_0x4923('0x13'),_0x133b0d,_0x559e4a);_0x1fffc2(_0x559e4a);});});}exports[_0x4923('0x17')]=function(_0x1be04d){var _0x517b95=this;return new Promise(function(_0x50fd18,_0x16955b){return db['Campaign'][_0x4923('0x18')]({'raw':_0x1be04d[_0x4923('0x19')]?_0x1be04d['options'][_0x4923('0x1a')]===undefined?!![]:![]:!![],'where':_0x1be04d[_0x4923('0x19')]?_0x1be04d[_0x4923('0x19')][_0x4923('0x1b')]||null:null,'attributes':_0x1be04d['options']?_0x1be04d[_0x4923('0x19')][_0x4923('0x1c')]||null:null,'limit':_0x1be04d['options']?_0x1be04d[_0x4923('0x19')]['limit']||null:null,'include':_0x1be04d[_0x4923('0x19')]?_0x1be04d[_0x4923('0x19')]['include']?_[_0x4923('0x1d')](_0x1be04d[_0x4923('0x19')][_0x4923('0x1e')],function(_0x161cf9){return{'model':db[_0x161cf9[_0x4923('0x1f')]],'as':_0x161cf9['as'],'attributes':_0x161cf9[_0x4923('0x1c')],'include':_0x161cf9[_0x4923('0x1e')]?_['map'](_0x161cf9['include'],function(_0x23ec97){return{'model':db[_0x23ec97[_0x4923('0x1f')]],'as':_0x23ec97['as'],'attributes':_0x23ec97[_0x4923('0x1c')],'include':_0x23ec97[_0x4923('0x1e')]?_[_0x4923('0x1d')](_0x23ec97[_0x4923('0x1e')],function(_0x13681b){return{'model':db[_0x13681b[_0x4923('0x1f')]],'as':_0x13681b['as'],'attributes':_0x13681b[_0x4923('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4923('0xb')](function(_0x3a7852){logger['info'](_0x4923('0x17'),_0x1be04d);logger[_0x4923('0xe')](_0x4923('0x17'),_0x1be04d,JSON[_0x4923('0x10')](_0x3a7852));_0x50fd18(_0x3a7852);})[_0x4923('0x16')](function(_0x47158c){logger[_0x4923('0x11')](_0x4923('0x17'),_0x47158c[_0x4923('0x14')],_0x1be04d);_0x16955b(_0x517b95[_0x4923('0x11')](0x1f4,_0x47158c[_0x4923('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 2ab36fa..b364a2c 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 _0x8d59=['getHopperFinals','/:id/hopper_black','/:id/lists','getLists','create','post','/:id/clone','/:id/blacklists','addBlackLists','put','update','destroy','delete','removeBlackLists','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals'];(function(_0x569d52,_0x251a54){var _0x1f38e1=function(_0x544f5c){while(--_0x544f5c){_0x569d52['push'](_0x569d52['shift']());}};_0x1f38e1(++_0x251a54);}(_0x8d59,0xa5));var _0x98d5=function(_0x31c4cc,_0x21af89){_0x31c4cc=_0x31c4cc-0x0;var _0x28950d=_0x8d59[_0x31c4cc];return _0x28950d;};'use strict';var multer=require('multer');var util=require(_0x98d5('0x0'));var path=require(_0x98d5('0x1'));var timeout=require(_0x98d5('0x2'));var express=require('express');var router=express[_0x98d5('0x3')]();var fs_extra=require(_0x98d5('0x4'));var auth=require(_0x98d5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x98d5('0x6'));var controller=require(_0x98d5('0x7'));router[_0x98d5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x98d5('0x8')](_0x98d5('0x9'),auth[_0x98d5('0xa')](),controller['show']);router[_0x98d5('0x8')](_0x98d5('0xb'),auth[_0x98d5('0xa')](),controller[_0x98d5('0xc')]);router[_0x98d5('0x8')](_0x98d5('0xd'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x98d5('0x8')](_0x98d5('0xe'),auth['isAuthenticated'](),controller[_0x98d5('0xf')]);router[_0x98d5('0x8')](_0x98d5('0x10'),auth[_0x98d5('0xa')](),controller['getHopperBlacks']);router['get'](_0x98d5('0x11'),auth['isAuthenticated'](),controller[_0x98d5('0x12')]);router['get']('/:id/blacklists',auth[_0x98d5('0xa')](),controller['getBlackLists']);router['post']('/',auth[_0x98d5('0xa')](),controller[_0x98d5('0x13')]);router[_0x98d5('0x14')](_0x98d5('0x15'),auth['isAuthenticated'](),controller['clone']);router['post'](_0x98d5('0x11'),auth['isAuthenticated'](),controller['addLists']);router[_0x98d5('0x14')](_0x98d5('0x16'),auth[_0x98d5('0xa')](),controller[_0x98d5('0x17')]);router[_0x98d5('0x18')]('/:id',auth[_0x98d5('0xa')](),controller[_0x98d5('0x19')]);router['delete'](_0x98d5('0x9'),auth[_0x98d5('0xa')](),controller[_0x98d5('0x1a')]);router['delete'](_0x98d5('0x11'),auth[_0x98d5('0xa')](),controller['removeLists']);router[_0x98d5('0x1b')](_0x98d5('0x16'),auth[_0x98d5('0xa')](),controller[_0x98d5('0x1c')]);module[_0x98d5('0x1d')]=router;
\ No newline at end of file
+var _0x7c60=['util','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','/:id/clone','addLists','addBlackLists','update','delete','destroy','removeBlackLists','exports','multer'];(function(_0x85da9e,_0x5efac3){var _0x17ec6c=function(_0x24a652){while(--_0x24a652){_0x85da9e['push'](_0x85da9e['shift']());}};_0x17ec6c(++_0x5efac3);}(_0x7c60,0xad));var _0x07c6=function(_0x2d91e2,_0x4238e1){_0x2d91e2=_0x2d91e2-0x0;var _0x4db27f=_0x7c60[_0x2d91e2];return _0x4db27f;};'use strict';var multer=require(_0x07c6('0x0'));var util=require(_0x07c6('0x1'));var path=require(_0x07c6('0x2'));var timeout=require('connect-timeout');var express=require(_0x07c6('0x3'));var router=express[_0x07c6('0x4')]();var fs_extra=require(_0x07c6('0x5'));var auth=require(_0x07c6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x07c6('0x7')]('/',auth[_0x07c6('0x8')](),controller['index']);router[_0x07c6('0x7')](_0x07c6('0x9'),auth[_0x07c6('0x8')](),controller['show']);router[_0x07c6('0x7')](_0x07c6('0xa'),auth[_0x07c6('0x8')](),controller['getHoppers']);router[_0x07c6('0x7')](_0x07c6('0xb'),auth[_0x07c6('0x8')](),controller[_0x07c6('0xc')]);router[_0x07c6('0x7')](_0x07c6('0xd'),auth['isAuthenticated'](),controller[_0x07c6('0xe')]);router[_0x07c6('0x7')](_0x07c6('0xf'),auth[_0x07c6('0x8')](),controller[_0x07c6('0x10')]);router['get'](_0x07c6('0x11'),auth[_0x07c6('0x8')](),controller[_0x07c6('0x12')]);router[_0x07c6('0x7')](_0x07c6('0x13'),auth[_0x07c6('0x8')](),controller['getBlackLists']);router[_0x07c6('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x07c6('0x14')](_0x07c6('0x15'),auth[_0x07c6('0x8')](),controller['clone']);router[_0x07c6('0x14')](_0x07c6('0x11'),auth[_0x07c6('0x8')](),controller[_0x07c6('0x16')]);router['post'](_0x07c6('0x13'),auth['isAuthenticated'](),controller[_0x07c6('0x17')]);router['put'](_0x07c6('0x9'),auth[_0x07c6('0x8')](),controller[_0x07c6('0x18')]);router[_0x07c6('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x07c6('0x1a')]);router[_0x07c6('0x19')](_0x07c6('0x11'),auth[_0x07c6('0x8')](),controller['removeLists']);router[_0x07c6('0x19')](_0x07c6('0x13'),auth[_0x07c6('0x8')](),controller[_0x07c6('0x1b')]);module[_0x07c6('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index fc11433..92e4354 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 _0x4c7b=['getDataValue','key','exports','STRING','TEXT','VIRTUAL'];(function(_0x28a281,_0x3fc022){var _0x2e2068=function(_0x2e56af){while(--_0x2e56af){_0x28a281['push'](_0x28a281['shift']());}};_0x2e2068(++_0x3fc022);}(_0x4c7b,0x13a));var _0xb4c7=function(_0x42048,_0x79762d){_0x42048=_0x42048-0x0;var _0x4e7f69=_0x4c7b[_0x42048];return _0x4e7f69;};'use strict';var Sequelize=require('sequelize');module[_0xb4c7('0x0')]={'key':{'type':Sequelize[_0xb4c7('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xb4c7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb4c7('0x1')]},'name':{'type':Sequelize[_0xb4c7('0x3')],'get':function(){return this[_0xb4c7('0x4')](_0xb4c7('0x5'));}}};
\ No newline at end of file
+var _0x9812=['key','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x1c4cca,_0x398ea1){var _0x2dedda=function(_0x10904b){while(--_0x10904b){_0x1c4cca['push'](_0x1c4cca['shift']());}};_0x2dedda(++_0x398ea1);}(_0x9812,0x1b7));var _0x2981=function(_0x42bd0e,_0x157bfa){_0x42bd0e=_0x42bd0e-0x0;var _0x4a5e2f=_0x9812[_0x42bd0e];return _0x4a5e2f;};'use strict';var Sequelize=require('sequelize');module[_0x2981('0x0')]={'key':{'type':Sequelize[_0x2981('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x2981('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2981('0x1')]},'name':{'type':Sequelize[_0x2981('0x3')],'get':function(){return this[_0x2981('0x4')](_0x2981('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index aea6ec4..ccae57e 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 _0xd195=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','length','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','CannedAnswers','userProfileId'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0xd195,0x172));var _0x5d19=function(_0x539b90,_0x57ce81){_0x539b90=_0x539b90-0x0;var _0xad8bd2=_0xd195[_0x539b90];return _0xad8bd2;};'use strict';var emlformat=require(_0x5d19('0x0'));var rimraf=require(_0x5d19('0x1'));var zipdir=require(_0x5d19('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5d19('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5d19('0x4'));var util=require(_0x5d19('0x5'));var path=require(_0x5d19('0x6'));var sox=require('sox');var csv=require(_0x5d19('0x7'));var ejs=require(_0x5d19('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d19('0x9'));var squel=require(_0x5d19('0xa'));var crypto=require('crypto');var jsforce=require(_0x5d19('0xb'));var deskjs=require(_0x5d19('0xc'));var toCsv=require(_0x5d19('0x7'));var querystring=require(_0x5d19('0xd'));var Papa=require(_0x5d19('0xe'));var Redis=require(_0x5d19('0xf'));var authService=require(_0x5d19('0x10'));var qs=require(_0x5d19('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d19('0x12'));var logger=require(_0x5d19('0x13'))(_0x5d19('0x14'));var utils=require('../../config/utils');var config=require(_0x5d19('0x15'));var licenseUtil=require(_0x5d19('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e3a0,_0xc061e3){_0xc061e3=_0xc061e3||0xcc;return function(_0x55abac){if(_0x55abac){return _0x15e3a0[_0x5d19('0x17')](_0xc061e3);}return _0x15e3a0[_0x5d19('0x18')](_0xc061e3)[_0x5d19('0x19')]();};}function respondWithResult(_0x24fcbd,_0xbd486a){_0xbd486a=_0xbd486a||0xc8;return function(_0x3afd45){if(_0x3afd45){return _0x24fcbd[_0x5d19('0x18')](_0xbd486a)[_0x5d19('0x1a')](_0x3afd45);}};}function respondWithFilteredResult(_0x4e1095,_0x46335e){return function(_0x2d99a3){if(_0x2d99a3){var _0x3d527d=typeof _0x46335e[_0x5d19('0x1b')]===_0x5d19('0x1c')&&typeof _0x46335e[_0x5d19('0x1d')]===_0x5d19('0x1c');var _0x2a92bd=_0x2d99a3[_0x5d19('0x1e')];var _0xce703c=_0x3d527d?0x0:_0x46335e[_0x5d19('0x1b')];var _0x183bd2=_0x3d527d?_0x2d99a3[_0x5d19('0x1e')]:_0x46335e[_0x5d19('0x1b')]+_0x46335e['limit'];var _0x4a5b9f;if(_0x183bd2>=_0x2a92bd){_0x183bd2=_0x2a92bd;_0x4a5b9f=0xc8;}else{_0x4a5b9f=0xce;}_0x4e1095['status'](_0x4a5b9f);return _0x4e1095[_0x5d19('0x1f')](_0x5d19('0x20'),_0xce703c+'-'+_0x183bd2+'/'+_0x2a92bd)[_0x5d19('0x1a')](_0x2d99a3);}return null;};}function patchUpdates(_0x15e706){return function(_0x131872){try{jsonpatch['apply'](_0x131872,_0x15e706,!![]);}catch(_0x37881c){return BPromise[_0x5d19('0x21')](_0x37881c);}return _0x131872[_0x5d19('0x22')]();};}function saveUpdates(_0x5ff331,_0x505654){return function(_0x3a9758){if(_0x3a9758){return _0x3a9758[_0x5d19('0x23')](_0x5ff331)[_0x5d19('0x24')](function(_0x4d7254){return _0x4d7254;});}return null;};}function removeEntity(_0x5ca5a2,_0x431fd5){return function(_0x31dac3){if(_0x31dac3){return _0x31dac3[_0x5d19('0x25')]()[_0x5d19('0x24')](function(){var _0x583915=_0x31dac3['get']({'plain':!![]});var _0x356108='CannedAnswers';return db[_0x5d19('0x26')][_0x5d19('0x25')]({'where':{'type':_0x356108,'resourceId':_0x583915['id']}})[_0x5d19('0x24')](function(){return _0x31dac3;});})[_0x5d19('0x24')](function(){_0x5ca5a2[_0x5d19('0x18')](0xcc)[_0x5d19('0x19')]();});}};}function handleEntityNotFound(_0x57c445,_0x101123){return function(_0x5c2a32){if(!_0x5c2a32){_0x57c445[_0x5d19('0x17')](0x194);}return _0x5c2a32;};}function handleError(_0x7dbece,_0x4ecb5a){_0x4ecb5a=_0x4ecb5a||0x1f4;return function(_0x3c6bf4){logger[_0x5d19('0x27')](_0x3c6bf4[_0x5d19('0x28')]);if(_0x3c6bf4[_0x5d19('0x29')]){delete _0x3c6bf4['name'];}_0x7dbece[_0x5d19('0x18')](_0x4ecb5a)[_0x5d19('0x2a')](_0x3c6bf4);};}exports[_0x5d19('0x2b')]=function(_0x12a924,_0x1b1bff){var _0x332668={},_0x1d565e={},_0x59f192={'count':0x0,'rows':[]};var _0x441528=_[_0x5d19('0x2c')](db[_0x5d19('0x2d')][_0x5d19('0x2e')],function(_0x32e5c5){return{'name':_0x32e5c5[_0x5d19('0x2f')],'type':_0x32e5c5[_0x5d19('0x30')]['key']};});_0x1d565e[_0x5d19('0x31')]=_[_0x5d19('0x2c')](_0x441528,'name');_0x1d565e[_0x5d19('0x32')]=_[_0x5d19('0x33')](_0x12a924[_0x5d19('0x32')]);_0x1d565e[_0x5d19('0x34')]=_[_0x5d19('0x35')](_0x1d565e[_0x5d19('0x31')],_0x1d565e[_0x5d19('0x32')]);_0x332668['attributes']=_[_0x5d19('0x35')](_0x1d565e[_0x5d19('0x31')],qs[_0x5d19('0x36')](_0x12a924['query']['fields']));_0x332668['attributes']=_0x332668[_0x5d19('0x37')]['length']?_0x332668[_0x5d19('0x37')]:_0x1d565e['model'];if(!_0x12a924['query'][_0x5d19('0x38')](_0x5d19('0x39'))){_0x332668['limit']=qs[_0x5d19('0x1d')](_0x12a924[_0x5d19('0x32')]['limit']);_0x332668[_0x5d19('0x1b')]=qs[_0x5d19('0x1b')](_0x12a924['query'][_0x5d19('0x1b')]);}_0x332668[_0x5d19('0x3a')]=qs[_0x5d19('0x3b')](_0x12a924[_0x5d19('0x32')][_0x5d19('0x3b')]);_0x332668[_0x5d19('0x3c')]=qs[_0x5d19('0x34')](_[_0x5d19('0x3d')](_0x12a924[_0x5d19('0x32')],_0x1d565e[_0x5d19('0x34')]),_0x441528);if(_0x12a924[_0x5d19('0x32')][_0x5d19('0x3e')]){_0x332668[_0x5d19('0x3c')]=_['merge'](_0x332668[_0x5d19('0x3c')],{'$or':[{'key':{'$like':'%'+_0x12a924[_0x5d19('0x32')][_0x5d19('0x3e')]+'%'}},{'value':{'$like':'%'+_0x12a924[_0x5d19('0x32')][_0x5d19('0x3e')]+'%'}}]});}_0x332668=_[_0x5d19('0x3f')]({},_0x332668,_0x12a924[_0x5d19('0x40')]);var _0x248e9b={'where':_0x332668[_0x5d19('0x3c')]};return db['CannedAnswer'][_0x5d19('0x1e')](_0x248e9b)[_0x5d19('0x24')](function(_0x154c0d){_0x59f192[_0x5d19('0x1e')]=_0x154c0d;if(_0x12a924['query'][_0x5d19('0x41')]){_0x332668[_0x5d19('0x42')]=[{'all':!![]}];}return db[_0x5d19('0x2d')]['findAll'](_0x332668);})[_0x5d19('0x24')](function(_0x429169){_0x59f192[_0x5d19('0x43')]=_0x429169;return _0x59f192;})[_0x5d19('0x24')](respondWithFilteredResult(_0x1b1bff,_0x332668))[_0x5d19('0x44')](handleError(_0x1b1bff,null));};exports[_0x5d19('0x45')]=function(_0x16f44e,_0x369f27){var _0x254d4d={'raw':!![],'where':{'id':_0x16f44e[_0x5d19('0x46')]['id']}},_0x5308b1={};_0x5308b1[_0x5d19('0x31')]=_[_0x5d19('0x33')](db[_0x5d19('0x2d')][_0x5d19('0x2e')]);_0x5308b1[_0x5d19('0x32')]=_[_0x5d19('0x33')](_0x16f44e[_0x5d19('0x32')]);_0x5308b1[_0x5d19('0x34')]=_[_0x5d19('0x35')](_0x5308b1[_0x5d19('0x31')],_0x5308b1[_0x5d19('0x32')]);_0x254d4d[_0x5d19('0x37')]=_['intersection'](_0x5308b1[_0x5d19('0x31')],qs['fields'](_0x16f44e[_0x5d19('0x32')][_0x5d19('0x36')]));_0x254d4d[_0x5d19('0x37')]=_0x254d4d['attributes'][_0x5d19('0x47')]?_0x254d4d['attributes']:_0x5308b1[_0x5d19('0x31')];if(_0x16f44e[_0x5d19('0x32')][_0x5d19('0x41')]){_0x254d4d[_0x5d19('0x42')]=[{'all':!![]}];}_0x254d4d=_[_0x5d19('0x3f')]({},_0x254d4d,_0x16f44e[_0x5d19('0x40')]);return db[_0x5d19('0x2d')]['find'](_0x254d4d)['then'](handleEntityNotFound(_0x369f27,null))[_0x5d19('0x24')](respondWithResult(_0x369f27,null))[_0x5d19('0x44')](handleError(_0x369f27,null));};exports[_0x5d19('0x23')]=function(_0xd232d5,_0x2f0428){if(_0xd232d5['body']['id']){delete _0xd232d5['body']['id'];}return db['CannedAnswer'][_0x5d19('0x48')]({'where':{'id':_0xd232d5['params']['id']}})[_0x5d19('0x24')](handleEntityNotFound(_0x2f0428,null))[_0x5d19('0x24')](saveUpdates(_0xd232d5[_0x5d19('0x49')],null))[_0x5d19('0x24')](respondWithResult(_0x2f0428,null))[_0x5d19('0x44')](handleError(_0x2f0428,null));};exports[_0x5d19('0x25')]=function(_0xbb26dd,_0x19cb8c){return db['CannedAnswer'][_0x5d19('0x48')]({'where':{'id':_0xbb26dd['params']['id']}})['then'](handleEntityNotFound(_0x19cb8c,null))[_0x5d19('0x24')](removeEntity(_0x19cb8c,null))[_0x5d19('0x44')](handleError(_0x19cb8c,null));};exports['create']=function(_0x549a98,_0x43f48a){var _0x6a07e8={'key':_0x549a98[_0x5d19('0x49')][_0x5d19('0x4a')]};if(_0x549a98[_0x5d19('0x49')][_0x5d19('0x4b')]){_0x6a07e8[_0x5d19('0x4b')]=_0x549a98['body'][_0x5d19('0x4b')];}else if(_0x549a98[_0x5d19('0x49')][_0x5d19('0x4c')]){_0x6a07e8[_0x5d19('0x4c')]=_0x549a98[_0x5d19('0x49')][_0x5d19('0x4c')];}else if(_0x549a98['body']['OpenchannelAccountId']){_0x6a07e8[_0x5d19('0x4d')]=_0x549a98['body'][_0x5d19('0x4d')];}else if(_0x549a98[_0x5d19('0x49')]['ChatWebsiteId']){_0x6a07e8['ChatWebsiteId']=_0x549a98[_0x5d19('0x49')][_0x5d19('0x4e')];}return db[_0x5d19('0x2d')][_0x5d19('0x48')]({'where':_0x6a07e8})[_0x5d19('0x24')](function(_0x2144a1){if(_0x2144a1){throw new db[(_0x5d19('0x4f'))][(_0x5d19('0x50'))](_0x5d19('0x51'));}return db['CannedAnswer'][_0x5d19('0x52')](_0x549a98[_0x5d19('0x49')]);})[_0x5d19('0x24')](function(_0x45b35a){var _0x5ae929=_0x549a98[_0x5d19('0x53')]['get']({'plain':!![]});if(!_0x5ae929)throw new Error(_0x5d19('0x54'));if(_0x5ae929[_0x5d19('0x55')]===_0x5d19('0x53')){var _0x4a915f=_0x45b35a[_0x5d19('0x56')]({'plain':!![]});return db[_0x5d19('0x57')]['find']({'where':{'name':_0x5d19('0x58'),'userProfileId':_0x5ae929[_0x5d19('0x59')]},'raw':!![]})[_0x5d19('0x24')](function(_0x47c06c){if(_0x47c06c&&_0x47c06c[_0x5d19('0x5a')]===0x0){return db[_0x5d19('0x26')][_0x5d19('0x52')]({'name':_0x4a915f['name'],'resourceId':_0x4a915f['id'],'type':_0x47c06c[_0x5d19('0x29')],'sectionId':_0x47c06c['id']},{})['then'](function(){return _0x45b35a;});}else{return _0x45b35a;}})['catch'](function(_0xf6fa8b){logger[_0x5d19('0x27')](_0x5d19('0x5b'),_0xf6fa8b);throw _0xf6fa8b;});}return _0x45b35a;})[_0x5d19('0x24')](respondWithResult(_0x43f48a,0xc9))[_0x5d19('0x44')](handleError(_0x43f48a,null));};
\ No newline at end of file
+var _0xeb19=['undefined','limit','count','Content-Range','apply','reject','save','then','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','update','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x234761,_0x598fff){var _0x501944=function(_0x310d44){while(--_0x310d44){_0x234761['push'](_0x234761['shift']());}};_0x501944(++_0x598fff);}(_0xeb19,0x14b));var _0x9eb1=function(_0x280405,_0x274b31){_0x280405=_0x280405-0x0;var _0x2db04d=_0xeb19[_0x280405];return _0x2db04d;};'use strict';var emlformat=require(_0x9eb1('0x0'));var rimraf=require(_0x9eb1('0x1'));var zipdir=require(_0x9eb1('0x2'));var jsonpatch=require(_0x9eb1('0x3'));var rp=require(_0x9eb1('0x4'));var moment=require(_0x9eb1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9eb1('0x6'));var util=require(_0x9eb1('0x7'));var path=require(_0x9eb1('0x8'));var sox=require(_0x9eb1('0x9'));var csv=require(_0x9eb1('0xa'));var ejs=require(_0x9eb1('0xb'));var fs=require('fs');var fs_extra=require(_0x9eb1('0xc'));var _=require(_0x9eb1('0xd'));var squel=require(_0x9eb1('0xe'));var crypto=require(_0x9eb1('0xf'));var jsforce=require(_0x9eb1('0x10'));var deskjs=require(_0x9eb1('0x11'));var toCsv=require(_0x9eb1('0xa'));var querystring=require(_0x9eb1('0x12'));var Papa=require('papaparse');var Redis=require(_0x9eb1('0x13'));var authService=require(_0x9eb1('0x14'));var qs=require(_0x9eb1('0x15'));var as=require(_0x9eb1('0x16'));var hardwareService=require(_0x9eb1('0x17'));var logger=require('../../config/logger')(_0x9eb1('0x18'));var utils=require(_0x9eb1('0x19'));var config=require(_0x9eb1('0x1a'));var licenseUtil=require(_0x9eb1('0x1b'));var db=require(_0x9eb1('0x1c'))['db'];function respondWithStatusCode(_0x5afc1c,_0x389d74){_0x389d74=_0x389d74||0xcc;return function(_0x294b4e){if(_0x294b4e){return _0x5afc1c[_0x9eb1('0x1d')](_0x389d74);}return _0x5afc1c[_0x9eb1('0x1e')](_0x389d74)['end']();};}function respondWithResult(_0x41e4a6,_0x454fd7){_0x454fd7=_0x454fd7||0xc8;return function(_0x42d7ce){if(_0x42d7ce){return _0x41e4a6[_0x9eb1('0x1e')](_0x454fd7)[_0x9eb1('0x1f')](_0x42d7ce);}};}function respondWithFilteredResult(_0x359983,_0xeb84fe){return function(_0x5ea477){if(_0x5ea477){var _0x26532f=typeof _0xeb84fe[_0x9eb1('0x20')]===_0x9eb1('0x21')&&typeof _0xeb84fe[_0x9eb1('0x22')]===_0x9eb1('0x21');var _0x44a7da=_0x5ea477[_0x9eb1('0x23')];var _0x5a7ab0=_0x26532f?0x0:_0xeb84fe[_0x9eb1('0x20')];var _0x1b9d55=_0x26532f?_0x5ea477[_0x9eb1('0x23')]:_0xeb84fe[_0x9eb1('0x20')]+_0xeb84fe[_0x9eb1('0x22')];var _0x233e5a;if(_0x1b9d55>=_0x44a7da){_0x1b9d55=_0x44a7da;_0x233e5a=0xc8;}else{_0x233e5a=0xce;}_0x359983[_0x9eb1('0x1e')](_0x233e5a);return _0x359983['set'](_0x9eb1('0x24'),_0x5a7ab0+'-'+_0x1b9d55+'/'+_0x44a7da)[_0x9eb1('0x1f')](_0x5ea477);}return null;};}function patchUpdates(_0x1ff109){return function(_0x432b33){try{jsonpatch[_0x9eb1('0x25')](_0x432b33,_0x1ff109,!![]);}catch(_0x5723b8){return BPromise[_0x9eb1('0x26')](_0x5723b8);}return _0x432b33[_0x9eb1('0x27')]();};}function saveUpdates(_0x455472,_0x33b3db){return function(_0x5e1c65){if(_0x5e1c65){return _0x5e1c65['update'](_0x455472)['then'](function(_0x4db916){return _0x4db916;});}return null;};}function removeEntity(_0x186b7b,_0xf948ab){return function(_0x2d0903){if(_0x2d0903){return _0x2d0903['destroy']()[_0x9eb1('0x28')](function(){var _0x10cd18=_0x2d0903[_0x9eb1('0x29')]({'plain':!![]});var _0x27fc4d=_0x9eb1('0x2a');return db[_0x9eb1('0x2b')]['destroy']({'where':{'type':_0x27fc4d,'resourceId':_0x10cd18['id']}})[_0x9eb1('0x28')](function(){return _0x2d0903;});})[_0x9eb1('0x28')](function(){_0x186b7b[_0x9eb1('0x1e')](0xcc)[_0x9eb1('0x2c')]();});}};}function handleEntityNotFound(_0x37950b,_0x1eac12){return function(_0x28d5bf){if(!_0x28d5bf){_0x37950b[_0x9eb1('0x1d')](0x194);}return _0x28d5bf;};}function handleError(_0x178670,_0x10b5be){_0x10b5be=_0x10b5be||0x1f4;return function(_0x23f41a){logger[_0x9eb1('0x2d')](_0x23f41a[_0x9eb1('0x2e')]);if(_0x23f41a[_0x9eb1('0x2f')]){delete _0x23f41a['name'];}_0x178670['status'](_0x10b5be)[_0x9eb1('0x30')](_0x23f41a);};}exports[_0x9eb1('0x31')]=function(_0x42c87a,_0x19861a){var _0x285997={},_0x46a3b3={},_0xa0e27f={'count':0x0,'rows':[]};var _0x19fba1=_['map'](db[_0x9eb1('0x32')][_0x9eb1('0x33')],function(_0x535f97){return{'name':_0x535f97[_0x9eb1('0x34')],'type':_0x535f97[_0x9eb1('0x35')]['key']};});_0x46a3b3[_0x9eb1('0x36')]=_[_0x9eb1('0x37')](_0x19fba1,'name');_0x46a3b3[_0x9eb1('0x38')]=_[_0x9eb1('0x39')](_0x42c87a[_0x9eb1('0x38')]);_0x46a3b3[_0x9eb1('0x3a')]=_[_0x9eb1('0x3b')](_0x46a3b3[_0x9eb1('0x36')],_0x46a3b3[_0x9eb1('0x38')]);_0x285997[_0x9eb1('0x3c')]=_['intersection'](_0x46a3b3[_0x9eb1('0x36')],qs[_0x9eb1('0x3d')](_0x42c87a[_0x9eb1('0x38')][_0x9eb1('0x3d')]));_0x285997[_0x9eb1('0x3c')]=_0x285997[_0x9eb1('0x3c')][_0x9eb1('0x3e')]?_0x285997['attributes']:_0x46a3b3[_0x9eb1('0x36')];if(!_0x42c87a[_0x9eb1('0x38')]['hasOwnProperty'](_0x9eb1('0x3f'))){_0x285997['limit']=qs[_0x9eb1('0x22')](_0x42c87a[_0x9eb1('0x38')][_0x9eb1('0x22')]);_0x285997[_0x9eb1('0x20')]=qs['offset'](_0x42c87a[_0x9eb1('0x38')][_0x9eb1('0x20')]);}_0x285997[_0x9eb1('0x40')]=qs['sort'](_0x42c87a['query']['sort']);_0x285997[_0x9eb1('0x41')]=qs['filters'](_[_0x9eb1('0x42')](_0x42c87a[_0x9eb1('0x38')],_0x46a3b3['filters']),_0x19fba1);if(_0x42c87a[_0x9eb1('0x38')][_0x9eb1('0x43')]){_0x285997['where']=_[_0x9eb1('0x44')](_0x285997['where'],{'$or':[{'key':{'$like':'%'+_0x42c87a['query'][_0x9eb1('0x43')]+'%'}},{'value':{'$like':'%'+_0x42c87a[_0x9eb1('0x38')][_0x9eb1('0x43')]+'%'}}]});}_0x285997=_[_0x9eb1('0x44')]({},_0x285997,_0x42c87a[_0x9eb1('0x45')]);var _0x194b45={'where':_0x285997[_0x9eb1('0x41')]};return db[_0x9eb1('0x32')]['count'](_0x194b45)['then'](function(_0x4c4c58){_0xa0e27f['count']=_0x4c4c58;if(_0x42c87a[_0x9eb1('0x38')][_0x9eb1('0x46')]){_0x285997[_0x9eb1('0x47')]=[{'all':!![]}];}return db[_0x9eb1('0x32')][_0x9eb1('0x48')](_0x285997);})[_0x9eb1('0x28')](function(_0x5b7ce1){_0xa0e27f[_0x9eb1('0x49')]=_0x5b7ce1;return _0xa0e27f;})[_0x9eb1('0x28')](respondWithFilteredResult(_0x19861a,_0x285997))[_0x9eb1('0x4a')](handleError(_0x19861a,null));};exports['show']=function(_0x282592,_0x3e91c1){var _0x230cca={'raw':!![],'where':{'id':_0x282592[_0x9eb1('0x4b')]['id']}},_0x19db26={};_0x19db26['model']=_[_0x9eb1('0x39')](db[_0x9eb1('0x32')]['rawAttributes']);_0x19db26[_0x9eb1('0x38')]=_[_0x9eb1('0x39')](_0x282592['query']);_0x19db26[_0x9eb1('0x3a')]=_[_0x9eb1('0x3b')](_0x19db26[_0x9eb1('0x36')],_0x19db26['query']);_0x230cca[_0x9eb1('0x3c')]=_[_0x9eb1('0x3b')](_0x19db26[_0x9eb1('0x36')],qs['fields'](_0x282592[_0x9eb1('0x38')][_0x9eb1('0x3d')]));_0x230cca[_0x9eb1('0x3c')]=_0x230cca['attributes']['length']?_0x230cca[_0x9eb1('0x3c')]:_0x19db26['model'];if(_0x282592[_0x9eb1('0x38')][_0x9eb1('0x46')]){_0x230cca['include']=[{'all':!![]}];}_0x230cca=_[_0x9eb1('0x44')]({},_0x230cca,_0x282592[_0x9eb1('0x45')]);return db[_0x9eb1('0x32')][_0x9eb1('0x4c')](_0x230cca)['then'](handleEntityNotFound(_0x3e91c1,null))[_0x9eb1('0x28')](respondWithResult(_0x3e91c1,null))[_0x9eb1('0x4a')](handleError(_0x3e91c1,null));};exports[_0x9eb1('0x4d')]=function(_0x52b4ab,_0x11635f){if(_0x52b4ab[_0x9eb1('0x4e')]['id']){delete _0x52b4ab[_0x9eb1('0x4e')]['id'];}return db[_0x9eb1('0x32')]['find']({'where':{'id':_0x52b4ab[_0x9eb1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x11635f,null))['then'](saveUpdates(_0x52b4ab[_0x9eb1('0x4e')],null))[_0x9eb1('0x28')](respondWithResult(_0x11635f,null))['catch'](handleError(_0x11635f,null));};exports['destroy']=function(_0x892d12,_0xfc8016){return db[_0x9eb1('0x32')][_0x9eb1('0x4c')]({'where':{'id':_0x892d12[_0x9eb1('0x4b')]['id']}})[_0x9eb1('0x28')](handleEntityNotFound(_0xfc8016,null))['then'](removeEntity(_0xfc8016,null))['catch'](handleError(_0xfc8016,null));};exports[_0x9eb1('0x4f')]=function(_0x17f8ce,_0x1b75f0){var _0x1fbf03={'key':_0x17f8ce[_0x9eb1('0x4e')][_0x9eb1('0x50')]};if(_0x17f8ce[_0x9eb1('0x4e')][_0x9eb1('0x51')]){_0x1fbf03[_0x9eb1('0x51')]=_0x17f8ce[_0x9eb1('0x4e')]['MailAccountId'];}else if(_0x17f8ce[_0x9eb1('0x4e')][_0x9eb1('0x52')]){_0x1fbf03[_0x9eb1('0x52')]=_0x17f8ce[_0x9eb1('0x4e')][_0x9eb1('0x52')];}else if(_0x17f8ce[_0x9eb1('0x4e')][_0x9eb1('0x53')]){_0x1fbf03['OpenchannelAccountId']=_0x17f8ce['body'][_0x9eb1('0x53')];}else if(_0x17f8ce[_0x9eb1('0x4e')][_0x9eb1('0x54')]){_0x1fbf03[_0x9eb1('0x54')]=_0x17f8ce[_0x9eb1('0x4e')]['ChatWebsiteId'];}return db[_0x9eb1('0x32')][_0x9eb1('0x4c')]({'where':_0x1fbf03})[_0x9eb1('0x28')](function(_0xff2305){if(_0xff2305){throw new db['Sequelize'][(_0x9eb1('0x55'))](_0x9eb1('0x56'));}return db['CannedAnswer'][_0x9eb1('0x4f')](_0x17f8ce[_0x9eb1('0x4e')]);})[_0x9eb1('0x28')](function(_0x41fc49){var _0x62ccd=_0x17f8ce[_0x9eb1('0x57')][_0x9eb1('0x29')]({'plain':!![]});if(!_0x62ccd)throw new Error(_0x9eb1('0x58'));if(_0x62ccd['role']==='user'){var _0xa619bb=_0x41fc49[_0x9eb1('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x9eb1('0x4c')]({'where':{'name':'CannedAnswers','userProfileId':_0x62ccd[_0x9eb1('0x59')]},'raw':!![]})[_0x9eb1('0x28')](function(_0x4fca89){if(_0x4fca89&&_0x4fca89['autoAssociation']===0x0){return db[_0x9eb1('0x2b')][_0x9eb1('0x4f')]({'name':_0xa619bb['name'],'resourceId':_0xa619bb['id'],'type':_0x4fca89[_0x9eb1('0x2f')],'sectionId':_0x4fca89['id']},{})['then'](function(){return _0x41fc49;});}else{return _0x41fc49;}})['catch'](function(_0xdeb372){logger[_0x9eb1('0x2d')](_0x9eb1('0x5a'),_0xdeb372);throw _0xdeb372;});}return _0x41fc49;})['then'](respondWithResult(_0x1b75f0,0xc9))[_0x9eb1('0x4a')](handleError(_0x1b75f0,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index e0bcbc3..a580360 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 _0x16c5=['exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x1f766a,_0x4415b9){var _0x1136cb=function(_0x56d98b){while(--_0x56d98b){_0x1f766a['push'](_0x1f766a['shift']());}};_0x1136cb(++_0x4415b9);}(_0x16c5,0x112));var _0x516c=function(_0xc48e6e,_0x3b961e){_0xc48e6e=_0xc48e6e-0x0;var _0x4d9a0d=_0x16c5[_0xc48e6e];return _0x4d9a0d;};'use strict';var _=require(_0x516c('0x0'));var util=require(_0x516c('0x1'));var logger=require(_0x516c('0x2'))(_0x516c('0x3'));var moment=require(_0x516c('0x4'));var BPromise=require(_0x516c('0x5'));var rp=require(_0x516c('0x6'));var fs=require('fs');var path=require(_0x516c('0x7'));var rimraf=require(_0x516c('0x8'));var config=require(_0x516c('0x9'));var attributes=require(_0x516c('0xa'));module[_0x516c('0xb')]=function(_0x4e8217,_0x13ee9d){return _0x4e8217['define'](_0x516c('0xc'),attributes,{'tableName':_0x516c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x516c('0xe')});};
\ No newline at end of file
+var _0xbefe=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4'];(function(_0x2f3852,_0x18fb67){var _0x4ce88e=function(_0xb22dcf){while(--_0xb22dcf){_0x2f3852['push'](_0x2f3852['shift']());}};_0x4ce88e(++_0x18fb67);}(_0xbefe,0x168));var _0xebef=function(_0x288371,_0x35f999){_0x288371=_0x288371-0x0;var _0x5a1ad1=_0xbefe[_0x288371];return _0x5a1ad1;};'use strict';var _=require('lodash');var util=require(_0xebef('0x0'));var logger=require('../../config/logger')(_0xebef('0x1'));var moment=require(_0xebef('0x2'));var BPromise=require(_0xebef('0x3'));var rp=require(_0xebef('0x4'));var fs=require('fs');var path=require(_0xebef('0x5'));var rimraf=require(_0xebef('0x6'));var config=require(_0xebef('0x7'));var attributes=require(_0xebef('0x8'));module['exports']=function(_0x3fe404,_0x39de80){return _0x3fe404[_0xebef('0x9')]('CannedAnswer',attributes,{'tableName':_0xebef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xebef('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 5856507..4e97799 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(_0x2a6990,_0x22b68a){var _0x1afd70=function(_0x113a00){while(--_0x113a00){_0x2a6990['push'](_0x2a6990['shift']());}};_0x1afd70(++_0x22b68a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x2367aa,_0x48a675){var _0x2e50a5=function(_0x474496){while(--_0x474496){_0x2367aa['push'](_0x2367aa['shift']());}};_0x2e50a5(++_0x48a675);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 363758e..6a6f152 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 _0x803d=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x1784d2,_0x1ba5ba){var _0x4784f3=function(_0x3c6fd0){while(--_0x3c6fd0){_0x1784d2['push'](_0x1784d2['shift']());}};_0x4784f3(++_0x1ba5ba);}(_0x803d,0x149));var _0xd803=function(_0x363a95,_0x4fc2ae){_0x363a95=_0x363a95-0x0;var _0x4c9aca=_0x803d[_0x363a95];return _0x4c9aca;};'use strict';var multer=require(_0xd803('0x0'));var util=require(_0xd803('0x1'));var path=require(_0xd803('0x2'));var timeout=require(_0xd803('0x3'));var express=require(_0xd803('0x4'));var router=express[_0xd803('0x5')]();var fs_extra=require(_0xd803('0x6'));var auth=require(_0xd803('0x7'));var interaction=require(_0xd803('0x8'));var config=require(_0xd803('0x9'));var controller=require(_0xd803('0xa'));router['get']('/',auth[_0xd803('0xb')](),controller[_0xd803('0xc')]);router[_0xd803('0xd')](_0xd803('0xe'),auth[_0xd803('0xb')](),controller[_0xd803('0xf')]);router[_0xd803('0x10')]('/',auth[_0xd803('0xb')](),controller[_0xd803('0x11')]);router[_0xd803('0x12')]('/:id',auth[_0xd803('0xb')](),controller[_0xd803('0x13')]);router[_0xd803('0x14')](_0xd803('0xe'),auth[_0xd803('0xb')](),controller['destroy']);module[_0xd803('0x15')]=router;
\ No newline at end of file
+var _0xe61f=['Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','util','path'];(function(_0x38ec07,_0x5d430a){var _0x322f99=function(_0x2745e7){while(--_0x2745e7){_0x38ec07['push'](_0x38ec07['shift']());}};_0x322f99(++_0x5d430a);}(_0xe61f,0xeb));var _0xfe61=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe61f[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xfe61('0x0'));var util=require(_0xfe61('0x1'));var path=require(_0xfe61('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfe61('0x3')]();var fs_extra=require(_0xfe61('0x4'));var auth=require(_0xfe61('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfe61('0x6'));var controller=require(_0xfe61('0x7'));router[_0xfe61('0x8')]('/',auth[_0xfe61('0x9')](),controller['index']);router['get'](_0xfe61('0xa'),auth[_0xfe61('0x9')](),controller[_0xfe61('0xb')]);router[_0xfe61('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfe61('0xd')](_0xfe61('0xa'),auth[_0xfe61('0x9')](),controller[_0xfe61('0xe')]);router['delete'](_0xfe61('0xa'),auth[_0xfe61('0x9')](),controller[_0xfe61('0xf')]);module[_0xfe61('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 57f41b7..9f38bd4 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 _0x502a=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x470b24,_0x58a01e){var _0xde9b3d=function(_0x445f8c){while(--_0x445f8c){_0x470b24['push'](_0x470b24['shift']());}};_0xde9b3d(++_0x58a01e);}(_0x502a,0xd8));var _0xa502=function(_0x403cd5,_0x2695bb){_0x403cd5=_0x403cd5-0x0;var _0x470e7b=_0x502a[_0x403cd5];return _0x470e7b;};'use strict';var Sequelize=require(_0xa502('0x0'));module[_0xa502('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xa502('0x2')},'clid':{'type':Sequelize[_0xa502('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xa502('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xa502('0x3')]},'lastapp':{'type':Sequelize[_0xa502('0x3')]},'lastdata':{'type':Sequelize[_0xa502('0x3')]},'duration':{'type':Sequelize[_0xa502('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa502('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xa502('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa502('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa502('0x3')]},'sequence':{'type':Sequelize[_0xa502('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa502('0x3')]},'tag':{'type':Sequelize[_0xa502('0x3')]}};
\ No newline at end of file
+var _0x7a72=['STRING','INTEGER','exports','DATE'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0x7a72,0x1be));var _0x27a7=function(_0x5e6943,_0x2e59da){_0x5e6943=_0x5e6943-0x0;var _0x7f52f2=_0x7a72[_0x5e6943];return _0x7f52f2;};'use strict';var Sequelize=require('sequelize');module[_0x27a7('0x0')]={'calldate':{'type':Sequelize[_0x27a7('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x27a7('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x27a7('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x27a7('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x27a7('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x27a7('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x27a7('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x27a7('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x27a7('0x2')]},'linkedid':{'type':Sequelize[_0x27a7('0x2')]},'sequence':{'type':Sequelize[_0x27a7('0x2')]},'peeraccount':{'type':Sequelize[_0x27a7('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x27a7('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 6a7d668..0059bff 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 _0x9009=['stack','name','index','Cdr','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','map','VIRTUAL','catch','show','params','includeAll','include','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x9009,0x1d4));var _0x9900=function(_0x26891e,_0x53401c){_0x26891e=_0x26891e-0x0;var _0x23a288=_0x9009[_0x26891e];return _0x23a288;};'use strict';var emlformat=require(_0x9900('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9900('0x1'));var jsonpatch=require(_0x9900('0x2'));var rp=require('request-promise');var moment=require(_0x9900('0x3'));var BPromise=require(_0x9900('0x4'));var Mustache=require(_0x9900('0x5'));var util=require(_0x9900('0x6'));var path=require('path');var sox=require(_0x9900('0x7'));var csv=require(_0x9900('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9900('0x9'));var squel=require(_0x9900('0xa'));var crypto=require('crypto');var jsforce=require(_0x9900('0xb'));var deskjs=require(_0x9900('0xc'));var toCsv=require(_0x9900('0x8'));var querystring=require(_0x9900('0xd'));var Papa=require('papaparse');var Redis=require(_0x9900('0xe'));var authService=require(_0x9900('0xf'));var qs=require(_0x9900('0x10'));var as=require(_0x9900('0x11'));var hardwareService=require(_0x9900('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9900('0x13'));var config=require(_0x9900('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17070a,_0x4e8312){_0x4e8312=_0x4e8312||0xcc;return function(_0x6bd4da){if(_0x6bd4da){return _0x17070a[_0x9900('0x15')](_0x4e8312);}return _0x17070a[_0x9900('0x16')](_0x4e8312)[_0x9900('0x17')]();};}function respondWithResult(_0x318fa5,_0x1014e8){_0x1014e8=_0x1014e8||0xc8;return function(_0x2eaf32){if(_0x2eaf32){return _0x318fa5[_0x9900('0x16')](_0x1014e8)[_0x9900('0x18')](_0x2eaf32);}};}function respondWithFilteredResult(_0x209b4d,_0x375ee0){return function(_0xce2dd6){if(_0xce2dd6){var _0x154e22=typeof _0x375ee0[_0x9900('0x19')]===_0x9900('0x1a')&&typeof _0x375ee0[_0x9900('0x1b')]===_0x9900('0x1a');var _0x5d9ec9=_0xce2dd6['count'];var _0x1017a5=_0x154e22?0x0:_0x375ee0[_0x9900('0x19')];var _0x1bd7a3=_0x154e22?_0xce2dd6[_0x9900('0x1c')]:_0x375ee0['offset']+_0x375ee0[_0x9900('0x1b')];var _0x57ae85;if(_0x1bd7a3>=_0x5d9ec9){_0x1bd7a3=_0x5d9ec9;_0x57ae85=0xc8;}else{_0x57ae85=0xce;}_0x209b4d['status'](_0x57ae85);return _0x209b4d[_0x9900('0x1d')]('Content-Range',_0x1017a5+'-'+_0x1bd7a3+'/'+_0x5d9ec9)[_0x9900('0x18')](_0xce2dd6);}return null;};}function patchUpdates(_0x596eff){return function(_0x48d6df){try{jsonpatch[_0x9900('0x1e')](_0x48d6df,_0x596eff,!![]);}catch(_0x2892ce){return BPromise[_0x9900('0x1f')](_0x2892ce);}return _0x48d6df[_0x9900('0x20')]();};}function saveUpdates(_0x5ee4ad,_0x215bd4){return function(_0x3e4cee){if(_0x3e4cee){return _0x3e4cee[_0x9900('0x21')](_0x5ee4ad)[_0x9900('0x22')](function(_0x45c0d0){return _0x45c0d0;});}return null;};}function removeEntity(_0x5368bf,_0x37842b){return function(_0x218d7e){if(_0x218d7e){return _0x218d7e['destroy']()[_0x9900('0x22')](function(){_0x5368bf[_0x9900('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a015,_0x43ed24){return function(_0x2ac147){if(!_0x2ac147){_0x54a015['sendStatus'](0x194);}return _0x2ac147;};}function handleError(_0x285d51,_0x4507a9){_0x4507a9=_0x4507a9||0x1f4;return function(_0x5e3e21){logger[_0x9900('0x23')](_0x5e3e21[_0x9900('0x24')]);if(_0x5e3e21[_0x9900('0x25')]){delete _0x5e3e21[_0x9900('0x25')];}_0x285d51[_0x9900('0x16')](_0x4507a9)['send'](_0x5e3e21);};}exports[_0x9900('0x26')]=function(_0x44d775,_0x10fbae){var _0x32e343={},_0x3b1b94={},_0x50f16a={'count':0x0,'rows':[]};var _0x4cef1f=_['map'](db[_0x9900('0x27')][_0x9900('0x28')],function(_0x4ef405){return{'name':_0x4ef405[_0x9900('0x29')],'type':_0x4ef405[_0x9900('0x2a')][_0x9900('0x2b')]};});_0x3b1b94['model']=_['map'](_0x4cef1f,_0x9900('0x25'));_0x3b1b94[_0x9900('0x2c')]=_[_0x9900('0x2d')](_0x44d775[_0x9900('0x2c')]);_0x3b1b94['filters']=_['intersection'](_0x3b1b94[_0x9900('0x2e')],_0x3b1b94[_0x9900('0x2c')]);_0x32e343[_0x9900('0x2f')]=_[_0x9900('0x30')](_0x3b1b94[_0x9900('0x2e')],qs[_0x9900('0x31')](_0x44d775[_0x9900('0x2c')][_0x9900('0x31')]));_0x32e343[_0x9900('0x2f')]=_0x32e343[_0x9900('0x2f')][_0x9900('0x32')]?_0x32e343[_0x9900('0x2f')]:_0x3b1b94[_0x9900('0x2e')];if(!_0x44d775['query']['hasOwnProperty'](_0x9900('0x33'))){_0x32e343['limit']=qs[_0x9900('0x1b')](_0x44d775[_0x9900('0x2c')][_0x9900('0x1b')]);_0x32e343[_0x9900('0x19')]=qs[_0x9900('0x19')](_0x44d775[_0x9900('0x2c')][_0x9900('0x19')]);}_0x32e343[_0x9900('0x34')]=qs[_0x9900('0x35')](_0x44d775['query']['sort']);_0x32e343['where']=qs[_0x9900('0x36')](_[_0x9900('0x37')](_0x44d775['query'],_0x3b1b94[_0x9900('0x36')]),_0x4cef1f);if(_0x44d775[_0x9900('0x2c')][_0x9900('0x38')]){_0x32e343['where']=_[_0x9900('0x39')](_0x32e343[_0x9900('0x3a')],{'$or':_[_0x9900('0x3b')](_0x4cef1f,function(_0x141131){if(_0x141131[_0x9900('0x2a')]!==_0x9900('0x3c')){var _0x510d6a={};_0x510d6a[_0x141131[_0x9900('0x25')]]={'$like':'%'+_0x44d775[_0x9900('0x2c')]['filter']+'%'};return _0x510d6a;}})});}_0x32e343=_[_0x9900('0x39')]({},_0x32e343,_0x44d775['options']);var _0x2cee90={'where':_0x32e343[_0x9900('0x3a')]};return db['Cdr'][_0x9900('0x1c')](_0x2cee90)[_0x9900('0x22')](function(_0x2595cc){_0x50f16a[_0x9900('0x1c')]=_0x2595cc;if(_0x44d775[_0x9900('0x2c')]['includeAll']){_0x32e343['include']=[{'all':!![]}];}return db[_0x9900('0x27')]['findAll'](_0x32e343);})['then'](function(_0x5e2765){_0x50f16a['rows']=_0x5e2765;return _0x50f16a;})['then'](respondWithFilteredResult(_0x10fbae,_0x32e343))[_0x9900('0x3d')](handleError(_0x10fbae,null));};exports[_0x9900('0x3e')]=function(_0x3c8f30,_0x42849a){var _0x31c003={'raw':!![],'where':{'id':_0x3c8f30[_0x9900('0x3f')]['id']}},_0xb94a40={};_0xb94a40[_0x9900('0x2e')]=_['keys'](db[_0x9900('0x27')][_0x9900('0x28')]);_0xb94a40['query']=_['keys'](_0x3c8f30[_0x9900('0x2c')]);_0xb94a40[_0x9900('0x36')]=_[_0x9900('0x30')](_0xb94a40[_0x9900('0x2e')],_0xb94a40[_0x9900('0x2c')]);_0x31c003[_0x9900('0x2f')]=_[_0x9900('0x30')](_0xb94a40[_0x9900('0x2e')],qs['fields'](_0x3c8f30[_0x9900('0x2c')][_0x9900('0x31')]));_0x31c003['attributes']=_0x31c003[_0x9900('0x2f')][_0x9900('0x32')]?_0x31c003[_0x9900('0x2f')]:_0xb94a40[_0x9900('0x2e')];if(_0x3c8f30['query'][_0x9900('0x40')]){_0x31c003[_0x9900('0x41')]=[{'all':!![]}];}_0x31c003=_['merge']({},_0x31c003,_0x3c8f30[_0x9900('0x42')]);return db[_0x9900('0x27')][_0x9900('0x43')](_0x31c003)['then'](handleEntityNotFound(_0x42849a,null))[_0x9900('0x22')](respondWithResult(_0x42849a,null))['catch'](handleError(_0x42849a,null));};exports[_0x9900('0x44')]=function(_0x5ea06a,_0x1409a0){return db[_0x9900('0x27')][_0x9900('0x44')](_0x5ea06a['body'],{})[_0x9900('0x22')](respondWithResult(_0x1409a0,0xc9))['catch'](handleError(_0x1409a0,null));};exports[_0x9900('0x21')]=function(_0x11be07,_0x5ac239){if(_0x11be07[_0x9900('0x45')]['id']){delete _0x11be07[_0x9900('0x45')]['id'];}return db['Cdr'][_0x9900('0x43')]({'where':{'id':_0x11be07[_0x9900('0x3f')]['id']}})[_0x9900('0x22')](handleEntityNotFound(_0x5ac239,null))[_0x9900('0x22')](saveUpdates(_0x11be07[_0x9900('0x45')],null))['then'](respondWithResult(_0x5ac239,null))['catch'](handleError(_0x5ac239,null));};exports[_0x9900('0x46')]=function(_0x43cf2c,_0x2aa081){return db[_0x9900('0x27')][_0x9900('0x43')]({'where':{'id':_0x43cf2c['params']['id']}})[_0x9900('0x22')](handleEntityNotFound(_0x2aa081,null))[_0x9900('0x22')](removeEntity(_0x2aa081,null))[_0x9900('0x3d')](handleError(_0x2aa081,null));};exports[_0x9900('0x47')]=function(_0x2f7f74,_0xb5512f){return db[_0x9900('0x27')]['describe']()[_0x9900('0x22')](respondWithResult(_0xb5512f,null))['catch'](handleError(_0xb5512f,null));};
\ No newline at end of file
+var _0xab86=['fieldName','type','key','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','filters','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','sendStatus','stack','name','send','map','Cdr','rawAttributes'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xab86,0x13e));var _0x6ab8=function(_0x179a64,_0x443ab2){_0x179a64=_0x179a64-0x0;var _0x34a105=_0xab86[_0x179a64];return _0x34a105;};'use strict';var emlformat=require(_0x6ab8('0x0'));var rimraf=require(_0x6ab8('0x1'));var zipdir=require(_0x6ab8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ab8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6ab8('0x4'));var util=require('util');var path=require(_0x6ab8('0x5'));var sox=require(_0x6ab8('0x6'));var csv=require(_0x6ab8('0x7'));var ejs=require(_0x6ab8('0x8'));var fs=require('fs');var fs_extra=require(_0x6ab8('0x9'));var _=require(_0x6ab8('0xa'));var squel=require(_0x6ab8('0xb'));var crypto=require(_0x6ab8('0xc'));var jsforce=require(_0x6ab8('0xd'));var deskjs=require(_0x6ab8('0xe'));var toCsv=require(_0x6ab8('0x7'));var querystring=require(_0x6ab8('0xf'));var Papa=require(_0x6ab8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ab8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ab8('0x12'));var logger=require(_0x6ab8('0x13'))(_0x6ab8('0x14'));var utils=require('../../config/utils');var config=require(_0x6ab8('0x15'));var licenseUtil=require(_0x6ab8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44d1d9,_0x1b9b34){_0x1b9b34=_0x1b9b34||0xcc;return function(_0x408ce1){if(_0x408ce1){return _0x44d1d9['sendStatus'](_0x1b9b34);}return _0x44d1d9[_0x6ab8('0x17')](_0x1b9b34)[_0x6ab8('0x18')]();};}function respondWithResult(_0x60b50,_0x968bac){_0x968bac=_0x968bac||0xc8;return function(_0x1c83a1){if(_0x1c83a1){return _0x60b50[_0x6ab8('0x17')](_0x968bac)[_0x6ab8('0x19')](_0x1c83a1);}};}function respondWithFilteredResult(_0x2043bb,_0x293389){return function(_0x5218e9){if(_0x5218e9){var _0x1f64a3=typeof _0x293389[_0x6ab8('0x1a')]===_0x6ab8('0x1b')&&typeof _0x293389['limit']===_0x6ab8('0x1b');var _0x35b790=_0x5218e9['count'];var _0x543726=_0x1f64a3?0x0:_0x293389[_0x6ab8('0x1a')];var _0x57cd18=_0x1f64a3?_0x5218e9[_0x6ab8('0x1c')]:_0x293389[_0x6ab8('0x1a')]+_0x293389[_0x6ab8('0x1d')];var _0x4e0fbd;if(_0x57cd18>=_0x35b790){_0x57cd18=_0x35b790;_0x4e0fbd=0xc8;}else{_0x4e0fbd=0xce;}_0x2043bb[_0x6ab8('0x17')](_0x4e0fbd);return _0x2043bb[_0x6ab8('0x1e')](_0x6ab8('0x1f'),_0x543726+'-'+_0x57cd18+'/'+_0x35b790)[_0x6ab8('0x19')](_0x5218e9);}return null;};}function patchUpdates(_0x5227c6){return function(_0x301004){try{jsonpatch[_0x6ab8('0x20')](_0x301004,_0x5227c6,!![]);}catch(_0x520cd8){return BPromise['reject'](_0x520cd8);}return _0x301004['save']();};}function saveUpdates(_0x190af2,_0x46cfdc){return function(_0xe2d5d8){if(_0xe2d5d8){return _0xe2d5d8['update'](_0x190af2)[_0x6ab8('0x21')](function(_0x433f37){return _0x433f37;});}return null;};}function removeEntity(_0x50fc50,_0x503f94){return function(_0x8af7e9){if(_0x8af7e9){return _0x8af7e9[_0x6ab8('0x22')]()['then'](function(){_0x50fc50[_0x6ab8('0x17')](0xcc)[_0x6ab8('0x18')]();});}};}function handleEntityNotFound(_0x24e400,_0x3d614b){return function(_0x3ddaeb){if(!_0x3ddaeb){_0x24e400[_0x6ab8('0x23')](0x194);}return _0x3ddaeb;};}function handleError(_0x2e098f,_0x1e26ed){_0x1e26ed=_0x1e26ed||0x1f4;return function(_0x5a1be3){logger['error'](_0x5a1be3[_0x6ab8('0x24')]);if(_0x5a1be3['name']){delete _0x5a1be3[_0x6ab8('0x25')];}_0x2e098f[_0x6ab8('0x17')](_0x1e26ed)[_0x6ab8('0x26')](_0x5a1be3);};}exports['index']=function(_0x525687,_0x4871e3){var _0x79dbd3={},_0x14e822={},_0x3723a7={'count':0x0,'rows':[]};var _0x2f14ea=_[_0x6ab8('0x27')](db[_0x6ab8('0x28')][_0x6ab8('0x29')],function(_0x4eda0b){return{'name':_0x4eda0b[_0x6ab8('0x2a')],'type':_0x4eda0b[_0x6ab8('0x2b')][_0x6ab8('0x2c')]};});_0x14e822[_0x6ab8('0x2d')]=_[_0x6ab8('0x27')](_0x2f14ea,'name');_0x14e822['query']=_[_0x6ab8('0x2e')](_0x525687['query']);_0x14e822['filters']=_[_0x6ab8('0x2f')](_0x14e822[_0x6ab8('0x2d')],_0x14e822['query']);_0x79dbd3[_0x6ab8('0x30')]=_['intersection'](_0x14e822[_0x6ab8('0x2d')],qs[_0x6ab8('0x31')](_0x525687['query']['fields']));_0x79dbd3[_0x6ab8('0x30')]=_0x79dbd3[_0x6ab8('0x30')][_0x6ab8('0x32')]?_0x79dbd3[_0x6ab8('0x30')]:_0x14e822[_0x6ab8('0x2d')];if(!_0x525687[_0x6ab8('0x33')][_0x6ab8('0x34')](_0x6ab8('0x35'))){_0x79dbd3['limit']=qs[_0x6ab8('0x1d')](_0x525687[_0x6ab8('0x33')][_0x6ab8('0x1d')]);_0x79dbd3[_0x6ab8('0x1a')]=qs[_0x6ab8('0x1a')](_0x525687[_0x6ab8('0x33')]['offset']);}_0x79dbd3[_0x6ab8('0x36')]=qs[_0x6ab8('0x37')](_0x525687[_0x6ab8('0x33')]['sort']);_0x79dbd3['where']=qs[_0x6ab8('0x38')](_[_0x6ab8('0x39')](_0x525687[_0x6ab8('0x33')],_0x14e822[_0x6ab8('0x38')]),_0x2f14ea);if(_0x525687[_0x6ab8('0x33')]['filter']){_0x79dbd3['where']=_[_0x6ab8('0x3a')](_0x79dbd3['where'],{'$or':_[_0x6ab8('0x27')](_0x2f14ea,function(_0x9ca6ed){if(_0x9ca6ed['type']!=='VIRTUAL'){var _0x8d76aa={};_0x8d76aa[_0x9ca6ed[_0x6ab8('0x25')]]={'$like':'%'+_0x525687[_0x6ab8('0x33')][_0x6ab8('0x3b')]+'%'};return _0x8d76aa;}})});}_0x79dbd3=_[_0x6ab8('0x3a')]({},_0x79dbd3,_0x525687[_0x6ab8('0x3c')]);var _0xef0ce5={'where':_0x79dbd3['where']};return db['Cdr'][_0x6ab8('0x1c')](_0xef0ce5)[_0x6ab8('0x21')](function(_0x146f43){_0x3723a7[_0x6ab8('0x1c')]=_0x146f43;if(_0x525687['query'][_0x6ab8('0x3d')]){_0x79dbd3['include']=[{'all':!![]}];}return db['Cdr'][_0x6ab8('0x3e')](_0x79dbd3);})[_0x6ab8('0x21')](function(_0x45735d){_0x3723a7[_0x6ab8('0x3f')]=_0x45735d;return _0x3723a7;})[_0x6ab8('0x21')](respondWithFilteredResult(_0x4871e3,_0x79dbd3))[_0x6ab8('0x40')](handleError(_0x4871e3,null));};exports[_0x6ab8('0x41')]=function(_0xf3abb8,_0x2494c3){var _0x45c70d={'raw':!![],'where':{'id':_0xf3abb8[_0x6ab8('0x42')]['id']}},_0xc32c6e={};_0xc32c6e['model']=_[_0x6ab8('0x2e')](db[_0x6ab8('0x28')][_0x6ab8('0x29')]);_0xc32c6e[_0x6ab8('0x33')]=_['keys'](_0xf3abb8[_0x6ab8('0x33')]);_0xc32c6e['filters']=_[_0x6ab8('0x2f')](_0xc32c6e[_0x6ab8('0x2d')],_0xc32c6e['query']);_0x45c70d[_0x6ab8('0x30')]=_[_0x6ab8('0x2f')](_0xc32c6e['model'],qs[_0x6ab8('0x31')](_0xf3abb8[_0x6ab8('0x33')][_0x6ab8('0x31')]));_0x45c70d[_0x6ab8('0x30')]=_0x45c70d[_0x6ab8('0x30')]['length']?_0x45c70d['attributes']:_0xc32c6e['model'];if(_0xf3abb8[_0x6ab8('0x33')][_0x6ab8('0x3d')]){_0x45c70d['include']=[{'all':!![]}];}_0x45c70d=_[_0x6ab8('0x3a')]({},_0x45c70d,_0xf3abb8[_0x6ab8('0x3c')]);return db[_0x6ab8('0x28')][_0x6ab8('0x43')](_0x45c70d)[_0x6ab8('0x21')](handleEntityNotFound(_0x2494c3,null))[_0x6ab8('0x21')](respondWithResult(_0x2494c3,null))['catch'](handleError(_0x2494c3,null));};exports[_0x6ab8('0x44')]=function(_0x74de32,_0x4b00cc){return db[_0x6ab8('0x28')][_0x6ab8('0x44')](_0x74de32[_0x6ab8('0x45')],{})['then'](respondWithResult(_0x4b00cc,0xc9))['catch'](handleError(_0x4b00cc,null));};exports[_0x6ab8('0x46')]=function(_0x4c27fa,_0x31965e){if(_0x4c27fa['body']['id']){delete _0x4c27fa[_0x6ab8('0x45')]['id'];}return db[_0x6ab8('0x28')][_0x6ab8('0x43')]({'where':{'id':_0x4c27fa[_0x6ab8('0x42')]['id']}})[_0x6ab8('0x21')](handleEntityNotFound(_0x31965e,null))[_0x6ab8('0x21')](saveUpdates(_0x4c27fa['body'],null))['then'](respondWithResult(_0x31965e,null))['catch'](handleError(_0x31965e,null));};exports[_0x6ab8('0x22')]=function(_0x54708b,_0xce83a3){return db[_0x6ab8('0x28')][_0x6ab8('0x43')]({'where':{'id':_0x54708b[_0x6ab8('0x42')]['id']}})[_0x6ab8('0x21')](handleEntityNotFound(_0xce83a3,null))[_0x6ab8('0x21')](removeEntity(_0xce83a3,null))[_0x6ab8('0x40')](handleError(_0xce83a3,null));};exports[_0x6ab8('0x47')]=function(_0x4d4e88,_0x1a372b){return db[_0x6ab8('0x28')][_0x6ab8('0x47')]()[_0x6ab8('0x21')](respondWithResult(_0x1a372b,null))['catch'](handleError(_0x1a372b,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 574f518..839bfd6 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(_0x12220f,_0x24cfb5){var _0x31f5f2=function(_0x5f0af6){while(--_0x5f0af6){_0x12220f['push'](_0x12220f['shift']());}};_0x31f5f2(++_0x24cfb5);}(_0x7a54,0x106));var _0x47a5=function(_0x1ca3c6,_0x574b0e){_0x1ca3c6=_0x1ca3c6-0x0;var _0x53c04c=_0x7a54[_0x1ca3c6];return _0x53c04c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x63416d,_0xc47f1){var _0x27b160=function(_0x3191cb){while(--_0x3191cb){_0x63416d['push'](_0x63416d['shift']());}};_0x27b160(++_0xc47f1);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index dfac075..2bb5ef1 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 _0x97d5=['util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','catch'];(function(_0x1db0ee,_0x3e8d0a){var _0x2af57b=function(_0x51338e){while(--_0x51338e){_0x1db0ee['push'](_0x1db0ee['shift']());}};_0x2af57b(++_0x3e8d0a);}(_0x97d5,0x150));var _0x597d=function(_0x35e7f5,_0x505458){_0x35e7f5=_0x35e7f5-0x0;var _0x21327e=_0x97d5[_0x35e7f5];return _0x21327e;};'use strict';var _=require('lodash');var util=require(_0x597d('0x0'));var moment=require(_0x597d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x597d('0x2'));var logger=require(_0x597d('0x3'))(_0x597d('0x4'));var config=require(_0x597d('0x5'));var jayson=require(_0x597d('0x6'));var client=jayson[_0x597d('0x7')][_0x597d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47e663,_0x10d917,_0x39c005){return new BPromise(function(_0x8d847,_0x4678c1){return client[_0x597d('0x9')](_0x47e663,_0x39c005)[_0x597d('0xa')](function(_0x3c8c91){logger[_0x597d('0xb')]('Cdr,\x20%s,\x20%s',_0x10d917,_0x597d('0xc'));logger[_0x597d('0xd')](_0x597d('0xe'),_0x10d917,_0x597d('0xc'),JSON[_0x597d('0xf')](_0x3c8c91));if(_0x3c8c91[_0x597d('0x10')]){if(_0x3c8c91['error'][_0x597d('0x11')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x10d917,_0x3c8c91[_0x597d('0x10')][_0x597d('0x12')]);return _0x4678c1(_0x3c8c91[_0x597d('0x10')][_0x597d('0x12')]);}logger[_0x597d('0x10')]('Cdr,\x20%s,\x20%s',_0x10d917,_0x3c8c91[_0x597d('0x10')][_0x597d('0x12')]);return _0x8d847(_0x3c8c91['error'][_0x597d('0x12')]);}else{logger[_0x597d('0xb')](_0x597d('0x13'),_0x10d917,'request\x20sent');_0x8d847(_0x3c8c91['result'][_0x597d('0x12')]);}})[_0x597d('0x14')](function(_0x1959c2){logger[_0x597d('0x10')](_0x597d('0x13'),_0x10d917,_0x1959c2);_0x4678c1(_0x1959c2);});});}
\ No newline at end of file
+var _0x5110=['error','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','message'];(function(_0x25d32f,_0xa94269){var _0x925e6e=function(_0x570a3a){while(--_0x570a3a){_0x25d32f['push'](_0x25d32f['shift']());}};_0x925e6e(++_0xa94269);}(_0x5110,0x16b));var _0x0511=function(_0x2311df,_0x55a309){_0x2311df=_0x2311df-0x0;var _0x1eece9=_0x5110[_0x2311df];return _0x1eece9;};'use strict';var _=require(_0x0511('0x0'));var util=require(_0x0511('0x1'));var moment=require('moment');var BPromise=require(_0x0511('0x2'));var rs=require(_0x0511('0x3'));var fs=require('fs');var Redis=require(_0x0511('0x4'));var db=require(_0x0511('0x5'))['db'];var utils=require(_0x0511('0x6'));var logger=require('../../config/logger')(_0x0511('0x7'));var config=require(_0x0511('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x315fa3,_0x4ab067,_0x43f88e){return new BPromise(function(_0x2d9d84,_0x1afade){return client[_0x0511('0x9')](_0x315fa3,_0x43f88e)['then'](function(_0x406baa){logger[_0x0511('0xa')](_0x0511('0xb'),_0x4ab067,_0x0511('0xc'));logger[_0x0511('0xd')](_0x0511('0xe'),_0x4ab067,_0x0511('0xc'),JSON[_0x0511('0xf')](_0x406baa));if(_0x406baa['error']){if(_0x406baa['error']['code']===0x1f4){logger['error'](_0x0511('0xb'),_0x4ab067,_0x406baa['error'][_0x0511('0x10')]);return _0x1afade(_0x406baa[_0x0511('0x11')][_0x0511('0x10')]);}logger[_0x0511('0x11')]('Cdr,\x20%s,\x20%s',_0x4ab067,_0x406baa[_0x0511('0x11')][_0x0511('0x10')]);return _0x2d9d84(_0x406baa['error'][_0x0511('0x10')]);}else{logger[_0x0511('0xa')](_0x0511('0xb'),_0x4ab067,_0x0511('0xc'));_0x2d9d84(_0x406baa[_0x0511('0x12')][_0x0511('0x10')]);}})['catch'](function(_0x44f5db){logger[_0x0511('0x11')](_0x0511('0xb'),_0x4ab067,_0x44f5db);_0x1afade(_0x44f5db);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 40835e5..dfefb91 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x31659b,_0x3f07a1){var _0x48b140=function(_0x3b295c){while(--_0x3b295c){_0x31659b['push'](_0x31659b['shift']());}};_0x48b140(++_0x3f07a1);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index c5ffc73..c5709ac 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 _0x5575=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x26d252,_0x5593bc){var _0x489f95=function(_0x3d751d){while(--_0x3d751d){_0x26d252['push'](_0x26d252['shift']());}};_0x489f95(++_0x5593bc);}(_0x5575,0xd3));var _0x5557=function(_0x295103,_0x3de66d){_0x295103=_0x295103-0x0;var _0x5e6c4c=_0x5575[_0x295103];return _0x5e6c4c;};'use strict';var Sequelize=require(_0x5557('0x0'));module[_0x5557('0x1')]={'priority':{'type':Sequelize[_0x5557('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5557('0x3')],'allowNull':![],'defaultValue':_0x5557('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5557('0x3')],'defaultValue':_0x5557('0x5')}};
\ No newline at end of file
+var _0xa2a8=['STRING','TEXT','sequelize','exports','INTEGER'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xa2a8,0x89));var _0x8a2a=function(_0x5d6494,_0x1f6d6a){_0x5d6494=_0x5d6494-0x0;var _0x1bde5e=_0xa2a8[_0x5d6494];return _0x1bde5e;};'use strict';var Sequelize=require(_0x8a2a('0x0'));module[_0x8a2a('0x1')]={'priority':{'type':Sequelize[_0x8a2a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8a2a('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8a2a('0x4')]()},'description':{'type':Sequelize[_0x8a2a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 826430c..5bc1034 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 _0x6e16=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','catch','body','find','zip-dir','request-promise','bluebird','mustache','path'];(function(_0x1c0280,_0xeef5a3){var _0x45f8a0=function(_0x590d3b){while(--_0x590d3b){_0x1c0280['push'](_0x1c0280['shift']());}};_0x45f8a0(++_0xeef5a3);}(_0x6e16,0x1d3));var _0x66e1=function(_0x12c5ab,_0x5cb466){_0x12c5ab=_0x12c5ab-0x0;var _0x1248fd=_0x6e16[_0x12c5ab];return _0x1248fd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x66e1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66e1('0x1'));var moment=require('moment');var BPromise=require(_0x66e1('0x2'));var Mustache=require(_0x66e1('0x3'));var util=require('util');var path=require(_0x66e1('0x4'));var sox=require('sox');var csv=require(_0x66e1('0x5'));var ejs=require(_0x66e1('0x6'));var fs=require('fs');var fs_extra=require(_0x66e1('0x7'));var _=require('lodash');var squel=require(_0x66e1('0x8'));var crypto=require(_0x66e1('0x9'));var jsforce=require(_0x66e1('0xa'));var deskjs=require(_0x66e1('0xb'));var toCsv=require(_0x66e1('0x5'));var querystring=require(_0x66e1('0xc'));var Papa=require(_0x66e1('0xd'));var Redis=require(_0x66e1('0xe'));var authService=require(_0x66e1('0xf'));var qs=require(_0x66e1('0x10'));var as=require(_0x66e1('0x11'));var hardwareService=require(_0x66e1('0x12'));var logger=require(_0x66e1('0x13'))(_0x66e1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x66e1('0x15'));var db=require(_0x66e1('0x16'))['db'];function respondWithStatusCode(_0x23e018,_0x497712){_0x497712=_0x497712||0xcc;return function(_0x58c184){if(_0x58c184){return _0x23e018[_0x66e1('0x17')](_0x497712);}return _0x23e018['status'](_0x497712)[_0x66e1('0x18')]();};}function respondWithResult(_0x3e36ff,_0x5b802b){_0x5b802b=_0x5b802b||0xc8;return function(_0x9c17f9){if(_0x9c17f9){return _0x3e36ff[_0x66e1('0x19')](_0x5b802b)['json'](_0x9c17f9);}};}function respondWithFilteredResult(_0x137f52,_0x12ca0b){return function(_0x18e2ab){if(_0x18e2ab){var _0x3a68b3=typeof _0x12ca0b['offset']===_0x66e1('0x1a')&&typeof _0x12ca0b[_0x66e1('0x1b')]===_0x66e1('0x1a');var _0x28e236=_0x18e2ab[_0x66e1('0x1c')];var _0x4f3276=_0x3a68b3?0x0:_0x12ca0b['offset'];var _0x2b5585=_0x3a68b3?_0x18e2ab['count']:_0x12ca0b[_0x66e1('0x1d')]+_0x12ca0b[_0x66e1('0x1b')];var _0x260e87;if(_0x2b5585>=_0x28e236){_0x2b5585=_0x28e236;_0x260e87=0xc8;}else{_0x260e87=0xce;}_0x137f52[_0x66e1('0x19')](_0x260e87);return _0x137f52[_0x66e1('0x1e')]('Content-Range',_0x4f3276+'-'+_0x2b5585+'/'+_0x28e236)[_0x66e1('0x1f')](_0x18e2ab);}return null;};}function patchUpdates(_0x23c6ce){return function(_0xe2822e){try{jsonpatch[_0x66e1('0x20')](_0xe2822e,_0x23c6ce,!![]);}catch(_0x28f6cf){return BPromise[_0x66e1('0x21')](_0x28f6cf);}return _0xe2822e[_0x66e1('0x22')]();};}function saveUpdates(_0x38cf5b,_0x11232c){return function(_0x350b81){if(_0x350b81){return _0x350b81[_0x66e1('0x23')](_0x38cf5b)[_0x66e1('0x24')](function(_0x43686e){return _0x43686e;});}return null;};}function removeEntity(_0x2ea42d,_0x756840){return function(_0x11b7f0){if(_0x11b7f0){return _0x11b7f0[_0x66e1('0x25')]()['then'](function(){_0x2ea42d[_0x66e1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x203919,_0x414c30){return function(_0x181a7b){if(!_0x181a7b){_0x203919[_0x66e1('0x17')](0x194);}return _0x181a7b;};}function handleError(_0x1e0dfe,_0x4f500e){_0x4f500e=_0x4f500e||0x1f4;return function(_0x5c416d){logger[_0x66e1('0x26')](_0x5c416d[_0x66e1('0x27')]);if(_0x5c416d['name']){delete _0x5c416d[_0x66e1('0x28')];}_0x1e0dfe['status'](_0x4f500e)['send'](_0x5c416d);};}exports[_0x66e1('0x29')]=function(_0x3fcc99,_0xdd2360){var _0x2720af={'raw':!![],'where':{'id':_0x3fcc99[_0x66e1('0x2a')]['id']}},_0x218902={};_0x218902[_0x66e1('0x2b')]=_[_0x66e1('0x2c')](db[_0x66e1('0x2d')][_0x66e1('0x2e')]);_0x218902[_0x66e1('0x2f')]=_[_0x66e1('0x2c')](_0x3fcc99['query']);_0x218902[_0x66e1('0x30')]=_[_0x66e1('0x31')](_0x218902['model'],_0x218902[_0x66e1('0x2f')]);_0x2720af[_0x66e1('0x32')]=_[_0x66e1('0x31')](_0x218902[_0x66e1('0x2b')],qs['fields'](_0x3fcc99[_0x66e1('0x2f')][_0x66e1('0x33')]));_0x2720af[_0x66e1('0x32')]=_0x2720af['attributes'][_0x66e1('0x34')]?_0x2720af['attributes']:_0x218902['model'];if(_0x3fcc99['query'][_0x66e1('0x35')]){_0x2720af[_0x66e1('0x36')]=[{'all':!![]}];}_0x2720af=_['merge']({},_0x2720af,_0x3fcc99[_0x66e1('0x37')]);return db[_0x66e1('0x2d')]['find'](_0x2720af)['then'](handleEntityNotFound(_0xdd2360,null))[_0x66e1('0x24')](respondWithResult(_0xdd2360,null))[_0x66e1('0x38')](handleError(_0xdd2360,null));};exports[_0x66e1('0x23')]=function(_0x4a91b9,_0x364053){if(_0x4a91b9[_0x66e1('0x39')]['id']){delete _0x4a91b9[_0x66e1('0x39')]['id'];}return db[_0x66e1('0x2d')]['find']({'where':{'id':_0x4a91b9[_0x66e1('0x2a')]['id']}})[_0x66e1('0x24')](handleEntityNotFound(_0x364053,null))[_0x66e1('0x24')](saveUpdates(_0x4a91b9[_0x66e1('0x39')],null))[_0x66e1('0x24')](respondWithResult(_0x364053,null))[_0x66e1('0x38')](handleError(_0x364053,null));};exports[_0x66e1('0x25')]=function(_0x361f71,_0xb17802){return db[_0x66e1('0x2d')][_0x66e1('0x3a')]({'where':{'id':_0x361f71[_0x66e1('0x2a')]['id']}})[_0x66e1('0x24')](handleEntityNotFound(_0xb17802,null))[_0x66e1('0x24')](removeEntity(_0xb17802,null))[_0x66e1('0x38')](handleError(_0xb17802,null));};
\ No newline at end of file
+var _0x33d2=['fields','length','includeAll','merge','options','find','catch','body','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33d2,0x7f));var _0x233d=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0x33d2[_0x37e845];return _0x59e55b;};'use strict';var emlformat=require(_0x233d('0x0'));var rimraf=require(_0x233d('0x1'));var zipdir=require(_0x233d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x233d('0x3'));var moment=require(_0x233d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x233d('0x5'));var util=require(_0x233d('0x6'));var path=require(_0x233d('0x7'));var sox=require(_0x233d('0x8'));var csv=require(_0x233d('0x9'));var ejs=require(_0x233d('0xa'));var fs=require('fs');var fs_extra=require(_0x233d('0xb'));var _=require(_0x233d('0xc'));var squel=require('squel');var crypto=require(_0x233d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x233d('0xe'));var toCsv=require(_0x233d('0x9'));var querystring=require(_0x233d('0xf'));var Papa=require('papaparse');var Redis=require(_0x233d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x233d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x233d('0x12'));var logger=require(_0x233d('0x13'))(_0x233d('0x14'));var utils=require('../../config/utils');var config=require(_0x233d('0x15'));var licenseUtil=require(_0x233d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d36d3,_0x19f04c){_0x19f04c=_0x19f04c||0xcc;return function(_0x51c461){if(_0x51c461){return _0x2d36d3[_0x233d('0x17')](_0x19f04c);}return _0x2d36d3[_0x233d('0x18')](_0x19f04c)[_0x233d('0x19')]();};}function respondWithResult(_0x50a166,_0x36627d){_0x36627d=_0x36627d||0xc8;return function(_0x294703){if(_0x294703){return _0x50a166[_0x233d('0x18')](_0x36627d)[_0x233d('0x1a')](_0x294703);}};}function respondWithFilteredResult(_0xda6da2,_0x59b818){return function(_0xd7624c){if(_0xd7624c){var _0x552bbd=typeof _0x59b818[_0x233d('0x1b')]===_0x233d('0x1c')&&typeof _0x59b818[_0x233d('0x1d')]===_0x233d('0x1c');var _0x2b5bb0=_0xd7624c['count'];var _0x4f96c8=_0x552bbd?0x0:_0x59b818[_0x233d('0x1b')];var _0x409637=_0x552bbd?_0xd7624c[_0x233d('0x1e')]:_0x59b818[_0x233d('0x1b')]+_0x59b818[_0x233d('0x1d')];var _0x1b70da;if(_0x409637>=_0x2b5bb0){_0x409637=_0x2b5bb0;_0x1b70da=0xc8;}else{_0x1b70da=0xce;}_0xda6da2[_0x233d('0x18')](_0x1b70da);return _0xda6da2[_0x233d('0x1f')](_0x233d('0x20'),_0x4f96c8+'-'+_0x409637+'/'+_0x2b5bb0)[_0x233d('0x1a')](_0xd7624c);}return null;};}function patchUpdates(_0x3fa180){return function(_0x3ff3e3){try{jsonpatch[_0x233d('0x21')](_0x3ff3e3,_0x3fa180,!![]);}catch(_0x5aa707){return BPromise[_0x233d('0x22')](_0x5aa707);}return _0x3ff3e3[_0x233d('0x23')]();};}function saveUpdates(_0x5dd0e0,_0x12f8e8){return function(_0x19f575){if(_0x19f575){return _0x19f575[_0x233d('0x24')](_0x5dd0e0)[_0x233d('0x25')](function(_0x4f4c2a){return _0x4f4c2a;});}return null;};}function removeEntity(_0xe38aea,_0x19749f){return function(_0x3c3cba){if(_0x3c3cba){return _0x3c3cba[_0x233d('0x26')]()[_0x233d('0x25')](function(){_0xe38aea[_0x233d('0x18')](0xcc)[_0x233d('0x19')]();});}};}function handleEntityNotFound(_0x586f62,_0x517d61){return function(_0x507b5a){if(!_0x507b5a){_0x586f62['sendStatus'](0x194);}return _0x507b5a;};}function handleError(_0x24087a,_0x14cda3){_0x14cda3=_0x14cda3||0x1f4;return function(_0x1609ed){logger['error'](_0x1609ed[_0x233d('0x27')]);if(_0x1609ed[_0x233d('0x28')]){delete _0x1609ed[_0x233d('0x28')];}_0x24087a[_0x233d('0x18')](_0x14cda3)['send'](_0x1609ed);};}exports[_0x233d('0x29')]=function(_0xf10fbe,_0x3db64c){var _0x332962={'raw':!![],'where':{'id':_0xf10fbe['params']['id']}},_0x23f4a0={};_0x23f4a0['model']=_[_0x233d('0x2a')](db[_0x233d('0x2b')][_0x233d('0x2c')]);_0x23f4a0[_0x233d('0x2d')]=_[_0x233d('0x2a')](_0xf10fbe[_0x233d('0x2d')]);_0x23f4a0[_0x233d('0x2e')]=_[_0x233d('0x2f')](_0x23f4a0[_0x233d('0x30')],_0x23f4a0['query']);_0x332962[_0x233d('0x31')]=_[_0x233d('0x2f')](_0x23f4a0[_0x233d('0x30')],qs['fields'](_0xf10fbe['query'][_0x233d('0x32')]));_0x332962['attributes']=_0x332962['attributes'][_0x233d('0x33')]?_0x332962[_0x233d('0x31')]:_0x23f4a0[_0x233d('0x30')];if(_0xf10fbe[_0x233d('0x2d')][_0x233d('0x34')]){_0x332962['include']=[{'all':!![]}];}_0x332962=_[_0x233d('0x35')]({},_0x332962,_0xf10fbe[_0x233d('0x36')]);return db[_0x233d('0x2b')][_0x233d('0x37')](_0x332962)['then'](handleEntityNotFound(_0x3db64c,null))[_0x233d('0x25')](respondWithResult(_0x3db64c,null))[_0x233d('0x38')](handleError(_0x3db64c,null));};exports[_0x233d('0x24')]=function(_0xa82d72,_0x116578){if(_0xa82d72[_0x233d('0x39')]['id']){delete _0xa82d72[_0x233d('0x39')]['id'];}return db[_0x233d('0x2b')][_0x233d('0x37')]({'where':{'id':_0xa82d72[_0x233d('0x3a')]['id']}})[_0x233d('0x25')](handleEntityNotFound(_0x116578,null))[_0x233d('0x25')](saveUpdates(_0xa82d72[_0x233d('0x39')],null))[_0x233d('0x25')](respondWithResult(_0x116578,null))[_0x233d('0x38')](handleError(_0x116578,null));};exports[_0x233d('0x26')]=function(_0x573921,_0x5ec9a3){return db[_0x233d('0x2b')][_0x233d('0x37')]({'where':{'id':_0x573921[_0x233d('0x3a')]['id']}})[_0x233d('0x25')](handleEntityNotFound(_0x5ec9a3,null))[_0x233d('0x25')](removeEntity(_0x5ec9a3,null))[_0x233d('0x38')](handleError(_0x5ec9a3,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index b6ffef7..93d7290 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 _0xad86=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xad86,0x194));var _0x6ad8=function(_0x41c2ee,_0x17f698){_0x41c2ee=_0x41c2ee-0x0;var _0x539d23=_0xad86[_0x41c2ee];return _0x539d23;};'use strict';var _=require(_0x6ad8('0x0'));var util=require(_0x6ad8('0x1'));var logger=require(_0x6ad8('0x2'))(_0x6ad8('0x3'));var moment=require(_0x6ad8('0x4'));var BPromise=require(_0x6ad8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6ad8('0x6'));var config=require(_0x6ad8('0x7'));var attributes=require(_0x6ad8('0x8'));module[_0x6ad8('0x9')]=function(_0x59fb87,_0x4d498c){return _0x59fb87[_0x6ad8('0xa')](_0x6ad8('0xb'),attributes,{'tableName':_0x6ad8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ad8('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x901c=['exports','define','ChatApplication','chat_applications','utf8mb4','lodash','../../config/logger','moment','bluebird','path','rimraf','./chatApplication.attributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x901c,0x119));var _0xc901=function(_0x336af7,_0x198a11){_0x336af7=_0x336af7-0x0;var _0x29469a=_0x901c[_0x336af7];return _0x29469a;};'use strict';var _=require(_0xc901('0x0'));var util=require('util');var logger=require(_0xc901('0x1'))('api');var moment=require(_0xc901('0x2'));var BPromise=require(_0xc901('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc901('0x4'));var rimraf=require(_0xc901('0x5'));var config=require('../../config/environment');var attributes=require(_0xc901('0x6'));module[_0xc901('0x7')]=function(_0x29e64d,_0x5cad1b){return _0x29e64d[_0xc901('0x8')](_0xc901('0x9'),attributes,{'tableName':_0xc901('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc901('0xb'),'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 1da67c3..28cafd1 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 _0x603d=['../../config/environment','jayson/promise','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x603d,0x92));var _0xd603=function(_0x442ab2,_0x2f1fbb){_0x442ab2=_0x442ab2-0x0;var _0x24f5de=_0x603d[_0x442ab2];return _0x24f5de;};'use strict';var _=require(_0xd603('0x0'));var util=require(_0xd603('0x1'));var moment=require(_0xd603('0x2'));var BPromise=require('bluebird');var rs=require(_0xd603('0x3'));var fs=require('fs');var Redis=require(_0xd603('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd603('0x5'));var logger=require(_0xd603('0x6'))(_0xd603('0x7'));var config=require(_0xd603('0x8'));var jayson=require(_0xd603('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c5774,_0x450cbd,_0x321b8d){return new BPromise(function(_0x2f0de5,_0x2c6ef0){return client[_0xd603('0xa')](_0x2c5774,_0x321b8d)[_0xd603('0xb')](function(_0x11b4e7){logger['info'](_0xd603('0xc'),_0x450cbd,_0xd603('0xd'));logger[_0xd603('0xe')](_0xd603('0xf'),_0x450cbd,_0xd603('0xd'),JSON[_0xd603('0x10')](_0x11b4e7));if(_0x11b4e7[_0xd603('0x11')]){if(_0x11b4e7[_0xd603('0x11')]['code']===0x1f4){logger[_0xd603('0x11')]('ChatApplication,\x20%s,\x20%s',_0x450cbd,_0x11b4e7[_0xd603('0x11')][_0xd603('0x12')]);return _0x2c6ef0(_0x11b4e7[_0xd603('0x11')]['message']);}logger[_0xd603('0x11')](_0xd603('0xc'),_0x450cbd,_0x11b4e7[_0xd603('0x11')][_0xd603('0x12')]);return _0x2f0de5(_0x11b4e7['error'][_0xd603('0x12')]);}else{logger[_0xd603('0x13')](_0xd603('0xc'),_0x450cbd,_0xd603('0xd'));_0x2f0de5(_0x11b4e7[_0xd603('0x14')][_0xd603('0x12')]);}})[_0xd603('0x15')](function(_0x178f4d){logger['error'](_0xd603('0xc'),_0x450cbd,_0x178f4d);_0x2c6ef0(_0x178f4d);});});}
\ No newline at end of file
+var _0x59cf=['request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x59cf,0x12c));var _0xf59c=function(_0x4bd67a,_0x4f9725){_0x4bd67a=_0x4bd67a-0x0;var _0x2be5fb=_0x59cf[_0x4bd67a];return _0x2be5fb;};'use strict';var _=require(_0xf59c('0x0'));var util=require(_0xf59c('0x1'));var moment=require('moment');var BPromise=require(_0xf59c('0x2'));var rs=require(_0xf59c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf59c('0x4'))['db'];var utils=require(_0xf59c('0x5'));var logger=require('../../config/logger')(_0xf59c('0x6'));var config=require(_0xf59c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf59c('0x8')][_0xf59c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cfa4d,_0x26e042,_0x44587a){return new BPromise(function(_0x38f546,_0x227094){return client[_0xf59c('0xa')](_0x2cfa4d,_0x44587a)[_0xf59c('0xb')](function(_0x2417f9){logger[_0xf59c('0xc')](_0xf59c('0xd'),_0x26e042,'request\x20sent');logger['debug'](_0xf59c('0xe'),_0x26e042,_0xf59c('0xf'),JSON['stringify'](_0x2417f9));if(_0x2417f9['error']){if(_0x2417f9[_0xf59c('0x10')][_0xf59c('0x11')]===0x1f4){logger[_0xf59c('0x10')](_0xf59c('0xd'),_0x26e042,_0x2417f9[_0xf59c('0x10')][_0xf59c('0x12')]);return _0x227094(_0x2417f9[_0xf59c('0x10')]['message']);}logger[_0xf59c('0x10')](_0xf59c('0xd'),_0x26e042,_0x2417f9[_0xf59c('0x10')][_0xf59c('0x12')]);return _0x38f546(_0x2417f9[_0xf59c('0x10')][_0xf59c('0x12')]);}else{logger[_0xf59c('0xc')](_0xf59c('0xd'),_0x26e042,_0xf59c('0xf'));_0x38f546(_0x2417f9[_0xf59c('0x13')]['message']);}})[_0xf59c('0x14')](function(_0x4caa83){logger[_0xf59c('0x10')](_0xf59c('0xd'),_0x26e042,_0x4caa83);_0x227094(_0x4caa83);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 3fb4742..9b5ac0b 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 _0xd78e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','put','update','delete','/:id','exports','util','path'];(function(_0x1aab74,_0x38a57b){var _0x396af2=function(_0x1c2e0d){while(--_0x1c2e0d){_0x1aab74['push'](_0x1aab74['shift']());}};_0x396af2(++_0x38a57b);}(_0xd78e,0xce));var _0xed78=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xd78e[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require('multer');var util=require(_0xed78('0x0'));var path=require(_0xed78('0x1'));var timeout=require(_0xed78('0x2'));var express=require(_0xed78('0x3'));var router=express[_0xed78('0x4')]();var fs_extra=require(_0xed78('0x5'));var auth=require(_0xed78('0x6'));var interaction=require(_0xed78('0x7'));var config=require(_0xed78('0x8'));var controller=require(_0xed78('0x9'));router['get']('/:id',auth[_0xed78('0xa')](),controller['show']);router[_0xed78('0xb')]('/:id',auth[_0xed78('0xa')](),controller[_0xed78('0xc')]);router[_0xed78('0xd')](_0xed78('0xe'),auth[_0xed78('0xa')](),controller['destroy']);module[_0xed78('0xf')]=router;
\ No newline at end of file
+var _0xf8e5=['isAuthenticated','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id'];(function(_0x3305b5,_0x50a1a8){var _0x41fea1=function(_0x3c1fa5){while(--_0x3c1fa5){_0x3305b5['push'](_0x3305b5['shift']());}};_0x41fea1(++_0x50a1a8);}(_0xf8e5,0x170));var _0x5f8e=function(_0x441eda,_0x5af144){_0x441eda=_0x441eda-0x0;var _0x47f045=_0xf8e5[_0x441eda];return _0x47f045;};'use strict';var multer=require(_0x5f8e('0x0'));var util=require(_0x5f8e('0x1'));var path=require(_0x5f8e('0x2'));var timeout=require('connect-timeout');var express=require(_0x5f8e('0x3'));var router=express['Router']();var fs_extra=require(_0x5f8e('0x4'));var auth=require(_0x5f8e('0x5'));var interaction=require(_0x5f8e('0x6'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x5f8e('0x7')](_0x5f8e('0x8'),auth[_0x5f8e('0x9')](),controller['show']);router['put'](_0x5f8e('0x8'),auth['isAuthenticated'](),controller[_0x5f8e('0xa')]);router[_0x5f8e('0xb')]('/:id',auth[_0x5f8e('0x9')](),controller['destroy']);module[_0x5f8e('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index cf2967f..d8194cc 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 _0xcd03=['STRING','BOOLEAN','sequelize'];(function(_0x302b5f,_0x394748){var _0x2ffb2b=function(_0xdc024e){while(--_0xdc024e){_0x302b5f['push'](_0x302b5f['shift']());}};_0x2ffb2b(++_0x394748);}(_0xcd03,0x14f));var _0x3cd0=function(_0xdf0c09,_0x8fbdd5){_0xdf0c09=_0xdf0c09-0x0;var _0x48f3c6=_0xcd03[_0xdf0c09];return _0x48f3c6;};'use strict';var Sequelize=require(_0x3cd0('0x0'));module['exports']={'name':{'type':Sequelize[_0x3cd0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x3cd0('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x41ec=['STRING','BOOLEAN','exports'];(function(_0x2f384e,_0x237f8b){var _0x56f0dd=function(_0x5087ff){while(--_0x5087ff){_0x2f384e['push'](_0x2f384e['shift']());}};_0x56f0dd(++_0x237f8b);}(_0x41ec,0x143));var _0xc41e=function(_0x14d800,_0x4a67bb){_0x14d800=_0x14d800-0x0;var _0x4e5d3a=_0x41ec[_0x14d800];return _0x4e5d3a;};'use strict';var Sequelize=require('sequelize');module[_0xc41e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xc41e('0x1')]},'write':{'type':Sequelize[_0xc41e('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 7b1cc9c..4038a98 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 _0x654c=['where','filters','merge','filter','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','addMembers','ids','findOne','User','pick','getMembers','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x49f19e,_0x1c3aa3){var _0x280b5a=function(_0x277203){while(--_0x277203){_0x49f19e['push'](_0x49f19e['shift']());}};_0x280b5a(++_0x1c3aa3);}(_0x654c,0x1f3));var _0xc654=function(_0x18010c,_0x7352e3){_0x18010c=_0x18010c-0x0;var _0x237628=_0x654c[_0x18010c];return _0x237628;};'use strict';var emlformat=require(_0xc654('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc654('0x1'));var moment=require(_0xc654('0x2'));var BPromise=require(_0xc654('0x3'));var Mustache=require(_0xc654('0x4'));var util=require(_0xc654('0x5'));var path=require(_0xc654('0x6'));var sox=require(_0xc654('0x7'));var csv=require(_0xc654('0x8'));var ejs=require(_0xc654('0x9'));var fs=require('fs');var fs_extra=require(_0xc654('0xa'));var _=require(_0xc654('0xb'));var squel=require(_0xc654('0xc'));var crypto=require(_0xc654('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc654('0xe'));var toCsv=require(_0xc654('0x8'));var querystring=require('querystring');var Papa=require(_0xc654('0xf'));var Redis=require(_0xc654('0x10'));var authService=require(_0xc654('0x11'));var qs=require(_0xc654('0x12'));var as=require(_0xc654('0x13'));var hardwareService=require(_0xc654('0x14'));var logger=require(_0xc654('0x15'))(_0xc654('0x16'));var utils=require(_0xc654('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc654('0x18'))['db'];config['redis']=_['defaults'](config[_0xc654('0x19')],{'host':_0xc654('0x1a'),'port':0x18eb});var socket=require(_0xc654('0x1b'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x5ed23f,_0x2deedc){_0x2deedc=_0x2deedc||0xcc;return function(_0x4113af){if(_0x4113af){return _0x5ed23f[_0xc654('0x1c')](_0x2deedc);}return _0x5ed23f[_0xc654('0x1d')](_0x2deedc)[_0xc654('0x1e')]();};}function respondWithResult(_0x44b582,_0x14bd47){_0x14bd47=_0x14bd47||0xc8;return function(_0x2a2ef2){if(_0x2a2ef2){return _0x44b582[_0xc654('0x1d')](_0x14bd47)[_0xc654('0x1f')](_0x2a2ef2);}};}function respondWithFilteredResult(_0x21e40e,_0x49475c){return function(_0x5a2012){if(_0x5a2012){var _0x4be672=typeof _0x49475c[_0xc654('0x20')]===_0xc654('0x21')&&typeof _0x49475c[_0xc654('0x22')]==='undefined';var _0xe167b6=_0x5a2012[_0xc654('0x23')];var _0x3c5d2d=_0x4be672?0x0:_0x49475c['offset'];var _0x3fb6a8=_0x4be672?_0x5a2012[_0xc654('0x23')]:_0x49475c[_0xc654('0x20')]+_0x49475c[_0xc654('0x22')];var _0xc16cdc;if(_0x3fb6a8>=_0xe167b6){_0x3fb6a8=_0xe167b6;_0xc16cdc=0xc8;}else{_0xc16cdc=0xce;}_0x21e40e[_0xc654('0x1d')](_0xc16cdc);return _0x21e40e[_0xc654('0x24')](_0xc654('0x25'),_0x3c5d2d+'-'+_0x3fb6a8+'/'+_0xe167b6)[_0xc654('0x1f')](_0x5a2012);}return null;};}function patchUpdates(_0x29610e){return function(_0x2f58d4){try{jsonpatch[_0xc654('0x26')](_0x2f58d4,_0x29610e,!![]);}catch(_0xef3517){return BPromise[_0xc654('0x27')](_0xef3517);}return _0x2f58d4['save']();};}function saveUpdates(_0x119cda,_0x40c37e){return function(_0x133669){if(_0x133669){return _0x133669[_0xc654('0x28')](_0x119cda)[_0xc654('0x29')](function(_0x317fa4){return _0x317fa4;});}return null;};}function removeEntity(_0x2176fd,_0x21817a){return function(_0xe5a328){if(_0xe5a328){return _0xe5a328[_0xc654('0x2a')]()[_0xc654('0x29')](function(){_0x2176fd[_0xc654('0x1d')](0xcc)[_0xc654('0x1e')]();});}};}function handleEntityNotFound(_0x3c3fde,_0x20f235){return function(_0xdcbde3){if(!_0xdcbde3){_0x3c3fde[_0xc654('0x1c')](0x194);}return _0xdcbde3;};}function handleError(_0x4a08d2,_0x111616){_0x111616=_0x111616||0x1f4;return function(_0x26cac0){logger[_0xc654('0x2b')](_0x26cac0[_0xc654('0x2c')]);if(_0x26cac0[_0xc654('0x2d')]){delete _0x26cac0[_0xc654('0x2d')];}_0x4a08d2[_0xc654('0x1d')](_0x111616)[_0xc654('0x2e')](_0x26cac0);};}exports[_0xc654('0x2f')]=function(_0x440504,_0x547df1){var _0x55680e={},_0x102c01={},_0x40e233={'count':0x0,'rows':[]};var _0x3e4921=_[_0xc654('0x30')](db[_0xc654('0x31')][_0xc654('0x32')],function(_0x38d409){return{'name':_0x38d409[_0xc654('0x33')],'type':_0x38d409[_0xc654('0x34')][_0xc654('0x35')]};});_0x102c01['model']=_[_0xc654('0x30')](_0x3e4921,'name');_0x102c01[_0xc654('0x36')]=_[_0xc654('0x37')](_0x440504[_0xc654('0x36')]);_0x102c01['filters']=_[_0xc654('0x38')](_0x102c01[_0xc654('0x39')],_0x102c01['query']);_0x55680e['attributes']=_[_0xc654('0x38')](_0x102c01[_0xc654('0x39')],qs['fields'](_0x440504[_0xc654('0x36')][_0xc654('0x3a')]));_0x55680e[_0xc654('0x3b')]=_0x55680e[_0xc654('0x3b')][_0xc654('0x3c')]?_0x55680e['attributes']:_0x102c01[_0xc654('0x39')];if(!_0x440504['query'][_0xc654('0x3d')](_0xc654('0x3e'))){_0x55680e['limit']=qs[_0xc654('0x22')](_0x440504['query'][_0xc654('0x22')]);_0x55680e[_0xc654('0x20')]=qs[_0xc654('0x20')](_0x440504[_0xc654('0x36')][_0xc654('0x20')]);}_0x55680e[_0xc654('0x3f')]=qs['sort'](_0x440504[_0xc654('0x36')][_0xc654('0x40')]);_0x55680e[_0xc654('0x41')]=qs[_0xc654('0x42')](_['pick'](_0x440504['query'],_0x102c01['filters']),_0x3e4921);if(_0x440504['query']['filter']){_0x55680e[_0xc654('0x41')]=_[_0xc654('0x43')](_0x55680e[_0xc654('0x41')],{'$or':_[_0xc654('0x30')](_0x3e4921,function(_0x1d711e){if(_0x1d711e[_0xc654('0x34')]!=='VIRTUAL'){var _0x506753={};_0x506753[_0x1d711e[_0xc654('0x2d')]]={'$like':'%'+_0x440504[_0xc654('0x36')][_0xc654('0x44')]+'%'};return _0x506753;}})});}_0x55680e=_[_0xc654('0x43')]({},_0x55680e,_0x440504[_0xc654('0x45')]);var _0x2b50b9={'where':_0x55680e['where']};return db[_0xc654('0x31')]['count'](_0x2b50b9)[_0xc654('0x29')](function(_0x19be0f){_0x40e233[_0xc654('0x23')]=_0x19be0f;if(_0x440504[_0xc654('0x36')]['includeAll']){_0x55680e['include']=[{'all':!![]}];}return db[_0xc654('0x31')][_0xc654('0x46')](_0x55680e);})[_0xc654('0x29')](function(_0xfd2168){_0x40e233[_0xc654('0x47')]=_0xfd2168;return _0x40e233;})[_0xc654('0x29')](respondWithFilteredResult(_0x547df1,_0x55680e))[_0xc654('0x48')](handleError(_0x547df1,null));};exports[_0xc654('0x49')]=function(_0x3d231d,_0x5b3e10){var _0x5bed86={'raw':!![],'where':{'id':_0x3d231d[_0xc654('0x4a')]['id']}},_0x18231c={};_0x18231c['model']=_[_0xc654('0x37')](db[_0xc654('0x31')][_0xc654('0x32')]);_0x18231c[_0xc654('0x36')]=_[_0xc654('0x37')](_0x3d231d['query']);_0x18231c[_0xc654('0x42')]=_[_0xc654('0x38')](_0x18231c[_0xc654('0x39')],_0x18231c['query']);_0x5bed86['attributes']=_[_0xc654('0x38')](_0x18231c['model'],qs[_0xc654('0x3a')](_0x3d231d[_0xc654('0x36')][_0xc654('0x3a')]));_0x5bed86['attributes']=_0x5bed86[_0xc654('0x3b')][_0xc654('0x3c')]?_0x5bed86[_0xc654('0x3b')]:_0x18231c[_0xc654('0x39')];if(_0x3d231d[_0xc654('0x36')][_0xc654('0x4b')]){_0x5bed86[_0xc654('0x4c')]=[{'all':!![]}];}_0x5bed86=_[_0xc654('0x43')]({},_0x5bed86,_0x3d231d['options']);return db[_0xc654('0x31')][_0xc654('0x4d')](_0x5bed86)['then'](handleEntityNotFound(_0x5b3e10,null))[_0xc654('0x29')](respondWithResult(_0x5b3e10,null))[_0xc654('0x48')](handleError(_0x5b3e10,null));};exports[_0xc654('0x4e')]=function(_0x572d59,_0x4be449){return db[_0xc654('0x31')][_0xc654('0x4e')](_0x572d59[_0xc654('0x4f')],{})[_0xc654('0x29')](respondWithResult(_0x4be449,0xc9))[_0xc654('0x48')](handleError(_0x4be449,null));};exports['update']=function(_0x4af9ab,_0x5972c6){if(_0x4af9ab[_0xc654('0x4f')]['id']){delete _0x4af9ab[_0xc654('0x4f')]['id'];}return db[_0xc654('0x31')]['find']({'where':{'id':_0x4af9ab['params']['id']}})['then'](handleEntityNotFound(_0x5972c6,null))[_0xc654('0x29')](saveUpdates(_0x4af9ab[_0xc654('0x4f')],null))[_0xc654('0x29')](respondWithResult(_0x5972c6,null))[_0xc654('0x48')](handleError(_0x5972c6,null));};exports[_0xc654('0x2a')]=function(_0x5abd01,_0x5142d5){return db[_0xc654('0x31')][_0xc654('0x4d')]({'where':{'id':_0x5abd01['params']['id']}})[_0xc654('0x29')](handleEntityNotFound(_0x5142d5,null))[_0xc654('0x29')](removeEntity(_0x5142d5,null))[_0xc654('0x48')](handleError(_0x5142d5,null));};exports[_0xc654('0x50')]=function(_0x4f02bf,_0x248610){return db[_0xc654('0x31')][_0xc654('0x50')]()[_0xc654('0x29')](respondWithResult(_0x248610,null))[_0xc654('0x48')](handleError(_0x248610,null));};exports['getUnread']=function(_0x12d7e7,_0x4e3499,_0x347013){return db['ChatInternalMessage'][_0xc654('0x23')]({'where':{'ChatGroupId':_0x12d7e7[_0xc654('0x4a')]['id'],'ToId':_0x12d7e7['user']['id'],'read':![]}})[_0xc654('0x29')](function(_0x306ce4){return{'id':_['toInteger'](_0x12d7e7[_0xc654('0x4a')]['id']),'count':_0x306ce4};})[_0xc654('0x29')](respondWithResult(_0x4e3499,null))[_0xc654('0x48')](handleError(_0x4e3499,null));};exports[_0xc654('0x51')]=function(_0x4ce9a5,_0xe0aa77,_0x36e954){return db['ChatGroup'][_0xc654('0x4d')]({'where':{'id':_0x4ce9a5[_0xc654('0x4a')]['id']}})[_0xc654('0x29')](handleEntityNotFound(_0xe0aa77,null))[_0xc654('0x29')](function(_0x326842){if(_0x326842){return _0x326842[_0xc654('0x51')](_0x4ce9a5['body'][_0xc654('0x52')],_['omit'](_0x4ce9a5['body'],['ids','id'])||{});}})[_0xc654('0x29')](respondWithResult(_0xe0aa77,null))[_0xc654('0x48')](handleError(_0xe0aa77,null));};exports['getMembers']=function(_0xc01edf,_0x4b8c97,_0x41186b){var _0x235d50={};var _0x3ae335={};var _0x140882;var _0x545ac9;return db['ChatGroup'][_0xc654('0x53')]({'where':{'id':_0xc01edf[_0xc654('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b8c97,null))['then'](function(_0x35fd6c){if(_0x35fd6c){_0x140882=_0x35fd6c;_0x3ae335['model']=_[_0xc654('0x37')](db[_0xc654('0x54')][_0xc654('0x32')]);_0x3ae335[_0xc654('0x36')]=_[_0xc654('0x37')](_0xc01edf[_0xc654('0x36')]);_0x3ae335[_0xc654('0x42')]=_['intersection'](_0x3ae335[_0xc654('0x39')],_0x3ae335[_0xc654('0x36')]);_0x235d50['attributes']=_[_0xc654('0x38')](_0x3ae335[_0xc654('0x39')],qs[_0xc654('0x3a')](_0xc01edf[_0xc654('0x36')][_0xc654('0x3a')]));_0x235d50[_0xc654('0x3b')]=_0x235d50['attributes']['length']?_0x235d50[_0xc654('0x3b')]:_0x3ae335[_0xc654('0x39')];_0x235d50[_0xc654('0x3f')]=qs[_0xc654('0x40')](_0xc01edf[_0xc654('0x36')][_0xc654('0x40')]);_0x235d50[_0xc654('0x41')]=qs[_0xc654('0x42')](_[_0xc654('0x55')](_0xc01edf[_0xc654('0x36')],_0x3ae335['filters']));if(_0xc01edf[_0xc654('0x36')][_0xc654('0x44')]){_0x235d50[_0xc654('0x41')]=_[_0xc654('0x43')](_0x235d50[_0xc654('0x41')],{'$or':_[_0xc654('0x30')](_0x235d50[_0xc654('0x3b')],function(_0x3e771a){var _0x2740f2={};_0x2740f2[_0x3e771a]={'$like':'%'+_0xc01edf['query'][_0xc654('0x44')]+'%'};return _0x2740f2;})});}_0x235d50=_[_0xc654('0x43')]({},_0x235d50,_0xc01edf[_0xc654('0x45')]);return _0x140882[_0xc654('0x56')](_0x235d50);}})['then'](function(_0x18b552){if(_0x18b552){_0x545ac9=_0x18b552['length'];if(!_0xc01edf['query'][_0xc654('0x3d')](_0xc654('0x3e'))){_0x235d50[_0xc654('0x22')]=qs['limit'](_0xc01edf['query'][_0xc654('0x22')]);_0x235d50[_0xc654('0x20')]=qs[_0xc654('0x20')](_0xc01edf[_0xc654('0x36')]['offset']);}return _0x140882[_0xc654('0x56')](_0x235d50);}})[_0xc654('0x29')](function(_0x798a6b){if(_0x798a6b){return _0x798a6b?{'count':_0x545ac9,'rows':_0x798a6b}:null;}})[_0xc654('0x29')](respondWithResult(_0x4b8c97,null))[_0xc654('0x48')](handleError(_0x4b8c97,null));};exports['removeMembers']=function(_0x141e53,_0x5ce5fc,_0x1cadd2){return db[_0xc654('0x31')][_0xc654('0x4d')]({'where':{'id':_0x141e53['params']['id']}})[_0xc654('0x29')](handleEntityNotFound(_0x5ce5fc,null))['then'](function(_0x452cef){if(_0x452cef){return _0x452cef[_0xc654('0x57')](_0x141e53['query'][_0xc654('0x52')]);}})[_0xc654('0x29')](respondWithStatusCode(_0x5ce5fc,null))['catch'](handleError(_0x5ce5fc,null));};exports[_0xc654('0x58')]=function(_0x4b1ded,_0x1887f0,_0x1edff4){if(_0x4b1ded[_0xc654('0x4f')]['id']){delete _0x4b1ded[_0xc654('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x4b1ded[_0xc654('0x4a')]['id']}})[_0xc654('0x29')](handleEntityNotFound(_0x1887f0,null))['then'](function(_0x177561){if(_0x177561){_0x4b1ded[_0xc654('0x4f')]['ChatGroupId']=_0x177561['id'];return db[_0xc654('0x59')]['create'](_0x4b1ded['body']);}})[_0xc654('0x29')](respondWithResult(_0x1887f0,null))['catch'](handleError(_0x1887f0,null));};exports[_0xc654('0x5a')]=function(_0x55453b,_0x5522c3,_0x25a28f){var _0x3b0c54={};var _0x58cb9a={};var _0x5680c8;var _0x1e3723;return db['ChatGroup'][_0xc654('0x53')]({'where':{'id':_0x55453b['params']['id']}})[_0xc654('0x29')](handleEntityNotFound(_0x5522c3,null))[_0xc654('0x29')](function(_0x263df3){if(_0x263df3){_0x5680c8=_0x263df3;_0x58cb9a['model']=_[_0xc654('0x37')](db['ChatInternalMessage']['rawAttributes']);_0x58cb9a[_0xc654('0x36')]=_[_0xc654('0x37')](_0x55453b[_0xc654('0x36')]);_0x58cb9a[_0xc654('0x42')]=_[_0xc654('0x38')](_0x58cb9a[_0xc654('0x39')],_0x58cb9a['query']);_0x3b0c54['attributes']=_['intersection'](_0x58cb9a[_0xc654('0x39')],qs[_0xc654('0x3a')](_0x55453b[_0xc654('0x36')]['fields']));_0x3b0c54[_0xc654('0x3b')]=_0x3b0c54[_0xc654('0x3b')][_0xc654('0x3c')]?_0x3b0c54[_0xc654('0x3b')]:_0x58cb9a[_0xc654('0x39')];_0x3b0c54[_0xc654('0x3f')]=qs[_0xc654('0x40')](_0x55453b['query'][_0xc654('0x40')]);_0x3b0c54[_0xc654('0x41')]=qs[_0xc654('0x42')](_['pick'](_0x55453b[_0xc654('0x36')],_0x58cb9a[_0xc654('0x42')]));if(_0x55453b['query'][_0xc654('0x44')]){_0x3b0c54[_0xc654('0x41')]=_[_0xc654('0x43')](_0x3b0c54[_0xc654('0x41')],{'$or':_[_0xc654('0x30')](_0x3b0c54[_0xc654('0x3b')],function(_0x2a6308){var _0x211ab7={};_0x211ab7[_0x2a6308]={'$like':'%'+_0x55453b[_0xc654('0x36')][_0xc654('0x44')]+'%'};return _0x211ab7;})});}if(_0x55453b[_0xc654('0x36')][_0xc654('0x5b')]){var _0x229f41=_0x55453b[_0xc654('0x36')][_0xc654('0x5b')][_0xc654('0x5c')](',');var _0x5a2884={};_0x5a2884[_0x229f41[0x0]]={'$gte':moment(_0x229f41[0x1])['format'](_0xc654('0x5d'))};_0x3b0c54[_0xc654('0x41')]=_[_0xc654('0x43')](_0x3b0c54[_0xc654('0x41')],_0x5a2884);}_0x3b0c54=_[_0xc654('0x43')]({},_0x3b0c54,_0x55453b['options']);return _0x5680c8[_0xc654('0x5a')](_0x3b0c54);}})[_0xc654('0x29')](function(_0x4e0dfd){if(_0x4e0dfd){_0x1e3723=_0x4e0dfd[_0xc654('0x3c')];if(!_0x55453b['query'][_0xc654('0x3d')](_0xc654('0x3e'))){_0x3b0c54[_0xc654('0x22')]=qs[_0xc654('0x22')](_0x55453b['query']['limit']);_0x3b0c54['offset']=qs[_0xc654('0x20')](_0x55453b[_0xc654('0x36')][_0xc654('0x20')]);}return _0x5680c8[_0xc654('0x5a')](_0x3b0c54);}})[_0xc654('0x29')](function(_0x42aa39){if(_0x42aa39){return _0x42aa39?{'count':_0x1e3723,'rows':_0x42aa39}:null;}})[_0xc654('0x29')](respondWithResult(_0x5522c3,null))['catch'](handleError(_0x5522c3,null));};
\ No newline at end of file
+var _0xa826=['User','getMembers','nolimit','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','ChatGroup','includeAll','findAll','rows','catch','include','find','create','body','params','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','findOne'];(function(_0x5b88c4,_0x4dd8a2){var _0x1a5de0=function(_0x40b3cf){while(--_0x40b3cf){_0x5b88c4['push'](_0x5b88c4['shift']());}};_0x1a5de0(++_0x4dd8a2);}(_0xa826,0x6a));var _0x6a82=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa826[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x6a82('0x0'));var rimraf=require(_0x6a82('0x1'));var zipdir=require(_0x6a82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a82('0x3'));var moment=require(_0x6a82('0x4'));var BPromise=require(_0x6a82('0x5'));var Mustache=require(_0x6a82('0x6'));var util=require(_0x6a82('0x7'));var path=require('path');var sox=require(_0x6a82('0x8'));var csv=require('to-csv');var ejs=require(_0x6a82('0x9'));var fs=require('fs');var fs_extra=require(_0x6a82('0xa'));var _=require(_0x6a82('0xb'));var squel=require(_0x6a82('0xc'));var crypto=require(_0x6a82('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6a82('0xe'));var authService=require(_0x6a82('0xf'));var qs=require(_0x6a82('0x10'));var as=require(_0x6a82('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a82('0x12'))(_0x6a82('0x13'));var utils=require(_0x6a82('0x14'));var config=require(_0x6a82('0x15'));var licenseUtil=require(_0x6a82('0x16'));var db=require(_0x6a82('0x17'))['db'];config[_0x6a82('0x18')]=_[_0x6a82('0x19')](config[_0x6a82('0x18')],{'host':_0x6a82('0x1a'),'port':0x18eb});var socket=require(_0x6a82('0x1b'))(new Redis(config[_0x6a82('0x18')]));require(_0x6a82('0x1c'))[_0x6a82('0x1d')](socket);function respondWithStatusCode(_0x37b0ad,_0x3007bf){_0x3007bf=_0x3007bf||0xcc;return function(_0x731fcc){if(_0x731fcc){return _0x37b0ad[_0x6a82('0x1e')](_0x3007bf);}return _0x37b0ad[_0x6a82('0x1f')](_0x3007bf)[_0x6a82('0x20')]();};}function respondWithResult(_0x18c2a6,_0x5d09a5){_0x5d09a5=_0x5d09a5||0xc8;return function(_0x102fb7){if(_0x102fb7){return _0x18c2a6[_0x6a82('0x1f')](_0x5d09a5)['json'](_0x102fb7);}};}function respondWithFilteredResult(_0x224aa3,_0x35fb25){return function(_0x6fc7fc){if(_0x6fc7fc){var _0x2c6a20=typeof _0x35fb25[_0x6a82('0x21')]===_0x6a82('0x22')&&typeof _0x35fb25['limit']==='undefined';var _0x341490=_0x6fc7fc[_0x6a82('0x23')];var _0x2c303f=_0x2c6a20?0x0:_0x35fb25['offset'];var _0x587649=_0x2c6a20?_0x6fc7fc[_0x6a82('0x23')]:_0x35fb25[_0x6a82('0x21')]+_0x35fb25[_0x6a82('0x24')];var _0x4e2ddd;if(_0x587649>=_0x341490){_0x587649=_0x341490;_0x4e2ddd=0xc8;}else{_0x4e2ddd=0xce;}_0x224aa3['status'](_0x4e2ddd);return _0x224aa3['set'](_0x6a82('0x25'),_0x2c303f+'-'+_0x587649+'/'+_0x341490)[_0x6a82('0x26')](_0x6fc7fc);}return null;};}function patchUpdates(_0x17e96e){return function(_0x331d9e){try{jsonpatch['apply'](_0x331d9e,_0x17e96e,!![]);}catch(_0x22fe7f){return BPromise['reject'](_0x22fe7f);}return _0x331d9e[_0x6a82('0x27')]();};}function saveUpdates(_0x900645,_0x3964e4){return function(_0x356e61){if(_0x356e61){return _0x356e61[_0x6a82('0x28')](_0x900645)[_0x6a82('0x29')](function(_0x4710ce){return _0x4710ce;});}return null;};}function removeEntity(_0x4a874f,_0x15f0a5){return function(_0x3a7424){if(_0x3a7424){return _0x3a7424['destroy']()[_0x6a82('0x29')](function(){_0x4a874f[_0x6a82('0x1f')](0xcc)[_0x6a82('0x20')]();});}};}function handleEntityNotFound(_0x37a211,_0x1b1d3f){return function(_0x955a04){if(!_0x955a04){_0x37a211[_0x6a82('0x1e')](0x194);}return _0x955a04;};}function handleError(_0x435776,_0x177f18){_0x177f18=_0x177f18||0x1f4;return function(_0x255b18){logger['error'](_0x255b18[_0x6a82('0x2a')]);if(_0x255b18[_0x6a82('0x2b')]){delete _0x255b18[_0x6a82('0x2b')];}_0x435776[_0x6a82('0x1f')](_0x177f18)[_0x6a82('0x2c')](_0x255b18);};}exports[_0x6a82('0x2d')]=function(_0x25111b,_0x329f8c){var _0x3c3270={},_0x3c9ce6={},_0x25c30c={'count':0x0,'rows':[]};var _0xf35037=_[_0x6a82('0x2e')](db['ChatGroup'][_0x6a82('0x2f')],function(_0x2f06ef){return{'name':_0x2f06ef[_0x6a82('0x30')],'type':_0x2f06ef[_0x6a82('0x31')][_0x6a82('0x32')]};});_0x3c9ce6[_0x6a82('0x33')]=_[_0x6a82('0x2e')](_0xf35037,'name');_0x3c9ce6['query']=_[_0x6a82('0x34')](_0x25111b[_0x6a82('0x35')]);_0x3c9ce6[_0x6a82('0x36')]=_[_0x6a82('0x37')](_0x3c9ce6[_0x6a82('0x33')],_0x3c9ce6[_0x6a82('0x35')]);_0x3c3270[_0x6a82('0x38')]=_['intersection'](_0x3c9ce6[_0x6a82('0x33')],qs[_0x6a82('0x39')](_0x25111b[_0x6a82('0x35')][_0x6a82('0x39')]));_0x3c3270[_0x6a82('0x38')]=_0x3c3270[_0x6a82('0x38')][_0x6a82('0x3a')]?_0x3c3270[_0x6a82('0x38')]:_0x3c9ce6[_0x6a82('0x33')];if(!_0x25111b[_0x6a82('0x35')][_0x6a82('0x3b')]('nolimit')){_0x3c3270[_0x6a82('0x24')]=qs['limit'](_0x25111b['query'][_0x6a82('0x24')]);_0x3c3270['offset']=qs[_0x6a82('0x21')](_0x25111b[_0x6a82('0x35')][_0x6a82('0x21')]);}_0x3c3270[_0x6a82('0x3c')]=qs[_0x6a82('0x3d')](_0x25111b[_0x6a82('0x35')][_0x6a82('0x3d')]);_0x3c3270['where']=qs[_0x6a82('0x36')](_[_0x6a82('0x3e')](_0x25111b[_0x6a82('0x35')],_0x3c9ce6[_0x6a82('0x36')]),_0xf35037);if(_0x25111b[_0x6a82('0x35')][_0x6a82('0x3f')]){_0x3c3270[_0x6a82('0x40')]=_[_0x6a82('0x41')](_0x3c3270[_0x6a82('0x40')],{'$or':_[_0x6a82('0x2e')](_0xf35037,function(_0x380b3d){if(_0x380b3d['type']!=='VIRTUAL'){var _0x50fc18={};_0x50fc18[_0x380b3d['name']]={'$like':'%'+_0x25111b[_0x6a82('0x35')][_0x6a82('0x3f')]+'%'};return _0x50fc18;}})});}_0x3c3270=_[_0x6a82('0x41')]({},_0x3c3270,_0x25111b[_0x6a82('0x42')]);var _0x39bae7={'where':_0x3c3270['where']};return db[_0x6a82('0x43')][_0x6a82('0x23')](_0x39bae7)[_0x6a82('0x29')](function(_0x54701b){_0x25c30c[_0x6a82('0x23')]=_0x54701b;if(_0x25111b[_0x6a82('0x35')][_0x6a82('0x44')]){_0x3c3270['include']=[{'all':!![]}];}return db[_0x6a82('0x43')][_0x6a82('0x45')](_0x3c3270);})['then'](function(_0x2d5064){_0x25c30c[_0x6a82('0x46')]=_0x2d5064;return _0x25c30c;})[_0x6a82('0x29')](respondWithFilteredResult(_0x329f8c,_0x3c3270))[_0x6a82('0x47')](handleError(_0x329f8c,null));};exports['show']=function(_0x143559,_0x5526a5){var _0x17df8e={'raw':!![],'where':{'id':_0x143559['params']['id']}},_0x147c14={};_0x147c14[_0x6a82('0x33')]=_[_0x6a82('0x34')](db[_0x6a82('0x43')]['rawAttributes']);_0x147c14[_0x6a82('0x35')]=_['keys'](_0x143559[_0x6a82('0x35')]);_0x147c14[_0x6a82('0x36')]=_['intersection'](_0x147c14[_0x6a82('0x33')],_0x147c14[_0x6a82('0x35')]);_0x17df8e[_0x6a82('0x38')]=_[_0x6a82('0x37')](_0x147c14[_0x6a82('0x33')],qs[_0x6a82('0x39')](_0x143559[_0x6a82('0x35')][_0x6a82('0x39')]));_0x17df8e[_0x6a82('0x38')]=_0x17df8e[_0x6a82('0x38')]['length']?_0x17df8e[_0x6a82('0x38')]:_0x147c14[_0x6a82('0x33')];if(_0x143559[_0x6a82('0x35')][_0x6a82('0x44')]){_0x17df8e[_0x6a82('0x48')]=[{'all':!![]}];}_0x17df8e=_['merge']({},_0x17df8e,_0x143559[_0x6a82('0x42')]);return db[_0x6a82('0x43')][_0x6a82('0x49')](_0x17df8e)[_0x6a82('0x29')](handleEntityNotFound(_0x5526a5,null))[_0x6a82('0x29')](respondWithResult(_0x5526a5,null))[_0x6a82('0x47')](handleError(_0x5526a5,null));};exports[_0x6a82('0x4a')]=function(_0x5e561b,_0x10b53f){return db[_0x6a82('0x43')][_0x6a82('0x4a')](_0x5e561b[_0x6a82('0x4b')],{})[_0x6a82('0x29')](respondWithResult(_0x10b53f,0xc9))['catch'](handleError(_0x10b53f,null));};exports[_0x6a82('0x28')]=function(_0x23000e,_0x41f47c){if(_0x23000e[_0x6a82('0x4b')]['id']){delete _0x23000e[_0x6a82('0x4b')]['id'];}return db[_0x6a82('0x43')][_0x6a82('0x49')]({'where':{'id':_0x23000e[_0x6a82('0x4c')]['id']}})[_0x6a82('0x29')](handleEntityNotFound(_0x41f47c,null))[_0x6a82('0x29')](saveUpdates(_0x23000e['body'],null))[_0x6a82('0x29')](respondWithResult(_0x41f47c,null))[_0x6a82('0x47')](handleError(_0x41f47c,null));};exports[_0x6a82('0x4d')]=function(_0x25bd0b,_0x45378a){return db[_0x6a82('0x43')][_0x6a82('0x49')]({'where':{'id':_0x25bd0b[_0x6a82('0x4c')]['id']}})[_0x6a82('0x29')](handleEntityNotFound(_0x45378a,null))[_0x6a82('0x29')](removeEntity(_0x45378a,null))['catch'](handleError(_0x45378a,null));};exports['describe']=function(_0x127daf,_0x439771){return db[_0x6a82('0x43')][_0x6a82('0x4e')]()['then'](respondWithResult(_0x439771,null))[_0x6a82('0x47')](handleError(_0x439771,null));};exports[_0x6a82('0x4f')]=function(_0x1abf9f,_0x48c1ba,_0xb76a13){return db[_0x6a82('0x50')][_0x6a82('0x23')]({'where':{'ChatGroupId':_0x1abf9f[_0x6a82('0x4c')]['id'],'ToId':_0x1abf9f[_0x6a82('0x51')]['id'],'read':![]}})[_0x6a82('0x29')](function(_0x454021){return{'id':_[_0x6a82('0x52')](_0x1abf9f[_0x6a82('0x4c')]['id']),'count':_0x454021};})['then'](respondWithResult(_0x48c1ba,null))['catch'](handleError(_0x48c1ba,null));};exports[_0x6a82('0x53')]=function(_0x4b7f9d,_0x37648d,_0x46831b){return db[_0x6a82('0x43')][_0x6a82('0x49')]({'where':{'id':_0x4b7f9d[_0x6a82('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37648d,null))[_0x6a82('0x29')](function(_0xdc75a5){if(_0xdc75a5){return _0xdc75a5['addMembers'](_0x4b7f9d['body'][_0x6a82('0x54')],_['omit'](_0x4b7f9d[_0x6a82('0x4b')],[_0x6a82('0x54'),'id'])||{});}})[_0x6a82('0x29')](respondWithResult(_0x37648d,null))[_0x6a82('0x47')](handleError(_0x37648d,null));};exports['getMembers']=function(_0x58ea78,_0x236c2d,_0x5dbb7d){var _0x247b93={};var _0x551ef4={};var _0xd597cd;var _0x14f0f5;return db[_0x6a82('0x43')][_0x6a82('0x55')]({'where':{'id':_0x58ea78[_0x6a82('0x4c')]['id']}})[_0x6a82('0x29')](handleEntityNotFound(_0x236c2d,null))[_0x6a82('0x29')](function(_0x1e4644){if(_0x1e4644){_0xd597cd=_0x1e4644;_0x551ef4[_0x6a82('0x33')]=_[_0x6a82('0x34')](db[_0x6a82('0x56')][_0x6a82('0x2f')]);_0x551ef4['query']=_[_0x6a82('0x34')](_0x58ea78['query']);_0x551ef4[_0x6a82('0x36')]=_[_0x6a82('0x37')](_0x551ef4[_0x6a82('0x33')],_0x551ef4[_0x6a82('0x35')]);_0x247b93[_0x6a82('0x38')]=_[_0x6a82('0x37')](_0x551ef4[_0x6a82('0x33')],qs[_0x6a82('0x39')](_0x58ea78['query'][_0x6a82('0x39')]));_0x247b93[_0x6a82('0x38')]=_0x247b93[_0x6a82('0x38')][_0x6a82('0x3a')]?_0x247b93[_0x6a82('0x38')]:_0x551ef4[_0x6a82('0x33')];_0x247b93[_0x6a82('0x3c')]=qs['sort'](_0x58ea78[_0x6a82('0x35')][_0x6a82('0x3d')]);_0x247b93[_0x6a82('0x40')]=qs[_0x6a82('0x36')](_[_0x6a82('0x3e')](_0x58ea78[_0x6a82('0x35')],_0x551ef4['filters']));if(_0x58ea78[_0x6a82('0x35')][_0x6a82('0x3f')]){_0x247b93[_0x6a82('0x40')]=_[_0x6a82('0x41')](_0x247b93[_0x6a82('0x40')],{'$or':_[_0x6a82('0x2e')](_0x247b93['attributes'],function(_0x1a8d0b){var _0x3b5968={};_0x3b5968[_0x1a8d0b]={'$like':'%'+_0x58ea78[_0x6a82('0x35')][_0x6a82('0x3f')]+'%'};return _0x3b5968;})});}_0x247b93=_[_0x6a82('0x41')]({},_0x247b93,_0x58ea78[_0x6a82('0x42')]);return _0xd597cd[_0x6a82('0x57')](_0x247b93);}})[_0x6a82('0x29')](function(_0x16cee0){if(_0x16cee0){_0x14f0f5=_0x16cee0[_0x6a82('0x3a')];if(!_0x58ea78[_0x6a82('0x35')]['hasOwnProperty'](_0x6a82('0x58'))){_0x247b93['limit']=qs[_0x6a82('0x24')](_0x58ea78[_0x6a82('0x35')][_0x6a82('0x24')]);_0x247b93[_0x6a82('0x21')]=qs[_0x6a82('0x21')](_0x58ea78[_0x6a82('0x35')][_0x6a82('0x21')]);}return _0xd597cd['getMembers'](_0x247b93);}})['then'](function(_0x285090){if(_0x285090){return _0x285090?{'count':_0x14f0f5,'rows':_0x285090}:null;}})[_0x6a82('0x29')](respondWithResult(_0x236c2d,null))[_0x6a82('0x47')](handleError(_0x236c2d,null));};exports['removeMembers']=function(_0x27cca5,_0x155f96,_0x4ddd45){return db[_0x6a82('0x43')][_0x6a82('0x49')]({'where':{'id':_0x27cca5[_0x6a82('0x4c')]['id']}})[_0x6a82('0x29')](handleEntityNotFound(_0x155f96,null))[_0x6a82('0x29')](function(_0x4ad215){if(_0x4ad215){return _0x4ad215[_0x6a82('0x59')](_0x27cca5[_0x6a82('0x35')][_0x6a82('0x54')]);}})['then'](respondWithStatusCode(_0x155f96,null))['catch'](handleError(_0x155f96,null));};exports['addMessage']=function(_0x1cb14a,_0xdece64,_0x138dc4){if(_0x1cb14a[_0x6a82('0x4b')]['id']){delete _0x1cb14a[_0x6a82('0x4b')]['id'];}return db['ChatGroup'][_0x6a82('0x49')]({'where':{'id':_0x1cb14a[_0x6a82('0x4c')]['id']}})['then'](handleEntityNotFound(_0xdece64,null))[_0x6a82('0x29')](function(_0x3c1547){if(_0x3c1547){_0x1cb14a[_0x6a82('0x4b')][_0x6a82('0x5a')]=_0x3c1547['id'];return db['ChatInternalMessage'][_0x6a82('0x4a')](_0x1cb14a[_0x6a82('0x4b')]);}})[_0x6a82('0x29')](respondWithResult(_0xdece64,null))[_0x6a82('0x47')](handleError(_0xdece64,null));};exports[_0x6a82('0x5b')]=function(_0x54dfbb,_0x43ea46,_0x3a5ab6){var _0x9233b8={};var _0x18aff1={};var _0x29de5a;var _0x78b79a;return db[_0x6a82('0x43')]['findOne']({'where':{'id':_0x54dfbb['params']['id']}})['then'](handleEntityNotFound(_0x43ea46,null))[_0x6a82('0x29')](function(_0x596b37){if(_0x596b37){_0x29de5a=_0x596b37;_0x18aff1['model']=_[_0x6a82('0x34')](db[_0x6a82('0x50')][_0x6a82('0x2f')]);_0x18aff1[_0x6a82('0x35')]=_['keys'](_0x54dfbb['query']);_0x18aff1[_0x6a82('0x36')]=_['intersection'](_0x18aff1[_0x6a82('0x33')],_0x18aff1[_0x6a82('0x35')]);_0x9233b8[_0x6a82('0x38')]=_[_0x6a82('0x37')](_0x18aff1[_0x6a82('0x33')],qs[_0x6a82('0x39')](_0x54dfbb[_0x6a82('0x35')][_0x6a82('0x39')]));_0x9233b8['attributes']=_0x9233b8[_0x6a82('0x38')][_0x6a82('0x3a')]?_0x9233b8['attributes']:_0x18aff1[_0x6a82('0x33')];_0x9233b8[_0x6a82('0x3c')]=qs['sort'](_0x54dfbb[_0x6a82('0x35')]['sort']);_0x9233b8[_0x6a82('0x40')]=qs[_0x6a82('0x36')](_[_0x6a82('0x3e')](_0x54dfbb[_0x6a82('0x35')],_0x18aff1['filters']));if(_0x54dfbb['query'][_0x6a82('0x3f')]){_0x9233b8[_0x6a82('0x40')]=_[_0x6a82('0x41')](_0x9233b8[_0x6a82('0x40')],{'$or':_[_0x6a82('0x2e')](_0x9233b8[_0x6a82('0x38')],function(_0x16dad2){var _0x4613f4={};_0x4613f4[_0x16dad2]={'$like':'%'+_0x54dfbb[_0x6a82('0x35')]['filter']+'%'};return _0x4613f4;})});}if(_0x54dfbb[_0x6a82('0x35')]['$gte']){var _0xf77ced=_0x54dfbb[_0x6a82('0x35')][_0x6a82('0x5c')][_0x6a82('0x5d')](',');var _0x391a40={};_0x391a40[_0xf77ced[0x0]]={'$gte':moment(_0xf77ced[0x1])[_0x6a82('0x5e')](_0x6a82('0x5f'))};_0x9233b8[_0x6a82('0x40')]=_[_0x6a82('0x41')](_0x9233b8[_0x6a82('0x40')],_0x391a40);}_0x9233b8=_[_0x6a82('0x41')]({},_0x9233b8,_0x54dfbb[_0x6a82('0x42')]);return _0x29de5a[_0x6a82('0x5b')](_0x9233b8);}})['then'](function(_0x2e296f){if(_0x2e296f){_0x78b79a=_0x2e296f['length'];if(!_0x54dfbb[_0x6a82('0x35')][_0x6a82('0x3b')](_0x6a82('0x58'))){_0x9233b8['limit']=qs[_0x6a82('0x24')](_0x54dfbb[_0x6a82('0x35')][_0x6a82('0x24')]);_0x9233b8[_0x6a82('0x21')]=qs[_0x6a82('0x21')](_0x54dfbb['query'][_0x6a82('0x21')]);}return _0x29de5a[_0x6a82('0x5b')](_0x9233b8);}})['then'](function(_0x5c29f2){if(_0x5c29f2){return _0x5c29f2?{'count':_0x78b79a,'rows':_0x5c29f2}:null;}})[_0x6a82('0x29')](respondWithResult(_0x43ea46,null))['catch'](handleError(_0x43ea46,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 12f36ab..b12564d 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 _0x3d65=['events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3d65,0x8c));var _0x53d6=function(_0x208749,_0x2b7b66){_0x208749=_0x208749-0x0;var _0x3e0042=_0x3d65[_0x208749];return _0x3e0042;};'use strict';var EventEmitter=require(_0x53d6('0x0'));var ChatGroup=require(_0x53d6('0x1'))['db'][_0x53d6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x53d6('0x3')](0x0);var events={'afterCreate':_0x53d6('0x4'),'afterUpdate':_0x53d6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x237396){return function(_0x732f30,_0x2d04d7,_0x2946ea){ChatGroupEvents[_0x53d6('0x6')](_0x237396+':'+_0x732f30['id'],_0x732f30);ChatGroupEvents['emit'](_0x237396,_0x732f30);_0x2946ea(null);};}for(var e in events){if(events[_0x53d6('0x7')](e)){var event=events[e];ChatGroup[_0x53d6('0x8')](e,emitEvent(event));}}module[_0x53d6('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xcd7f=['ChatGroup','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x10b4f4,_0x4f1ca0){var _0x187294=function(_0x342ed2){while(--_0x342ed2){_0x10b4f4['push'](_0x10b4f4['shift']());}};_0x187294(++_0x4f1ca0);}(_0xcd7f,0x16e));var _0xfcd7=function(_0x9d380f,_0x47dd5d){_0x9d380f=_0x9d380f-0x0;var _0x216a52=_0xcd7f[_0x9d380f];return _0x216a52;};'use strict';var EventEmitter=require(_0xfcd7('0x0'));var ChatGroup=require(_0xfcd7('0x1'))['db'][_0xfcd7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfcd7('0x3')};function emitEvent(_0x355263){return function(_0x2555a3,_0x45208c,_0x22d95c){ChatGroupEvents['emit'](_0x355263+':'+_0x2555a3['id'],_0x2555a3);ChatGroupEvents[_0xfcd7('0x4')](_0x355263,_0x2555a3);_0x22d95c(null);};}for(var e in events){if(events[_0xfcd7('0x5')](e)){var event=events[e];ChatGroup[_0xfcd7('0x6')](e,emitEvent(event));}}module[_0xfcd7('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 2fdf7de..9f07794 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 _0x974b=['define','ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes'];(function(_0x54f415,_0x52be28){var _0xaca73b=function(_0x5937ce){while(--_0x5937ce){_0x54f415['push'](_0x54f415['shift']());}};_0xaca73b(++_0x52be28);}(_0x974b,0xb7));var _0xb974=function(_0x1943d9,_0x245bb8){_0x1943d9=_0x1943d9-0x0;var _0x4b4f3f=_0x974b[_0x1943d9];return _0x4b4f3f;};'use strict';var _=require('lodash');var util=require(_0xb974('0x0'));var logger=require(_0xb974('0x1'))(_0xb974('0x2'));var moment=require(_0xb974('0x3'));var BPromise=require(_0xb974('0x4'));var rp=require(_0xb974('0x5'));var fs=require('fs');var path=require(_0xb974('0x6'));var rimraf=require('rimraf');var config=require(_0xb974('0x7'));var attributes=require(_0xb974('0x8'));module['exports']=function(_0x3530cb,_0x1987a9){return _0x3530cb[_0xb974('0x9')](_0xb974('0xa'),attributes,{'tableName':_0xb974('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ddf=['ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports'];(function(_0x50516e,_0x464fe1){var _0x2e34b5=function(_0x9c889c){while(--_0x9c889c){_0x50516e['push'](_0x50516e['shift']());}};_0x2e34b5(++_0x464fe1);}(_0x9ddf,0x142));var _0xf9dd=function(_0x4e248c,_0x3dba6e){_0x4e248c=_0x4e248c-0x0;var _0x311f49=_0x9ddf[_0x4e248c];return _0x311f49;};'use strict';var _=require(_0xf9dd('0x0'));var util=require(_0xf9dd('0x1'));var logger=require(_0xf9dd('0x2'))(_0xf9dd('0x3'));var moment=require(_0xf9dd('0x4'));var BPromise=require('bluebird');var rp=require(_0xf9dd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf9dd('0x6'));var attributes=require('./chatGroup.attributes');module[_0xf9dd('0x7')]=function(_0x2f17ff,_0x5b0d34){return _0x2f17ff['define'](_0xf9dd('0x8'),attributes,{'tableName':_0xf9dd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 4768600..ef5cf64 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 _0x06f4=['request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatGroup.socket','request','info'];(function(_0x2acfed,_0x1526b3){var _0x5b7b43=function(_0x20f95d){while(--_0x20f95d){_0x2acfed['push'](_0x2acfed['shift']());}};_0x5b7b43(++_0x1526b3);}(_0x06f4,0x136));var _0x406f=function(_0x10946b,_0x415d73){_0x10946b=_0x10946b-0x0;var _0x4351ef=_0x06f4[_0x10946b];return _0x4351ef;};'use strict';var _=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var moment=require('moment');var BPromise=require(_0x406f('0x2'));var rs=require(_0x406f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x406f('0x4'));var logger=require('../../config/logger')(_0x406f('0x5'));var config=require(_0x406f('0x6'));var jayson=require(_0x406f('0x7'));var client=jayson[_0x406f('0x8')]['http']({'port':0x232a});config[_0x406f('0x9')]=_['defaults'](config[_0x406f('0x9')],{'host':_0x406f('0xa'),'port':0x18eb});var socket=require(_0x406f('0xb'))(new Redis(config['redis']));require(_0x406f('0xc'))['register'](socket);function respondWithRpcPromise(_0x5b46bf,_0xd817eb,_0x56edc2){return new BPromise(function(_0x28c5a5,_0x4e0e96){return client[_0x406f('0xd')](_0x5b46bf,_0x56edc2)['then'](function(_0xb2c62d){logger[_0x406f('0xe')]('ChatGroup,\x20%s,\x20%s',_0xd817eb,_0x406f('0xf'));logger[_0x406f('0x10')](_0x406f('0x11'),_0xd817eb,_0x406f('0xf'),JSON[_0x406f('0x12')](_0xb2c62d));if(_0xb2c62d[_0x406f('0x13')]){if(_0xb2c62d[_0x406f('0x13')][_0x406f('0x14')]===0x1f4){logger[_0x406f('0x13')](_0x406f('0x15'),_0xd817eb,_0xb2c62d[_0x406f('0x13')]['message']);return _0x4e0e96(_0xb2c62d[_0x406f('0x13')][_0x406f('0x16')]);}logger[_0x406f('0x13')]('ChatGroup,\x20%s,\x20%s',_0xd817eb,_0xb2c62d[_0x406f('0x13')][_0x406f('0x16')]);return _0x28c5a5(_0xb2c62d['error']['message']);}else{logger[_0x406f('0xe')](_0x406f('0x15'),_0xd817eb,'request\x20sent');_0x28c5a5(_0xb2c62d[_0x406f('0x17')]['message']);}})[_0x406f('0x18')](function(_0x3ad3fe){logger[_0x406f('0x13')](_0x406f('0x15'),_0xd817eb,_0x3ad3fe);_0x4e0e96(_0x3ad3fe);});});}
\ No newline at end of file
+var _0x3468=['message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x553e3a,_0xf08208){var _0x3988f6=function(_0x4f1930){while(--_0x4f1930){_0x553e3a['push'](_0x553e3a['shift']());}};_0x3988f6(++_0xf08208);}(_0x3468,0x8d));var _0x8346=function(_0x157614,_0x1aba89){_0x157614=_0x157614-0x0;var _0x383bc8=_0x3468[_0x157614];return _0x383bc8;};'use strict';var _=require(_0x8346('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8346('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8346('0x2'))['db'];var utils=require(_0x8346('0x3'));var logger=require(_0x8346('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8346('0x5')]['http']({'port':0x232a});config[_0x8346('0x6')]=_[_0x8346('0x7')](config[_0x8346('0x6')],{'host':_0x8346('0x8'),'port':0x18eb});var socket=require(_0x8346('0x9'))(new Redis(config[_0x8346('0x6')]));require(_0x8346('0xa'))[_0x8346('0xb')](socket);function respondWithRpcPromise(_0xa9c056,_0x2bc2a4,_0x35b247){return new BPromise(function(_0x3caac8,_0x461116){return client['request'](_0xa9c056,_0x35b247)[_0x8346('0xc')](function(_0x265c06){logger[_0x8346('0xd')](_0x8346('0xe'),_0x2bc2a4,_0x8346('0xf'));logger[_0x8346('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2bc2a4,_0x8346('0xf'),JSON[_0x8346('0x11')](_0x265c06));if(_0x265c06[_0x8346('0x12')]){if(_0x265c06[_0x8346('0x12')][_0x8346('0x13')]===0x1f4){logger[_0x8346('0x12')](_0x8346('0xe'),_0x2bc2a4,_0x265c06['error'][_0x8346('0x14')]);return _0x461116(_0x265c06['error'][_0x8346('0x14')]);}logger['error'](_0x8346('0xe'),_0x2bc2a4,_0x265c06['error'][_0x8346('0x14')]);return _0x3caac8(_0x265c06['error']['message']);}else{logger[_0x8346('0xd')](_0x8346('0xe'),_0x2bc2a4,'request\x20sent');_0x3caac8(_0x265c06[_0x8346('0x15')][_0x8346('0x14')]);}})[_0x8346('0x16')](function(_0x4dc342){logger[_0x8346('0x12')](_0x8346('0xe'),_0x2bc2a4,_0x4dc342);_0x461116(_0x4dc342);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 3c8f3d4..6296762 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 _0x63de=['remove','emit','removeListener','length','chatGroup:','./chatGroup.events','save'];(function(_0x5b5af1,_0x1db01b){var _0x45ab7b=function(_0x1e353a){while(--_0x1e353a){_0x5b5af1['push'](_0x5b5af1['shift']());}};_0x45ab7b(++_0x1db01b);}(_0x63de,0xe5));var _0xe63d=function(_0x50f6af,_0x1726d0){_0x50f6af=_0x50f6af-0x0;var _0x434ab1=_0x63de[_0x50f6af];return _0x434ab1;};'use strict';var ChatGroupEvents=require(_0xe63d('0x0'));var events=[_0xe63d('0x1'),_0xe63d('0x2'),'update'];function createListener(_0x5c6358,_0x5d316e){return function(_0x46a0e5){_0x5d316e[_0xe63d('0x3')](_0x5c6358,_0x46a0e5);};}function removeListener(_0xf00d1e,_0xf7a67){return function(){ChatGroupEvents[_0xe63d('0x4')](_0xf00d1e,_0xf7a67);};}exports['register']=function(_0x3abb40){for(var _0x3d4182=0x0,_0x4e66b8=events[_0xe63d('0x5')];_0x3d4182<_0x4e66b8;_0x3d4182++){var _0x2d39e9=events[_0x3d4182];var _0x291d36=createListener(_0xe63d('0x6')+_0x2d39e9,_0x3abb40);ChatGroupEvents['on'](_0x2d39e9,_0x291d36);}};
\ No newline at end of file
+var _0xe351=['chatGroup:','remove','update','removeListener','register'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0xe351,0x182));var _0x1e35=function(_0xd86d0c,_0x2391ef){_0xd86d0c=_0xd86d0c-0x0;var _0x16c264=_0xe351[_0xd86d0c];return _0x16c264;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x1e35('0x0'),_0x1e35('0x1')];function createListener(_0x3356c8,_0x596b28){return function(_0x5e2828){_0x596b28['emit'](_0x3356c8,_0x5e2828);};}function removeListener(_0x23bbaf,_0x4e7b35){return function(){ChatGroupEvents[_0x1e35('0x2')](_0x23bbaf,_0x4e7b35);};}exports[_0x1e35('0x3')]=function(_0x831927){for(var _0x4a0d92=0x0,_0x133971=events['length'];_0x4a0d92<_0x133971;_0x4a0d92++){var _0x19fff4=events[_0x4a0d92];var _0x5c5ea9=createListener(_0x1e35('0x4')+_0x19fff4,_0x831927);ChatGroupEvents['on'](_0x19fff4,_0x5c5ea9);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index e927adc..a148483 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 _0x3c55=['isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get'];(function(_0x4d3726,_0xbec3ae){var _0x51b610=function(_0x3698dc){while(--_0x3698dc){_0x4d3726['push'](_0x4d3726['shift']());}};_0x51b610(++_0xbec3ae);}(_0x3c55,0x123));var _0x53c5=function(_0x50b54b,_0xba911d){_0x50b54b=_0x50b54b-0x0;var _0x1859c1=_0x3c55[_0x50b54b];return _0x1859c1;};'use strict';var multer=require('multer');var util=require(_0x53c5('0x0'));var path=require(_0x53c5('0x1'));var timeout=require(_0x53c5('0x2'));var express=require(_0x53c5('0x3'));var router=express['Router']();var fs_extra=require(_0x53c5('0x4'));var auth=require(_0x53c5('0x5'));var interaction=require(_0x53c5('0x6'));var config=require('../../config/environment');var controller=require(_0x53c5('0x7'));router[_0x53c5('0x8')]('/',auth[_0x53c5('0x9')](),controller[_0x53c5('0xa')]);router[_0x53c5('0x8')](_0x53c5('0xb'),auth['isAuthenticated'](),controller[_0x53c5('0xc')]);router[_0x53c5('0x8')](_0x53c5('0xd'),auth[_0x53c5('0x9')](),controller[_0x53c5('0xe')]);router['get'](_0x53c5('0xf'),auth[_0x53c5('0x9')](),controller[_0x53c5('0x10')]);router[_0x53c5('0x8')]('/:id/members',auth[_0x53c5('0x9')](),controller['getMembers']);router[_0x53c5('0x8')](_0x53c5('0x11'),auth[_0x53c5('0x9')](),controller[_0x53c5('0x12')]);router[_0x53c5('0x13')]('/',auth[_0x53c5('0x9')](),controller[_0x53c5('0x14')]);router[_0x53c5('0x13')](_0x53c5('0x15'),auth[_0x53c5('0x9')](),controller[_0x53c5('0x16')]);router['post'](_0x53c5('0x11'),auth[_0x53c5('0x9')](),controller[_0x53c5('0x17')]);router[_0x53c5('0x18')](_0x53c5('0xd'),auth[_0x53c5('0x9')](),controller[_0x53c5('0x19')]);router[_0x53c5('0x1a')](_0x53c5('0xd'),auth['isAuthenticated'](),controller[_0x53c5('0x1b')]);router[_0x53c5('0x1a')]('/:id/members',auth[_0x53c5('0x9')](),controller[_0x53c5('0x1c')]);module[_0x53c5('0x1d')]=router;
\ No newline at end of file
+var _0x9fdc=['post','/:id/messages','addMessage','put','update','destroy','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages'];(function(_0x5ce4a1,_0x15f338){var _0x437272=function(_0x39d353){while(--_0x39d353){_0x5ce4a1['push'](_0x5ce4a1['shift']());}};_0x437272(++_0x15f338);}(_0x9fdc,0x164));var _0xc9fd=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x9fdc[_0x4eafed];return _0x159c85;};'use strict';var multer=require(_0xc9fd('0x0'));var util=require(_0xc9fd('0x1'));var path=require(_0xc9fd('0x2'));var timeout=require('connect-timeout');var express=require(_0xc9fd('0x3'));var router=express[_0xc9fd('0x4')]();var fs_extra=require(_0xc9fd('0x5'));var auth=require(_0xc9fd('0x6'));var interaction=require(_0xc9fd('0x7'));var config=require(_0xc9fd('0x8'));var controller=require(_0xc9fd('0x9'));router[_0xc9fd('0xa')]('/',auth[_0xc9fd('0xb')](),controller[_0xc9fd('0xc')]);router[_0xc9fd('0xa')](_0xc9fd('0xd'),auth[_0xc9fd('0xb')](),controller[_0xc9fd('0xe')]);router[_0xc9fd('0xa')](_0xc9fd('0xf'),auth[_0xc9fd('0xb')](),controller[_0xc9fd('0x10')]);router[_0xc9fd('0xa')](_0xc9fd('0x11'),auth['isAuthenticated'](),controller[_0xc9fd('0x12')]);router['get']('/:id/members',auth[_0xc9fd('0xb')](),controller[_0xc9fd('0x13')]);router[_0xc9fd('0xa')]('/:id/messages',auth[_0xc9fd('0xb')](),controller[_0xc9fd('0x14')]);router[_0xc9fd('0x15')]('/',auth[_0xc9fd('0xb')](),controller['create']);router[_0xc9fd('0x15')]('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0xc9fd('0x15')](_0xc9fd('0x16'),auth[_0xc9fd('0xb')](),controller[_0xc9fd('0x17')]);router[_0xc9fd('0x18')](_0xc9fd('0xf'),auth['isAuthenticated'](),controller[_0xc9fd('0x19')]);router['delete'](_0xc9fd('0xf'),auth[_0xc9fd('0xb')](),controller[_0xc9fd('0x1a')]);router[_0xc9fd('0x1b')]('/:id/members',auth[_0xc9fd('0xb')](),controller['removeMembers']);module[_0xc9fd('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index f0a835a..40e7b46 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 _0xdb94=['long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','STRING','TEXT'];(function(_0x27fc00,_0x5c0310){var _0x18e581=function(_0x147f3d){while(--_0x147f3d){_0x27fc00['push'](_0x27fc00['shift']());}};_0x18e581(++_0x5c0310);}(_0xdb94,0xab));var _0x4db9=function(_0x24dbf7,_0x101d78){_0x24dbf7=_0x24dbf7-0x0;var _0xd42ec8=_0xdb94[_0x24dbf7];return _0xd42ec8;};'use strict';var Sequelize=require(_0x4db9('0x0'));module[_0x4db9('0x1')]={'closed':{'type':Sequelize[_0x4db9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4db9('0x3')]},'ratingType':{'type':Sequelize[_0x4db9('0x4')]('star',_0x4db9('0x5')),'defaultValue':_0x4db9('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x4db9('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4db9('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4db9('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x4db9('0x7')]},'osName':{'type':Sequelize[_0x4db9('0x7')]},'osVersion':{'type':Sequelize[_0x4db9('0x7')]},'deviceModel':{'type':Sequelize[_0x4db9('0x7')]},'deviceVendor':{'type':Sequelize[_0x4db9('0x7')]},'deviceType':{'type':Sequelize[_0x4db9('0x7')]},'referer':{'type':Sequelize[_0x4db9('0x8')]},'customerIp':{'type':Sequelize[_0x4db9('0x7')]},'formData':{'type':Sequelize[_0x4db9('0x8')](_0x4db9('0x9'))},'read1stAt':{'type':Sequelize[_0x4db9('0xa')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4db9('0x4')]('in',_0x4db9('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x4db9('0x8')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x80ed=['INTEGER','ENUM','thumb','star','TEXT','DATE','STRING','long','out','sequelize','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80ed,0x11c));var _0xd80e=function(_0x1d1cb5,_0x298f33){_0x1d1cb5=_0x1d1cb5-0x0;var _0x332fbe=_0x80ed[_0x1d1cb5];return _0x332fbe;};'use strict';var Sequelize=require(_0xd80e('0x0'));module['exports']={'closed':{'type':Sequelize[_0xd80e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd80e('0x2')]},'ratingType':{'type':Sequelize[_0xd80e('0x3')]('star',_0xd80e('0x4')),'defaultValue':_0xd80e('0x5')},'ratingMessage':{'type':Sequelize[_0xd80e('0x6')]},'pathTranscript':{'type':Sequelize[_0xd80e('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd80e('0x7')]},'disposition':{'type':Sequelize[_0xd80e('0x8')]},'secondDisposition':{'type':Sequelize[_0xd80e('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd80e('0x8')]},'browserName':{'type':Sequelize[_0xd80e('0x8')]},'browserVersion':{'type':Sequelize[_0xd80e('0x8')]},'osName':{'type':Sequelize[_0xd80e('0x8')]},'osVersion':{'type':Sequelize[_0xd80e('0x8')]},'deviceModel':{'type':Sequelize[_0xd80e('0x8')]},'deviceVendor':{'type':Sequelize[_0xd80e('0x8')]},'deviceType':{'type':Sequelize[_0xd80e('0x8')]},'referer':{'type':Sequelize[_0xd80e('0x6')]},'customerIp':{'type':Sequelize[_0xd80e('0x8')]},'formData':{'type':Sequelize['TEXT'](_0xd80e('0x9'))},'read1stAt':{'type':Sequelize[_0xd80e('0x7')]},'lastMsgAt':{'type':Sequelize[_0xd80e('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xd80e('0x3')]('in',_0xd80e('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd80e('0x8')]},'customerPort':{'type':Sequelize[_0xd80e('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xd80e('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xd80e('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index e254f38..bf13f21 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 _0x7a33=['options','include','getMyMessages','hasOwnProperty','ChatInteractionId','push','rows','addTags','omit','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','get','mkdirSync','Chat','Owner','N.A.','createdAt','browserName','osName','customerPort','tail','createReadStream','read','value','renderFile','views','transcript-','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','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','end','offset','undefined','limit','count','set','Content-Range','update','destroy','name','render','merge','body','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','getOptions','findAll','query','user','params','model','keys','filters','intersection','fields','attributes','includeAll','find','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','User','ChatWebsiteId','ContactId','length','UserId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','rawAttributes','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a33,0xff));var _0x37a3=function(_0x263810,_0x35827a){_0x263810=_0x263810-0x0;var _0x2c90bd=_0x7a33[_0x263810];return _0x2c90bd;};'use strict';var rimraf=require(_0x37a3('0x0'));var zipdir=require('zip-dir');var rp=require(_0x37a3('0x1'));var moment=require(_0x37a3('0x2'));var BPromise=require(_0x37a3('0x3'));var Mustache=require(_0x37a3('0x4'));var util=require(_0x37a3('0x5'));var path=require(_0x37a3('0x6'));var ejs=require(_0x37a3('0x7'));var fs=require('fs');var _=require(_0x37a3('0x8'));var Redis=require(_0x37a3('0x9'));var interaction=require(_0x37a3('0xa'));var qs=require(_0x37a3('0xb'));var pdf=require(_0x37a3('0xc'));var logger=require(_0x37a3('0xd'))(_0x37a3('0xe'));var config=require(_0x37a3('0xf'));var db=require(_0x37a3('0x10'))['db'];config[_0x37a3('0x11')]=_[_0x37a3('0x12')](config[_0x37a3('0x11')],{'host':_0x37a3('0x13'),'port':0x18eb});var socket=require(_0x37a3('0x14'))(new Redis(config[_0x37a3('0x11')]));require(_0x37a3('0x15'))[_0x37a3('0x16')](socket);var jayson=require(_0x37a3('0x17'));var client=jayson[_0x37a3('0x18')][_0x37a3('0x19')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x35b47b,_0x22ffbf,_0x26be59,_0x5c4f45){return new BPromise(function(_0x21bdf4,_0x38271e){var _0x1101d3=_0x5c4f45||client;return _0x1101d3['request'](_0x35b47b,_0x26be59)[_0x37a3('0x1a')](function(_0x29f687){logger[_0x37a3('0x1b')](_0x37a3('0x1c'),_0x22ffbf,_0x37a3('0x1d'));logger[_0x37a3('0x1e')](_0x37a3('0x1f'),_0x22ffbf,_0x37a3('0x1d'),JSON[_0x37a3('0x20')](_0x29f687));if(_0x29f687[_0x37a3('0x21')]){if(_0x29f687[_0x37a3('0x21')][_0x37a3('0x22')]===0x1f4){logger[_0x37a3('0x21')](_0x37a3('0x1c'),_0x22ffbf,_0x29f687[_0x37a3('0x21')][_0x37a3('0x23')]);return _0x38271e(_0x29f687['error'][_0x37a3('0x23')]);}logger[_0x37a3('0x21')](_0x37a3('0x1c'),_0x22ffbf,_0x29f687[_0x37a3('0x21')][_0x37a3('0x23')]);return _0x21bdf4(_0x29f687[_0x37a3('0x21')][_0x37a3('0x23')]);}else{logger[_0x37a3('0x1b')](_0x37a3('0x1c'),_0x22ffbf,_0x37a3('0x1d'));_0x21bdf4(_0x29f687[_0x37a3('0x24')]['message']);}})[_0x37a3('0x25')](function(_0x4a38fa){logger[_0x37a3('0x21')](_0x37a3('0x1c'),_0x22ffbf,_0x4a38fa);_0x38271e(_0x4a38fa);});});}function respondWithStatusCode(_0x4f8927,_0x41d4e3){_0x41d4e3=_0x41d4e3||0xcc;return function(_0x240075){if(_0x240075){return _0x4f8927[_0x37a3('0x26')](_0x41d4e3);}return _0x4f8927[_0x37a3('0x27')](_0x41d4e3)[_0x37a3('0x28')]();};}function respondWithResult(_0x1f92f0,_0x174e23){_0x174e23=_0x174e23||0xc8;return function(_0x5837d5){if(_0x5837d5){return _0x1f92f0[_0x37a3('0x27')](_0x174e23)['json'](_0x5837d5);}};}function respondWithFilteredResult(_0x46c53a,_0x8eb52d){return function(_0x3d9cf){if(_0x3d9cf){var _0x3802d3=typeof _0x8eb52d[_0x37a3('0x29')]===_0x37a3('0x2a')&&typeof _0x8eb52d[_0x37a3('0x2b')]===_0x37a3('0x2a');var _0x2f379b=_0x3d9cf[_0x37a3('0x2c')];var _0x18ba47=_0x3802d3?0x0:_0x8eb52d[_0x37a3('0x29')];var _0x2f5440=_0x3802d3?_0x3d9cf[_0x37a3('0x2c')]:_0x8eb52d[_0x37a3('0x29')]+_0x8eb52d['limit'];var _0xa62da0;if(_0x2f5440>=_0x2f379b){_0x2f5440=_0x2f379b;_0xa62da0=0xc8;}else{_0xa62da0=0xce;}_0x46c53a[_0x37a3('0x27')](_0xa62da0);return _0x46c53a[_0x37a3('0x2d')](_0x37a3('0x2e'),_0x18ba47+'-'+_0x2f5440+'/'+_0x2f379b)['json'](_0x3d9cf);}return null;};}function saveUpdates(_0x1cff55){return function(_0x4daa07){if(_0x4daa07){return _0x4daa07[_0x37a3('0x2f')](_0x1cff55)[_0x37a3('0x1a')](function(_0x4ed719){return _0x4ed719;});}return null;};}function removeEntity(_0x187e41){return function(_0x1657c1){if(_0x1657c1){return _0x1657c1[_0x37a3('0x30')]()[_0x37a3('0x1a')](function(){_0x187e41['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf84672){return function(_0x41edc3){if(!_0x41edc3){_0xf84672[_0x37a3('0x26')](0x194);}return _0x41edc3;};}function handleError(_0x13bf46,_0xc2f5e2){_0xc2f5e2=_0xc2f5e2||0x1f4;return function(_0x4e629c){logger[_0x37a3('0x21')](_0x4e629c['stack']);if(_0x4e629c[_0x37a3('0x31')]){delete _0x4e629c[_0x37a3('0x31')];}_0x13bf46[_0x37a3('0x27')](_0xc2f5e2)['send'](_0x4e629c);};}function getMustacheRender(_0x249e88,_0x2a9050){return Mustache[_0x37a3('0x32')](_0x249e88,_[_0x37a3('0x33')](_0x2a9050[_0x37a3('0x34')],{'contact':_0x2a9050['contact'],'message':_0x2a9050[_0x37a3('0x23')],'agent':_0x2a9050[_0x37a3('0x35')],'interaction':_0x2a9050[_0x37a3('0x36')],'account':_0x2a9050[_0x37a3('0x37')]}))||'';}exports[_0x37a3('0x38')]=function(_0x296a1d,_0x3fddc8){var _0x573a16={};var _0x216703=_[_0x37a3('0x39')](db[_0x37a3('0x3a')]['rawAttributes'],function(_0xfd04a9){return{'name':_0xfd04a9[_0x37a3('0x3b')],'type':_0xfd04a9[_0x37a3('0x3c')][_0x37a3('0x3d')]};});_0x573a16=qs[_0x37a3('0x3e')](_0x216703,_0x296a1d);return interaction[_0x37a3('0x3f')]('chat',_0x296a1d[_0x37a3('0x40')],_0x296a1d[_0x37a3('0x41')],_0x573a16,_0x216703)[_0x37a3('0x1a')](respondWithFilteredResult(_0x3fddc8,_0x573a16))['catch'](handleError(_0x3fddc8,null));};exports['show']=function(_0x42e3e9,_0x2ef847){var _0x1a5973={'raw':![],'where':{'id':_0x42e3e9[_0x37a3('0x42')]['id']}},_0xf0b539={};_0xf0b539[_0x37a3('0x43')]=_[_0x37a3('0x44')](db['ChatInteraction']['rawAttributes']);_0xf0b539[_0x37a3('0x40')]=_[_0x37a3('0x44')](_0x42e3e9['query']);_0xf0b539[_0x37a3('0x45')]=_[_0x37a3('0x46')](_0xf0b539['model'],_0xf0b539['query']);_0x1a5973['attributes']=_[_0x37a3('0x46')](_0xf0b539[_0x37a3('0x43')],qs[_0x37a3('0x47')](_0x42e3e9['query'][_0x37a3('0x47')]));_0x1a5973['attributes']=_0x1a5973[_0x37a3('0x48')]['length']?_0x1a5973[_0x37a3('0x48')]:_0xf0b539['model'];if(_0x42e3e9[_0x37a3('0x40')][_0x37a3('0x49')]){_0x1a5973['include']=[{'all':!![]}];}_0x1a5973=_[_0x37a3('0x33')]({},_0x1a5973,_0x42e3e9['options']);return db[_0x37a3('0x3a')][_0x37a3('0x4a')](_0x1a5973)[_0x37a3('0x1a')](handleEntityNotFound(_0x2ef847,null))[_0x37a3('0x1a')](respondWithResult(_0x2ef847,null))[_0x37a3('0x25')](handleError(_0x2ef847,null));};exports[_0x37a3('0x4b')]=function(_0x5e6ce0,_0x45b4d6){return db['ChatInteraction'][_0x37a3('0x4b')](_0x5e6ce0[_0x37a3('0x34')],{})[_0x37a3('0x1a')](respondWithResult(_0x45b4d6,0xc9))[_0x37a3('0x25')](handleError(_0x45b4d6,null));};exports[_0x37a3('0x2f')]=function(_0x1ba8f7,_0x370f7e){if(_0x1ba8f7[_0x37a3('0x34')]['id']){delete _0x1ba8f7[_0x37a3('0x34')]['id'];}return db['ChatInteraction'][_0x37a3('0x4a')]({'where':{'id':_0x1ba8f7[_0x37a3('0x42')]['id']}})[_0x37a3('0x1a')](handleEntityNotFound(_0x370f7e,null))['then'](saveUpdates(_0x1ba8f7['body'],null))[_0x37a3('0x1a')](respondWithResult(_0x370f7e,null))['catch'](handleError(_0x370f7e,null));};exports[_0x37a3('0x30')]=function(_0x432d0e,_0x20f3a0){return db[_0x37a3('0x3a')][_0x37a3('0x4a')]({'where':{'id':_0x432d0e[_0x37a3('0x42')]['id']}})[_0x37a3('0x1a')](handleEntityNotFound(_0x20f3a0,null))[_0x37a3('0x1a')](removeEntity(_0x20f3a0,null))[_0x37a3('0x25')](handleError(_0x20f3a0,null));};exports[_0x37a3('0x4c')]=function(_0x5cecba,_0x2c7cfd){return db[_0x37a3('0x3a')][_0x37a3('0x4c')]()[_0x37a3('0x1a')](respondWithResult(_0x2c7cfd,null))[_0x37a3('0x25')](handleError(_0x2c7cfd,null));};exports[_0x37a3('0x4d')]=function(_0x36ab79,_0x3c57ba){var _0x5f1b2d=_0x36ab79[_0x37a3('0x42')]['id'];var _0x43627c;var _0x804ed6;var _0x538dd1;return db[_0x37a3('0x3a')][_0x37a3('0x4e')]({'where':{'id':_0x5f1b2d}})[_0x37a3('0x1a')](function(_0x6a664){_0x43627c=_0x6a664;return db[_0x37a3('0x4f')]['findOne']({'where':{'id':_0x6a664['ChatWebsiteId']},'attributes':['id',_0x37a3('0x50'),_0x37a3('0x51'),_0x37a3('0x52'),_0x37a3('0x53'),'vidaooMetadata'],'raw':!![]});})[_0x37a3('0x1a')](function(_0x79240e){if(_0x79240e&&_0x79240e[_0x37a3('0x50')]&&_0x79240e[_0x37a3('0x51')]){_0x804ed6=_0x79240e;var _0x275e46={'interaction':{'id':_0x5f1b2d},'agent':{'id':_0x36ab79[_0x37a3('0x41')]['id'],'name':_0x36ab79['user'][_0x37a3('0x31')],'fullname':_0x36ab79[_0x37a3('0x41')][_0x37a3('0x54')],'email':_0x36ab79['user'][_0x37a3('0x55')]},'contact':_0x36ab79[_0x37a3('0x34')][_0x37a3('0x56')],'account':_0x36ab79[_0x37a3('0x34')][_0x37a3('0x37')]};var _0x5e9305={'rejectUnauthorized':![],'method':_0x37a3('0x57'),'url':_0x37a3('0x58'),'headers':{'X-APIKEY':_0x79240e[_0x37a3('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x36ab79['user'][_0x37a3('0x55')]],'buttons':null,'topic':_0x804ed6[_0x37a3('0x52')],'note':_[_0x37a3('0x59')](_0x804ed6[_0x37a3('0x53')])?null:getMustacheRender(_0x804ed6[_0x37a3('0x53')],_0x275e46),'metadata':null},'redirect':_0x37a3('0x5a'),'json':!![]};try{if(!_['isNull'](_0x804ed6[_0x37a3('0x5b')])){var _0xb4910a=getMustacheRender(_0x804ed6[_0x37a3('0x5b')],_0x275e46);var _0x30031c=JSON[_0x37a3('0x5c')](_0xb4910a);_0x5e9305[_0x37a3('0x34')]['metadata']=_0x30031c;}}catch(_0x2d07e8){throw new db[(_0x37a3('0x5d'))]['ValidationError'](_0x37a3('0x5e'));}return rp(_0x5e9305);}else{throw new db[(_0x37a3('0x5d'))][(_0x37a3('0x5f'))](_0x37a3('0x60'));}})['then'](function(_0x23748a){_0x538dd1=_0x23748a;if(_0x538dd1['id']){var _0x5bb242={'body':_0x538dd1[_0x37a3('0x61')],'ChatWebsiteId':_0x804ed6['id'],'ChatInteractionId':_0x43627c['id'],'direction':_0x37a3('0x62'),'UserId':_0x36ab79[_0x37a3('0x41')]['id']};return db[_0x37a3('0x63')][_0x37a3('0x4b')](_0x5bb242,{});}else{throw new db[(_0x37a3('0x5d'))][(_0x37a3('0x5f'))](_0x37a3('0x64'));}})[_0x37a3('0x1a')](function(){return _0x43627c[_0x37a3('0x65')]({'vidaooSessionId':_0x538dd1['id']});})['then'](respondWithResult(_0x3c57ba,null))[_0x37a3('0x25')](handleError(_0x3c57ba,null));};exports[_0x37a3('0x66')]=function(_0x5e98af,_0x5516cf){if(_0x5e98af[_0x37a3('0x34')]['id']){delete _0x5e98af[_0x37a3('0x34')]['id'];}return db[_0x37a3('0x3a')][_0x37a3('0x4a')]({'where':{'id':_0x5e98af[_0x37a3('0x42')]['id']},'include':[{'model':db[_0x37a3('0x67')],'as':_0x37a3('0x68')}]})[_0x37a3('0x1a')](handleEntityNotFound(_0x5516cf,null))[_0x37a3('0x1a')](saveUpdates(_0x5e98af[_0x37a3('0x34')],null))[_0x37a3('0x1a')](respondWithResult(_0x5516cf,null))['catch'](handleError(_0x5516cf,null));};exports[_0x37a3('0x69')]=function(_0x2d20e9,_0x109a87){if(_0x2d20e9[_0x37a3('0x34')]['id']){delete _0x2d20e9[_0x37a3('0x34')]['id'];}return db[_0x37a3('0x3a')]['find']({'where':{'id':_0x2d20e9['params']['id']}})[_0x37a3('0x1a')](function(_0x17e0d6){if(!_0x17e0d6){logger['error'](_0x37a3('0x6a'),_0x37a3('0x69'),0x194,_0x37a3('0x6b'));_0x109a87['sendStatus'](0x194);}else{if(_0x17e0d6['UserId']){throw new db[(_0x37a3('0x5d'))][(_0x37a3('0x5f'))](_0x37a3('0x6c'));}}return _0x17e0d6;})['then'](function(_0xaf13f0){if(_0xaf13f0){return _0xaf13f0[_0x37a3('0x2f')]({'closed':_0x2d20e9[_0x37a3('0x34')][_0x37a3('0x6d')],'disposition':_0x2d20e9[_0x37a3('0x34')][_0x37a3('0x6e')]})[_0x37a3('0x1a')](function(_0x214025){return _0x214025;});}})[_0x37a3('0x1a')](function(){return respondWithRpcPromise(_0x37a3('0x6f'),'abandon',_0x2d20e9[_0x37a3('0x34')],client9004);})[_0x37a3('0x1a')](respondWithResult(_0x109a87,null))[_0x37a3('0x25')](handleError(_0x109a87,null));};exports[_0x37a3('0x70')]=function(_0x47e134,_0x1e5dfe){_0x47e134[_0x37a3('0x34')][_0x37a3('0x31')]=_0x47e134[_0x37a3('0x71')]['originalname'];_0x47e134[_0x37a3('0x34')]['basename']=_0x47e134[_0x37a3('0x71')][_0x37a3('0x72')];_0x47e134[_0x37a3('0x34')][_0x37a3('0x3c')]=_0x47e134[_0x37a3('0x71')][_0x37a3('0x73')];return db[_0x37a3('0x74')]['create'](_0x47e134[_0x37a3('0x34')])[_0x37a3('0x1a')](respondWithResult(_0x1e5dfe,0xc9))['catch'](handleError(_0x1e5dfe,null));};exports[_0x37a3('0x75')]=function(_0x13daa8,_0x17fb7d){return db[_0x37a3('0x3a')][_0x37a3('0x4e')]({'where':{'id':_0x13daa8[_0x37a3('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x17fb7d,null))[_0x37a3('0x1a')](function(_0x38d723){if(_0x38d723){if(_0x38d723['closed']){return _0x17fb7d['status'](0x193)[_0x37a3('0x76')]({'status':0x193,'message':_0x37a3('0x77')});}return db['Attachment'][_0x37a3('0x4e')]({'where':{'id':_0x13daa8['query'][_0x37a3('0x78')]},'raw':!![]})[_0x37a3('0x1a')](handleEntityNotFound(_0x17fb7d,null));}})[_0x37a3('0x1a')](function(_0xb35335){if(_0xb35335){var _0x2f5fce=_0xb35335[_0x37a3('0x79')]!==null;var _0x141167=path[_0x37a3('0x7a')](config[_0x37a3('0x7b')],'server/files/attachments/');if(_0x2f5fce){_0x141167=path[_0x37a3('0x7a')](_0x141167,_0x37a3('0x7c'));}var _0x50f7c5=path['join'](_0x141167,_0xb35335[_0x37a3('0x7d')]);return _0x17fb7d[_0x37a3('0x7e')](_0x50f7c5);}})['catch'](handleError(_0x17fb7d,null));};exports[_0x37a3('0x7f')]=function(_0x564381,_0x41100c){var _0x1fa757=null;var _0x3335f4=null;var _0x59b2a2=null;if(_0x564381[_0x37a3('0x34')]['id']){delete _0x564381['body']['id'];}if(_0x564381[_0x37a3('0x34')][_0x37a3('0x80')]){_0x59b2a2=path['join'](config[_0x37a3('0x7b')],_0x37a3('0x81'),util[_0x37a3('0x82')]('transcript-%s.txt',Date[_0x37a3('0x83')]()));_0x564381['body'][_0x37a3('0x84')]=_0x59b2a2;}return db['ChatInteraction'][_0x37a3('0x4a')]({'where':{'id':_0x564381['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x37a3('0x85'),'include':[{'model':db[_0x37a3('0x86')],'as':'User'}]}]})[_0x37a3('0x1a')](handleEntityNotFound(_0x41100c,null))[_0x37a3('0x1a')](saveUpdates(_0x564381[_0x37a3('0x34')],null))['then'](function(_0x35348f){if(_0x35348f){_0x1fa757=_0x35348f;return db['ChatWebsite']['find']({'where':{'id':_0x1fa757[_0x37a3('0x87')]}});}})[_0x37a3('0x1a')](function(_0x488211){if(_0x488211){_0x3335f4=_0x488211;return db['CmContact'][_0x37a3('0x4a')]({'where':{'id':_0x1fa757[_0x37a3('0x88')]}});}})['then'](function(_0x3396cb){if(_0x3396cb){if(_0x59b2a2){var _0x261328=null;for(var _0x3c41d2=0x1;_0x3c41d2<_0x1fa757[_0x37a3('0x85')][_0x37a3('0x89')];++_0x3c41d2){_0x261328=_0x1fa757[_0x37a3('0x85')][_0x3c41d2];var _0x5d23e0=_0x261328[_0x37a3('0x8a')]?util[_0x37a3('0x82')](_0x37a3('0x8b'),_0x3335f4[_0x37a3('0x8c')],_0x261328['UserId']):'System';var _0x8dc9c2=_0x564381[_0x37a3('0x34')][_0x37a3('0x8d')]||util[_0x37a3('0x82')]('%s%d',_0x37a3('0x8e'),_0x261328[_0x37a3('0x88')]);switch(_0x3335f4[_0x37a3('0x8f')]){case _0x37a3('0x90'):_0x5d23e0=_0x261328[_0x37a3('0x8a')]?util[_0x37a3('0x82')]('%s%d',_0x3335f4[_0x37a3('0x8c')],_0x261328[_0x37a3('0x8a')]):_0x37a3('0x91');break;case'agent_alias':_0x5d23e0=_0x261328['UserId']?_0x261328['User'][_0x37a3('0x92')]||_0x261328['User'][_0x37a3('0x54')]:_0x37a3('0x91');break;case'agent_fullname':_0x5d23e0=_0x261328[_0x37a3('0x8a')]?_0x261328[_0x37a3('0x86')][_0x37a3('0x54')]:_0x37a3('0x91');break;default:_0x5d23e0=_0x261328[_0x37a3('0x8a')]?util[_0x37a3('0x82')](_0x37a3('0x8b'),_0x3335f4[_0x37a3('0x8c')],_0x261328['UserId']):_0x37a3('0x91');}var _0x3fec82=util[_0x37a3('0x82')](_0x37a3('0x93'),moment(_0x261328['createdAt'])[_0x37a3('0x82')](_0x37a3('0x94')),_0x261328[_0x37a3('0x95')]==='in'?_0x8dc9c2:_0x5d23e0,_0x261328[_0x37a3('0x34')]);if(!_0x261328['secret']){fs[_0x37a3('0x96')](_0x59b2a2,_0x3fec82);}}return db[_0x37a3('0x97')][_0x37a3('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x37a3('0x98')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x37a3('0x99')],'as':_0x37a3('0x99'),'raw':!![]}]}]});}}})['then'](function(_0x5e91b1){if(!_0x5e91b1||!_0x5e91b1[_0x37a3('0x9a')]||!_0x564381[_0x37a3('0x34')])return _0x1fa757;var _0x2af499=_0x5e91b1[_0x37a3('0x9b')]();return respondWithRpcPromise(_0x37a3('0x9c'),'sendMail',{'account':_0x2af499,'message':{'from':util[_0x37a3('0x82')](_0x37a3('0x9d'),_0x5e91b1['name'],_0x5e91b1[_0x37a3('0x55')]||_0x5e91b1['Smtp'][_0x37a3('0x41')]),'to':_0x564381[_0x37a3('0x34')][_0x37a3('0x80')],'subject':_0x37a3('0x9e'),'text':util[_0x37a3('0x82')](_0x37a3('0x9f'),_0x564381[_0x37a3('0x34')]['mailTranscript']),'attachments':[{'path':_0x59b2a2}]}})[_0x37a3('0x1a')](function(){return _0x1fa757;})[_0x37a3('0x25')](function(_0x3cc452){logger['error'](_0x3cc452);});})[_0x37a3('0x1a')](respondWithStatusCode(_0x41100c,0xc8))[_0x37a3('0x25')](handleError(_0x41100c,null));};exports['addMessage']=function(_0x27fec8,_0x3fa772){return db[_0x37a3('0x63')][_0x37a3('0x4a')]({'where':{'id':_0x27fec8['params']['id']}})[_0x37a3('0x1a')](handleEntityNotFound(_0x3fa772,null))[_0x37a3('0x1a')](function(_0x25daf2){if(_0x25daf2){return _0x25daf2[_0x37a3('0xa0')](_0x27fec8[_0x37a3('0x34')]['ids'],_['omit'](_0x27fec8[_0x37a3('0x34')],[_0x37a3('0xa1'),'id'])||{});}})[_0x37a3('0x1a')](respondWithResult(_0x3fa772,null))[_0x37a3('0x25')](handleError(_0x3fa772,null));};exports[_0x37a3('0xa2')]=function(_0x400594,_0x143f75){var _0x320808={'raw':![],'where':{}};var _0x3a7e12={};var _0x3fd048={'count':0x0,'rows':[]};return db[_0x37a3('0x3a')]['findOne']({'where':{'id':_0x400594['params']['id']}})[_0x37a3('0x1a')](handleEntityNotFound(_0x143f75,null))['then'](function(_0x480f69){if(_0x480f69){_0x3a7e12[_0x37a3('0x43')]=_[_0x37a3('0x44')](db['ChatMessage'][_0x37a3('0xa3')]);_0x3a7e12[_0x37a3('0x40')]=_[_0x37a3('0x44')](_0x400594[_0x37a3('0x40')]);_0x3a7e12['filters']=_[_0x37a3('0x46')](_0x3a7e12[_0x37a3('0x43')],_0x3a7e12[_0x37a3('0x40')]);_0x320808['attributes']=_[_0x37a3('0x46')](_0x3a7e12['model'],qs[_0x37a3('0x47')](_0x400594[_0x37a3('0x40')][_0x37a3('0x47')]));_0x320808[_0x37a3('0x48')]=_0x320808['attributes'][_0x37a3('0x89')]?_0x320808[_0x37a3('0x48')]:_0x3a7e12[_0x37a3('0x43')];if(!_0x400594[_0x37a3('0x40')]['hasOwnProperty'](_0x37a3('0xa4'))){_0x320808[_0x37a3('0x2b')]=qs[_0x37a3('0x2b')](_0x400594[_0x37a3('0x40')][_0x37a3('0x2b')]);_0x320808[_0x37a3('0x29')]=qs[_0x37a3('0x29')](_0x400594['query'][_0x37a3('0x29')]);}_0x320808[_0x37a3('0xa5')]=qs[_0x37a3('0xa6')](_0x400594[_0x37a3('0x40')][_0x37a3('0xa6')]);_0x320808[_0x37a3('0xa7')]=qs[_0x37a3('0x45')](_[_0x37a3('0xa8')](_0x400594[_0x37a3('0x40')],_0x3a7e12['filters']));_0x320808['where']['ChatInteractionId']=_0x480f69['id'];if(_0x400594[_0x37a3('0x40')][_0x37a3('0xa9')]){_0x320808[_0x37a3('0xa7')]=_[_0x37a3('0x33')](_0x320808[_0x37a3('0xa7')],{'$or':_[_0x37a3('0x39')](_0x320808[_0x37a3('0x48')],function(_0x371f74){var _0x479e75={};_0x479e75[_0x371f74]={'$like':'%'+_0x400594[_0x37a3('0x40')][_0x37a3('0xa9')]+'%'};return _0x479e75;})});}if(_0x400594['query'][_0x37a3('0xaa')]){var _0x453147=_0x400594[_0x37a3('0x40')][_0x37a3('0xaa')][_0x37a3('0xab')](',');var _0x83e5e3={};_0x83e5e3[_0x453147[0x0]]={'$gte':moment(_0x453147[0x1])['format'](_0x37a3('0xac'))};_0x320808[_0x37a3('0xa7')]=_[_0x37a3('0x33')](_0x320808['where'],_0x83e5e3);}_0x320808=_['merge']({},_0x320808,_0x400594[_0x37a3('0xad')]);return db[_0x37a3('0x63')]['count']({'where':_0x320808[_0x37a3('0xa7')]})['then'](function(_0x588237){_0x3fd048['count']=_0x588237;if(_0x400594[_0x37a3('0x40')][_0x37a3('0x49')]){_0x320808[_0x37a3('0xae')]=[{'all':!![]}];}return db[_0x37a3('0x63')][_0x37a3('0x3f')](_0x320808);})[_0x37a3('0x1a')](function(_0x1ba6f0){_0x3fd048['rows']=_0x1ba6f0;return _0x3fd048;});}})[_0x37a3('0x1a')](respondWithFilteredResult(_0x143f75,_0x320808))[_0x37a3('0x25')](handleError(_0x143f75,null));};exports[_0x37a3('0xaf')]=function(_0x1c8bc7,_0x5787c7){var _0x5c1fd4={'where':{}},_0x5e75c7={},_0x4d1100={'count':0x0,'rows':[]};return db[_0x37a3('0x3a')][_0x37a3('0x4e')]({'where':{'id':_0x1c8bc7[_0x37a3('0x42')]['id']}})[_0x37a3('0x1a')](handleEntityNotFound(_0x5787c7,null))['then'](function(_0x4b820d){if(_0x4b820d){_0x5e75c7[_0x37a3('0x43')]=_['keys'](db[_0x37a3('0x63')]['rawAttributes']);_0x5e75c7[_0x37a3('0x40')]=_[_0x37a3('0x44')](_0x1c8bc7[_0x37a3('0x40')]);_0x5e75c7[_0x37a3('0x45')]=_['intersection'](_0x5e75c7[_0x37a3('0x43')],_0x5e75c7['query']);_0x5c1fd4[_0x37a3('0x48')]=_[_0x37a3('0x46')](_0x5e75c7[_0x37a3('0x43')],qs[_0x37a3('0x47')](_0x1c8bc7[_0x37a3('0x40')][_0x37a3('0x47')]));_0x5c1fd4['attributes']=_0x5c1fd4[_0x37a3('0x48')][_0x37a3('0x89')]?_0x5c1fd4['attributes']:_0x5e75c7[_0x37a3('0x43')];if(!_0x1c8bc7[_0x37a3('0x40')][_0x37a3('0xb0')](_0x37a3('0xa4'))){_0x5c1fd4[_0x37a3('0x2b')]=qs[_0x37a3('0x2b')](_0x1c8bc7[_0x37a3('0x40')]['limit']);_0x5c1fd4['offset']=qs[_0x37a3('0x29')](_0x1c8bc7[_0x37a3('0x40')][_0x37a3('0x29')]);}_0x5c1fd4[_0x37a3('0xa5')]=qs['sort'](_0x1c8bc7[_0x37a3('0x40')]['sort']);_0x5c1fd4['where']=qs[_0x37a3('0x45')](_[_0x37a3('0xa8')](_0x1c8bc7[_0x37a3('0x40')],_0x5e75c7[_0x37a3('0x45')]));_0x5c1fd4[_0x37a3('0xa7')][_0x37a3('0xb1')]=_0x4b820d['id'];if(_0x1c8bc7[_0x37a3('0x40')][_0x37a3('0xa9')]){_0x5c1fd4[_0x37a3('0xa7')]=_[_0x37a3('0x33')](_0x5c1fd4[_0x37a3('0xa7')],{'$or':_['map'](_0x5c1fd4[_0x37a3('0x48')],function(_0x49d765){var _0x380260={};_0x380260[_0x49d765]={'$like':'%'+_0x1c8bc7[_0x37a3('0x40')][_0x37a3('0xa9')]+'%'};return _0x380260;})});}_0x5c1fd4[_0x37a3('0xa7')]['secret']=![];if(_0x1c8bc7[_0x37a3('0x40')]['id']){_0x5c1fd4[_0x37a3('0xa7')]['id']={'$gt':_0x1c8bc7[_0x37a3('0x40')]['id']};}_0x5c1fd4=_[_0x37a3('0x33')]({},_0x5c1fd4,_0x1c8bc7[_0x37a3('0xad')]);return db[_0x37a3('0x63')][_0x37a3('0x2c')]({'where':_0x5c1fd4[_0x37a3('0xa7')]})['then'](function(_0x25c400){_0x4d1100['count']=_0x25c400;_0x5c1fd4[_0x37a3('0xae')]=[];if(_0x1c8bc7[_0x37a3('0x40')]['includeAgent']){_0x5c1fd4[_0x37a3('0xae')][_0x37a3('0xb2')]({'model':db[_0x37a3('0x86')],'as':_0x37a3('0x86'),'attributes':['id',_0x37a3('0x54'),'alias']});}if(_0x1c8bc7['query'][_0x37a3('0x49')]){_0x5c1fd4[_0x37a3('0xae')]=[{'all':!![]}];}return db[_0x37a3('0x63')][_0x37a3('0x3f')](_0x5c1fd4);})[_0x37a3('0x1a')](function(_0x10344f){_0x4d1100[_0x37a3('0xb3')]=_0x10344f;return _0x4d1100;});}})[_0x37a3('0x1a')](respondWithFilteredResult(_0x5787c7,_0x5c1fd4))[_0x37a3('0x25')](handleError(_0x5787c7,null));};exports[_0x37a3('0xb4')]=function(_0x1eaed7,_0x19f72f){return db[_0x37a3('0x3a')][_0x37a3('0x4a')]({'where':{'id':_0x1eaed7[_0x37a3('0x42')]['id']}})[_0x37a3('0x1a')](handleEntityNotFound(_0x19f72f,null))[_0x37a3('0x1a')](function(_0x18f87d){if(_0x18f87d){return _0x18f87d['setTags'](_0x1eaed7['body']['ids'],_[_0x37a3('0xb5')](_0x1eaed7[_0x37a3('0x34')],['ids','id'])||{})[_0x37a3('0xb6')](function(){return db[_0x37a3('0xb7')][_0x37a3('0x3f')]({'attributes':['id',_0x37a3('0x31'),'color'],'where':{'id':_0x1eaed7[_0x37a3('0x34')][_0x37a3('0xa1')]}});})[_0x37a3('0x1a')](function(_0x422351){socket[_0x37a3('0xb8')](_0x37a3('0xb9'),{'id':Number(_0x1eaed7[_0x37a3('0x42')]['id']),'tags':_0x422351||[]});return{'id':Number(_0x1eaed7[_0x37a3('0x42')]['id']),'tags':_0x422351||[]};});}})[_0x37a3('0x1a')](respondWithResult(_0x19f72f,null))[_0x37a3('0x25')](handleError(_0x19f72f,null));};exports['removeTags']=function(_0x91ecae,_0x5c3a3d){return db[_0x37a3('0x3a')][_0x37a3('0x4a')]({'where':{'id':_0x91ecae[_0x37a3('0x42')]['id']}})[_0x37a3('0x1a')](handleEntityNotFound(_0x5c3a3d,null))[_0x37a3('0x1a')](function(_0x5e06be){if(_0x5e06be){return _0x5e06be[_0x37a3('0xba')](_0x91ecae[_0x37a3('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x5c3a3d,null))[_0x37a3('0x25')](handleError(_0x5c3a3d,null));};exports[_0x37a3('0x7e')]=function(_0x5f4443,_0x3a9369){var _0x3a03ab=moment()[_0x37a3('0xbb')]()[_0x37a3('0xbc')]();var _0x3eed9b=path[_0x37a3('0x7a')](config[_0x37a3('0x7b')],_0x37a3('0xbd'),_0x37a3('0xbe'),_0x37a3('0xbf'));var _0x3ce612=path[_0x37a3('0x7a')](config[_0x37a3('0x7b')],_0x37a3('0xbd'),_0x37a3('0xbe'),_0x37a3('0xc0'));var _0x5bcfc2=path[_0x37a3('0x7a')](_0x3eed9b,_0x3a03ab);var _0x19008=util[_0x37a3('0x82')](_0x37a3('0xc1'),_0x5f4443[_0x37a3('0x42')]['id'],_0x3a03ab);var _0x19ad17=path[_0x37a3('0x7a')](_0x3eed9b,_0x19008);var _0x409c65=[];_0x409c65[_0x37a3('0xb2')]({'model':db[_0x37a3('0x86')],'as':_0x37a3('0x86'),'attributes':['id',_0x37a3('0x54')],'raw':!![]});_0x409c65[_0x37a3('0xb2')]({'model':db[_0x37a3('0x67')],'as':_0x37a3('0x68'),'attributes':['id',_0x37a3('0xc2'),_0x37a3('0xc3')],'raw':!![]});if(_0x5f4443[_0x37a3('0x40')][_0x37a3('0xc0')]){_0x409c65['push']({'model':db[_0x37a3('0x74')],'as':_0x37a3('0x74'),'raw':!![]});}var _0x50178e=[{'model':db['ChatMessage'],'as':_0x37a3('0x85'),'attributes':['id',_0x37a3('0x34'),'createdAt',_0x37a3('0x95'),'secret','read'],'include':_0x409c65}];_0x50178e[_0x37a3('0xb2')]({'model':db[_0x37a3('0x4f')],'as':_0x37a3('0xc4'),'attributes':['id','name']});_0x50178e['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x37a3('0x54')]});return db[_0x37a3('0x3a')]['find']({'where':{'id':_0x5f4443[_0x37a3('0x42')]['id']},'include':_0x50178e})['then'](handleEntityNotFound(_0x3a9369,null))['then'](function(_0x4b78a4){if(_0x4b78a4){var _0x476141=_0x4b78a4[_0x37a3('0xc5')]({'plain':!![]});fs[_0x37a3('0xc6')](_0x5bcfc2);var _0x5a1dea={'channel':_0x37a3('0xc7'),'account':_0x476141[_0x37a3('0xc4')][_0x37a3('0x31')],'agent':_0x476141[_0x37a3('0xc8')]?_0x476141['Owner'][_0x37a3('0x54')]:_0x37a3('0xc9'),'createdAt':moment(_0x476141[_0x37a3('0xca')])[_0x37a3('0x82')](_0x37a3('0xac'))[_0x37a3('0xbc')](),'closedAt':_0x476141['closed']?moment(_0x476141['closedAt'])[_0x37a3('0x82')](_0x37a3('0xac'))[_0x37a3('0xbc')]():'','disposition':_0x476141['disposition'],'chatInfo':{'browser':_0x476141[_0x37a3('0xcb')],'os':_0x476141[_0x37a3('0xcc')],'referer':_0x476141['referer'],'customerIp':_0x476141['customerIp'],'customerPort':_0x476141[_0x37a3('0xcd')]?_0x476141['customerPort']:_0x37a3('0xc9')},'messages':_(_0x476141[_0x37a3('0x85')])[_0x37a3('0xce')]()[_0x37a3('0xa9')]({'secret':![]})[_0x37a3('0x39')](function(_0x17b789){if(_0x17b789[_0x37a3('0x74')]){var _0x4839a8=path[_0x37a3('0x7a')](_0x3ce612,_0x17b789[_0x37a3('0x74')][_0x37a3('0x7d')]);if(fs['existsSync'](_0x4839a8)){fs[_0x37a3('0xcf')](_0x4839a8)['pipe'](fs['createWriteStream'](path[_0x37a3('0x7a')](_0x5bcfc2,_0x17b789[_0x37a3('0x74')]['basename'])));}}return{'date':moment(_0x17b789['createdAt'])[_0x37a3('0x82')](_0x37a3('0xac'))[_0x37a3('0xbc')](),'sender':_0x17b789[_0x37a3('0x95')]==='out'?_0x17b789[_0x37a3('0x86')]?_0x17b789[_0x37a3('0x86')][_0x37a3('0x54')]:'System':_0x17b789[_0x37a3('0x68')][_0x37a3('0xc2')]+(_0x17b789[_0x37a3('0x68')][_0x37a3('0xc3')]?'\x20'+_0x17b789[_0x37a3('0x68')]['lastName']:''),'body':_0x17b789['Attachment']?_0x17b789[_0x37a3('0x74')][_0x37a3('0x7d')]:_0x17b789[_0x37a3('0x34')],'direction':_0x17b789[_0x37a3('0x95')]==='out'?'A':'C','secret':_0x17b789['secret'],'read':_0x17b789[_0x37a3('0xd0')],'attachment':_0x17b789[_0x37a3('0x74')]};})[_0x37a3('0xd1')]()};return ejs[_0x37a3('0xd2')](path[_0x37a3('0x7a')](config[_0x37a3('0x7b')],'server',_0x37a3('0xd3'),'downloadInteraction.ejs'),{'interaction':_0x5a1dea})[_0x37a3('0x1a')](function(_0x64199d){var _0x408f1c=path[_0x37a3('0x7a')](_0x5bcfc2,_0x37a3('0xd4')+_0x476141['id']+'-'+_0x3a03ab+'.pdf');var _0x5a7cfb={'path':_0x408f1c,'channel':_0x37a3('0xc7'),'interactionId':_0x476141['id']};return pdf['createPdfFromHTML'](_0x64199d,_0x5a7cfb);})[_0x37a3('0x1a')](function(){return new Promise(function(_0x4b63ea,_0x9147e7){zipdir(_0x5bcfc2,{'saveTo':_0x19ad17},function(_0x2cf557,_0x5f48e4){if(_0x2cf557)return _0x9147e7(_0x2cf557);return _0x4b63ea(_0x5f48e4);});})[_0x37a3('0x1a')](function(){return new BPromise(function(_0x55fc60,_0x285eeb){rimraf(_0x5bcfc2,function(_0x5a08b0){if(_0x5a08b0)_0x285eeb(_0x5a08b0);return _0x55fc60();});});})[_0x37a3('0x1a')](function(){return _0x3a9369[_0x37a3('0x7e')](_0x19ad17,_0x19008,function(_0x4d805b){if(_0x4d805b){logger[_0x37a3('0x21')]('err',_0x4d805b);}else{fs[_0x37a3('0xd5')](_0x19ad17);}});});});}else{return _0x3a9369['sendStatus'](0xc8);}})[_0x37a3('0x25')](handleError(_0x3a9369,null));};
\ No newline at end of file
+var _0xc013=['toString','server','tmp','files','attachments','transcript-%d-%s.zip','push','Contact','firstName','read','Account','Owner','get','mkdirSync','createdAt','closedAt','browserName','referer','customerIp','customerPort','existsSync','createWriteStream','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','stack','name','send','render','body','contact','account','index','map','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','rawAttributes','filters','attributes','intersection','fields','includeAll','include','merge','create','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','closed','disposition','AbandonInteraction','originalname','basename','file','mimetype','attachmentDownload','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','transcript-%s.txt','pathTranscript','Messages','User','length','agentAlias','System','customer','format','Visitor','ContactId','website_alias','%s%d','agent_alias','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','hasOwnProperty','nolimit','order','alias','setTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix'];(function(_0x1ada47,_0x93420b){var _0x35d6c3=function(_0x5d3d56){while(--_0x5d3d56){_0x1ada47['push'](_0x1ada47['shift']());}};_0x35d6c3(++_0x93420b);}(_0xc013,0xf5));var _0x3c01=function(_0x91d019,_0x5223c4){_0x91d019=_0x91d019-0x0;var _0x19de1f=_0xc013[_0x91d019];return _0x19de1f;};'use strict';var rimraf=require(_0x3c01('0x0'));var zipdir=require(_0x3c01('0x1'));var rp=require(_0x3c01('0x2'));var moment=require('moment');var BPromise=require(_0x3c01('0x3'));var Mustache=require('mustache');var util=require(_0x3c01('0x4'));var path=require(_0x3c01('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3c01('0x6'));var Redis=require(_0x3c01('0x7'));var interaction=require(_0x3c01('0x8'));var qs=require(_0x3c01('0x9'));var pdf=require(_0x3c01('0xa'));var logger=require(_0x3c01('0xb'))(_0x3c01('0xc'));var config=require(_0x3c01('0xd'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3c01('0xe')](config[_0x3c01('0xf')],{'host':_0x3c01('0x10'),'port':0x18eb});var socket=require(_0x3c01('0x11'))(new Redis(config[_0x3c01('0xf')]));require(_0x3c01('0x12'))['register'](socket);var jayson=require(_0x3c01('0x13'));var client=jayson[_0x3c01('0x14')][_0x3c01('0x15')]({'port':0x232b});var client9004=jayson['client'][_0x3c01('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x59dabb,_0x282b16,_0x49b967,_0x4dd4b9){return new BPromise(function(_0x36272d,_0x5ae76a){var _0x46a485=_0x4dd4b9||client;return _0x46a485[_0x3c01('0x16')](_0x59dabb,_0x49b967)['then'](function(_0x38e459){logger[_0x3c01('0x17')](_0x3c01('0x18'),_0x282b16,'request\x20sent');logger[_0x3c01('0x19')](_0x3c01('0x1a'),_0x282b16,'request\x20sent',JSON['stringify'](_0x38e459));if(_0x38e459[_0x3c01('0x1b')]){if(_0x38e459[_0x3c01('0x1b')][_0x3c01('0x1c')]===0x1f4){logger[_0x3c01('0x1b')](_0x3c01('0x18'),_0x282b16,_0x38e459[_0x3c01('0x1b')][_0x3c01('0x1d')]);return _0x5ae76a(_0x38e459[_0x3c01('0x1b')][_0x3c01('0x1d')]);}logger[_0x3c01('0x1b')](_0x3c01('0x18'),_0x282b16,_0x38e459['error'][_0x3c01('0x1d')]);return _0x36272d(_0x38e459[_0x3c01('0x1b')][_0x3c01('0x1d')]);}else{logger[_0x3c01('0x17')](_0x3c01('0x18'),_0x282b16,_0x3c01('0x1e'));_0x36272d(_0x38e459[_0x3c01('0x1f')][_0x3c01('0x1d')]);}})[_0x3c01('0x20')](function(_0x12cc45){logger[_0x3c01('0x1b')](_0x3c01('0x18'),_0x282b16,_0x12cc45);_0x5ae76a(_0x12cc45);});});}function respondWithStatusCode(_0x31dea6,_0x784f98){_0x784f98=_0x784f98||0xcc;return function(_0x494339){if(_0x494339){return _0x31dea6[_0x3c01('0x21')](_0x784f98);}return _0x31dea6[_0x3c01('0x22')](_0x784f98)[_0x3c01('0x23')]();};}function respondWithResult(_0x1aa5c9,_0x16f376){_0x16f376=_0x16f376||0xc8;return function(_0x965374){if(_0x965374){return _0x1aa5c9[_0x3c01('0x22')](_0x16f376)[_0x3c01('0x24')](_0x965374);}};}function respondWithFilteredResult(_0x57c0c6,_0x5589ca){return function(_0x1b3006){if(_0x1b3006){var _0x5e2273=typeof _0x5589ca['offset']===_0x3c01('0x25')&&typeof _0x5589ca['limit']===_0x3c01('0x25');var _0x460994=_0x1b3006['count'];var _0x4dab2e=_0x5e2273?0x0:_0x5589ca['offset'];var _0x48b25d=_0x5e2273?_0x1b3006[_0x3c01('0x26')]:_0x5589ca[_0x3c01('0x27')]+_0x5589ca[_0x3c01('0x28')];var _0x42c6a8;if(_0x48b25d>=_0x460994){_0x48b25d=_0x460994;_0x42c6a8=0xc8;}else{_0x42c6a8=0xce;}_0x57c0c6['status'](_0x42c6a8);return _0x57c0c6[_0x3c01('0x29')](_0x3c01('0x2a'),_0x4dab2e+'-'+_0x48b25d+'/'+_0x460994)['json'](_0x1b3006);}return null;};}function saveUpdates(_0x15786e){return function(_0x47931f){if(_0x47931f){return _0x47931f[_0x3c01('0x2b')](_0x15786e)[_0x3c01('0x2c')](function(_0x5a3e56){return _0x5a3e56;});}return null;};}function removeEntity(_0x35be7d){return function(_0x198683){if(_0x198683){return _0x198683[_0x3c01('0x2d')]()['then'](function(){_0x35be7d[_0x3c01('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x552580){return function(_0x3f25c6){if(!_0x3f25c6){_0x552580[_0x3c01('0x21')](0x194);}return _0x3f25c6;};}function handleError(_0x5decd7,_0x574ea0){_0x574ea0=_0x574ea0||0x1f4;return function(_0x237a79){logger[_0x3c01('0x1b')](_0x237a79[_0x3c01('0x2e')]);if(_0x237a79['name']){delete _0x237a79[_0x3c01('0x2f')];}_0x5decd7[_0x3c01('0x22')](_0x574ea0)[_0x3c01('0x30')](_0x237a79);};}function getMustacheRender(_0x5904dc,_0x2dbbcb){return Mustache[_0x3c01('0x31')](_0x5904dc,_['merge'](_0x2dbbcb[_0x3c01('0x32')],{'contact':_0x2dbbcb[_0x3c01('0x33')],'message':_0x2dbbcb[_0x3c01('0x1d')],'agent':_0x2dbbcb['agent'],'interaction':_0x2dbbcb['interaction'],'account':_0x2dbbcb[_0x3c01('0x34')]}))||'';}exports[_0x3c01('0x35')]=function(_0xf9b7eb,_0x5d30c7){var _0x5acb39={};var _0x299d16=_[_0x3c01('0x36')](db[_0x3c01('0x37')]['rawAttributes'],function(_0x4001d2){return{'name':_0x4001d2[_0x3c01('0x38')],'type':_0x4001d2[_0x3c01('0x39')][_0x3c01('0x3a')]};});_0x5acb39=qs[_0x3c01('0x3b')](_0x299d16,_0xf9b7eb);return interaction[_0x3c01('0x3c')](_0x3c01('0x3d'),_0xf9b7eb[_0x3c01('0x3e')],_0xf9b7eb[_0x3c01('0x3f')],_0x5acb39,_0x299d16)[_0x3c01('0x2c')](respondWithFilteredResult(_0x5d30c7,_0x5acb39))[_0x3c01('0x20')](handleError(_0x5d30c7,null));};exports[_0x3c01('0x40')]=function(_0xf46328,_0x63e081){var _0x248982={'raw':![],'where':{'id':_0xf46328[_0x3c01('0x41')]['id']}},_0x37d08a={};_0x37d08a[_0x3c01('0x42')]=_[_0x3c01('0x43')](db['ChatInteraction'][_0x3c01('0x44')]);_0x37d08a[_0x3c01('0x3e')]=_[_0x3c01('0x43')](_0xf46328[_0x3c01('0x3e')]);_0x37d08a[_0x3c01('0x45')]=_['intersection'](_0x37d08a['model'],_0x37d08a[_0x3c01('0x3e')]);_0x248982[_0x3c01('0x46')]=_[_0x3c01('0x47')](_0x37d08a[_0x3c01('0x42')],qs[_0x3c01('0x48')](_0xf46328[_0x3c01('0x3e')][_0x3c01('0x48')]));_0x248982[_0x3c01('0x46')]=_0x248982[_0x3c01('0x46')]['length']?_0x248982[_0x3c01('0x46')]:_0x37d08a[_0x3c01('0x42')];if(_0xf46328['query'][_0x3c01('0x49')]){_0x248982[_0x3c01('0x4a')]=[{'all':!![]}];}_0x248982=_[_0x3c01('0x4b')]({},_0x248982,_0xf46328['options']);return db['ChatInteraction']['find'](_0x248982)[_0x3c01('0x2c')](handleEntityNotFound(_0x63e081,null))[_0x3c01('0x2c')](respondWithResult(_0x63e081,null))['catch'](handleError(_0x63e081,null));};exports[_0x3c01('0x4c')]=function(_0x458cd9,_0x3cad3f){return db[_0x3c01('0x37')][_0x3c01('0x4c')](_0x458cd9[_0x3c01('0x32')],{})['then'](respondWithResult(_0x3cad3f,0xc9))['catch'](handleError(_0x3cad3f,null));};exports[_0x3c01('0x2b')]=function(_0x36ddeb,_0x1e4b29){if(_0x36ddeb[_0x3c01('0x32')]['id']){delete _0x36ddeb[_0x3c01('0x32')]['id'];}return db[_0x3c01('0x37')][_0x3c01('0x4d')]({'where':{'id':_0x36ddeb['params']['id']}})[_0x3c01('0x2c')](handleEntityNotFound(_0x1e4b29,null))[_0x3c01('0x2c')](saveUpdates(_0x36ddeb[_0x3c01('0x32')],null))['then'](respondWithResult(_0x1e4b29,null))['catch'](handleError(_0x1e4b29,null));};exports[_0x3c01('0x2d')]=function(_0xee08f7,_0x512019){return db[_0x3c01('0x37')]['find']({'where':{'id':_0xee08f7[_0x3c01('0x41')]['id']}})[_0x3c01('0x2c')](handleEntityNotFound(_0x512019,null))['then'](removeEntity(_0x512019,null))[_0x3c01('0x20')](handleError(_0x512019,null));};exports[_0x3c01('0x4e')]=function(_0x2948e0,_0x4507a8){return db['ChatInteraction']['describe']()[_0x3c01('0x2c')](respondWithResult(_0x4507a8,null))[_0x3c01('0x20')](handleError(_0x4507a8,null));};exports[_0x3c01('0x4f')]=function(_0xdedbe5,_0x262ec7){var _0x50fa46=_0xdedbe5['params']['id'];var _0x1b6ccd;var _0x15a318;var _0x5ca2ac;return db[_0x3c01('0x37')][_0x3c01('0x50')]({'where':{'id':_0x50fa46}})[_0x3c01('0x2c')](function(_0x1eb7a7){_0x1b6ccd=_0x1eb7a7;return db[_0x3c01('0x51')][_0x3c01('0x50')]({'where':{'id':_0x1eb7a7[_0x3c01('0x52')]},'attributes':['id',_0x3c01('0x53'),_0x3c01('0x54'),_0x3c01('0x55'),_0x3c01('0x56'),_0x3c01('0x57')],'raw':!![]});})[_0x3c01('0x2c')](function(_0x497ad6){if(_0x497ad6&&_0x497ad6[_0x3c01('0x53')]&&_0x497ad6[_0x3c01('0x54')]){_0x15a318=_0x497ad6;var _0x2d7e49={'interaction':{'id':_0x50fa46},'agent':{'id':_0xdedbe5[_0x3c01('0x3f')]['id'],'name':_0xdedbe5[_0x3c01('0x3f')][_0x3c01('0x2f')],'fullname':_0xdedbe5['user'][_0x3c01('0x58')],'email':_0xdedbe5[_0x3c01('0x3f')]['email']},'contact':_0xdedbe5[_0x3c01('0x32')][_0x3c01('0x33')],'account':_0xdedbe5[_0x3c01('0x32')][_0x3c01('0x34')]};var _0x49d170={'rejectUnauthorized':![],'method':_0x3c01('0x59'),'url':_0x3c01('0x5a'),'headers':{'X-APIKEY':_0x497ad6['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0xdedbe5[_0x3c01('0x3f')][_0x3c01('0x5b')]],'buttons':null,'topic':_0x15a318[_0x3c01('0x55')],'note':_[_0x3c01('0x5c')](_0x15a318[_0x3c01('0x56')])?null:getMustacheRender(_0x15a318[_0x3c01('0x56')],_0x2d7e49),'metadata':null},'redirect':_0x3c01('0x5d'),'json':!![]};try{if(!_['isNull'](_0x15a318[_0x3c01('0x57')])){var _0x20d59c=getMustacheRender(_0x15a318[_0x3c01('0x57')],_0x2d7e49);var _0xaed906=JSON[_0x3c01('0x5e')](_0x20d59c);_0x49d170[_0x3c01('0x32')]['metadata']=_0xaed906;}}catch(_0x22d74e){throw new db[(_0x3c01('0x5f'))]['ValidationError'](_0x3c01('0x60'));}return rp(_0x49d170);}else{throw new db[(_0x3c01('0x5f'))][(_0x3c01('0x61'))](_0x3c01('0x62'));}})[_0x3c01('0x2c')](function(_0x1e1225){_0x5ca2ac=_0x1e1225;if(_0x5ca2ac['id']){var _0x2c51d0={'body':_0x5ca2ac[_0x3c01('0x63')],'ChatWebsiteId':_0x15a318['id'],'ChatInteractionId':_0x1b6ccd['id'],'direction':_0x3c01('0x64'),'UserId':_0xdedbe5[_0x3c01('0x3f')]['id']};return db[_0x3c01('0x65')]['create'](_0x2c51d0,{});}else{throw new db['Sequelize'][(_0x3c01('0x61'))](_0x3c01('0x66'));}})[_0x3c01('0x2c')](function(){return _0x1b6ccd[_0x3c01('0x67')]({'vidaooSessionId':_0x5ca2ac['id']});})['then'](respondWithResult(_0x262ec7,null))[_0x3c01('0x20')](handleError(_0x262ec7,null));};exports[_0x3c01('0x68')]=function(_0x2e7c76,_0x3db599){if(_0x2e7c76[_0x3c01('0x32')]['id']){delete _0x2e7c76[_0x3c01('0x32')]['id'];}return db[_0x3c01('0x37')][_0x3c01('0x4d')]({'where':{'id':_0x2e7c76[_0x3c01('0x41')]['id']},'include':[{'model':db[_0x3c01('0x69')],'as':'Contact'}]})[_0x3c01('0x2c')](handleEntityNotFound(_0x3db599,null))['then'](saveUpdates(_0x2e7c76[_0x3c01('0x32')],null))[_0x3c01('0x2c')](respondWithResult(_0x3db599,null))[_0x3c01('0x20')](handleError(_0x3db599,null));};exports[_0x3c01('0x6a')]=function(_0x26d134,_0x573013){if(_0x26d134[_0x3c01('0x32')]['id']){delete _0x26d134[_0x3c01('0x32')]['id'];}return db['ChatInteraction'][_0x3c01('0x4d')]({'where':{'id':_0x26d134[_0x3c01('0x41')]['id']}})['then'](function(_0x9e52f6){if(!_0x9e52f6){logger[_0x3c01('0x1b')](_0x3c01('0x6b'),_0x3c01('0x6a'),0x194,'entity\x20not\x20found');_0x573013[_0x3c01('0x21')](0x194);}else{if(_0x9e52f6[_0x3c01('0x6c')]){throw new db['Sequelize'][(_0x3c01('0x61'))]('Interaction\x20already\x20assigned');}}return _0x9e52f6;})['then'](function(_0x5e4135){if(_0x5e4135){return _0x5e4135[_0x3c01('0x2b')]({'closed':_0x26d134[_0x3c01('0x32')][_0x3c01('0x6d')],'disposition':_0x26d134[_0x3c01('0x32')][_0x3c01('0x6e')]})['then'](function(_0x563cfa){return _0x563cfa;});}})[_0x3c01('0x2c')](function(){return respondWithRpcPromise(_0x3c01('0x6f'),_0x3c01('0x6a'),_0x26d134[_0x3c01('0x32')],client9004);})[_0x3c01('0x2c')](respondWithResult(_0x573013,null))['catch'](handleError(_0x573013,null));};exports['attachmentUpload']=function(_0x25a1f1,_0x530562){_0x25a1f1[_0x3c01('0x32')]['name']=_0x25a1f1['file'][_0x3c01('0x70')];_0x25a1f1[_0x3c01('0x32')][_0x3c01('0x71')]=_0x25a1f1[_0x3c01('0x72')]['filename'];_0x25a1f1[_0x3c01('0x32')]['type']=_0x25a1f1[_0x3c01('0x72')][_0x3c01('0x73')];return db['Attachment'][_0x3c01('0x4c')](_0x25a1f1[_0x3c01('0x32')])[_0x3c01('0x2c')](respondWithResult(_0x530562,0xc9))[_0x3c01('0x20')](handleError(_0x530562,null));};exports[_0x3c01('0x74')]=function(_0x1bd383,_0xc85382){return db[_0x3c01('0x37')][_0x3c01('0x50')]({'where':{'id':_0x1bd383['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xc85382,null))[_0x3c01('0x2c')](function(_0x590b5d){if(_0x590b5d){if(_0x590b5d[_0x3c01('0x6d')]){return _0xc85382[_0x3c01('0x22')](0x193)[_0x3c01('0x24')]({'status':0x193,'message':'Unauthorized'});}return db[_0x3c01('0x75')]['findOne']({'where':{'id':_0x1bd383[_0x3c01('0x3e')][_0x3c01('0x76')]},'raw':!![]})[_0x3c01('0x2c')](handleEntityNotFound(_0xc85382,null));}})['then'](function(_0x5bba60){if(_0x5bba60){var _0x4d6722=_0x5bba60[_0x3c01('0x77')]!==null;var _0x2b3407=path[_0x3c01('0x78')](config[_0x3c01('0x79')],'server/files/attachments/');if(_0x4d6722){_0x2b3407=path[_0x3c01('0x78')](_0x2b3407,_0x3c01('0x7a'));}var _0x558d7a=path['join'](_0x2b3407,_0x5bba60[_0x3c01('0x71')]);return _0xc85382[_0x3c01('0x7b')](_0x558d7a);}})[_0x3c01('0x20')](handleError(_0xc85382,null));};exports[_0x3c01('0x7c')]=function(_0x3f5720,_0x2d24b4){var _0x39d379=null;var _0x575077=null;var _0xa776d2=null;if(_0x3f5720['body']['id']){delete _0x3f5720[_0x3c01('0x32')]['id'];}if(_0x3f5720['body'][_0x3c01('0x7d')]){_0xa776d2=path[_0x3c01('0x78')](config[_0x3c01('0x79')],'server/files/chat/upload/',util['format'](_0x3c01('0x7e'),Date['now']()));_0x3f5720[_0x3c01('0x32')][_0x3c01('0x7f')]=_0xa776d2;}return db['ChatInteraction']['find']({'where':{'id':_0x3f5720[_0x3c01('0x41')]['id']},'include':[{'model':db[_0x3c01('0x65')],'as':_0x3c01('0x80'),'include':[{'model':db[_0x3c01('0x81')],'as':_0x3c01('0x81')}]}]})[_0x3c01('0x2c')](handleEntityNotFound(_0x2d24b4,null))[_0x3c01('0x2c')](saveUpdates(_0x3f5720[_0x3c01('0x32')],null))[_0x3c01('0x2c')](function(_0x27cd91){if(_0x27cd91){_0x39d379=_0x27cd91;return db[_0x3c01('0x51')][_0x3c01('0x4d')]({'where':{'id':_0x39d379[_0x3c01('0x52')]}});}})[_0x3c01('0x2c')](function(_0x530753){if(_0x530753){_0x575077=_0x530753;return db[_0x3c01('0x69')][_0x3c01('0x4d')]({'where':{'id':_0x39d379['ContactId']}});}})['then'](function(_0x57a548){if(_0x57a548){if(_0xa776d2){var _0x2184fe=null;for(var _0x57a728=0x1;_0x57a728<_0x39d379[_0x3c01('0x80')][_0x3c01('0x82')];++_0x57a728){_0x2184fe=_0x39d379[_0x3c01('0x80')][_0x57a728];var _0x17d30e=_0x2184fe[_0x3c01('0x6c')]?util['format']('%s%d',_0x575077[_0x3c01('0x83')],_0x2184fe[_0x3c01('0x6c')]):_0x3c01('0x84');var _0x21b330=_0x3f5720[_0x3c01('0x32')][_0x3c01('0x85')]||util[_0x3c01('0x86')]('%s%d',_0x3c01('0x87'),_0x2184fe[_0x3c01('0x88')]);switch(_0x575077['agentIdentifier']){case _0x3c01('0x89'):_0x17d30e=_0x2184fe[_0x3c01('0x6c')]?util['format'](_0x3c01('0x8a'),_0x575077[_0x3c01('0x83')],_0x2184fe[_0x3c01('0x6c')]):_0x3c01('0x84');break;case _0x3c01('0x8b'):_0x17d30e=_0x2184fe[_0x3c01('0x6c')]?_0x2184fe[_0x3c01('0x81')]['alias']||_0x2184fe[_0x3c01('0x81')][_0x3c01('0x58')]:'System';break;case'agent_fullname':_0x17d30e=_0x2184fe['UserId']?_0x2184fe[_0x3c01('0x81')][_0x3c01('0x58')]:'System';break;default:_0x17d30e=_0x2184fe['UserId']?util['format'](_0x3c01('0x8a'),_0x575077['agentAlias'],_0x2184fe[_0x3c01('0x6c')]):_0x3c01('0x84');}var _0x26a691=util[_0x3c01('0x86')](_0x3c01('0x8c'),moment(_0x2184fe['createdAt'])[_0x3c01('0x86')]('MM/DD/YYYY\x20HH:mm:ss'),_0x2184fe[_0x3c01('0x8d')]==='in'?_0x21b330:_0x17d30e,_0x2184fe['body']);if(!_0x2184fe[_0x3c01('0x8e')]){fs[_0x3c01('0x8f')](_0xa776d2,_0x26a691);}}return db[_0x3c01('0x90')][_0x3c01('0x50')]({'where':{'service':!![]},'include':[{'model':db[_0x3c01('0x91')],'as':_0x3c01('0x92'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x3c01('0x93'),'raw':!![]}]}]});}}})[_0x3c01('0x2c')](function(_0x35ad81){if(!_0x35ad81||!_0x35ad81['Smtp']||!_0x3f5720['body'])return _0x39d379;var _0x305a6b=_0x35ad81[_0x3c01('0x94')]();return respondWithRpcPromise('SendMail',_0x3c01('0x95'),{'account':_0x305a6b,'message':{'from':util[_0x3c01('0x86')](_0x3c01('0x96'),_0x35ad81[_0x3c01('0x2f')],_0x35ad81[_0x3c01('0x5b')]||_0x35ad81[_0x3c01('0x92')][_0x3c01('0x3f')]),'to':_0x3f5720[_0x3c01('0x32')]['mailTranscript'],'subject':_0x3c01('0x97'),'text':util['format'](_0x3c01('0x98'),_0x3f5720[_0x3c01('0x32')][_0x3c01('0x7d')]),'attachments':[{'path':_0xa776d2}]}})[_0x3c01('0x2c')](function(){return _0x39d379;})['catch'](function(_0x252f68){logger['error'](_0x252f68);});})[_0x3c01('0x2c')](respondWithStatusCode(_0x2d24b4,0xc8))[_0x3c01('0x20')](handleError(_0x2d24b4,null));};exports[_0x3c01('0x99')]=function(_0x310e83,_0x42ebd0){return db['ChatMessage'][_0x3c01('0x4d')]({'where':{'id':_0x310e83['params']['id']}})[_0x3c01('0x2c')](handleEntityNotFound(_0x42ebd0,null))[_0x3c01('0x2c')](function(_0x3cf14a){if(_0x3cf14a){return _0x3cf14a[_0x3c01('0x99')](_0x310e83['body']['ids'],_['omit'](_0x310e83[_0x3c01('0x32')],[_0x3c01('0x9a'),'id'])||{});}})['then'](respondWithResult(_0x42ebd0,null))['catch'](handleError(_0x42ebd0,null));};exports[_0x3c01('0x9b')]=function(_0x41c44b,_0x4f8b05){var _0x5ef6ad={'raw':![],'where':{}};var _0x2dbe11={};var _0x12bdb8={'count':0x0,'rows':[]};return db[_0x3c01('0x37')]['findOne']({'where':{'id':_0x41c44b[_0x3c01('0x41')]['id']}})[_0x3c01('0x2c')](handleEntityNotFound(_0x4f8b05,null))[_0x3c01('0x2c')](function(_0x1f9a74){if(_0x1f9a74){_0x2dbe11[_0x3c01('0x42')]=_[_0x3c01('0x43')](db[_0x3c01('0x65')][_0x3c01('0x44')]);_0x2dbe11[_0x3c01('0x3e')]=_['keys'](_0x41c44b['query']);_0x2dbe11[_0x3c01('0x45')]=_[_0x3c01('0x47')](_0x2dbe11['model'],_0x2dbe11[_0x3c01('0x3e')]);_0x5ef6ad['attributes']=_[_0x3c01('0x47')](_0x2dbe11[_0x3c01('0x42')],qs[_0x3c01('0x48')](_0x41c44b[_0x3c01('0x3e')][_0x3c01('0x48')]));_0x5ef6ad[_0x3c01('0x46')]=_0x5ef6ad[_0x3c01('0x46')][_0x3c01('0x82')]?_0x5ef6ad['attributes']:_0x2dbe11[_0x3c01('0x42')];if(!_0x41c44b[_0x3c01('0x3e')]['hasOwnProperty']('nolimit')){_0x5ef6ad[_0x3c01('0x28')]=qs[_0x3c01('0x28')](_0x41c44b[_0x3c01('0x3e')]['limit']);_0x5ef6ad[_0x3c01('0x27')]=qs[_0x3c01('0x27')](_0x41c44b['query'][_0x3c01('0x27')]);}_0x5ef6ad['order']=qs[_0x3c01('0x9c')](_0x41c44b[_0x3c01('0x3e')][_0x3c01('0x9c')]);_0x5ef6ad[_0x3c01('0x9d')]=qs[_0x3c01('0x45')](_[_0x3c01('0x9e')](_0x41c44b['query'],_0x2dbe11['filters']));_0x5ef6ad['where'][_0x3c01('0x9f')]=_0x1f9a74['id'];if(_0x41c44b[_0x3c01('0x3e')][_0x3c01('0xa0')]){_0x5ef6ad[_0x3c01('0x9d')]=_[_0x3c01('0x4b')](_0x5ef6ad[_0x3c01('0x9d')],{'$or':_[_0x3c01('0x36')](_0x5ef6ad[_0x3c01('0x46')],function(_0x2c9a8d){var _0x11c427={};_0x11c427[_0x2c9a8d]={'$like':'%'+_0x41c44b[_0x3c01('0x3e')][_0x3c01('0xa0')]+'%'};return _0x11c427;})});}if(_0x41c44b[_0x3c01('0x3e')][_0x3c01('0xa1')]){var _0x520682=_0x41c44b[_0x3c01('0x3e')][_0x3c01('0xa1')][_0x3c01('0xa2')](',');var _0x1c4f95={};_0x1c4f95[_0x520682[0x0]]={'$gte':moment(_0x520682[0x1])[_0x3c01('0x86')](_0x3c01('0xa3'))};_0x5ef6ad[_0x3c01('0x9d')]=_['merge'](_0x5ef6ad[_0x3c01('0x9d')],_0x1c4f95);}_0x5ef6ad=_[_0x3c01('0x4b')]({},_0x5ef6ad,_0x41c44b[_0x3c01('0xa4')]);return db[_0x3c01('0x65')][_0x3c01('0x26')]({'where':_0x5ef6ad[_0x3c01('0x9d')]})[_0x3c01('0x2c')](function(_0x1ce110){_0x12bdb8['count']=_0x1ce110;if(_0x41c44b[_0x3c01('0x3e')]['includeAll']){_0x5ef6ad[_0x3c01('0x4a')]=[{'all':!![]}];}return db[_0x3c01('0x65')][_0x3c01('0x3c')](_0x5ef6ad);})[_0x3c01('0x2c')](function(_0x59bcad){_0x12bdb8[_0x3c01('0xa5')]=_0x59bcad;return _0x12bdb8;});}})[_0x3c01('0x2c')](respondWithFilteredResult(_0x4f8b05,_0x5ef6ad))[_0x3c01('0x20')](handleError(_0x4f8b05,null));};exports['getMyMessages']=function(_0x47efdf,_0x1e905e){var _0x2b4881={'where':{}},_0x26c4db={},_0x3b5f91={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3c01('0x50')]({'where':{'id':_0x47efdf['params']['id']}})[_0x3c01('0x2c')](handleEntityNotFound(_0x1e905e,null))[_0x3c01('0x2c')](function(_0x34fb1d){if(_0x34fb1d){_0x26c4db[_0x3c01('0x42')]=_['keys'](db[_0x3c01('0x65')][_0x3c01('0x44')]);_0x26c4db['query']=_[_0x3c01('0x43')](_0x47efdf[_0x3c01('0x3e')]);_0x26c4db[_0x3c01('0x45')]=_[_0x3c01('0x47')](_0x26c4db[_0x3c01('0x42')],_0x26c4db['query']);_0x2b4881[_0x3c01('0x46')]=_[_0x3c01('0x47')](_0x26c4db['model'],qs[_0x3c01('0x48')](_0x47efdf[_0x3c01('0x3e')][_0x3c01('0x48')]));_0x2b4881[_0x3c01('0x46')]=_0x2b4881[_0x3c01('0x46')][_0x3c01('0x82')]?_0x2b4881[_0x3c01('0x46')]:_0x26c4db[_0x3c01('0x42')];if(!_0x47efdf['query'][_0x3c01('0xa6')](_0x3c01('0xa7'))){_0x2b4881[_0x3c01('0x28')]=qs[_0x3c01('0x28')](_0x47efdf[_0x3c01('0x3e')][_0x3c01('0x28')]);_0x2b4881[_0x3c01('0x27')]=qs['offset'](_0x47efdf[_0x3c01('0x3e')]['offset']);}_0x2b4881[_0x3c01('0xa8')]=qs['sort'](_0x47efdf[_0x3c01('0x3e')][_0x3c01('0x9c')]);_0x2b4881[_0x3c01('0x9d')]=qs[_0x3c01('0x45')](_['pick'](_0x47efdf[_0x3c01('0x3e')],_0x26c4db[_0x3c01('0x45')]));_0x2b4881[_0x3c01('0x9d')][_0x3c01('0x9f')]=_0x34fb1d['id'];if(_0x47efdf['query'][_0x3c01('0xa0')]){_0x2b4881[_0x3c01('0x9d')]=_[_0x3c01('0x4b')](_0x2b4881[_0x3c01('0x9d')],{'$or':_['map'](_0x2b4881['attributes'],function(_0x37e448){var _0x15cdcb={};_0x15cdcb[_0x37e448]={'$like':'%'+_0x47efdf[_0x3c01('0x3e')][_0x3c01('0xa0')]+'%'};return _0x15cdcb;})});}_0x2b4881[_0x3c01('0x9d')][_0x3c01('0x8e')]=![];if(_0x47efdf['query']['id']){_0x2b4881['where']['id']={'$gt':_0x47efdf[_0x3c01('0x3e')]['id']};}_0x2b4881=_['merge']({},_0x2b4881,_0x47efdf[_0x3c01('0xa4')]);return db['ChatMessage'][_0x3c01('0x26')]({'where':_0x2b4881[_0x3c01('0x9d')]})['then'](function(_0x19fc25){_0x3b5f91[_0x3c01('0x26')]=_0x19fc25;_0x2b4881[_0x3c01('0x4a')]=[];if(_0x47efdf[_0x3c01('0x3e')]['includeAgent']){_0x2b4881[_0x3c01('0x4a')]['push']({'model':db['User'],'as':_0x3c01('0x81'),'attributes':['id',_0x3c01('0x58'),_0x3c01('0xa9')]});}if(_0x47efdf['query'][_0x3c01('0x49')]){_0x2b4881['include']=[{'all':!![]}];}return db[_0x3c01('0x65')]['findAll'](_0x2b4881);})[_0x3c01('0x2c')](function(_0x5c7a9d){_0x3b5f91[_0x3c01('0xa5')]=_0x5c7a9d;return _0x3b5f91;});}})[_0x3c01('0x2c')](respondWithFilteredResult(_0x1e905e,_0x2b4881))[_0x3c01('0x20')](handleError(_0x1e905e,null));};exports['addTags']=function(_0xac8a93,_0x100ae1){return db[_0x3c01('0x37')][_0x3c01('0x4d')]({'where':{'id':_0xac8a93[_0x3c01('0x41')]['id']}})[_0x3c01('0x2c')](handleEntityNotFound(_0x100ae1,null))[_0x3c01('0x2c')](function(_0x37524c){if(_0x37524c){return _0x37524c[_0x3c01('0xaa')](_0xac8a93[_0x3c01('0x32')]['ids'],_[_0x3c01('0xab')](_0xac8a93['body'],['ids','id'])||{})[_0x3c01('0xac')](function(){return db[_0x3c01('0xad')]['findAll']({'attributes':['id',_0x3c01('0x2f'),_0x3c01('0xae')],'where':{'id':_0xac8a93[_0x3c01('0x32')][_0x3c01('0x9a')]}});})[_0x3c01('0x2c')](function(_0x3ccbb5){socket[_0x3c01('0xaf')](_0x3c01('0xb0'),{'id':Number(_0xac8a93[_0x3c01('0x41')]['id']),'tags':_0x3ccbb5||[]});return{'id':Number(_0xac8a93[_0x3c01('0x41')]['id']),'tags':_0x3ccbb5||[]};});}})[_0x3c01('0x2c')](respondWithResult(_0x100ae1,null))[_0x3c01('0x20')](handleError(_0x100ae1,null));};exports[_0x3c01('0xb1')]=function(_0x54f7fa,_0x2dba4d){return db[_0x3c01('0x37')][_0x3c01('0x4d')]({'where':{'id':_0x54f7fa[_0x3c01('0x41')]['id']}})['then'](handleEntityNotFound(_0x2dba4d,null))[_0x3c01('0x2c')](function(_0x3240a7){if(_0x3240a7){return _0x3240a7['removeTags'](_0x54f7fa[_0x3c01('0x3e')]['ids']);}})[_0x3c01('0x2c')](respondWithStatusCode(_0x2dba4d,null))[_0x3c01('0x20')](handleError(_0x2dba4d,null));};exports[_0x3c01('0x7b')]=function(_0xa49e4e,_0x5b404b){var _0x429f7d=moment()[_0x3c01('0xb2')]()[_0x3c01('0xb3')]();var _0x4ebb68=path['join'](config[_0x3c01('0x79')],_0x3c01('0xb4'),'files',_0x3c01('0xb5'));var _0x464346=path['join'](config['root'],_0x3c01('0xb4'),_0x3c01('0xb6'),_0x3c01('0xb7'));var _0x50480e=path['join'](_0x4ebb68,_0x429f7d);var _0x32800f=util[_0x3c01('0x86')](_0x3c01('0xb8'),_0xa49e4e[_0x3c01('0x41')]['id'],_0x429f7d);var _0x592986=path['join'](_0x4ebb68,_0x32800f);var _0x5a063c=[];_0x5a063c[_0x3c01('0xb9')]({'model':db[_0x3c01('0x81')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5a063c['push']({'model':db[_0x3c01('0x69')],'as':_0x3c01('0xba'),'attributes':['id',_0x3c01('0xbb'),'lastName'],'raw':!![]});if(_0xa49e4e[_0x3c01('0x3e')][_0x3c01('0xb7')]){_0x5a063c['push']({'model':db[_0x3c01('0x75')],'as':_0x3c01('0x75'),'raw':!![]});}var _0x2035e1=[{'model':db[_0x3c01('0x65')],'as':_0x3c01('0x80'),'attributes':['id','body','createdAt','direction',_0x3c01('0x8e'),_0x3c01('0xbc')],'include':_0x5a063c}];_0x2035e1[_0x3c01('0xb9')]({'model':db[_0x3c01('0x51')],'as':_0x3c01('0xbd'),'attributes':['id',_0x3c01('0x2f')]});_0x2035e1[_0x3c01('0xb9')]({'model':db[_0x3c01('0x81')],'as':_0x3c01('0xbe'),'attributes':['id','fullname']});return db[_0x3c01('0x37')]['find']({'where':{'id':_0xa49e4e[_0x3c01('0x41')]['id']},'include':_0x2035e1})[_0x3c01('0x2c')](handleEntityNotFound(_0x5b404b,null))[_0x3c01('0x2c')](function(_0x5e7db6){if(_0x5e7db6){var _0x4b3cdc=_0x5e7db6[_0x3c01('0xbf')]({'plain':!![]});fs[_0x3c01('0xc0')](_0x50480e);var _0xe8e2af={'channel':'Chat','account':_0x4b3cdc[_0x3c01('0xbd')]['name'],'agent':_0x4b3cdc[_0x3c01('0xbe')]?_0x4b3cdc['Owner'][_0x3c01('0x58')]:'N.A.','createdAt':moment(_0x4b3cdc[_0x3c01('0xc1')])[_0x3c01('0x86')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3c01('0xb3')](),'closedAt':_0x4b3cdc[_0x3c01('0x6d')]?moment(_0x4b3cdc[_0x3c01('0xc2')])[_0x3c01('0x86')](_0x3c01('0xa3'))[_0x3c01('0xb3')]():'','disposition':_0x4b3cdc[_0x3c01('0x6e')],'chatInfo':{'browser':_0x4b3cdc[_0x3c01('0xc3')],'os':_0x4b3cdc['osName'],'referer':_0x4b3cdc[_0x3c01('0xc4')],'customerIp':_0x4b3cdc[_0x3c01('0xc5')],'customerPort':_0x4b3cdc[_0x3c01('0xc6')]?_0x4b3cdc[_0x3c01('0xc6')]:'N.A.'},'messages':_(_0x4b3cdc[_0x3c01('0x80')])['tail']()[_0x3c01('0xa0')]({'secret':![]})['map'](function(_0x54a50b){if(_0x54a50b['Attachment']){var _0x4a4c68=path[_0x3c01('0x78')](_0x464346,_0x54a50b[_0x3c01('0x75')][_0x3c01('0x71')]);if(fs[_0x3c01('0xc7')](_0x4a4c68)){fs['createReadStream'](_0x4a4c68)['pipe'](fs[_0x3c01('0xc8')](path['join'](_0x50480e,_0x54a50b[_0x3c01('0x75')]['basename'])));}}return{'date':moment(_0x54a50b[_0x3c01('0xc1')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3c01('0xb3')](),'sender':_0x54a50b[_0x3c01('0x8d')]===_0x3c01('0x64')?_0x54a50b[_0x3c01('0x81')]?_0x54a50b[_0x3c01('0x81')][_0x3c01('0x58')]:_0x3c01('0x84'):_0x54a50b[_0x3c01('0xba')][_0x3c01('0xbb')]+(_0x54a50b[_0x3c01('0xba')][_0x3c01('0xc9')]?'\x20'+_0x54a50b['Contact'][_0x3c01('0xc9')]:''),'body':_0x54a50b[_0x3c01('0x75')]?_0x54a50b['Attachment'][_0x3c01('0x71')]:_0x54a50b['body'],'direction':_0x54a50b['direction']===_0x3c01('0x64')?'A':'C','secret':_0x54a50b[_0x3c01('0x8e')],'read':_0x54a50b[_0x3c01('0xbc')],'attachment':_0x54a50b[_0x3c01('0x75')]};})[_0x3c01('0xca')]()};return ejs[_0x3c01('0xcb')](path[_0x3c01('0x78')](config['root'],_0x3c01('0xb4'),_0x3c01('0xcc'),_0x3c01('0xcd')),{'interaction':_0xe8e2af})[_0x3c01('0x2c')](function(_0x152bec){var _0x52a09b=path[_0x3c01('0x78')](_0x50480e,_0x3c01('0xce')+_0x4b3cdc['id']+'-'+_0x429f7d+_0x3c01('0xcf'));var _0x5bd457={'path':_0x52a09b,'channel':_0x3c01('0xd0'),'interactionId':_0x4b3cdc['id']};return pdf[_0x3c01('0xd1')](_0x152bec,_0x5bd457);})[_0x3c01('0x2c')](function(){return new Promise(function(_0x554836,_0x1685f1){zipdir(_0x50480e,{'saveTo':_0x592986},function(_0x215551,_0x491be5){if(_0x215551)return _0x1685f1(_0x215551);return _0x554836(_0x491be5);});})[_0x3c01('0x2c')](function(){return new BPromise(function(_0x56fad1,_0xa7371){rimraf(_0x50480e,function(_0x9ebc12){if(_0x9ebc12)_0xa7371(_0x9ebc12);return _0x56fad1();});});})[_0x3c01('0x2c')](function(){return _0x5b404b['download'](_0x592986,_0x32800f,function(_0x44f2e8){if(_0x44f2e8){logger['error'](_0x3c01('0xd2'),_0x44f2e8);}else{fs[_0x3c01('0xd3')](_0x592986);}});});});}else{return _0x5b404b[_0x3c01('0x21')](0xc8);}})[_0x3c01('0x20')](handleError(_0x5b404b,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 780538b..6a6a700 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 _0x630e=['setMaxListeners','save','remove','getUsers','setDataValue','Users','map','then','emit','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x57510a,_0x63f368){var _0x15200b=function(_0x27d48a){while(--_0x27d48a){_0x57510a['push'](_0x57510a['shift']());}};_0x15200b(++_0x63f368);}(_0x630e,0x1a0));var _0xe630=function(_0x44fa99,_0x2a8f2a){_0x44fa99=_0x44fa99-0x0;var _0x2c4123=_0x630e[_0x44fa99];return _0x2c4123;};'use strict';var EventEmitter=require(_0xe630('0x0'));var ChatInteraction=require(_0xe630('0x1'))['db'][_0xe630('0x2')];var ChatMessage=require(_0xe630('0x1'))['db'][_0xe630('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe630('0x4')](0x0);var events={'afterCreate':_0xe630('0x5'),'afterUpdate':'update','afterDestroy':_0xe630('0x6')};function emitEvent(_0x160a04){return function(_0x6fb47e,_0x759d3c,_0x11b0bc){_0x6fb47e[_0xe630('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e864c){_0x6fb47e[_0xe630('0x8')](_0xe630('0x9'),_0x3e864c[_0xe630('0xa')](function(_0x1f23c1){return{'id':_0x1f23c1['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x6fb47e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe630('0xb')](function(_0x2a1f05){_0x6fb47e[_0xe630('0x8')]('unreadMessages',_0x2a1f05['length']);ChatInteractionEvents[_0xe630('0xc')](_0x160a04+':'+_0x6fb47e['id'],_0x6fb47e);ChatInteractionEvents[_0xe630('0xc')](_0x160a04,_0x6fb47e);_0x11b0bc(null);})['catch'](_0x11b0bc(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xe630('0xd')](e,emitEvent(event));}}module[_0xe630('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x804e=['update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save'];(function(_0x242ecf,_0xcbeb0){var _0x5c8971=function(_0x234cfd){while(--_0x234cfd){_0x242ecf['push'](_0x242ecf['shift']());}};_0x5c8971(++_0xcbeb0);}(_0x804e,0x79));var _0xe804=function(_0x535bf6,_0x43a5ae){_0x535bf6=_0x535bf6-0x0;var _0x5d764c=_0x804e[_0x535bf6];return _0x5d764c;};'use strict';var EventEmitter=require(_0xe804('0x0'));var ChatInteraction=require(_0xe804('0x1'))['db'][_0xe804('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xe804('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe804('0x4'),'afterUpdate':_0xe804('0x5'),'afterDestroy':_0xe804('0x6')};function emitEvent(_0x19e812){return function(_0x5e52ab,_0x15cbaf,_0xe4d772){_0x5e52ab[_0xe804('0x7')]({'attributes':['id'],'raw':!![]})[_0xe804('0x8')](function(_0x274ce){_0x5e52ab[_0xe804('0x9')](_0xe804('0xa'),_0x274ce[_0xe804('0xb')](function(_0x813e3f){return{'id':_0x813e3f['id']};}));return ChatMessage[_0xe804('0xc')]({'where':{'ChatInteractionId':_0x5e52ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe804('0x8')](function(_0x311139){_0x5e52ab[_0xe804('0x9')]('unreadMessages',_0x311139[_0xe804('0xd')]);ChatInteractionEvents[_0xe804('0xe')](_0x19e812+':'+_0x5e52ab['id'],_0x5e52ab);ChatInteractionEvents[_0xe804('0xe')](_0x19e812,_0x5e52ab);_0xe4d772(null);})[_0xe804('0xf')](_0xe4d772(null));};}for(var e in events){if(events[_0xe804('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xe804('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index b0a79c5..0c36e3f 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 _0xe4f6=['changed','closed','format','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions'];(function(_0x49309b,_0x4b048d){var _0x2e6d7e=function(_0x897b09){while(--_0x897b09){_0x49309b['push'](_0x49309b['shift']());}};_0x2e6d7e(++_0x4b048d);}(_0xe4f6,0xb4));var _0x6e4f=function(_0x3cfb9e,_0x103c95){_0x3cfb9e=_0x3cfb9e-0x0;var _0x446856=_0xe4f6[_0x3cfb9e];return _0x446856;};'use strict';var _=require(_0x6e4f('0x0'));var util=require('util');var logger=require(_0x6e4f('0x1'))(_0x6e4f('0x2'));var moment=require('moment');var BPromise=require(_0x6e4f('0x3'));var rp=require(_0x6e4f('0x4'));var fs=require('fs');var path=require(_0x6e4f('0x5'));var rimraf=require(_0x6e4f('0x6'));var config=require(_0x6e4f('0x7'));var attributes=require(_0x6e4f('0x8'));module['exports']=function(_0xdfb230,_0x33db06){return _0xdfb230[_0x6e4f('0x9')](_0x6e4f('0xa'),attributes,{'tableName':_0x6e4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32e3c2,_0x19cdc8,_0x4ac024){if(_0x32e3c2[_0x6e4f('0xc')](_0x6e4f('0xd'))){_0x32e3c2['closedAt']=moment()[_0x6e4f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4ac024(null,_0x32e3c2);}},'charset':'utf8mb4','collate':_0x6e4f('0xf')});};
\ No newline at end of file
+var _0xd7af=['moment','bluebird','request-promise','path','rimraf','define','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util'];(function(_0xaca408,_0x5663b4){var _0x23f079=function(_0x230c77){while(--_0x230c77){_0xaca408['push'](_0xaca408['shift']());}};_0x23f079(++_0x5663b4);}(_0xd7af,0x8a));var _0xfd7a=function(_0x27ddfb,_0x2ae31f){_0x27ddfb=_0x27ddfb-0x0;var _0x3a3efd=_0xd7af[_0x27ddfb];return _0x3a3efd;};'use strict';var _=require(_0xfd7a('0x0'));var util=require(_0xfd7a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfd7a('0x2'));var BPromise=require(_0xfd7a('0x3'));var rp=require(_0xfd7a('0x4'));var fs=require('fs');var path=require(_0xfd7a('0x5'));var rimraf=require(_0xfd7a('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x3bd028,_0x202f29){return _0x3bd028[_0xfd7a('0x7')]('ChatInteraction',attributes,{'tableName':_0xfd7a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x262deb,_0x3ccb31,_0x38e44b){if(_0x262deb[_0xfd7a('0x9')](_0xfd7a('0xa'))){_0x262deb[_0xfd7a('0xb')]=moment()['format'](_0xfd7a('0xc'));}_0x38e44b(null,_0x262deb);}},'charset':'utf8mb4','collate':_0xfd7a('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index b271ee2..01002c8 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 _0x8f4c=['ChatInteraction','update','body','options','raw','attributes','limit','debug','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction'];(function(_0x4f750d,_0x4a9ec4){var _0x3d3d31=function(_0x30fd7a){while(--_0x30fd7a){_0x4f750d['push'](_0x4f750d['shift']());}};_0x3d3d31(++_0x4a9ec4);}(_0x8f4c,0x65));var _0xc8f4=function(_0x2f8b0f,_0x532d7c){_0x2f8b0f=_0x2f8b0f-0x0;var _0x34273d=_0x8f4c[_0x2f8b0f];return _0x34273d;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require('moment');var BPromise=require(_0xc8f4('0x2'));var rs=require(_0xc8f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8f4('0x4'))['db'];var utils=require(_0xc8f4('0x5'));var logger=require(_0xc8f4('0x6'))(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc8f4('0x9')][_0xc8f4('0xa')]({'port':0x232a});config[_0xc8f4('0xb')]=_[_0xc8f4('0xc')](config[_0xc8f4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc8f4('0xd'))(new Redis(config[_0xc8f4('0xb')]));require(_0xc8f4('0xe'))[_0xc8f4('0xf')](socket);function respondWithRpcPromise(_0x38e948,_0x4e9ce1,_0x1af77e){return new BPromise(function(_0x4d4be5,_0x42120e){return client['request'](_0x38e948,_0x1af77e)[_0xc8f4('0x10')](function(_0x54ec06){logger[_0xc8f4('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x4e9ce1,_0xc8f4('0x12'));logger['debug'](_0xc8f4('0x13'),_0x4e9ce1,_0xc8f4('0x12'),JSON[_0xc8f4('0x14')](_0x54ec06));if(_0x54ec06[_0xc8f4('0x15')]){if(_0x54ec06[_0xc8f4('0x15')][_0xc8f4('0x16')]===0x1f4){logger[_0xc8f4('0x15')](_0xc8f4('0x17'),_0x4e9ce1,_0x54ec06[_0xc8f4('0x15')][_0xc8f4('0x18')]);return _0x42120e(_0x54ec06[_0xc8f4('0x15')]['message']);}logger[_0xc8f4('0x15')](_0xc8f4('0x17'),_0x4e9ce1,_0x54ec06[_0xc8f4('0x15')][_0xc8f4('0x18')]);return _0x4d4be5(_0x54ec06[_0xc8f4('0x15')][_0xc8f4('0x18')]);}else{logger[_0xc8f4('0x11')](_0xc8f4('0x17'),_0x4e9ce1,_0xc8f4('0x12'));_0x4d4be5(_0x54ec06[_0xc8f4('0x19')][_0xc8f4('0x18')]);}})[_0xc8f4('0x1a')](function(_0x5be566){logger[_0xc8f4('0x15')](_0xc8f4('0x17'),_0x4e9ce1,_0x5be566);_0x42120e(_0x5be566);});});}exports[_0xc8f4('0x1b')]=function(_0x8595ab){var _0x34edfe=this;return new Promise(function(_0x44a3a7,_0x4f608a){return db[_0xc8f4('0x1c')][_0xc8f4('0x1d')](_0x8595ab[_0xc8f4('0x1e')],{'raw':_0x8595ab[_0xc8f4('0x1f')]?_0x8595ab[_0xc8f4('0x1f')][_0xc8f4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8595ab[_0xc8f4('0x1f')]?_0x8595ab[_0xc8f4('0x1f')]['where']||null:null,'attributes':_0x8595ab[_0xc8f4('0x1f')]?_0x8595ab[_0xc8f4('0x1f')][_0xc8f4('0x21')]||null:null,'limit':_0x8595ab[_0xc8f4('0x1f')]?_0x8595ab['options'][_0xc8f4('0x22')]||null:null})[_0xc8f4('0x10')](function(_0x3a4b73){logger['info'](_0xc8f4('0x1b'),_0x8595ab);logger[_0xc8f4('0x23')](_0xc8f4('0x1b'),_0x8595ab,JSON[_0xc8f4('0x14')](_0x3a4b73));_0x44a3a7(_0x3a4b73);})[_0xc8f4('0x1a')](function(_0x37d60f){logger[_0xc8f4('0x15')](_0xc8f4('0x1b'),_0x37d60f[_0xc8f4('0x18')],_0x8595ab);_0x4f608a(_0x34edfe[_0xc8f4('0x15')](0x1f4,_0x37d60f['message']));});});};exports[_0xc8f4('0x24')]=function(_0x3205a4){return new Promise(function(_0x357cc7,_0x4e9ecc){return db['ChatInteraction'][_0xc8f4('0x25')]({'where':_0x3205a4['options']?_0x3205a4[_0xc8f4('0x1f')]['where']||null:null})[_0xc8f4('0x10')](function(_0x3066f0){if(_0x3066f0){return _0x3066f0[_0xc8f4('0x26')](_0x3205a4[_0xc8f4('0x1e')][_0xc8f4('0x27')],_[_0xc8f4('0x28')](_0x3205a4[_0xc8f4('0x1e')],[_0xc8f4('0x27'),'id'])||{});}})[_0xc8f4('0x29')](function(_0x41a17e){logger[_0xc8f4('0x11')](_0xc8f4('0x2a'),_0x3205a4);logger['debug'](_0xc8f4('0x2a'),_0x3205a4,JSON['stringify'](_0x41a17e));_0x357cc7(_0x41a17e);})[_0xc8f4('0x1a')](function(_0x4af131){logger['error'](_0xc8f4('0x2a'),_0x4af131[_0xc8f4('0x18')],_0x3205a4);_0x4e9ecc(_this[_0xc8f4('0x15')](0x1f4,_0x4af131[_0xc8f4('0x18')]));});});};
\ No newline at end of file
+var _0x7060=['request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','options','raw','where','attributes','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','omit','body','spread','AddTags','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x5b366f,_0x46ba68){var _0x536f9b=function(_0x3214c7){while(--_0x3214c7){_0x5b366f['push'](_0x5b366f['shift']());}};_0x536f9b(++_0x46ba68);}(_0x7060,0x1d4));var _0x0706=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7060[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0706('0x0'));var util=require(_0x0706('0x1'));var moment=require('moment');var BPromise=require(_0x0706('0x2'));var rs=require(_0x0706('0x3'));var fs=require('fs');var Redis=require(_0x0706('0x4'));var db=require(_0x0706('0x5'))['db'];var utils=require(_0x0706('0x6'));var logger=require(_0x0706('0x7'))(_0x0706('0x8'));var config=require(_0x0706('0x9'));var jayson=require(_0x0706('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x0706('0xb')]=_[_0x0706('0xc')](config['redis'],{'host':_0x0706('0xd'),'port':0x18eb});var socket=require(_0x0706('0xe'))(new Redis(config[_0x0706('0xb')]));require(_0x0706('0xf'))['register'](socket);function respondWithRpcPromise(_0x1373a4,_0x3031ea,_0x165522){return new BPromise(function(_0x547693,_0x9dde63){return client[_0x0706('0x10')](_0x1373a4,_0x165522)[_0x0706('0x11')](function(_0xdcf7f2){logger[_0x0706('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x3031ea,_0x0706('0x13'));logger[_0x0706('0x14')](_0x0706('0x15'),_0x3031ea,'request\x20sent',JSON['stringify'](_0xdcf7f2));if(_0xdcf7f2[_0x0706('0x16')]){if(_0xdcf7f2['error'][_0x0706('0x17')]===0x1f4){logger['error'](_0x0706('0x18'),_0x3031ea,_0xdcf7f2[_0x0706('0x16')][_0x0706('0x19')]);return _0x9dde63(_0xdcf7f2[_0x0706('0x16')]['message']);}logger[_0x0706('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3031ea,_0xdcf7f2[_0x0706('0x16')]['message']);return _0x547693(_0xdcf7f2['error'][_0x0706('0x19')]);}else{logger[_0x0706('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x3031ea,_0x0706('0x13'));_0x547693(_0xdcf7f2[_0x0706('0x1a')][_0x0706('0x19')]);}})[_0x0706('0x1b')](function(_0x4b81ec){logger[_0x0706('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3031ea,_0x4b81ec);_0x9dde63(_0x4b81ec);});});}exports['UpdateChatInteraction']=function(_0xe69205){var _0x507676=this;return new Promise(function(_0x182bec,_0x44eb67){return db[_0x0706('0x1c')][_0x0706('0x1d')](_0xe69205['body'],{'raw':_0xe69205['options']?_0xe69205[_0x0706('0x1e')][_0x0706('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe69205[_0x0706('0x1e')]?_0xe69205[_0x0706('0x1e')][_0x0706('0x20')]||null:null,'attributes':_0xe69205[_0x0706('0x1e')]?_0xe69205[_0x0706('0x1e')][_0x0706('0x21')]||null:null,'limit':_0xe69205[_0x0706('0x1e')]?_0xe69205['options']['limit']||null:null})[_0x0706('0x11')](function(_0x1b2856){logger['info'](_0x0706('0x22'),_0xe69205);logger[_0x0706('0x14')](_0x0706('0x22'),_0xe69205,JSON['stringify'](_0x1b2856));_0x182bec(_0x1b2856);})[_0x0706('0x1b')](function(_0x3cf10b){logger[_0x0706('0x16')](_0x0706('0x22'),_0x3cf10b[_0x0706('0x19')],_0xe69205);_0x44eb67(_0x507676['error'](0x1f4,_0x3cf10b[_0x0706('0x19')]));});});};exports[_0x0706('0x23')]=function(_0x4e0bdf){return new Promise(function(_0x56ab89,_0x48f008){return db['ChatInteraction'][_0x0706('0x24')]({'where':_0x4e0bdf[_0x0706('0x1e')]?_0x4e0bdf[_0x0706('0x1e')]['where']||null:null})[_0x0706('0x11')](function(_0x244deb){if(_0x244deb){return _0x244deb[_0x0706('0x25')](_0x4e0bdf['body'][_0x0706('0x26')],_[_0x0706('0x27')](_0x4e0bdf[_0x0706('0x28')],[_0x0706('0x26'),'id'])||{});}})[_0x0706('0x29')](function(_0x572208){logger[_0x0706('0x12')](_0x0706('0x2a'),_0x4e0bdf);logger['debug'](_0x0706('0x2a'),_0x4e0bdf,JSON[_0x0706('0x2b')](_0x572208));_0x56ab89(_0x572208);})[_0x0706('0x1b')](function(_0x5ac10f){logger[_0x0706('0x16')](_0x0706('0x2a'),_0x5ac10f[_0x0706('0x19')],_0x4e0bdf);_0x48f008(_this[_0x0706('0x16')](0x1f4,_0x5ac10f[_0x0706('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index e08297f..c725530 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 _0xc3a8=['chatInteraction:','./chatInteraction.events','save','remove','emit','register','length'];(function(_0x4f77ab,_0x3bc032){var _0x12d696=function(_0x3dd31c){while(--_0x3dd31c){_0x4f77ab['push'](_0x4f77ab['shift']());}};_0x12d696(++_0x3bc032);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0xc3a8[_0x507403];return _0x1327c;};'use strict';var ChatInteractionEvents=require(_0x8c3a('0x0'));var events=[_0x8c3a('0x1'),_0x8c3a('0x2'),'update'];function createListener(_0x1790e6,_0x5b6a76){return function(_0x3142c7){_0x5b6a76[_0x8c3a('0x3')](_0x1790e6,_0x3142c7);};}function removeListener(_0x3585d1,_0x1d993b){return function(){ChatInteractionEvents['removeListener'](_0x3585d1,_0x1d993b);};}exports[_0x8c3a('0x4')]=function(_0x2477f9){for(var _0x18a92a=0x0,_0x170999=events[_0x8c3a('0x5')];_0x18a92a<_0x170999;_0x18a92a++){var _0x37047e=events[_0x18a92a];var _0x58a9b0=createListener(_0x8c3a('0x6')+_0x37047e,_0x2477f9);ChatInteractionEvents['on'](_0x37047e,_0x58a9b0);}};
\ No newline at end of file
+var _0xdb67=['emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x4587d6,_0x1d1523){var _0x393d9e=function(_0x3bd6cd){while(--_0x3bd6cd){_0x4587d6['push'](_0x4587d6['shift']());}};_0x393d9e(++_0x1d1523);}(_0xdb67,0x90));var _0x7db6=function(_0x11b764,_0x1ecfe5){_0x11b764=_0x11b764-0x0;var _0x24f0ac=_0xdb67[_0x11b764];return _0x24f0ac;};'use strict';var ChatInteractionEvents=require(_0x7db6('0x0'));var events=['save','remove','update'];function createListener(_0x51d5ef,_0x3b4855){return function(_0x1b9867){_0x3b4855[_0x7db6('0x1')](_0x51d5ef,_0x1b9867);};}function removeListener(_0x5386e0,_0x4b02cb){return function(){ChatInteractionEvents[_0x7db6('0x2')](_0x5386e0,_0x4b02cb);};}exports[_0x7db6('0x3')]=function(_0x114dbd){for(var _0x590232=0x0,_0x59b1f6=events['length'];_0x590232<_0x59b1f6;_0x590232++){var _0x1dc63d=events[_0x590232];var _0x269d7d=createListener(_0x7db6('0x4')+_0x1dc63d,_0x114dbd);ChatInteractionEvents['on'](_0x1dc63d,_0x269d7d);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index d9f424f..2775ae7 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 _0x6aba=['/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','addMessage','/:id/tags','tracked','chat','addTags','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','/:id','chatinteraction:destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','describe','get','show','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0x6aba,0x1ec));var _0xa6ab=function(_0x2794ab,_0x1044b5){_0x2794ab=_0x2794ab-0x0;var _0x3fd145=_0x6aba[_0x2794ab];return _0x3fd145;};'use strict';var multer=require(_0xa6ab('0x0'));var util=require('util');var path=require(_0xa6ab('0x1'));var timeout=require('connect-timeout');var express=require(_0xa6ab('0x2'));var router=express[_0xa6ab('0x3')]();var fs_extra=require(_0xa6ab('0x4'));var auth=require(_0xa6ab('0x5'));var interaction=require(_0xa6ab('0x6'));var config=require(_0xa6ab('0x7'));var controller=require(_0xa6ab('0x8'));router['get']('/',auth[_0xa6ab('0x9')](),controller[_0xa6ab('0xa')]);router['get']('/describe',auth[_0xa6ab('0x9')](),controller[_0xa6ab('0xb')]);router[_0xa6ab('0xc')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0xa6ab('0xd')]);router['get'](_0xa6ab('0xe'),auth[_0xa6ab('0xf')](),controller['attachmentDownload']);router['get'](_0xa6ab('0x10'),auth[_0xa6ab('0x9')](),controller[_0xa6ab('0x11')]);router[_0xa6ab('0xc')](_0xa6ab('0x12'),auth['isChatInteractionAuthorized'](),controller[_0xa6ab('0x13')]);router[_0xa6ab('0xc')](_0xa6ab('0x14'),auth[_0xa6ab('0x9')](),controller[_0xa6ab('0x15')]);router[_0xa6ab('0x16')]('/',auth['isAuthenticated'](),controller[_0xa6ab('0x17')]);router['post'](_0xa6ab('0x18'),auth[_0xa6ab('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xa6ab('0x19')]({'destination':function(_0x89d0fd,_0x387ecc,_0x3741c3){_0x3741c3(null,path[_0xa6ab('0x1a')](config['root'],_0xa6ab('0x1b')));},'filename':function(_0x47ab64,_0x2de710,_0x539a8c){_0x539a8c(null,util[_0xa6ab('0x1c')]('%s-%s',Date[_0xa6ab('0x1d')](),_0x2de710[_0xa6ab('0x1e')][_0xa6ab('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa6ab('0x16')](_0xa6ab('0x20'),upload[_0xa6ab('0x21')]('file'),controller['attachmentUpload']);router[_0xa6ab('0x16')]('/:id/messages',auth[_0xa6ab('0xf')](),controller[_0xa6ab('0x22')]);router['post'](_0xa6ab('0x23'),auth[_0xa6ab('0x9')](),interaction[_0xa6ab('0x24')](_0xa6ab('0x25'),'chatinteraction:addtags'),controller[_0xa6ab('0x26')]);router['put']('/:id',auth[_0xa6ab('0x9')](),interaction['tracked'](_0xa6ab('0x25'),'chatinteraction:update'),controller[_0xa6ab('0x27')]);router[_0xa6ab('0x28')](_0xa6ab('0x29'),controller[_0xa6ab('0x2a')]);router['put'](_0xa6ab('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xa6ab('0x2c')]);router['put'](_0xa6ab('0x2d'),controller[_0xa6ab('0x2e')]);router[_0xa6ab('0x2f')](_0xa6ab('0x30'),auth[_0xa6ab('0x9')](),interaction[_0xa6ab('0x24')](_0xa6ab('0x25'),_0xa6ab('0x31')),controller['destroy']);router[_0xa6ab('0x2f')](_0xa6ab('0x23'),auth[_0xa6ab('0x9')](),controller['removeTags']);module[_0xa6ab('0x32')]=router;
\ No newline at end of file
+var _0x8fc5=['getMessages','/:id/my_messages','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','/:id/custom_update','customUpdate','abandon','/:id/close','close','destroy','delete','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages'];(function(_0x2e5167,_0x1cef92){var _0xfd5324=function(_0x1b5427){while(--_0x1b5427){_0x2e5167['push'](_0x2e5167['shift']());}};_0xfd5324(++_0x1cef92);}(_0x8fc5,0xce));var _0x58fc=function(_0x130b53,_0x30924b){_0x130b53=_0x130b53-0x0;var _0x358070=_0x8fc5[_0x130b53];return _0x358070;};'use strict';var multer=require('multer');var util=require(_0x58fc('0x0'));var path=require(_0x58fc('0x1'));var timeout=require(_0x58fc('0x2'));var express=require(_0x58fc('0x3'));var router=express['Router']();var fs_extra=require(_0x58fc('0x4'));var auth=require(_0x58fc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x58fc('0x6'));var controller=require(_0x58fc('0x7'));router[_0x58fc('0x8')]('/',auth[_0x58fc('0x9')](),controller[_0x58fc('0xa')]);router['get'](_0x58fc('0xb'),auth[_0x58fc('0x9')](),controller[_0x58fc('0xc')]);router[_0x58fc('0x8')]('/:id',auth[_0x58fc('0xd')](),controller[_0x58fc('0xe')]);router['get'](_0x58fc('0xf'),auth[_0x58fc('0xd')](),controller[_0x58fc('0x10')]);router[_0x58fc('0x8')](_0x58fc('0x11'),auth[_0x58fc('0x9')](),controller[_0x58fc('0x12')]);router[_0x58fc('0x8')](_0x58fc('0x13'),auth[_0x58fc('0xd')](),controller[_0x58fc('0x14')]);router[_0x58fc('0x8')](_0x58fc('0x15'),auth[_0x58fc('0x9')](),controller['download']);router[_0x58fc('0x16')]('/',auth[_0x58fc('0x9')](),controller['create']);router[_0x58fc('0x16')](_0x58fc('0x17'),auth[_0x58fc('0x9')](),controller[_0x58fc('0x18')]);var upload=multer({'storage':multer[_0x58fc('0x19')]({'destination':function(_0x33a7b8,_0x17ff5f,_0x1e4170){_0x1e4170(null,path[_0x58fc('0x1a')](config[_0x58fc('0x1b')],_0x58fc('0x1c')));},'filename':function(_0x1e85f1,_0x1f2711,_0x2febae){_0x2febae(null,util[_0x58fc('0x1d')](_0x58fc('0x1e'),Date[_0x58fc('0x1f')](),_0x1f2711[_0x58fc('0x20')][_0x58fc('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x58fc('0x16')](_0x58fc('0x22'),upload[_0x58fc('0x23')](_0x58fc('0x24')),controller[_0x58fc('0x25')]);router['post'](_0x58fc('0x11'),auth[_0x58fc('0xd')](),controller[_0x58fc('0x26')]);router[_0x58fc('0x16')](_0x58fc('0x27'),auth[_0x58fc('0x9')](),interaction[_0x58fc('0x28')](_0x58fc('0x29'),_0x58fc('0x2a')),controller[_0x58fc('0x2b')]);router[_0x58fc('0x2c')](_0x58fc('0x2d'),auth[_0x58fc('0x9')](),interaction[_0x58fc('0x28')](_0x58fc('0x29'),_0x58fc('0x2e')),controller['update']);router['put'](_0x58fc('0x2f'),controller[_0x58fc('0x30')]);router[_0x58fc('0x2c')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x58fc('0x31')]);router[_0x58fc('0x2c')](_0x58fc('0x32'),controller[_0x58fc('0x33')]);router['delete'](_0x58fc('0x2d'),auth[_0x58fc('0x9')](),interaction['tracked'](_0x58fc('0x29'),'chatinteraction:destroy'),controller[_0x58fc('0x34')]);router[_0x58fc('0x35')](_0x58fc('0x27'),auth[_0x58fc('0x9')](),controller[_0x58fc('0x36')]);module[_0x58fc('0x37')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 0a8d861..7214b21 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 _0x5066=['BOOLEAN','INTEGER','exports','TEXT','medium'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0x5066,0x98));var _0x6506=function(_0xe1bdfa,_0x5371ce){_0xe1bdfa=_0xe1bdfa-0x0;var _0x28daee=_0x5066[_0xe1bdfa];return _0x28daee;};'use strict';var Sequelize=require('sequelize');module[_0x6506('0x0')]={'body':{'type':Sequelize[_0x6506('0x1')](_0x6506('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6506('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6506('0x4')]}};
\ No newline at end of file
+var _0xe493=['sequelize','exports','medium','BOOLEAN'];(function(_0x2b53d0,_0x46dfb4){var _0x5b59d9=function(_0x1bfff4){while(--_0x1bfff4){_0x2b53d0['push'](_0x2b53d0['shift']());}};_0x5b59d9(++_0x46dfb4);}(_0xe493,0x158));var _0x3e49=function(_0x2feb4c,_0x488e1f){_0x2feb4c=_0x2feb4c-0x0;var _0x594db6=_0xe493[_0x2feb4c];return _0x594db6;};'use strict';var Sequelize=require(_0x3e49('0x0'));module[_0x3e49('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3e49('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3e49('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 9400014..1d60282 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 _0xea20=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','ChatInternalMessage','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','then','rows','catch','show','keys','rawAttributes','find','create','body','params','describe','get','messages','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','fullname','role','internal','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','push','createdAt','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xea20,0x144));var _0x0ea2=function(_0x5e67f1,_0x18774c){_0x5e67f1=_0x5e67f1-0x0;var _0x567754=_0xea20[_0x5e67f1];return _0x567754;};'use strict';var emlformat=require(_0x0ea2('0x0'));var rimraf=require(_0x0ea2('0x1'));var zipdir=require(_0x0ea2('0x2'));var jsonpatch=require(_0x0ea2('0x3'));var rp=require(_0x0ea2('0x4'));var moment=require(_0x0ea2('0x5'));var BPromise=require(_0x0ea2('0x6'));var Mustache=require(_0x0ea2('0x7'));var util=require(_0x0ea2('0x8'));var path=require(_0x0ea2('0x9'));var sox=require(_0x0ea2('0xa'));var csv=require(_0x0ea2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ea2('0xc'));var squel=require(_0x0ea2('0xd'));var crypto=require(_0x0ea2('0xe'));var jsforce=require(_0x0ea2('0xf'));var deskjs=require(_0x0ea2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0ea2('0x11'));var Papa=require(_0x0ea2('0x12'));var Redis=require(_0x0ea2('0x13'));var authService=require(_0x0ea2('0x14'));var qs=require(_0x0ea2('0x15'));var as=require(_0x0ea2('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0ea2('0x17'));var licenseUtil=require(_0x0ea2('0x18'));var db=require(_0x0ea2('0x19'))['db'];config[_0x0ea2('0x1a')]=_[_0x0ea2('0x1b')](config[_0x0ea2('0x1a')],{'host':_0x0ea2('0x1c'),'port':0x18eb});var socket=require(_0x0ea2('0x1d'))(new Redis(config[_0x0ea2('0x1a')]));require(_0x0ea2('0x1e'))[_0x0ea2('0x1f')](socket);function respondWithStatusCode(_0x58e075,_0x3788aa){_0x3788aa=_0x3788aa||0xcc;return function(_0x1971d9){if(_0x1971d9){return _0x58e075[_0x0ea2('0x20')](_0x3788aa);}return _0x58e075[_0x0ea2('0x21')](_0x3788aa)[_0x0ea2('0x22')]();};}function respondWithResult(_0x3729e5,_0x560d79){_0x560d79=_0x560d79||0xc8;return function(_0x187a31){if(_0x187a31){return _0x3729e5[_0x0ea2('0x21')](_0x560d79)[_0x0ea2('0x23')](_0x187a31);}};}function respondWithFilteredResult(_0x1dc811,_0x3c0292){return function(_0x2ee782){if(_0x2ee782){var _0x328cc1=typeof _0x3c0292['offset']==='undefined'&&typeof _0x3c0292[_0x0ea2('0x24')]===_0x0ea2('0x25');var _0x2aa570=_0x2ee782[_0x0ea2('0x26')];var _0x452535=_0x328cc1?0x0:_0x3c0292[_0x0ea2('0x27')];var _0x2dcc87=_0x328cc1?_0x2ee782['count']:_0x3c0292['offset']+_0x3c0292['limit'];var _0x493747;if(_0x2dcc87>=_0x2aa570){_0x2dcc87=_0x2aa570;_0x493747=0xc8;}else{_0x493747=0xce;}_0x1dc811[_0x0ea2('0x21')](_0x493747);return _0x1dc811[_0x0ea2('0x28')](_0x0ea2('0x29'),_0x452535+'-'+_0x2dcc87+'/'+_0x2aa570)[_0x0ea2('0x23')](_0x2ee782);}return null;};}function patchUpdates(_0x396725){return function(_0x3fd1d0){try{jsonpatch[_0x0ea2('0x2a')](_0x3fd1d0,_0x396725,!![]);}catch(_0x30a63f){return BPromise[_0x0ea2('0x2b')](_0x30a63f);}return _0x3fd1d0[_0x0ea2('0x2c')]();};}function saveUpdates(_0xf96111,_0x521e99){return function(_0x30cbb8){if(_0x30cbb8){return _0x30cbb8[_0x0ea2('0x2d')](_0xf96111)['then'](function(_0x4c94fa){return _0x4c94fa;});}return null;};}function removeEntity(_0x11b1e7,_0x195b6){return function(_0x71381f){if(_0x71381f){return _0x71381f[_0x0ea2('0x2e')]()['then'](function(){_0x11b1e7[_0x0ea2('0x21')](0xcc)[_0x0ea2('0x22')]();});}};}function handleEntityNotFound(_0x1ca167,_0x3c8cf3){return function(_0xdccb9a){if(!_0xdccb9a){_0x1ca167[_0x0ea2('0x20')](0x194);}return _0xdccb9a;};}function handleError(_0x53c905,_0x4b28a5){_0x4b28a5=_0x4b28a5||0x1f4;return function(_0x2dcbad){logger[_0x0ea2('0x2f')](_0x2dcbad[_0x0ea2('0x30')]);if(_0x2dcbad['name']){delete _0x2dcbad[_0x0ea2('0x31')];}_0x53c905[_0x0ea2('0x21')](_0x4b28a5)[_0x0ea2('0x32')](_0x2dcbad);};}exports['index']=function(_0x4d592f,_0x1bc6a6){var _0x2d6dd1={},_0x31d504={},_0x140997={'count':0x0,'rows':[]};var _0x9d5040=_['map'](db[_0x0ea2('0x33')]['rawAttributes'],function(_0x207f6f){return{'name':_0x207f6f[_0x0ea2('0x34')],'type':_0x207f6f['type'][_0x0ea2('0x35')]};});_0x31d504[_0x0ea2('0x36')]=_[_0x0ea2('0x37')](_0x9d5040,_0x0ea2('0x31'));_0x31d504[_0x0ea2('0x38')]=_['keys'](_0x4d592f[_0x0ea2('0x38')]);_0x31d504[_0x0ea2('0x39')]=_[_0x0ea2('0x3a')](_0x31d504[_0x0ea2('0x36')],_0x31d504[_0x0ea2('0x38')]);_0x2d6dd1[_0x0ea2('0x3b')]=_['intersection'](_0x31d504[_0x0ea2('0x36')],qs['fields'](_0x4d592f[_0x0ea2('0x38')][_0x0ea2('0x3c')]));_0x2d6dd1[_0x0ea2('0x3b')]=_0x2d6dd1['attributes'][_0x0ea2('0x3d')]?_0x2d6dd1['attributes']:_0x31d504[_0x0ea2('0x36')];if(!_0x4d592f[_0x0ea2('0x38')][_0x0ea2('0x3e')](_0x0ea2('0x3f'))){_0x2d6dd1[_0x0ea2('0x24')]=qs[_0x0ea2('0x24')](_0x4d592f[_0x0ea2('0x38')][_0x0ea2('0x24')]);_0x2d6dd1[_0x0ea2('0x27')]=qs[_0x0ea2('0x27')](_0x4d592f[_0x0ea2('0x38')][_0x0ea2('0x27')]);}_0x2d6dd1[_0x0ea2('0x40')]=qs[_0x0ea2('0x41')](_0x4d592f[_0x0ea2('0x38')][_0x0ea2('0x41')]);_0x2d6dd1[_0x0ea2('0x42')]=qs[_0x0ea2('0x39')](_[_0x0ea2('0x43')](_0x4d592f[_0x0ea2('0x38')],_0x31d504[_0x0ea2('0x39')]),_0x9d5040);if(_0x4d592f[_0x0ea2('0x38')]['filter']){_0x2d6dd1[_0x0ea2('0x42')]=_[_0x0ea2('0x44')](_0x2d6dd1[_0x0ea2('0x42')],{'$or':_['map'](_0x9d5040,function(_0x2cfd55){if(_0x2cfd55[_0x0ea2('0x45')]!==_0x0ea2('0x46')){var _0x192178={};_0x192178[_0x2cfd55[_0x0ea2('0x31')]]={'$like':'%'+_0x4d592f[_0x0ea2('0x38')][_0x0ea2('0x47')]+'%'};return _0x192178;}})});}_0x2d6dd1=_[_0x0ea2('0x44')]({},_0x2d6dd1,_0x4d592f['options']);var _0x2377f2={'where':_0x2d6dd1['where']};return db['ChatInternalMessage'][_0x0ea2('0x26')](_0x2377f2)['then'](function(_0x13b45e){_0x140997['count']=_0x13b45e;if(_0x4d592f[_0x0ea2('0x38')][_0x0ea2('0x48')]){_0x2d6dd1[_0x0ea2('0x49')]=[{'all':!![]}];}return db[_0x0ea2('0x33')][_0x0ea2('0x4a')](_0x2d6dd1);})[_0x0ea2('0x4b')](function(_0xd6a58d){_0x140997[_0x0ea2('0x4c')]=_0xd6a58d;return _0x140997;})[_0x0ea2('0x4b')](respondWithFilteredResult(_0x1bc6a6,_0x2d6dd1))[_0x0ea2('0x4d')](handleError(_0x1bc6a6,null));};exports[_0x0ea2('0x4e')]=function(_0x406a1d,_0x43313a){var _0x23c530={'raw':!![],'where':{'id':_0x406a1d['params']['id']}},_0x379705={};_0x379705[_0x0ea2('0x36')]=_[_0x0ea2('0x4f')](db[_0x0ea2('0x33')][_0x0ea2('0x50')]);_0x379705[_0x0ea2('0x38')]=_[_0x0ea2('0x4f')](_0x406a1d[_0x0ea2('0x38')]);_0x379705[_0x0ea2('0x39')]=_[_0x0ea2('0x3a')](_0x379705['model'],_0x379705['query']);_0x23c530['attributes']=_['intersection'](_0x379705[_0x0ea2('0x36')],qs[_0x0ea2('0x3c')](_0x406a1d[_0x0ea2('0x38')]['fields']));_0x23c530[_0x0ea2('0x3b')]=_0x23c530[_0x0ea2('0x3b')][_0x0ea2('0x3d')]?_0x23c530[_0x0ea2('0x3b')]:_0x379705[_0x0ea2('0x36')];if(_0x406a1d[_0x0ea2('0x38')][_0x0ea2('0x48')]){_0x23c530['include']=[{'all':!![]}];}_0x23c530=_[_0x0ea2('0x44')]({},_0x23c530,_0x406a1d['options']);return db[_0x0ea2('0x33')][_0x0ea2('0x51')](_0x23c530)[_0x0ea2('0x4b')](handleEntityNotFound(_0x43313a,null))[_0x0ea2('0x4b')](respondWithResult(_0x43313a,null))['catch'](handleError(_0x43313a,null));};exports['create']=function(_0x2207d7,_0x3716fb){return db[_0x0ea2('0x33')][_0x0ea2('0x52')](_0x2207d7['body'],{})[_0x0ea2('0x4b')](respondWithResult(_0x3716fb,0xc9))['catch'](handleError(_0x3716fb,null));};exports[_0x0ea2('0x2d')]=function(_0x25bf84,_0x43ebca){if(_0x25bf84['body']['id']){delete _0x25bf84[_0x0ea2('0x53')]['id'];}return db[_0x0ea2('0x33')][_0x0ea2('0x51')]({'where':{'id':_0x25bf84[_0x0ea2('0x54')]['id']}})[_0x0ea2('0x4b')](handleEntityNotFound(_0x43ebca,null))[_0x0ea2('0x4b')](saveUpdates(_0x25bf84[_0x0ea2('0x53')],null))[_0x0ea2('0x4b')](respondWithResult(_0x43ebca,null))[_0x0ea2('0x4d')](handleError(_0x43ebca,null));};exports[_0x0ea2('0x2e')]=function(_0x46092d,_0x2141c6){return db[_0x0ea2('0x33')][_0x0ea2('0x51')]({'where':{'id':_0x46092d['params']['id']}})[_0x0ea2('0x4b')](handleEntityNotFound(_0x2141c6,null))[_0x0ea2('0x4b')](removeEntity(_0x2141c6,null))[_0x0ea2('0x4d')](handleError(_0x2141c6,null));};exports[_0x0ea2('0x55')]=function(_0x190fcf,_0x42fe90){return db[_0x0ea2('0x33')]['describe']()['then'](respondWithResult(_0x42fe90,null))[_0x0ea2('0x4d')](handleError(_0x42fe90,null));};function wrapUser(_0x1ded64){return function(_0x377170){var _0x1cd381=_0x1ded64[_0x0ea2('0x56')]({'plain':!![]});_0x1cd381[_0x0ea2('0x57')]=[];if(_0x377170){_0x1cd381[_0x0ea2('0x58')]=_0x377170['createdAt'];_0x1cd381[_0x0ea2('0x59')]=_0x377170;}else{_0x1cd381[_0x0ea2('0x58')]=moment(0x0)['format'](_0x0ea2('0x5a'));_0x1cd381[_0x0ea2('0x59')]={};}return _0x1cd381;};}exports['getUsers']=function(_0x96e8c2,_0x40921d,_0x1a2b25){var _0x48e72a=[];return db[_0x0ea2('0x5b')][_0x0ea2('0x4a')]({'where':{'role':[_0x0ea2('0x5c'),_0x0ea2('0x5d'),'user']},'attributes':['id',_0x0ea2('0x5e'),_0x0ea2('0x31'),_0x0ea2('0x5f'),'userpic',_0x0ea2('0x60'),'online',_0x0ea2('0x61'),_0x0ea2('0x62'),'showWebBar'],'order':qs[_0x0ea2('0x41')](_0x0ea2('0x63')),'include':[{'model':db[_0x0ea2('0x64')],'as':_0x0ea2('0x65'),'attributes':['id','name',_0x0ea2('0x45')],'through':{'attributes':[]}}]})['then'](function(_0x5e1005){if(_0x5e1005){var _0x34d9b6=_0x96e8c2['user'][_0x0ea2('0x56')]({'plain':!![]});if(!_0x34d9b6)throw new Error(_0x0ea2('0x66'));if(_0x34d9b6[_0x0ea2('0x5f')]===_0x0ea2('0x67')){return db[_0x0ea2('0x68')]['find']({'where':{'name':_0x0ea2('0x69'),'userProfileId':_0x34d9b6['userProfileId']},'raw':!![]})[_0x0ea2('0x4b')](function(_0x300271){if(_0x300271){if(_0x300271[_0x0ea2('0x6a')]===0x0){return db[_0x0ea2('0x6b')][_0x0ea2('0x4a')]({'where':{'sectionId':_0x300271['id']},'raw':!![]})['then'](function(_0x5aad87){var _0x4f134d=[];if(_[_0x0ea2('0x6c')](_0x5aad87)){_0x4f134d=_[_0x0ea2('0x47')](_0x5e1005,function(_0x2c6621){if(_0x2c6621[_0x0ea2('0x5f')]!==_0x0ea2('0x5c')){return _0x2c6621;}});return _0x4f134d;}else{for(var _0x8b8a35=0x0;_0x8b8a35<_0x5e1005[_0x0ea2('0x3d')];_0x8b8a35++){var _0x634b17=_0x5e1005[_0x8b8a35];if(_0x634b17[_0x0ea2('0x5f')]===_0x0ea2('0x5c')){var _0x559ae3=_['find'](_0x5aad87,function(_0x15f88b){return _0x15f88b['resourceId']===_0x634b17['id'];});if(_0x559ae3)_0x4f134d[_0x0ea2('0x6d')](_0x634b17);}else{_0x4f134d[_0x0ea2('0x6d')](_0x634b17);}}return _0x4f134d;}});}else{return _0x5e1005;}}else{var _0x516117=_[_0x0ea2('0x47')](_0x5e1005,function(_0x58462a){if(_0x58462a['role']!==_0x0ea2('0x5c')){return _0x58462a;}});return _0x516117;}});}else{return _0x5e1005;}}})['then'](function(_0x5eb9fb){var _0x7c4ac8=[];if(_0x5eb9fb){_0x48e72a=_0x5eb9fb;for(var _0x216690=0x0;_0x216690<_0x5eb9fb['length'];_0x216690+=0x1){_0x48e72a[_0x216690][_0x0ea2('0x57')]=[];_0x7c4ac8[_0x0ea2('0x6d')](db[_0x0ea2('0x33')][_0x0ea2('0x51')]({'where':{'FromId':[_0x96e8c2[_0x0ea2('0x67')]['id'],_0x5eb9fb[_0x216690]['id']],'ToId':[_0x96e8c2['user']['id'],_0x5eb9fb[_0x216690]['id']],'ChatGroupId':null},'attributes':['id',_0x0ea2('0x6e'),_0x0ea2('0x6f'),_0x0ea2('0x70'),_0x0ea2('0x71'),_0x0ea2('0x53')],'order':qs[_0x0ea2('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0ea2('0x4b')](wrapUser(_0x5eb9fb[_0x216690])));}return BPromise[_0x0ea2('0x72')](_0x7c4ac8);}return[];})['then'](function(_0x4b9592){return{'rows':_0x4b9592,'count':_0x4b9592['length']};})[_0x0ea2('0x4b')](respondWithResult(_0x40921d,null))['catch'](handleError(_0x40921d,null));};
\ No newline at end of file
+var _0xc406=['FromId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','end','error','name','send','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','include','rows','catch','show','params','intersection','includeAll','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','lastMessage','getUsers','User','findAll','admin','user','fullname','role','internal','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc406,0xd0));var _0x6c40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc406[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c40('0x0'));var zipdir=require(_0x6c40('0x1'));var jsonpatch=require(_0x6c40('0x2'));var rp=require(_0x6c40('0x3'));var moment=require(_0x6c40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6c40('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6c40('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c40('0x7'));var _=require(_0x6c40('0x8'));var squel=require(_0x6c40('0x9'));var crypto=require(_0x6c40('0xa'));var jsforce=require(_0x6c40('0xb'));var deskjs=require(_0x6c40('0xc'));var toCsv=require(_0x6c40('0x6'));var querystring=require('querystring');var Papa=require(_0x6c40('0xd'));var Redis=require(_0x6c40('0xe'));var authService=require(_0x6c40('0xf'));var qs=require(_0x6c40('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6c40('0x11'));var config=require(_0x6c40('0x12'));var licenseUtil=require(_0x6c40('0x13'));var db=require('../../mysqldb')['db'];config[_0x6c40('0x14')]=_['defaults'](config['redis'],{'host':_0x6c40('0x15'),'port':0x18eb});var socket=require(_0x6c40('0x16'))(new Redis(config['redis']));require(_0x6c40('0x17'))[_0x6c40('0x18')](socket);function respondWithStatusCode(_0x40f170,_0x4776ad){_0x4776ad=_0x4776ad||0xcc;return function(_0x1fe556){if(_0x1fe556){return _0x40f170[_0x6c40('0x19')](_0x4776ad);}return _0x40f170[_0x6c40('0x1a')](_0x4776ad)['end']();};}function respondWithResult(_0x360cb8,_0x13327b){_0x13327b=_0x13327b||0xc8;return function(_0x559ba4){if(_0x559ba4){return _0x360cb8[_0x6c40('0x1a')](_0x13327b)[_0x6c40('0x1b')](_0x559ba4);}};}function respondWithFilteredResult(_0xdec5d7,_0x254425){return function(_0x421372){if(_0x421372){var _0x1122d7=typeof _0x254425[_0x6c40('0x1c')]===_0x6c40('0x1d')&&typeof _0x254425[_0x6c40('0x1e')]===_0x6c40('0x1d');var _0x32a7ea=_0x421372[_0x6c40('0x1f')];var _0x1ae4fc=_0x1122d7?0x0:_0x254425[_0x6c40('0x1c')];var _0x3d855=_0x1122d7?_0x421372[_0x6c40('0x1f')]:_0x254425[_0x6c40('0x1c')]+_0x254425[_0x6c40('0x1e')];var _0x414104;if(_0x3d855>=_0x32a7ea){_0x3d855=_0x32a7ea;_0x414104=0xc8;}else{_0x414104=0xce;}_0xdec5d7[_0x6c40('0x1a')](_0x414104);return _0xdec5d7['set'](_0x6c40('0x20'),_0x1ae4fc+'-'+_0x3d855+'/'+_0x32a7ea)[_0x6c40('0x1b')](_0x421372);}return null;};}function patchUpdates(_0x5aa342){return function(_0x293dfa){try{jsonpatch['apply'](_0x293dfa,_0x5aa342,!![]);}catch(_0x2f8549){return BPromise[_0x6c40('0x21')](_0x2f8549);}return _0x293dfa[_0x6c40('0x22')]();};}function saveUpdates(_0x2397d5,_0x36bd21){return function(_0x48bc5c){if(_0x48bc5c){return _0x48bc5c['update'](_0x2397d5)[_0x6c40('0x23')](function(_0x16700c){return _0x16700c;});}return null;};}function removeEntity(_0x2bc969,_0x74427){return function(_0x1ccb84){if(_0x1ccb84){return _0x1ccb84[_0x6c40('0x24')]()['then'](function(){_0x2bc969[_0x6c40('0x1a')](0xcc)[_0x6c40('0x25')]();});}};}function handleEntityNotFound(_0x4fa07a,_0x2c9a06){return function(_0x3187f6){if(!_0x3187f6){_0x4fa07a[_0x6c40('0x19')](0x194);}return _0x3187f6;};}function handleError(_0x561e86,_0x34fecb){_0x34fecb=_0x34fecb||0x1f4;return function(_0xabf85a){logger[_0x6c40('0x26')](_0xabf85a['stack']);if(_0xabf85a[_0x6c40('0x27')]){delete _0xabf85a['name'];}_0x561e86[_0x6c40('0x1a')](_0x34fecb)[_0x6c40('0x28')](_0xabf85a);};}exports['index']=function(_0x4d0b27,_0x54db30){var _0x3ad78b={},_0x5204e3={},_0x53cda7={'count':0x0,'rows':[]};var _0x1d6775=_[_0x6c40('0x29')](db[_0x6c40('0x2a')][_0x6c40('0x2b')],function(_0x520a38){return{'name':_0x520a38[_0x6c40('0x2c')],'type':_0x520a38['type'][_0x6c40('0x2d')]};});_0x5204e3[_0x6c40('0x2e')]=_[_0x6c40('0x29')](_0x1d6775,_0x6c40('0x27'));_0x5204e3[_0x6c40('0x2f')]=_[_0x6c40('0x30')](_0x4d0b27[_0x6c40('0x2f')]);_0x5204e3['filters']=_['intersection'](_0x5204e3['model'],_0x5204e3[_0x6c40('0x2f')]);_0x3ad78b[_0x6c40('0x31')]=_['intersection'](_0x5204e3[_0x6c40('0x2e')],qs['fields'](_0x4d0b27[_0x6c40('0x2f')][_0x6c40('0x32')]));_0x3ad78b[_0x6c40('0x31')]=_0x3ad78b[_0x6c40('0x31')][_0x6c40('0x33')]?_0x3ad78b['attributes']:_0x5204e3[_0x6c40('0x2e')];if(!_0x4d0b27['query']['hasOwnProperty']('nolimit')){_0x3ad78b[_0x6c40('0x1e')]=qs[_0x6c40('0x1e')](_0x4d0b27['query']['limit']);_0x3ad78b[_0x6c40('0x1c')]=qs[_0x6c40('0x1c')](_0x4d0b27['query']['offset']);}_0x3ad78b[_0x6c40('0x34')]=qs[_0x6c40('0x35')](_0x4d0b27[_0x6c40('0x2f')]['sort']);_0x3ad78b['where']=qs[_0x6c40('0x36')](_[_0x6c40('0x37')](_0x4d0b27[_0x6c40('0x2f')],_0x5204e3[_0x6c40('0x36')]),_0x1d6775);if(_0x4d0b27['query'][_0x6c40('0x38')]){_0x3ad78b[_0x6c40('0x39')]=_[_0x6c40('0x3a')](_0x3ad78b[_0x6c40('0x39')],{'$or':_[_0x6c40('0x29')](_0x1d6775,function(_0x2e2833){if(_0x2e2833[_0x6c40('0x3b')]!==_0x6c40('0x3c')){var _0x1c0162={};_0x1c0162[_0x2e2833['name']]={'$like':'%'+_0x4d0b27['query'][_0x6c40('0x38')]+'%'};return _0x1c0162;}})});}_0x3ad78b=_[_0x6c40('0x3a')]({},_0x3ad78b,_0x4d0b27[_0x6c40('0x3d')]);var _0x44e80e={'where':_0x3ad78b['where']};return db['ChatInternalMessage'][_0x6c40('0x1f')](_0x44e80e)[_0x6c40('0x23')](function(_0x480f32){_0x53cda7[_0x6c40('0x1f')]=_0x480f32;if(_0x4d0b27[_0x6c40('0x2f')]['includeAll']){_0x3ad78b[_0x6c40('0x3e')]=[{'all':!![]}];}return db[_0x6c40('0x2a')]['findAll'](_0x3ad78b);})[_0x6c40('0x23')](function(_0x15476b){_0x53cda7[_0x6c40('0x3f')]=_0x15476b;return _0x53cda7;})[_0x6c40('0x23')](respondWithFilteredResult(_0x54db30,_0x3ad78b))[_0x6c40('0x40')](handleError(_0x54db30,null));};exports[_0x6c40('0x41')]=function(_0x163d4f,_0x4cf967){var _0x40e4a5={'raw':!![],'where':{'id':_0x163d4f[_0x6c40('0x42')]['id']}},_0x4b703d={};_0x4b703d[_0x6c40('0x2e')]=_[_0x6c40('0x30')](db[_0x6c40('0x2a')][_0x6c40('0x2b')]);_0x4b703d[_0x6c40('0x2f')]=_[_0x6c40('0x30')](_0x163d4f[_0x6c40('0x2f')]);_0x4b703d['filters']=_[_0x6c40('0x43')](_0x4b703d[_0x6c40('0x2e')],_0x4b703d[_0x6c40('0x2f')]);_0x40e4a5[_0x6c40('0x31')]=_[_0x6c40('0x43')](_0x4b703d[_0x6c40('0x2e')],qs[_0x6c40('0x32')](_0x163d4f[_0x6c40('0x2f')]['fields']));_0x40e4a5[_0x6c40('0x31')]=_0x40e4a5[_0x6c40('0x31')][_0x6c40('0x33')]?_0x40e4a5[_0x6c40('0x31')]:_0x4b703d[_0x6c40('0x2e')];if(_0x163d4f[_0x6c40('0x2f')][_0x6c40('0x44')]){_0x40e4a5[_0x6c40('0x3e')]=[{'all':!![]}];}_0x40e4a5=_[_0x6c40('0x3a')]({},_0x40e4a5,_0x163d4f[_0x6c40('0x3d')]);return db[_0x6c40('0x2a')][_0x6c40('0x45')](_0x40e4a5)[_0x6c40('0x23')](handleEntityNotFound(_0x4cf967,null))[_0x6c40('0x23')](respondWithResult(_0x4cf967,null))[_0x6c40('0x40')](handleError(_0x4cf967,null));};exports[_0x6c40('0x46')]=function(_0x2614b3,_0x2cd259){return db['ChatInternalMessage'][_0x6c40('0x46')](_0x2614b3['body'],{})['then'](respondWithResult(_0x2cd259,0xc9))[_0x6c40('0x40')](handleError(_0x2cd259,null));};exports['update']=function(_0x4b38e3,_0x1a8ff8){if(_0x4b38e3['body']['id']){delete _0x4b38e3[_0x6c40('0x47')]['id'];}return db[_0x6c40('0x2a')][_0x6c40('0x45')]({'where':{'id':_0x4b38e3[_0x6c40('0x42')]['id']}})[_0x6c40('0x23')](handleEntityNotFound(_0x1a8ff8,null))['then'](saveUpdates(_0x4b38e3[_0x6c40('0x47')],null))[_0x6c40('0x23')](respondWithResult(_0x1a8ff8,null))['catch'](handleError(_0x1a8ff8,null));};exports['destroy']=function(_0x41f669,_0x53521e){return db[_0x6c40('0x2a')][_0x6c40('0x45')]({'where':{'id':_0x41f669['params']['id']}})[_0x6c40('0x23')](handleEntityNotFound(_0x53521e,null))[_0x6c40('0x23')](removeEntity(_0x53521e,null))[_0x6c40('0x40')](handleError(_0x53521e,null));};exports[_0x6c40('0x48')]=function(_0x22c132,_0x4ddbc6){return db[_0x6c40('0x2a')][_0x6c40('0x48')]()[_0x6c40('0x23')](respondWithResult(_0x4ddbc6,null))[_0x6c40('0x40')](handleError(_0x4ddbc6,null));};function wrapUser(_0xd06380){return function(_0x410201){var _0x390339=_0xd06380[_0x6c40('0x49')]({'plain':!![]});_0x390339[_0x6c40('0x4a')]=[];if(_0x410201){_0x390339[_0x6c40('0x4b')]=_0x410201[_0x6c40('0x4c')];_0x390339['lastMessage']=_0x410201;}else{_0x390339[_0x6c40('0x4b')]=moment(0x0)[_0x6c40('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x390339[_0x6c40('0x4e')]={};}return _0x390339;};}exports[_0x6c40('0x4f')]=function(_0x20e3a9,_0x424d08,_0x4bda57){var _0x1f3d01=[];return db[_0x6c40('0x50')][_0x6c40('0x51')]({'where':{'role':['agent',_0x6c40('0x52'),_0x6c40('0x53')]},'attributes':['id',_0x6c40('0x54'),_0x6c40('0x27'),_0x6c40('0x55'),'userpic',_0x6c40('0x56'),'online','lastLoginAt',_0x6c40('0x57'),_0x6c40('0x58')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x6c40('0x59'),'attributes':['id',_0x6c40('0x27'),_0x6c40('0x3b')],'through':{'attributes':[]}}]})[_0x6c40('0x23')](function(_0x43a830){if(_0x43a830){var _0x3eb26b=_0x20e3a9['user'][_0x6c40('0x49')]({'plain':!![]});if(!_0x3eb26b)throw new Error(_0x6c40('0x5a'));if(_0x3eb26b[_0x6c40('0x55')]===_0x6c40('0x53')){return db[_0x6c40('0x5b')][_0x6c40('0x45')]({'where':{'name':'Agents','userProfileId':_0x3eb26b['userProfileId']},'raw':!![]})[_0x6c40('0x23')](function(_0x3d8cf9){if(_0x3d8cf9){if(_0x3d8cf9[_0x6c40('0x5c')]===0x0){return db[_0x6c40('0x5d')][_0x6c40('0x51')]({'where':{'sectionId':_0x3d8cf9['id']},'raw':!![]})[_0x6c40('0x23')](function(_0x29854f){var _0x460d5d=[];if(_[_0x6c40('0x5e')](_0x29854f)){_0x460d5d=_['filter'](_0x43a830,function(_0x5b448e){if(_0x5b448e[_0x6c40('0x55')]!==_0x6c40('0x5f')){return _0x5b448e;}});return _0x460d5d;}else{for(var _0x592e1b=0x0;_0x592e1b<_0x43a830['length'];_0x592e1b++){var _0x5afa37=_0x43a830[_0x592e1b];if(_0x5afa37[_0x6c40('0x55')]==='agent'){var _0x4fd117=_['find'](_0x29854f,function(_0x3f7a16){return _0x3f7a16[_0x6c40('0x60')]===_0x5afa37['id'];});if(_0x4fd117)_0x460d5d[_0x6c40('0x61')](_0x5afa37);}else{_0x460d5d['push'](_0x5afa37);}}return _0x460d5d;}});}else{return _0x43a830;}}else{var _0x58094f=_['filter'](_0x43a830,function(_0x55570b){if(_0x55570b[_0x6c40('0x55')]!==_0x6c40('0x5f')){return _0x55570b;}});return _0x58094f;}});}else{return _0x43a830;}}})[_0x6c40('0x23')](function(_0x1e67da){var _0xd05077=[];if(_0x1e67da){_0x1f3d01=_0x1e67da;for(var _0x5eae2d=0x0;_0x5eae2d<_0x1e67da['length'];_0x5eae2d+=0x1){_0x1f3d01[_0x5eae2d][_0x6c40('0x4a')]=[];_0xd05077[_0x6c40('0x61')](db['ChatInternalMessage'][_0x6c40('0x45')]({'where':{'FromId':[_0x20e3a9['user']['id'],_0x1e67da[_0x5eae2d]['id']],'ToId':[_0x20e3a9[_0x6c40('0x53')]['id'],_0x1e67da[_0x5eae2d]['id']],'ChatGroupId':null},'attributes':['id',_0x6c40('0x4c'),_0x6c40('0x62'),'ToId',_0x6c40('0x63'),_0x6c40('0x47')],'order':qs[_0x6c40('0x35')](_0x6c40('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6c40('0x23')](wrapUser(_0x1e67da[_0x5eae2d])));}return BPromise[_0x6c40('0x65')](_0xd05077);}return[];})[_0x6c40('0x23')](function(_0x4d4676){return{'rows':_0x4d4676,'count':_0x4d4676['length']};})[_0x6c40('0x23')](respondWithResult(_0x424d08,null))[_0x6c40('0x40')](handleError(_0x424d08,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index f18c11e..e37a7ce 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 _0x3c94=['../../mysqldb','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x3308b7,_0x73df9c){var _0x3f89bd=function(_0x4da01a){while(--_0x4da01a){_0x3308b7['push'](_0x3308b7['shift']());}};_0x3f89bd(++_0x73df9c);}(_0x3c94,0x111));var _0x43c9=function(_0x56d1b7,_0x1d88f5){_0x56d1b7=_0x56d1b7-0x0;var _0x184d91=_0x3c94[_0x56d1b7];return _0x184d91;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x43c9('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x43c9('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x43c9('0x2'),'afterDestroy':_0x43c9('0x3')};function emitEvent(_0x388344){return function(_0x37eb74,_0x1b8725,_0x5e6c3e){ChatInternalMessageEvents[_0x43c9('0x4')](_0x388344+':'+_0x37eb74['id'],_0x37eb74);ChatInternalMessageEvents[_0x43c9('0x4')](_0x388344,_0x37eb74);_0x5e6c3e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x43c9('0x5')](e,emitEvent(event));}}module[_0x43c9('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xf064=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xf064,0xcc));var _0x4f06=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xf064[_0x58afd5];return _0x3e503b;};'use strict';var EventEmitter=require(_0x4f06('0x0'));var ChatInternalMessage=require(_0x4f06('0x1'))['db'][_0x4f06('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f06('0x3'),'afterUpdate':_0x4f06('0x4'),'afterDestroy':'remove'};function emitEvent(_0x48764c){return function(_0x43a57a,_0x377693,_0x4d3478){ChatInternalMessageEvents[_0x4f06('0x5')](_0x48764c+':'+_0x43a57a['id'],_0x43a57a);ChatInternalMessageEvents[_0x4f06('0x5')](_0x48764c,_0x43a57a);_0x4d3478(null);};}for(var e in events){if(events[_0x4f06('0x6')](e)){var event=events[e];ChatInternalMessage[_0x4f06('0x7')](e,emitEvent(event));}}module[_0x4f06('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index ec9add0..6f5021e 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 _0xd916=['./chatInternalMessage.attributes','exports','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','../../config/environment'];(function(_0x23d1c8,_0x4a7fd2){var _0x1055ee=function(_0x5c27d7){while(--_0x5c27d7){_0x23d1c8['push'](_0x23d1c8['shift']());}};_0x1055ee(++_0x4a7fd2);}(_0xd916,0x165));var _0x6d91=function(_0x3647b6,_0x3a0d67){_0x3647b6=_0x3647b6-0x0;var _0x4b1ea9=_0xd916[_0x3647b6];return _0x4b1ea9;};'use strict';var _=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var logger=require(_0x6d91('0x2'))('api');var moment=require(_0x6d91('0x3'));var BPromise=require('bluebird');var rp=require(_0x6d91('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6d91('0x5'));var attributes=require(_0x6d91('0x6'));module[_0x6d91('0x7')]=function(_0x412a98,_0x507890){return _0x412a98['define']('ChatInternalMessage',attributes,{'tableName':_0x6d91('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d91('0x9'),'collate':_0x6d91('0xa')});};
\ No newline at end of file
+var _0xc1e4=['exports','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','bluebird','../../config/environment','./chatInternalMessage.attributes'];(function(_0x496bb7,_0x32b9fa){var _0x589721=function(_0x4ca56b){while(--_0x4ca56b){_0x496bb7['push'](_0x496bb7['shift']());}};_0x589721(++_0x32b9fa);}(_0xc1e4,0x1a2));var _0x4c1e=function(_0x4e654d,_0x4565aa){_0x4e654d=_0x4e654d-0x0;var _0x261d8f=_0xc1e4[_0x4e654d];return _0x261d8f;};'use strict';var _=require(_0x4c1e('0x0'));var util=require(_0x4c1e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4c1e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4c1e('0x3'));var attributes=require(_0x4c1e('0x4'));module[_0x4c1e('0x5')]=function(_0x5f2687,_0x43bbcc){return _0x5f2687['define'](_0x4c1e('0x6'),attributes,{'tableName':_0x4c1e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c1e('0x8'),'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 6fe2307..4ded27d 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 _0x673f=['http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x107dec,_0x59bac7){var _0x596053=function(_0x29d744){while(--_0x29d744){_0x107dec['push'](_0x107dec['shift']());}};_0x596053(++_0x59bac7);}(_0x673f,0x64));var _0xf673=function(_0x23a24d,_0x42d93b){_0x23a24d=_0x23a24d-0x0;var _0x386294=_0x673f[_0x23a24d];return _0x386294;};'use strict';var _=require(_0xf673('0x0'));var util=require(_0xf673('0x1'));var moment=require(_0xf673('0x2'));var BPromise=require(_0xf673('0x3'));var rs=require(_0xf673('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf673('0x5'))['db'];var utils=require(_0xf673('0x6'));var logger=require(_0xf673('0x7'))(_0xf673('0x8'));var config=require(_0xf673('0x9'));var jayson=require(_0xf673('0xa'));var client=jayson[_0xf673('0xb')][_0xf673('0xc')]({'port':0x232a});config[_0xf673('0xd')]=_['defaults'](config[_0xf673('0xd')],{'host':_0xf673('0xe'),'port':0x18eb});var socket=require(_0xf673('0xf'))(new Redis(config[_0xf673('0xd')]));require(_0xf673('0x10'))[_0xf673('0x11')](socket);function respondWithRpcPromise(_0x2c0185,_0x53b65d,_0x379248){return new BPromise(function(_0x27d518,_0xa4ae22){return client[_0xf673('0x12')](_0x2c0185,_0x379248)['then'](function(_0x3ced76){logger['info'](_0xf673('0x13'),_0x53b65d,_0xf673('0x14'));logger[_0xf673('0x15')](_0xf673('0x16'),_0x53b65d,_0xf673('0x14'),JSON['stringify'](_0x3ced76));if(_0x3ced76[_0xf673('0x17')]){if(_0x3ced76['error'][_0xf673('0x18')]===0x1f4){logger['error'](_0xf673('0x13'),_0x53b65d,_0x3ced76[_0xf673('0x17')][_0xf673('0x19')]);return _0xa4ae22(_0x3ced76[_0xf673('0x17')][_0xf673('0x19')]);}logger['error'](_0xf673('0x13'),_0x53b65d,_0x3ced76[_0xf673('0x17')][_0xf673('0x19')]);return _0x27d518(_0x3ced76[_0xf673('0x17')]['message']);}else{logger[_0xf673('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x53b65d,_0xf673('0x14'));_0x27d518(_0x3ced76[_0xf673('0x1b')][_0xf673('0x19')]);}})['catch'](function(_0xa59a76){logger[_0xf673('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x53b65d,_0xa59a76);_0xa4ae22(_0xa59a76);});});}
\ No newline at end of file
+var _0xc343=['client','http','redis','./chatInternalMessage.socket','register','request','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','ChatInternalMessage,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x24919a,_0x1f9540){var _0x4e8c1d=function(_0x57b5a6){while(--_0x57b5a6){_0x24919a['push'](_0x24919a['shift']());}};_0x4e8c1d(++_0x1f9540);}(_0xc343,0x1bf));var _0x3c34=function(_0x516874,_0x3f436c){_0x516874=_0x516874-0x0;var _0x32c810=_0xc343[_0x516874];return _0x32c810;};'use strict';var _=require('lodash');var util=require(_0x3c34('0x0'));var moment=require(_0x3c34('0x1'));var BPromise=require(_0x3c34('0x2'));var rs=require(_0x3c34('0x3'));var fs=require('fs');var Redis=require(_0x3c34('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c34('0x5'));var logger=require('../../config/logger')(_0x3c34('0x6'));var config=require(_0x3c34('0x7'));var jayson=require(_0x3c34('0x8'));var client=jayson[_0x3c34('0x9')][_0x3c34('0xa')]({'port':0x232a});config[_0x3c34('0xb')]=_['defaults'](config[_0x3c34('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3c34('0xc'))[_0x3c34('0xd')](socket);function respondWithRpcPromise(_0x45fc65,_0x43a119,_0x1ffde5){return new BPromise(function(_0x51b7cc,_0x55ba3c){return client[_0x3c34('0xe')](_0x45fc65,_0x1ffde5)['then'](function(_0x323f65){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x43a119,_0x3c34('0xf'));logger[_0x3c34('0x10')](_0x3c34('0x11'),_0x43a119,_0x3c34('0xf'),JSON['stringify'](_0x323f65));if(_0x323f65[_0x3c34('0x12')]){if(_0x323f65[_0x3c34('0x12')][_0x3c34('0x13')]===0x1f4){logger[_0x3c34('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x43a119,_0x323f65[_0x3c34('0x12')][_0x3c34('0x14')]);return _0x55ba3c(_0x323f65[_0x3c34('0x12')][_0x3c34('0x14')]);}logger[_0x3c34('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x43a119,_0x323f65[_0x3c34('0x12')][_0x3c34('0x14')]);return _0x51b7cc(_0x323f65[_0x3c34('0x12')][_0x3c34('0x14')]);}else{logger[_0x3c34('0x15')](_0x3c34('0x16'),_0x43a119,_0x3c34('0xf'));_0x51b7cc(_0x323f65['result'][_0x3c34('0x14')]);}})[_0x3c34('0x17')](function(_0x46a203){logger['error'](_0x3c34('0x16'),_0x43a119,_0x46a203);_0x55ba3c(_0x46a203);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 5078ccb..eef25e8 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 _0xbe24=['emit','removeListener','chatInternalMessage:','./chatInternalMessage.events','save','update'];(function(_0x4c359a,_0x104871){var _0x2b4038=function(_0x582ee1){while(--_0x582ee1){_0x4c359a['push'](_0x4c359a['shift']());}};_0x2b4038(++_0x104871);}(_0xbe24,0x18f));var _0x4be2=function(_0x2cc09d,_0x23dede){_0x2cc09d=_0x2cc09d-0x0;var _0x38b9cf=_0xbe24[_0x2cc09d];return _0x38b9cf;};'use strict';var ChatInternalMessageEvents=require(_0x4be2('0x0'));var events=[_0x4be2('0x1'),'remove',_0x4be2('0x2')];function createListener(_0x566dc6,_0xbabfd6){return function(_0x56c89c){_0xbabfd6[_0x4be2('0x3')](_0x566dc6,_0x56c89c);};}function removeListener(_0x9050e7,_0x2b8c84){return function(){ChatInternalMessageEvents[_0x4be2('0x4')](_0x9050e7,_0x2b8c84);};}exports['register']=function(_0x2c2c4c){for(var _0x402366=0x0,_0x32541d=events['length'];_0x402366<_0x32541d;_0x402366++){var _0x4c9f2e=events[_0x402366];var _0x104c39=createListener(_0x4be2('0x5')+_0x4c9f2e,_0x2c2c4c);ChatInternalMessageEvents['on'](_0x4c9f2e,_0x104c39);}};
\ No newline at end of file
+var _0xf3aa=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','update','emit'];(function(_0x500470,_0x592fe9){var _0x4764df=function(_0x5f98b8){while(--_0x5f98b8){_0x500470['push'](_0x500470['shift']());}};_0x4764df(++_0x592fe9);}(_0xf3aa,0x9e));var _0xaf3a=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0xf3aa[_0x1fa381];return _0x47eefe;};'use strict';var ChatInternalMessageEvents=require(_0xaf3a('0x0'));var events=['save','remove',_0xaf3a('0x1')];function createListener(_0x403964,_0x536336){return function(_0x59e89){_0x536336[_0xaf3a('0x2')](_0x403964,_0x59e89);};}function removeListener(_0x283c2b,_0x285be8){return function(){ChatInternalMessageEvents[_0xaf3a('0x3')](_0x283c2b,_0x285be8);};}exports[_0xaf3a('0x4')]=function(_0x1c3850){for(var _0x42e2f7=0x0,_0xb6e3fd=events[_0xaf3a('0x5')];_0x42e2f7<_0xb6e3fd;_0x42e2f7++){var _0x3efbe4=events[_0x42e2f7];var _0x43d188=createListener(_0xaf3a('0x6')+_0x3efbe4,_0x1c3850);ChatInternalMessageEvents['on'](_0x3efbe4,_0x43d188);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index fc8eae3..6dd5be8 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 _0xbf15=['put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','show','post'];(function(_0x1d10b3,_0x292510){var _0x216b02=function(_0xe1615e){while(--_0xe1615e){_0x1d10b3['push'](_0x1d10b3['shift']());}};_0x216b02(++_0x292510);}(_0xbf15,0xa7));var _0x5bf1=function(_0x583abd,_0x3bed69){_0x583abd=_0x583abd-0x0;var _0x4721d4=_0xbf15[_0x583abd];return _0x4721d4;};'use strict';var multer=require(_0x5bf1('0x0'));var util=require('util');var path=require(_0x5bf1('0x1'));var timeout=require('connect-timeout');var express=require(_0x5bf1('0x2'));var router=express[_0x5bf1('0x3')]();var fs_extra=require(_0x5bf1('0x4'));var auth=require(_0x5bf1('0x5'));var interaction=require(_0x5bf1('0x6'));var config=require(_0x5bf1('0x7'));var controller=require(_0x5bf1('0x8'));router[_0x5bf1('0x9')]('/',auth[_0x5bf1('0xa')](),controller[_0x5bf1('0xb')]);router[_0x5bf1('0x9')](_0x5bf1('0xc'),auth[_0x5bf1('0xa')](),controller[_0x5bf1('0xd')]);router[_0x5bf1('0x9')](_0x5bf1('0xe'),auth[_0x5bf1('0xa')](),controller['getUsers']);router[_0x5bf1('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5bf1('0xf')]);router[_0x5bf1('0x10')]('/',auth[_0x5bf1('0xa')](),controller['create']);router[_0x5bf1('0x11')](_0x5bf1('0x12'),controller[_0x5bf1('0x13')]);router[_0x5bf1('0x14')]('/:id',auth[_0x5bf1('0xa')](),controller[_0x5bf1('0x15')]);module[_0x5bf1('0x16')]=router;
\ No newline at end of file
+var _0x82ed=['show','post','create','update','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','getUsers'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0x82ed,0xcf));var _0xd82e=function(_0x2d3629,_0x2aa9c1){_0x2d3629=_0x2d3629-0x0;var _0x399933=_0x82ed[_0x2d3629];return _0x399933;};'use strict';var multer=require(_0xd82e('0x0'));var util=require(_0xd82e('0x1'));var path=require(_0xd82e('0x2'));var timeout=require(_0xd82e('0x3'));var express=require('express');var router=express[_0xd82e('0x4')]();var fs_extra=require(_0xd82e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd82e('0x6'));var controller=require(_0xd82e('0x7'));router[_0xd82e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd82e('0x8')](_0xd82e('0x9'),auth[_0xd82e('0xa')](),controller[_0xd82e('0xb')]);router[_0xd82e('0x8')]('/users',auth['isAuthenticated'](),controller[_0xd82e('0xc')]);router[_0xd82e('0x8')]('/:id',auth[_0xd82e('0xa')](),controller[_0xd82e('0xd')]);router[_0xd82e('0xe')]('/',auth[_0xd82e('0xa')](),controller[_0xd82e('0xf')]);router['put']('/:id',controller[_0xd82e('0x10')]);router['delete'](_0xd82e('0x11'),auth[_0xd82e('0xa')](),controller[_0xd82e('0x12')]);module[_0xd82e('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 432717c..ab79919 100644
--- a/server/api/chatMessage/chatMessage.attributes.js
+++ b/server/api/chatMessage/chatMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7462=['out','STRING','TEXT','sequelize','exports','BOOLEAN'];(function(_0x159af8,_0x19d870){var _0x5bb6cd=function(_0x51d044){while(--_0x51d044){_0x159af8['push'](_0x159af8['shift']());}};_0x5bb6cd(++_0x19d870);}(_0x7462,0x165));var _0x2746=function(_0x216428,_0x5d20ea){_0x216428=_0x216428-0x0;var _0x313dd4=_0x7462[_0x216428];return _0x313dd4;};'use strict';var Sequelize=require(_0x2746('0x0'));module[_0x2746('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2746('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2746('0x3')),'defaultValue':_0x2746('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x2746('0x4')]},'providerResponse':{'type':Sequelize[_0x2746('0x5')]}};
\ No newline at end of file
+var _0x81cb=['DATE','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x2e7325,_0x5cfde7){var _0x3430de=function(_0x5cee86){while(--_0x5cee86){_0x2e7325['push'](_0x2e7325['shift']());}};_0x3430de(++_0x5cfde7);}(_0x81cb,0xaa));var _0xb81c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81cb[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb81c('0x0'));module[_0xb81c('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb81c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb81c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb81c('0x4')]('in',_0xb81c('0x5')),'defaultValue':_0xb81c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb81c('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb81c('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 5c4ac3f..974fc06 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 _0x25ae=['body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','motionChannel','event','EventManager','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','channel','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','sendStatus','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','status','name','send','index','map','ChatMessage','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes','length','include','find','create'];(function(_0x387a82,_0x5bde2a){var _0x1aa008=function(_0x1902d){while(--_0x1902d){_0x387a82['push'](_0x387a82['shift']());}};_0x1aa008(++_0x5bde2a);}(_0x25ae,0x1c3));var _0xe25a=function(_0x6174c3,_0x1cd49a){_0x6174c3=_0x6174c3-0x0;var _0x5a9008=_0x25ae[_0x6174c3];return _0x5a9008;};'use strict';var emlformat=require(_0xe25a('0x0'));var rimraf=require(_0xe25a('0x1'));var zipdir=require(_0xe25a('0x2'));var jsonpatch=require(_0xe25a('0x3'));var rp=require(_0xe25a('0x4'));var moment=require('moment');var BPromise=require(_0xe25a('0x5'));var Mustache=require(_0xe25a('0x6'));var util=require(_0xe25a('0x7'));var path=require(_0xe25a('0x8'));var sox=require(_0xe25a('0x9'));var csv=require('to-csv');var ejs=require(_0xe25a('0xa'));var fs=require('fs');var fs_extra=require(_0xe25a('0xb'));var _=require(_0xe25a('0xc'));var squel=require(_0xe25a('0xd'));var crypto=require(_0xe25a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe25a('0xf'));var toCsv=require(_0xe25a('0x10'));var querystring=require(_0xe25a('0x11'));var Papa=require(_0xe25a('0x12'));var Redis=require('ioredis');var authService=require(_0xe25a('0x13'));var qs=require(_0xe25a('0x14'));var as=require(_0xe25a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe25a('0x16'))(_0xe25a('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe25a('0x18'))['db'];config['redis']=_[_0xe25a('0x19')](config[_0xe25a('0x1a')],{'host':_0xe25a('0x1b'),'port':0x18eb});var socket=require(_0xe25a('0x1c'))(new Redis(config[_0xe25a('0x1a')]));require('./chatMessage.socket')[_0xe25a('0x1d')](socket);var jayson=require(_0xe25a('0x1e'));var client=jayson[_0xe25a('0x1f')][_0xe25a('0x20')]({'port':0x232c});var client9002=jayson[_0xe25a('0x1f')][_0xe25a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x4f365f,_0x538b1e,_0x1f93e7,_0x335555){return new BPromise(function(_0x42fb5d,_0x1effb2){var _0x5151fb=_0x335555||client;return _0x5151fb['request'](_0x4f365f,_0x1f93e7)[_0xe25a('0x21')](function(_0x139f61){logger[_0xe25a('0x22')](_0xe25a('0x23'),_0x538b1e,'request\x20sent');logger['debug'](_0xe25a('0x24'),_0x538b1e,_0xe25a('0x25'),JSON['stringify'](_0x139f61));if(_0x139f61['error']){if(_0x139f61['error'][_0xe25a('0x26')]===0x1f4){logger[_0xe25a('0x27')]('ChatMessage,\x20%s,\x20%s',_0x538b1e,_0x139f61['error'][_0xe25a('0x28')]);return _0x1effb2(_0x139f61[_0xe25a('0x27')][_0xe25a('0x28')]);}logger[_0xe25a('0x27')](_0xe25a('0x23'),_0x538b1e,_0x139f61['error'][_0xe25a('0x28')]);return _0x42fb5d(_0x139f61[_0xe25a('0x27')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x538b1e,_0xe25a('0x25'));_0x42fb5d(_0x139f61[_0xe25a('0x29')][_0xe25a('0x28')]);}})[_0xe25a('0x2a')](function(_0x43cd56){logger[_0xe25a('0x27')](_0xe25a('0x23'),_0x538b1e,_0x43cd56);_0x1effb2(_0x43cd56);});});}function respondWithStatusCode(_0xe9750,_0x439031){_0x439031=_0x439031||0xcc;return function(_0x40b65c){if(_0x40b65c){return _0xe9750[_0xe25a('0x2b')](_0x439031);}return _0xe9750['status'](_0x439031)[_0xe25a('0x2c')]();};}function respondWithResult(_0x292d98,_0x5c3465){_0x5c3465=_0x5c3465||0xc8;return function(_0x13d09e){if(_0x13d09e){return _0x292d98['status'](_0x5c3465)[_0xe25a('0x2d')](_0x13d09e);}};}function respondWithFilteredResult(_0x5e5a8c,_0x4e2b25){return function(_0x307864){if(_0x307864){var _0x4d8e3c=typeof _0x4e2b25[_0xe25a('0x2e')]==='undefined'&&typeof _0x4e2b25[_0xe25a('0x2f')]===_0xe25a('0x30');var _0x135ea4=_0x307864[_0xe25a('0x31')];var _0xbcceb6=_0x4d8e3c?0x0:_0x4e2b25[_0xe25a('0x2e')];var _0x349b5b=_0x4d8e3c?_0x307864['count']:_0x4e2b25[_0xe25a('0x2e')]+_0x4e2b25[_0xe25a('0x2f')];var _0x3e8ab8;if(_0x349b5b>=_0x135ea4){_0x349b5b=_0x135ea4;_0x3e8ab8=0xc8;}else{_0x3e8ab8=0xce;}_0x5e5a8c['status'](_0x3e8ab8);return _0x5e5a8c['set'](_0xe25a('0x32'),_0xbcceb6+'-'+_0x349b5b+'/'+_0x135ea4)[_0xe25a('0x2d')](_0x307864);}return null;};}function patchUpdates(_0x279b6f){return function(_0x286861){try{jsonpatch[_0xe25a('0x33')](_0x286861,_0x279b6f,!![]);}catch(_0xccb5f6){return BPromise['reject'](_0xccb5f6);}return _0x286861[_0xe25a('0x34')]();};}function saveUpdates(_0x19fdc8,_0x557809){return function(_0x500f20){if(_0x500f20){return _0x500f20[_0xe25a('0x35')](_0x19fdc8)[_0xe25a('0x21')](function(_0x33548f){return _0x33548f;});}return null;};}function removeEntity(_0x110a0c,_0x3ca95c){return function(_0x25fc77){if(_0x25fc77){return _0x25fc77[_0xe25a('0x36')]()[_0xe25a('0x21')](function(){_0x110a0c[_0xe25a('0x37')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24bf08,_0x5e659d){return function(_0x53ed80){if(!_0x53ed80){_0x24bf08[_0xe25a('0x2b')](0x194);}return _0x53ed80;};}function handleError(_0xfedac3,_0x48b013){_0x48b013=_0x48b013||0x1f4;return function(_0x1c4bd0){logger[_0xe25a('0x27')](_0x1c4bd0['stack']);if(_0x1c4bd0[_0xe25a('0x38')]){delete _0x1c4bd0[_0xe25a('0x38')];}_0xfedac3[_0xe25a('0x37')](_0x48b013)[_0xe25a('0x39')](_0x1c4bd0);};}exports[_0xe25a('0x3a')]=function(_0xab45ac,_0x267481){var _0x5629b3={},_0x4891d3={},_0x30d2bd={'count':0x0,'rows':[]};var _0x508a27=_[_0xe25a('0x3b')](db[_0xe25a('0x3c')]['rawAttributes'],function(_0xaf7b44){return{'name':_0xaf7b44[_0xe25a('0x3d')],'type':_0xaf7b44['type'][_0xe25a('0x3e')]};});_0x4891d3[_0xe25a('0x3f')]=_[_0xe25a('0x3b')](_0x508a27,_0xe25a('0x38'));_0x4891d3[_0xe25a('0x40')]=_[_0xe25a('0x41')](_0xab45ac[_0xe25a('0x40')]);_0x4891d3['filters']=_[_0xe25a('0x42')](_0x4891d3['model'],_0x4891d3['query']);_0x5629b3['attributes']=_[_0xe25a('0x42')](_0x4891d3['model'],qs[_0xe25a('0x43')](_0xab45ac[_0xe25a('0x40')][_0xe25a('0x43')]));_0x5629b3[_0xe25a('0x44')]=_0x5629b3[_0xe25a('0x44')]['length']?_0x5629b3[_0xe25a('0x44')]:_0x4891d3[_0xe25a('0x3f')];if(!_0xab45ac[_0xe25a('0x40')][_0xe25a('0x45')]('nolimit')){_0x5629b3[_0xe25a('0x2f')]=qs[_0xe25a('0x2f')](_0xab45ac['query']['limit']);_0x5629b3[_0xe25a('0x2e')]=qs[_0xe25a('0x2e')](_0xab45ac['query'][_0xe25a('0x2e')]);}_0x5629b3[_0xe25a('0x46')]=qs[_0xe25a('0x47')](_0xab45ac[_0xe25a('0x40')][_0xe25a('0x47')]);_0x5629b3[_0xe25a('0x48')]=qs[_0xe25a('0x49')](_[_0xe25a('0x4a')](_0xab45ac[_0xe25a('0x40')],_0x4891d3[_0xe25a('0x49')]),_0x508a27);if(_0xab45ac['query'][_0xe25a('0x4b')]){_0x5629b3[_0xe25a('0x48')]=_[_0xe25a('0x4c')](_0x5629b3['where'],{'$or':_[_0xe25a('0x3b')](_0x508a27,function(_0x5c75ac){if(_0x5c75ac[_0xe25a('0x4d')]!==_0xe25a('0x4e')){var _0x267a31={};_0x267a31[_0x5c75ac['name']]={'$like':'%'+_0xab45ac[_0xe25a('0x40')][_0xe25a('0x4b')]+'%'};return _0x267a31;}})});}_0x5629b3=_[_0xe25a('0x4c')]({},_0x5629b3,_0xab45ac[_0xe25a('0x4f')]);var _0x7a5975={'where':_0x5629b3[_0xe25a('0x48')]};return db['ChatMessage'][_0xe25a('0x31')](_0x7a5975)['then'](function(_0x48a4e6){_0x30d2bd[_0xe25a('0x31')]=_0x48a4e6;if(_0xab45ac[_0xe25a('0x40')][_0xe25a('0x50')]){_0x5629b3['include']=[{'all':!![]}];}return db[_0xe25a('0x3c')][_0xe25a('0x51')](_0x5629b3);})[_0xe25a('0x21')](function(_0x290d0c){_0x30d2bd[_0xe25a('0x52')]=_0x290d0c;return _0x30d2bd;})['then'](respondWithFilteredResult(_0x267481,_0x5629b3))[_0xe25a('0x2a')](handleError(_0x267481,null));};exports['show']=function(_0x3b0745,_0x16f93e){var _0x514538={'raw':!![],'where':{'id':_0x3b0745[_0xe25a('0x53')]['id']}},_0x3e1e9b={};_0x3e1e9b[_0xe25a('0x3f')]=_[_0xe25a('0x41')](db[_0xe25a('0x3c')][_0xe25a('0x54')]);_0x3e1e9b[_0xe25a('0x40')]=_[_0xe25a('0x41')](_0x3b0745[_0xe25a('0x40')]);_0x3e1e9b[_0xe25a('0x49')]=_[_0xe25a('0x42')](_0x3e1e9b[_0xe25a('0x3f')],_0x3e1e9b[_0xe25a('0x40')]);_0x514538[_0xe25a('0x44')]=_[_0xe25a('0x42')](_0x3e1e9b[_0xe25a('0x3f')],qs[_0xe25a('0x43')](_0x3b0745[_0xe25a('0x40')][_0xe25a('0x43')]));_0x514538[_0xe25a('0x44')]=_0x514538['attributes'][_0xe25a('0x55')]?_0x514538['attributes']:_0x3e1e9b[_0xe25a('0x3f')];if(_0x3b0745['query'][_0xe25a('0x50')]){_0x514538[_0xe25a('0x56')]=[{'all':!![]}];}_0x514538=_[_0xe25a('0x4c')]({},_0x514538,_0x3b0745['options']);return db[_0xe25a('0x3c')][_0xe25a('0x57')](_0x514538)[_0xe25a('0x21')](handleEntityNotFound(_0x16f93e,null))['then'](respondWithResult(_0x16f93e,null))[_0xe25a('0x2a')](handleError(_0x16f93e,null));};exports[_0xe25a('0x58')]=function(_0x30cbe5,_0x16da52){return db[_0xe25a('0x3c')][_0xe25a('0x58')](_0x30cbe5[_0xe25a('0x59')],{})[_0xe25a('0x21')](respondWithResult(_0x16da52,0xc9))['catch'](handleError(_0x16da52,null));};exports[_0xe25a('0x35')]=function(_0xe5d118,_0x35c84f){if(_0xe5d118[_0xe25a('0x59')]['id']){delete _0xe5d118[_0xe25a('0x59')]['id'];}return db[_0xe25a('0x3c')][_0xe25a('0x57')]({'where':{'id':_0xe5d118['params']['id']}})[_0xe25a('0x21')](handleEntityNotFound(_0x35c84f,null))[_0xe25a('0x21')](saveUpdates(_0xe5d118['body'],null))[_0xe25a('0x21')](respondWithResult(_0x35c84f,null))[_0xe25a('0x2a')](handleError(_0x35c84f,null));};exports[_0xe25a('0x36')]=function(_0x2633aa,_0x17db81){return db[_0xe25a('0x3c')][_0xe25a('0x57')]({'where':{'id':_0x2633aa['params']['id']}})[_0xe25a('0x21')](handleEntityNotFound(_0x17db81,null))[_0xe25a('0x21')](removeEntity(_0x17db81,null))['catch'](handleError(_0x17db81,null));};exports[_0xe25a('0x5a')]=function(_0x1b030a,_0x584961){return db[_0xe25a('0x3c')]['describe']()[_0xe25a('0x21')](respondWithResult(_0x584961,null))['catch'](handleError(_0x584961,null));};var interaction_log=require(_0xe25a('0x16'))(_0xe25a('0x5b'));exports['accept']=function(_0x444b25,_0x57a5ba,_0x48fa47){var _0x1f92d7={'agent':{},'channel':_0xe25a('0x5c')};if(_0x444b25['body']['id']){delete _0x444b25['body']['id'];}_0x444b25[_0xe25a('0x59')][_0xe25a('0x5d')]=!![];_0x444b25[_0xe25a('0x59')][_0xe25a('0x5e')]=moment()[_0xe25a('0x5f')](_0xe25a('0x60'));_0x444b25[_0xe25a('0x59')]['UserId']=_0x444b25[_0xe25a('0x59')][_0xe25a('0x61')]||_0x444b25[_0xe25a('0x62')]['id'];_0x1f92d7[_0xe25a('0x63')]['id']=_0x444b25[_0xe25a('0x59')][_0xe25a('0x61')];return db[_0xe25a('0x3c')][_0xe25a('0x57')]({'where':{'id':_0x444b25[_0xe25a('0x53')]['id'],'UserId':null}})[_0xe25a('0x21')](handleEntityNotFound(_0x57a5ba,null))[_0xe25a('0x21')](saveUpdates(_0x444b25[_0xe25a('0x59')],null))[_0xe25a('0x21')](function(_0x42669c){if(_0x42669c){_0x1f92d7[_0xe25a('0x28')]=_0x42669c[_0xe25a('0x64')]({'plain':!![]});return db[_0xe25a('0x65')][_0xe25a('0x57')]({'where':{'id':_0x42669c[_0xe25a('0x66')]}});}return null;})[_0xe25a('0x21')](handleEntityNotFound(_0x57a5ba,null))[_0xe25a('0x21')](function(_0x34a6e2){if(_0x34a6e2){return _0x34a6e2[_0xe25a('0x35')]({'UserId':_0x444b25['body']['UserId'],'read1stAt':_[_0xe25a('0x67')](_0x34a6e2[_0xe25a('0x68')])?moment()[_0xe25a('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe25a('0x21')](function(_0x5e0907){if(_0x5e0907){_0x1f92d7[_0xe25a('0x69')]=_0x5e0907[_0xe25a('0x64')]({'plain':!![]});interaction_log[_0xe25a('0x22')](_0xe25a('0x6a'),_0x444b25['user']['id'],_0x444b25[_0xe25a('0x62')][_0xe25a('0x38')],_0x444b25[_0xe25a('0x62')][_0xe25a('0x6b')],_0x1f92d7[_0xe25a('0x69')]['id'],_0x444b25[_0xe25a('0x59')]?JSON[_0xe25a('0x6c')](_0x444b25[_0xe25a('0x59')]):'null');return respondWithRpcPromise(_0xe25a('0x6d'),'acceptMessage',_0x1f92d7);}return null;})[_0xe25a('0x21')](function(_0x49e1c9){var _0x4f4d10=_0xe25a('0x6e')+_0x49e1c9[_0xe25a('0x28')][_0xe25a('0x6f')];return db[_0xe25a('0x70')][_0xe25a('0x40')](_0x4f4d10,{'type':db['Sequelize'][_0xe25a('0x71')][_0xe25a('0x72')],'raw':!![]})[_0xe25a('0x21')](function(_0x4b1978){return _0x4b1978;});})['then'](function(_0x2c5c40){if(_0x2c5c40){_0x1f92d7[_0xe25a('0x28')][_0xe25a('0x73')]=_0x2c5c40[0x0];if(!_0x444b25[_0xe25a('0x59')][_0xe25a('0x61')])return;return db[_0xe25a('0x74')][_0xe25a('0x57')]({'where':{'id':_0x444b25[_0xe25a('0x59')][_0xe25a('0x61')],'role':_0xe25a('0x63')},'attributes':['id',_0xe25a('0x38'),'fullname',_0xe25a('0x75'),_0xe25a('0x76')],'raw':!![]});}return null;})[_0xe25a('0x21')](function(_0x43bdf6){if(!_0x43bdf6)return null;_0x1f92d7[_0xe25a('0x28')][_0xe25a('0x63')]=_0x43bdf6;return _0x1f92d7;})[_0xe25a('0x21')](function(_0xf26ba9){if(_0xf26ba9){if(_0x444b25[_0xe25a('0x59')][_0xe25a('0x77')]){_0x1f92d7[_0xe25a('0x28')][_0xe25a('0x78')]=util[_0xe25a('0x5f')](_0xe25a('0x79'),_0x444b25[_0xe25a('0x62')][_0xe25a('0x38')]);_0x1f92d7[_0xe25a('0x28')]['channel']=_0x1f92d7['channel'];_0x1f92d7[_0xe25a('0x28')][_0xe25a('0x7a')]=_0x1f92d7['channel'];_0x1f92d7['message'][_0xe25a('0x7b')]='accept';return respondWithRpcPromise(_0xe25a('0x7c'),_0xe25a('0x7c'),{'event':_0xe25a('0x7d'),'message':_[_0xe25a('0x4c')](_0x1f92d7[_0xe25a('0x28')],JSON['parse'](_0x1f92d7['interaction'][_0xe25a('0x7e')]))},client9002)['then'](function(){return _0x1f92d7;});}return _0x1f92d7;}return null;})['then'](respondWithResult(_0x57a5ba,null))[_0xe25a('0x2a')](handleError(_0x57a5ba,null));};var interaction_log=require(_0xe25a('0x16'))(_0xe25a('0x5b'));exports[_0xe25a('0x7f')]=function(_0x3acaa4,_0x19104f,_0x31394d){var _0x242993={'agent':{},'channel':_0xe25a('0x5c')};if(_0x3acaa4[_0xe25a('0x59')]['id']){delete _0x3acaa4['body']['id'];}_0x3acaa4[_0xe25a('0x59')][_0xe25a('0x61')]=_0x3acaa4[_0xe25a('0x59')][_0xe25a('0x61')]||_0x3acaa4[_0xe25a('0x62')]['id'];_0x242993[_0xe25a('0x63')]['id']=_0x3acaa4[_0xe25a('0x59')][_0xe25a('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x3acaa4[_0xe25a('0x53')]['id'],'UserId':null}})[_0xe25a('0x21')](handleEntityNotFound(_0x19104f,null))[_0xe25a('0x21')](function(_0x5a8291){if(_0x5a8291){_0x242993[_0xe25a('0x28')]=_0x5a8291[_0xe25a('0x64')]({'plain':!![]});return db[_0xe25a('0x65')][_0xe25a('0x57')]({'where':{'id':_0x5a8291[_0xe25a('0x66')]}});}return null;})[_0xe25a('0x21')](handleEntityNotFound(_0x19104f,null))['then'](function(_0x1a8be6){if(_0x1a8be6){_0x242993['interaction']=_0x1a8be6[_0xe25a('0x64')]({'plain':!![]});interaction_log[_0xe25a('0x22')](_0xe25a('0x80'),_0x3acaa4[_0xe25a('0x62')]['id'],_0x3acaa4[_0xe25a('0x62')]['name'],_0x3acaa4[_0xe25a('0x62')][_0xe25a('0x6b')],_0x242993[_0xe25a('0x69')]['id'],_0x3acaa4[_0xe25a('0x59')]?JSON[_0xe25a('0x6c')](_0x3acaa4[_0xe25a('0x59')]):_0xe25a('0x81'));return respondWithRpcPromise(_0xe25a('0x82'),_0xe25a('0x83'),_0x242993);}return null;})['then'](function(_0x2af5f4){var _0x22a586='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2af5f4[_0xe25a('0x28')]['ContactId'];return db[_0xe25a('0x70')][_0xe25a('0x40')](_0x22a586,{'type':db['Sequelize']['QueryTypes'][_0xe25a('0x72')],'raw':!![]})[_0xe25a('0x21')](function(_0x1e2648){return _0x1e2648;});})[_0xe25a('0x21')](function(_0x14b804){if(_0x14b804){_0x242993['message'][_0xe25a('0x73')]=_0x14b804[0x0];if(!_0x3acaa4['body'][_0xe25a('0x61')])return;return db['User'][_0xe25a('0x57')]({'where':{'id':_0x3acaa4[_0xe25a('0x59')][_0xe25a('0x61')],'role':_0xe25a('0x63')},'attributes':['id',_0xe25a('0x38'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xe25a('0x21')](function(_0x3acc08){if(!_0x3acc08)return null;_0x242993[_0xe25a('0x28')][_0xe25a('0x63')]=_0x3acc08;return _0x242993;})[_0xe25a('0x21')](function(_0x135580){if(_0x135580){_0x135580[_0xe25a('0x28')][_0xe25a('0x78')]=util['format'](_0xe25a('0x79'),_0x3acaa4[_0xe25a('0x62')][_0xe25a('0x38')]);_0x135580[_0xe25a('0x28')][_0xe25a('0x84')]=_0x242993[_0xe25a('0x84')];_0x135580['message'][_0xe25a('0x7a')]=_0x242993['channel'];_0x135580['message'][_0xe25a('0x7b')]=_0xe25a('0x7f');respondWithRpcPromise('EventManager',_0xe25a('0x7c'),{'event':_0xe25a('0x85'),'message':_[_0xe25a('0x4c')](_0x242993[_0xe25a('0x28')],JSON[_0xe25a('0x86')](_0x242993['interaction']['formData']))},client9002);return _0x242993;}return null;})['then'](respondWithResult(_0x19104f,null))[_0xe25a('0x2a')](handleError(_0x19104f,null));};
\ No newline at end of file
+var _0x9c46=['destroy','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','merge','where','VIRTUAL','name','filter','options','include','findAll','rows','params','keys','includeAll','find','create','body','describe','chat-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','fullname','event','reject','rejectmessage','formData','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save'];(function(_0x316413,_0x5b54e7){var _0xf2984e=function(_0x47d42d){while(--_0x47d42d){_0x316413['push'](_0x316413['shift']());}};_0xf2984e(++_0x5b54e7);}(_0x9c46,0x1e1));var _0x69c4=function(_0x10fa8d,_0x4d6063){_0x10fa8d=_0x10fa8d-0x0;var _0x5d49cb=_0x9c46[_0x10fa8d];return _0x5d49cb;};'use strict';var emlformat=require(_0x69c4('0x0'));var rimraf=require(_0x69c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x69c4('0x2'));var rp=require('request-promise');var moment=require(_0x69c4('0x3'));var BPromise=require(_0x69c4('0x4'));var Mustache=require(_0x69c4('0x5'));var util=require('util');var path=require(_0x69c4('0x6'));var sox=require(_0x69c4('0x7'));var csv=require(_0x69c4('0x8'));var ejs=require(_0x69c4('0x9'));var fs=require('fs');var fs_extra=require(_0x69c4('0xa'));var _=require('lodash');var squel=require(_0x69c4('0xb'));var crypto=require(_0x69c4('0xc'));var jsforce=require(_0x69c4('0xd'));var deskjs=require(_0x69c4('0xe'));var toCsv=require(_0x69c4('0x8'));var querystring=require(_0x69c4('0xf'));var Papa=require(_0x69c4('0x10'));var Redis=require(_0x69c4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x69c4('0x12'));var as=require(_0x69c4('0x13'));var hardwareService=require(_0x69c4('0x14'));var logger=require(_0x69c4('0x15'))(_0x69c4('0x16'));var utils=require(_0x69c4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x69c4('0x18'));var db=require(_0x69c4('0x19'))['db'];config[_0x69c4('0x1a')]=_[_0x69c4('0x1b')](config[_0x69c4('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x69c4('0x1c'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x69c4('0x1d')](socket);var jayson=require(_0x69c4('0x1e'));var client=jayson[_0x69c4('0x1f')][_0x69c4('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x69c4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5d7b60,_0x1bbf8d,_0x168760,_0x243630){return new BPromise(function(_0x50fd75,_0x3b5007){var _0x2be021=_0x243630||client;return _0x2be021[_0x69c4('0x21')](_0x5d7b60,_0x168760)[_0x69c4('0x22')](function(_0x36b26e){logger[_0x69c4('0x23')](_0x69c4('0x24'),_0x1bbf8d,_0x69c4('0x25'));logger[_0x69c4('0x26')](_0x69c4('0x27'),_0x1bbf8d,_0x69c4('0x25'),JSON[_0x69c4('0x28')](_0x36b26e));if(_0x36b26e[_0x69c4('0x29')]){if(_0x36b26e[_0x69c4('0x29')][_0x69c4('0x2a')]===0x1f4){logger['error'](_0x69c4('0x24'),_0x1bbf8d,_0x36b26e[_0x69c4('0x29')][_0x69c4('0x2b')]);return _0x3b5007(_0x36b26e[_0x69c4('0x29')][_0x69c4('0x2b')]);}logger[_0x69c4('0x29')]('ChatMessage,\x20%s,\x20%s',_0x1bbf8d,_0x36b26e[_0x69c4('0x29')][_0x69c4('0x2b')]);return _0x50fd75(_0x36b26e[_0x69c4('0x29')][_0x69c4('0x2b')]);}else{logger[_0x69c4('0x23')](_0x69c4('0x24'),_0x1bbf8d,_0x69c4('0x25'));_0x50fd75(_0x36b26e['result'][_0x69c4('0x2b')]);}})[_0x69c4('0x2c')](function(_0x403471){logger[_0x69c4('0x29')]('ChatMessage,\x20%s,\x20%s',_0x1bbf8d,_0x403471);_0x3b5007(_0x403471);});});}function respondWithStatusCode(_0x3967ba,_0x3fa5e4){_0x3fa5e4=_0x3fa5e4||0xcc;return function(_0x4ddd19){if(_0x4ddd19){return _0x3967ba[_0x69c4('0x2d')](_0x3fa5e4);}return _0x3967ba[_0x69c4('0x2e')](_0x3fa5e4)['end']();};}function respondWithResult(_0x5f1b00,_0x42c8f3){_0x42c8f3=_0x42c8f3||0xc8;return function(_0xf4e5f5){if(_0xf4e5f5){return _0x5f1b00[_0x69c4('0x2e')](_0x42c8f3)[_0x69c4('0x2f')](_0xf4e5f5);}};}function respondWithFilteredResult(_0x41a9ec,_0x127fa2){return function(_0x4cb0b3){if(_0x4cb0b3){var _0x38985b=typeof _0x127fa2['offset']===_0x69c4('0x30')&&typeof _0x127fa2[_0x69c4('0x31')]===_0x69c4('0x30');var _0x43be9d=_0x4cb0b3[_0x69c4('0x32')];var _0x404d1e=_0x38985b?0x0:_0x127fa2[_0x69c4('0x33')];var _0x5c1b94=_0x38985b?_0x4cb0b3[_0x69c4('0x32')]:_0x127fa2[_0x69c4('0x33')]+_0x127fa2[_0x69c4('0x31')];var _0x2aaa60;if(_0x5c1b94>=_0x43be9d){_0x5c1b94=_0x43be9d;_0x2aaa60=0xc8;}else{_0x2aaa60=0xce;}_0x41a9ec[_0x69c4('0x2e')](_0x2aaa60);return _0x41a9ec['set'](_0x69c4('0x34'),_0x404d1e+'-'+_0x5c1b94+'/'+_0x43be9d)[_0x69c4('0x2f')](_0x4cb0b3);}return null;};}function patchUpdates(_0x21a5f8){return function(_0x21816d){try{jsonpatch[_0x69c4('0x35')](_0x21816d,_0x21a5f8,!![]);}catch(_0x36f3f6){return BPromise['reject'](_0x36f3f6);}return _0x21816d[_0x69c4('0x36')]();};}function saveUpdates(_0x6bd519,_0x1be93c){return function(_0x3a3d6d){if(_0x3a3d6d){return _0x3a3d6d['update'](_0x6bd519)[_0x69c4('0x22')](function(_0x2dc15b){return _0x2dc15b;});}return null;};}function removeEntity(_0x2d6aa0,_0x4c9dc2){return function(_0x34331d){if(_0x34331d){return _0x34331d[_0x69c4('0x37')]()[_0x69c4('0x22')](function(){_0x2d6aa0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ce007,_0x37c48d){return function(_0x2c5e1d){if(!_0x2c5e1d){_0x4ce007[_0x69c4('0x2d')](0x194);}return _0x2c5e1d;};}function handleError(_0x56ff53,_0xf9b6b7){_0xf9b6b7=_0xf9b6b7||0x1f4;return function(_0xe2185d){logger[_0x69c4('0x29')](_0xe2185d['stack']);if(_0xe2185d['name']){delete _0xe2185d['name'];}_0x56ff53[_0x69c4('0x2e')](_0xf9b6b7)['send'](_0xe2185d);};}exports[_0x69c4('0x38')]=function(_0x1b3626,_0x54ad62){var _0x692e77={},_0xdc628f={},_0x14043f={'count':0x0,'rows':[]};var _0x473cd1=_[_0x69c4('0x39')](db[_0x69c4('0x3a')][_0x69c4('0x3b')],function(_0x5d8e13){return{'name':_0x5d8e13[_0x69c4('0x3c')],'type':_0x5d8e13['type'][_0x69c4('0x3d')]};});_0xdc628f[_0x69c4('0x3e')]=_[_0x69c4('0x39')](_0x473cd1,'name');_0xdc628f[_0x69c4('0x3f')]=_['keys'](_0x1b3626['query']);_0xdc628f['filters']=_[_0x69c4('0x40')](_0xdc628f[_0x69c4('0x3e')],_0xdc628f['query']);_0x692e77[_0x69c4('0x41')]=_[_0x69c4('0x40')](_0xdc628f[_0x69c4('0x3e')],qs[_0x69c4('0x42')](_0x1b3626[_0x69c4('0x3f')][_0x69c4('0x42')]));_0x692e77[_0x69c4('0x41')]=_0x692e77['attributes'][_0x69c4('0x43')]?_0x692e77[_0x69c4('0x41')]:_0xdc628f[_0x69c4('0x3e')];if(!_0x1b3626[_0x69c4('0x3f')][_0x69c4('0x44')](_0x69c4('0x45'))){_0x692e77['limit']=qs[_0x69c4('0x31')](_0x1b3626[_0x69c4('0x3f')][_0x69c4('0x31')]);_0x692e77[_0x69c4('0x33')]=qs[_0x69c4('0x33')](_0x1b3626[_0x69c4('0x3f')][_0x69c4('0x33')]);}_0x692e77['order']=qs[_0x69c4('0x46')](_0x1b3626[_0x69c4('0x3f')]['sort']);_0x692e77['where']=qs[_0x69c4('0x47')](_[_0x69c4('0x48')](_0x1b3626['query'],_0xdc628f[_0x69c4('0x47')]),_0x473cd1);if(_0x1b3626['query']['filter']){_0x692e77['where']=_[_0x69c4('0x49')](_0x692e77[_0x69c4('0x4a')],{'$or':_['map'](_0x473cd1,function(_0x790ba6){if(_0x790ba6['type']!==_0x69c4('0x4b')){var _0x404254={};_0x404254[_0x790ba6[_0x69c4('0x4c')]]={'$like':'%'+_0x1b3626[_0x69c4('0x3f')][_0x69c4('0x4d')]+'%'};return _0x404254;}})});}_0x692e77=_[_0x69c4('0x49')]({},_0x692e77,_0x1b3626[_0x69c4('0x4e')]);var _0x54797d={'where':_0x692e77[_0x69c4('0x4a')]};return db[_0x69c4('0x3a')][_0x69c4('0x32')](_0x54797d)[_0x69c4('0x22')](function(_0x558da3){_0x14043f[_0x69c4('0x32')]=_0x558da3;if(_0x1b3626[_0x69c4('0x3f')]['includeAll']){_0x692e77[_0x69c4('0x4f')]=[{'all':!![]}];}return db[_0x69c4('0x3a')][_0x69c4('0x50')](_0x692e77);})[_0x69c4('0x22')](function(_0x976831){_0x14043f[_0x69c4('0x51')]=_0x976831;return _0x14043f;})['then'](respondWithFilteredResult(_0x54ad62,_0x692e77))['catch'](handleError(_0x54ad62,null));};exports['show']=function(_0x43f033,_0xd5c7f7){var _0x429ac1={'raw':!![],'where':{'id':_0x43f033[_0x69c4('0x52')]['id']}},_0x3beca1={};_0x3beca1[_0x69c4('0x3e')]=_['keys'](db['ChatMessage'][_0x69c4('0x3b')]);_0x3beca1[_0x69c4('0x3f')]=_[_0x69c4('0x53')](_0x43f033[_0x69c4('0x3f')]);_0x3beca1['filters']=_[_0x69c4('0x40')](_0x3beca1[_0x69c4('0x3e')],_0x3beca1['query']);_0x429ac1[_0x69c4('0x41')]=_['intersection'](_0x3beca1[_0x69c4('0x3e')],qs[_0x69c4('0x42')](_0x43f033['query'][_0x69c4('0x42')]));_0x429ac1['attributes']=_0x429ac1[_0x69c4('0x41')][_0x69c4('0x43')]?_0x429ac1[_0x69c4('0x41')]:_0x3beca1['model'];if(_0x43f033[_0x69c4('0x3f')][_0x69c4('0x54')]){_0x429ac1[_0x69c4('0x4f')]=[{'all':!![]}];}_0x429ac1=_[_0x69c4('0x49')]({},_0x429ac1,_0x43f033[_0x69c4('0x4e')]);return db['ChatMessage'][_0x69c4('0x55')](_0x429ac1)['then'](handleEntityNotFound(_0xd5c7f7,null))['then'](respondWithResult(_0xd5c7f7,null))[_0x69c4('0x2c')](handleError(_0xd5c7f7,null));};exports[_0x69c4('0x56')]=function(_0x15610a,_0x1e14b2){return db[_0x69c4('0x3a')][_0x69c4('0x56')](_0x15610a[_0x69c4('0x57')],{})['then'](respondWithResult(_0x1e14b2,0xc9))['catch'](handleError(_0x1e14b2,null));};exports['update']=function(_0x4293ea,_0x18c907){if(_0x4293ea[_0x69c4('0x57')]['id']){delete _0x4293ea[_0x69c4('0x57')]['id'];}return db[_0x69c4('0x3a')][_0x69c4('0x55')]({'where':{'id':_0x4293ea[_0x69c4('0x52')]['id']}})[_0x69c4('0x22')](handleEntityNotFound(_0x18c907,null))[_0x69c4('0x22')](saveUpdates(_0x4293ea[_0x69c4('0x57')],null))[_0x69c4('0x22')](respondWithResult(_0x18c907,null))['catch'](handleError(_0x18c907,null));};exports[_0x69c4('0x37')]=function(_0x5ea9ca,_0x512722){return db[_0x69c4('0x3a')][_0x69c4('0x55')]({'where':{'id':_0x5ea9ca[_0x69c4('0x52')]['id']}})[_0x69c4('0x22')](handleEntityNotFound(_0x512722,null))[_0x69c4('0x22')](removeEntity(_0x512722,null))[_0x69c4('0x2c')](handleError(_0x512722,null));};exports[_0x69c4('0x58')]=function(_0x27c0b6,_0x2a2460){return db[_0x69c4('0x3a')]['describe']()[_0x69c4('0x22')](respondWithResult(_0x2a2460,null))['catch'](handleError(_0x2a2460,null));};var interaction_log=require(_0x69c4('0x15'))(_0x69c4('0x59'));exports[_0x69c4('0x5a')]=function(_0x51c474,_0x302969,_0x4a1768){var _0x5dfd7f={'agent':{},'channel':'chat'};if(_0x51c474['body']['id']){delete _0x51c474[_0x69c4('0x57')]['id'];}_0x51c474[_0x69c4('0x57')][_0x69c4('0x5b')]=!![];_0x51c474[_0x69c4('0x57')][_0x69c4('0x5c')]=moment()['format'](_0x69c4('0x5d'));_0x51c474[_0x69c4('0x57')][_0x69c4('0x5e')]=_0x51c474[_0x69c4('0x57')][_0x69c4('0x5e')]||_0x51c474[_0x69c4('0x5f')]['id'];_0x5dfd7f['agent']['id']=_0x51c474['body'][_0x69c4('0x5e')];return db[_0x69c4('0x3a')][_0x69c4('0x55')]({'where':{'id':_0x51c474[_0x69c4('0x52')]['id'],'UserId':null}})[_0x69c4('0x22')](handleEntityNotFound(_0x302969,null))[_0x69c4('0x22')](saveUpdates(_0x51c474['body'],null))[_0x69c4('0x22')](function(_0x3264b7){if(_0x3264b7){_0x5dfd7f[_0x69c4('0x2b')]=_0x3264b7[_0x69c4('0x60')]({'plain':!![]});return db[_0x69c4('0x61')][_0x69c4('0x55')]({'where':{'id':_0x3264b7[_0x69c4('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x302969,null))[_0x69c4('0x22')](function(_0x5dae80){if(_0x5dae80){return _0x5dae80['update']({'UserId':_0x51c474['body']['UserId'],'read1stAt':_[_0x69c4('0x63')](_0x5dae80[_0x69c4('0x64')])?moment()[_0x69c4('0x65')](_0x69c4('0x5d')):undefined});}return null;})[_0x69c4('0x22')](function(_0xb8d6f1){if(_0xb8d6f1){_0x5dfd7f[_0x69c4('0x66')]=_0xb8d6f1['get']({'plain':!![]});interaction_log[_0x69c4('0x23')](_0x69c4('0x67'),_0x51c474[_0x69c4('0x5f')]['id'],_0x51c474['user'][_0x69c4('0x4c')],_0x51c474[_0x69c4('0x5f')][_0x69c4('0x68')],_0x5dfd7f['interaction']['id'],_0x51c474[_0x69c4('0x57')]?JSON['stringify'](_0x51c474[_0x69c4('0x57')]):_0x69c4('0x69'));return respondWithRpcPromise(_0x69c4('0x6a'),_0x69c4('0x6b'),_0x5dfd7f);}return null;})['then'](function(_0x36d14a){var _0x136787=_0x69c4('0x6c')+_0x36d14a[_0x69c4('0x2b')][_0x69c4('0x6d')];return db[_0x69c4('0x6e')]['query'](_0x136787,{'type':db[_0x69c4('0x6f')][_0x69c4('0x70')][_0x69c4('0x71')],'raw':!![]})[_0x69c4('0x22')](function(_0x27abaa){return _0x27abaa;});})[_0x69c4('0x22')](function(_0x58b3bd){if(_0x58b3bd){_0x5dfd7f['message'][_0x69c4('0x72')]=_0x58b3bd[0x0];if(!_0x51c474[_0x69c4('0x57')][_0x69c4('0x5e')])return;return db[_0x69c4('0x73')][_0x69c4('0x55')]({'where':{'id':_0x51c474[_0x69c4('0x57')][_0x69c4('0x5e')],'role':_0x69c4('0x74')},'attributes':['id',_0x69c4('0x4c'),'fullname',_0x69c4('0x75'),_0x69c4('0x76')],'raw':!![]});}return null;})['then'](function(_0x4ece6b){if(!_0x4ece6b)return null;_0x5dfd7f[_0x69c4('0x2b')][_0x69c4('0x74')]=_0x4ece6b;return _0x5dfd7f;})[_0x69c4('0x22')](function(_0x1516bf){if(_0x1516bf){if(_0x51c474[_0x69c4('0x57')][_0x69c4('0x77')]){_0x5dfd7f[_0x69c4('0x2b')][_0x69c4('0x78')]=util[_0x69c4('0x65')](_0x69c4('0x79'),_0x51c474['user'][_0x69c4('0x4c')]);_0x5dfd7f[_0x69c4('0x2b')]['channel']=_0x5dfd7f[_0x69c4('0x7a')];_0x5dfd7f['message'][_0x69c4('0x7b')]=_0x5dfd7f[_0x69c4('0x7a')];_0x5dfd7f['message']['event']=_0x69c4('0x5a');return respondWithRpcPromise(_0x69c4('0x7c'),_0x69c4('0x7c'),{'event':_0x69c4('0x7d'),'message':_[_0x69c4('0x49')](_0x5dfd7f[_0x69c4('0x2b')],JSON[_0x69c4('0x7e')](_0x5dfd7f['interaction']['formData']))},client9002)[_0x69c4('0x22')](function(){return _0x5dfd7f;});}return _0x5dfd7f;}return null;})[_0x69c4('0x22')](respondWithResult(_0x302969,null))['catch'](handleError(_0x302969,null));};var interaction_log=require('../../config/logger')(_0x69c4('0x59'));exports['reject']=function(_0x537418,_0x6755c9,_0x32c9bb){var _0xd7917a={'agent':{},'channel':'chat'};if(_0x537418['body']['id']){delete _0x537418['body']['id'];}_0x537418[_0x69c4('0x57')][_0x69c4('0x5e')]=_0x537418[_0x69c4('0x57')][_0x69c4('0x5e')]||_0x537418[_0x69c4('0x5f')]['id'];_0xd7917a[_0x69c4('0x74')]['id']=_0x537418[_0x69c4('0x57')][_0x69c4('0x5e')];return db[_0x69c4('0x3a')][_0x69c4('0x55')]({'where':{'id':_0x537418['params']['id'],'UserId':null}})[_0x69c4('0x22')](handleEntityNotFound(_0x6755c9,null))[_0x69c4('0x22')](function(_0x40bda6){if(_0x40bda6){_0xd7917a['message']=_0x40bda6[_0x69c4('0x60')]({'plain':!![]});return db[_0x69c4('0x61')][_0x69c4('0x55')]({'where':{'id':_0x40bda6[_0x69c4('0x62')]}});}return null;})[_0x69c4('0x22')](handleEntityNotFound(_0x6755c9,null))[_0x69c4('0x22')](function(_0x3f62ee){if(_0x3f62ee){_0xd7917a[_0x69c4('0x66')]=_0x3f62ee['get']({'plain':!![]});interaction_log[_0x69c4('0x23')](_0x69c4('0x7f'),_0x537418['user']['id'],_0x537418[_0x69c4('0x5f')][_0x69c4('0x4c')],_0x537418[_0x69c4('0x5f')][_0x69c4('0x68')],_0xd7917a[_0x69c4('0x66')]['id'],_0x537418[_0x69c4('0x57')]?JSON[_0x69c4('0x28')](_0x537418['body']):'null');return respondWithRpcPromise('RejectMessage',_0x69c4('0x80'),_0xd7917a);}return null;})['then'](function(_0x3c5bfb){var _0x204183='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3c5bfb[_0x69c4('0x2b')][_0x69c4('0x6d')];return db[_0x69c4('0x6e')][_0x69c4('0x3f')](_0x204183,{'type':db[_0x69c4('0x6f')][_0x69c4('0x70')][_0x69c4('0x71')],'raw':!![]})['then'](function(_0x1c153f){return _0x1c153f;});})[_0x69c4('0x22')](function(_0x277be8){if(_0x277be8){_0xd7917a[_0x69c4('0x2b')][_0x69c4('0x72')]=_0x277be8[0x0];if(!_0x537418['body'][_0x69c4('0x5e')])return;return db[_0x69c4('0x73')]['find']({'where':{'id':_0x537418['body'][_0x69c4('0x5e')],'role':_0x69c4('0x74')},'attributes':['id',_0x69c4('0x4c'),_0x69c4('0x81'),_0x69c4('0x75'),_0x69c4('0x76')],'raw':!![]});}return null;})['then'](function(_0x5129d1){if(!_0x5129d1)return null;_0xd7917a['message'][_0x69c4('0x74')]=_0x5129d1;return _0xd7917a;})['then'](function(_0xce400a){if(_0xce400a){_0xce400a[_0x69c4('0x2b')][_0x69c4('0x78')]=util[_0x69c4('0x65')](_0x69c4('0x79'),_0x537418[_0x69c4('0x5f')][_0x69c4('0x4c')]);_0xce400a[_0x69c4('0x2b')][_0x69c4('0x7a')]=_0xd7917a['channel'];_0xce400a[_0x69c4('0x2b')][_0x69c4('0x7b')]=_0xd7917a['channel'];_0xce400a[_0x69c4('0x2b')][_0x69c4('0x82')]=_0x69c4('0x83');respondWithRpcPromise(_0x69c4('0x7c'),'EventManager',{'event':_0x69c4('0x84'),'message':_[_0x69c4('0x49')](_0xd7917a[_0x69c4('0x2b')],JSON[_0x69c4('0x7e')](_0xd7917a[_0x69c4('0x66')][_0x69c4('0x85')]))},client9002);return _0xd7917a;}return null;})[_0x69c4('0x22')](respondWithResult(_0x6755c9,null))[_0x69c4('0x2c')](handleError(_0x6755c9,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 8aff5d0..386fdd2 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 _0x3dba=['hook','exports','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1b18e7,_0x5d06ca){var _0x2c435a=function(_0x2140da){while(--_0x2140da){_0x1b18e7['push'](_0x1b18e7['shift']());}};_0x2c435a(++_0x5d06ca);}(_0x3dba,0xe2));var _0xa3db=function(_0x2c4949,_0x2476d2){_0x2c4949=_0x2c4949-0x0;var _0x5e9161=_0x3dba[_0x2c4949];return _0x5e9161;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0xa3db('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa3db('0x1')](0x0);var events={'afterCreate':_0xa3db('0x2'),'afterUpdate':_0xa3db('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3f4bc0){return function(_0x41cf89,_0x5f1113,_0x515c62){ChatMessageEvents[_0xa3db('0x4')](_0x3f4bc0+':'+_0x41cf89['id'],_0x41cf89);ChatMessageEvents[_0xa3db('0x4')](_0x3f4bc0,_0x41cf89);_0x515c62(null);};}for(var e in events){if(events[_0xa3db('0x5')](e)){var event=events[e];ChatMessage[_0xa3db('0x6')](e,emitEvent(event));}}module[_0xa3db('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xd6b7=['hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0xd6b7,0x1ec));var _0x7d6b=function(_0x41fb84,_0x3770b8){_0x41fb84=_0x41fb84-0x0;var _0x231304=_0xd6b7[_0x41fb84];return _0x231304;};'use strict';var EventEmitter=require(_0x7d6b('0x0'));var ChatMessage=require(_0x7d6b('0x1'))['db'][_0x7d6b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7d6b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7d6b('0x4'),'afterDestroy':_0x7d6b('0x5')};function emitEvent(_0x23801e){return function(_0x1b6809,_0xa42e4f,_0x2690a0){ChatMessageEvents['emit'](_0x23801e+':'+_0x1b6809['id'],_0x1b6809);ChatMessageEvents[_0x7d6b('0x6')](_0x23801e,_0x1b6809);_0x2690a0(null);};}for(var e in events){if(events[_0x7d6b('0x7')](e)){var event=events[e];ChatMessage[_0x7d6b('0x8')](e,emitEvent(event));}}module[_0x7d6b('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 3c141ec..45cc632 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 _0x854a=['update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','./chatMessage.attributes','exports','define','body','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then'];(function(_0x517839,_0x317183){var _0x4b89d1=function(_0x18f9ca){while(--_0x18f9ca){_0x517839['push'](_0x517839['shift']());}};_0x4b89d1(++_0x317183);}(_0x854a,0x1e8));var _0xa854=function(_0xe18a4d,_0x290e52){_0xe18a4d=_0xe18a4d-0x0;var _0x41b211=_0x854a[_0xe18a4d];return _0x41b211;};'use strict';var _=require(_0xa854('0x0'));var util=require(_0xa854('0x1'));var logger=require('../../config/logger')(_0xa854('0x2'));var moment=require(_0xa854('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa854('0x4'));module[_0xa854('0x5')]=function(_0x10050d,_0x3456f2){return _0x10050d[_0xa854('0x6')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xa854('0x7')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x359e15,_0x52b63d,_0x54477b){var _0x6d36a9=_0x10050d['models'];var _0x3c185d=_0x359e15[_0xa854('0x8')]({'plain':!![]});if(_0x3c185d[_0xa854('0x9')][_0xa854('0xa')]()==='in'||_0x3c185d[_0xa854('0x9')]['toLowerCase']()===_0xa854('0xb')&&!_0x3c185d[_0xa854('0xc')]&&!_[_0xa854('0xd')](_0x3c185d[_0xa854('0xe')])){_0x6d36a9[_0xa854('0xf')]['findOne']({'where':{'id':_0x3c185d[_0xa854('0x10')]}})[_0xa854('0x11')](function(_0x4f7153){if(_0x4f7153){_0x4f7153[_0xa854('0x12')]({'lastMsgAt':_0x3c185d['createdAt'],'lastMsgDirection':_0x3c185d[_0xa854('0x9')]['toLowerCase']()});}})[_0xa854('0x13')](function(_0x17be9e){console['error'](_0x17be9e);});}_0x54477b();}},'charset':_0xa854('0x14'),'collate':_0xa854('0x15')});};
\ No newline at end of file
+var _0xc300=['../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0xc300,0x132));var _0x0c30=function(_0x302b27,_0x26d927){_0x302b27=_0x302b27-0x0;var _0x2b2193=_0xc300[_0x302b27];return _0x2b2193;};'use strict';var _=require(_0x0c30('0x0'));var util=require(_0x0c30('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c30('0x2'));var BPromise=require(_0x0c30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c30('0x4'));var rimraf=require(_0x0c30('0x5'));var config=require(_0x0c30('0x6'));var attributes=require(_0x0c30('0x7'));module[_0x0c30('0x8')]=function(_0x99afcb,_0xc8f529){return _0x99afcb[_0x0c30('0x9')]('ChatMessage',attributes,{'tableName':_0x0c30('0xa'),'paranoid':![],'indexes':[{'name':_0x0c30('0xb'),'fields':['body'],'type':_0x0c30('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39417c,_0x56d44a,_0x351cca){var _0x2d077e=_0x99afcb[_0x0c30('0xd')];var _0x104032=_0x39417c[_0x0c30('0xe')]({'plain':!![]});if(_0x104032['direction']['toLowerCase']()==='in'||_0x104032[_0x0c30('0xf')][_0x0c30('0x10')]()==='out'&&!_0x104032['secret']&&!_[_0x0c30('0x11')](_0x104032[_0x0c30('0x12')])){_0x2d077e[_0x0c30('0x13')][_0x0c30('0x14')]({'where':{'id':_0x104032[_0x0c30('0x15')]}})['then'](function(_0x11c0ae){if(_0x11c0ae){_0x11c0ae['update']({'lastMsgAt':_0x104032[_0x0c30('0x16')],'lastMsgDirection':_0x104032[_0x0c30('0xf')][_0x0c30('0x10')]()});}})[_0x0c30('0x17')](function(_0x295efb){console[_0x0c30('0x18')](_0x295efb);});}_0x351cca();}},'charset':'utf8mb4','collate':_0x0c30('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 9a38134..149397f 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 _0x6d88=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage','body','options','CreateChatMessage','lodash','util','moment','randomstring'];(function(_0x4538f6,_0x50f153){var _0x3e771e=function(_0x2dd558){while(--_0x2dd558){_0x4538f6['push'](_0x4538f6['shift']());}};_0x3e771e(++_0x50f153);}(_0x6d88,0x9c));var _0x86d8=function(_0x1804ae,_0x33570b){_0x1804ae=_0x1804ae-0x0;var _0x5e5161=_0x6d88[_0x1804ae];return _0x5e5161;};'use strict';var _=require(_0x86d8('0x0'));var util=require(_0x86d8('0x1'));var moment=require(_0x86d8('0x2'));var BPromise=require('bluebird');var rs=require(_0x86d8('0x3'));var fs=require('fs');var Redis=require(_0x86d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x86d8('0x5'));var logger=require(_0x86d8('0x6'))(_0x86d8('0x7'));var config=require('../../config/environment');var jayson=require(_0x86d8('0x8'));var client=jayson[_0x86d8('0x9')][_0x86d8('0xa')]({'port':0x232a});config[_0x86d8('0xb')]=_[_0x86d8('0xc')](config[_0x86d8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x86d8('0xd'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x86d8('0xe')](socket);function respondWithRpcPromise(_0x5639d6,_0x3e51bf,_0xaf5a5f){return new BPromise(function(_0x3f8ca6,_0x542474){return client[_0x86d8('0xf')](_0x5639d6,_0xaf5a5f)[_0x86d8('0x10')](function(_0x3cb003){logger[_0x86d8('0x11')]('ChatMessage,\x20%s,\x20%s',_0x3e51bf,'request\x20sent');logger[_0x86d8('0x12')](_0x86d8('0x13'),_0x3e51bf,_0x86d8('0x14'),JSON[_0x86d8('0x15')](_0x3cb003));if(_0x3cb003['error']){if(_0x3cb003[_0x86d8('0x16')][_0x86d8('0x17')]===0x1f4){logger['error'](_0x86d8('0x18'),_0x3e51bf,_0x3cb003[_0x86d8('0x16')][_0x86d8('0x19')]);return _0x542474(_0x3cb003[_0x86d8('0x16')][_0x86d8('0x19')]);}logger[_0x86d8('0x16')]('ChatMessage,\x20%s,\x20%s',_0x3e51bf,_0x3cb003[_0x86d8('0x16')][_0x86d8('0x19')]);return _0x3f8ca6(_0x3cb003[_0x86d8('0x16')][_0x86d8('0x19')]);}else{logger[_0x86d8('0x11')](_0x86d8('0x18'),_0x3e51bf,'request\x20sent');_0x3f8ca6(_0x3cb003[_0x86d8('0x1a')][_0x86d8('0x19')]);}})[_0x86d8('0x1b')](function(_0x7b3a41){logger['error'](_0x86d8('0x18'),_0x3e51bf,_0x7b3a41);_0x542474(_0x7b3a41);});});}exports['CreateChatMessage']=function(_0xbc88e6){var _0x2c790a=this;return new Promise(function(_0x41ee44,_0x168410){return db[_0x86d8('0x1c')]['create'](_0xbc88e6[_0x86d8('0x1d')],{'raw':_0xbc88e6[_0x86d8('0x1e')]?_0xbc88e6[_0x86d8('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x32fa55){logger[_0x86d8('0x11')]('CreateChatMessage',_0xbc88e6);logger[_0x86d8('0x12')]('CreateChatMessage',_0xbc88e6,JSON[_0x86d8('0x15')](_0x32fa55));_0x41ee44(_0x32fa55);})[_0x86d8('0x1b')](function(_0x5a80d2){logger['error'](_0x86d8('0x1f'),_0x5a80d2['message'],_0xbc88e6);_0x168410(_0x2c790a[_0x86d8('0x16')](0x1f4,_0x5a80d2[_0x86d8('0x19')]));});});};
\ No newline at end of file
+var _0x7166=['request\x20sent','error','code','ChatMessage,\x20%s,\x20%s','message','catch','ChatMessage','body','options','raw','CreateChatMessage','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x382ed9,_0x523c26){var _0x20028c=function(_0x19580d){while(--_0x19580d){_0x382ed9['push'](_0x382ed9['shift']());}};_0x20028c(++_0x523c26);}(_0x7166,0x90));var _0x6716=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x7166[_0x4bd06e];return _0x85ebb;};'use strict';var _=require(_0x6716('0x0'));var util=require(_0x6716('0x1'));var moment=require(_0x6716('0x2'));var BPromise=require('bluebird');var rs=require(_0x6716('0x3'));var fs=require('fs');var Redis=require(_0x6716('0x4'));var db=require(_0x6716('0x5'))['db'];var utils=require(_0x6716('0x6'));var logger=require('../../config/logger')(_0x6716('0x7'));var config=require(_0x6716('0x8'));var jayson=require(_0x6716('0x9'));var client=jayson[_0x6716('0xa')][_0x6716('0xb')]({'port':0x232a});config[_0x6716('0xc')]=_[_0x6716('0xd')](config[_0x6716('0xc')],{'host':_0x6716('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6716('0xc')]));require(_0x6716('0xf'))[_0x6716('0x10')](socket);function respondWithRpcPromise(_0x392a19,_0x5d3e14,_0x3dbc74){return new BPromise(function(_0x42864c,_0x78d90d){return client[_0x6716('0x11')](_0x392a19,_0x3dbc74)['then'](function(_0x5a9a33){logger[_0x6716('0x12')]('ChatMessage,\x20%s,\x20%s',_0x5d3e14,'request\x20sent');logger[_0x6716('0x13')](_0x6716('0x14'),_0x5d3e14,_0x6716('0x15'),JSON['stringify'](_0x5a9a33));if(_0x5a9a33[_0x6716('0x16')]){if(_0x5a9a33[_0x6716('0x16')][_0x6716('0x17')]===0x1f4){logger[_0x6716('0x16')](_0x6716('0x18'),_0x5d3e14,_0x5a9a33[_0x6716('0x16')]['message']);return _0x78d90d(_0x5a9a33['error']['message']);}logger[_0x6716('0x16')](_0x6716('0x18'),_0x5d3e14,_0x5a9a33[_0x6716('0x16')][_0x6716('0x19')]);return _0x42864c(_0x5a9a33[_0x6716('0x16')][_0x6716('0x19')]);}else{logger[_0x6716('0x12')](_0x6716('0x18'),_0x5d3e14,'request\x20sent');_0x42864c(_0x5a9a33['result']['message']);}})[_0x6716('0x1a')](function(_0x200f3b){logger[_0x6716('0x16')](_0x6716('0x18'),_0x5d3e14,_0x200f3b);_0x78d90d(_0x200f3b);});});}exports['CreateChatMessage']=function(_0x340455){var _0x509843=this;return new Promise(function(_0x20053d,_0x497334){return db[_0x6716('0x1b')]['create'](_0x340455[_0x6716('0x1c')],{'raw':_0x340455[_0x6716('0x1d')]?_0x340455[_0x6716('0x1d')][_0x6716('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x289cb6){logger[_0x6716('0x12')](_0x6716('0x1f'),_0x340455);logger[_0x6716('0x13')](_0x6716('0x1f'),_0x340455,JSON[_0x6716('0x20')](_0x289cb6));_0x20053d(_0x289cb6);})[_0x6716('0x1a')](function(_0x35487f){logger[_0x6716('0x16')]('CreateChatMessage',_0x35487f['message'],_0x340455);_0x497334(_0x509843[_0x6716('0x16')](0x1f4,_0x35487f[_0x6716('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 0cf625e..ddf2e05 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 _0x7217=['chatMessage:','./chatMessage.events','remove','update','removeListener','register','length'];(function(_0x485feb,_0x4687f9){var _0x3013fd=function(_0x247283){while(--_0x247283){_0x485feb['push'](_0x485feb['shift']());}};_0x3013fd(++_0x4687f9);}(_0x7217,0x19e));var _0x7721=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x7217[_0x220dbb];return _0x2b77de;};'use strict';var ChatMessageEvents=require(_0x7721('0x0'));var events=['save',_0x7721('0x1'),_0x7721('0x2')];function createListener(_0x1de988,_0x2a78d8){return function(_0x115ab3){_0x2a78d8['emit'](_0x1de988,_0x115ab3);};}function removeListener(_0x5bf160,_0x472a96){return function(){ChatMessageEvents[_0x7721('0x3')](_0x5bf160,_0x472a96);};}exports[_0x7721('0x4')]=function(_0x3fe47c){for(var _0xb239e0=0x0,_0xf7ff37=events[_0x7721('0x5')];_0xb239e0<_0xf7ff37;_0xb239e0++){var _0x21f680=events[_0xb239e0];var _0x225610=createListener(_0x7721('0x6')+_0x21f680,_0x3fe47c);ChatMessageEvents['on'](_0x21f680,_0x225610);}};
\ No newline at end of file
+var _0xcea5=['save','remove','update','emit','register','chatMessage:','./chatMessage.events'];(function(_0x1bc18a,_0x3b586d){var _0x2f9358=function(_0x34fcac){while(--_0x34fcac){_0x1bc18a['push'](_0x1bc18a['shift']());}};_0x2f9358(++_0x3b586d);}(_0xcea5,0xed));var _0x5cea=function(_0x3177f0,_0x5142dc){_0x3177f0=_0x3177f0-0x0;var _0x55414d=_0xcea5[_0x3177f0];return _0x55414d;};'use strict';var ChatMessageEvents=require(_0x5cea('0x0'));var events=[_0x5cea('0x1'),_0x5cea('0x2'),_0x5cea('0x3')];function createListener(_0x2c6970,_0x52a9b8){return function(_0x20a2d9){_0x52a9b8[_0x5cea('0x4')](_0x2c6970,_0x20a2d9);};}function removeListener(_0x382c21,_0x319dba){return function(){ChatMessageEvents['removeListener'](_0x382c21,_0x319dba);};}exports[_0x5cea('0x5')]=function(_0x31e6f3){for(var _0x599bc5=0x0,_0x49db13=events['length'];_0x599bc5<_0x49db13;_0x599bc5++){var _0x502d95=events[_0x599bc5];var _0x3b6fbc=createListener(_0x5cea('0x6')+_0x502d95,_0x31e6f3);ChatMessageEvents['on'](_0x502d95,_0x3b6fbc);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 715d022..1c4b178 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 _0xa82c=['fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','accept','reject','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x3908df,_0x5b8c1a){var _0x17a7ce=function(_0x469c30){while(--_0x469c30){_0x3908df['push'](_0x3908df['shift']());}};_0x17a7ce(++_0x5b8c1a);}(_0xa82c,0x182));var _0xca82=function(_0x130fb2,_0x2c76dc){_0x130fb2=_0x130fb2-0x0;var _0x3ffb77=_0xa82c[_0x130fb2];return _0x3ffb77;};'use strict';var multer=require(_0xca82('0x0'));var util=require(_0xca82('0x1'));var path=require(_0xca82('0x2'));var timeout=require(_0xca82('0x3'));var express=require(_0xca82('0x4'));var router=express[_0xca82('0x5')]();var fs_extra=require(_0xca82('0x6'));var auth=require(_0xca82('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xca82('0x8'));var controller=require(_0xca82('0x9'));router[_0xca82('0xa')]('/',auth[_0xca82('0xb')](),controller[_0xca82('0xc')]);router[_0xca82('0xa')](_0xca82('0xd'),auth['isAuthenticated'](),controller[_0xca82('0xe')]);router[_0xca82('0xa')](_0xca82('0xf'),auth['isAuthenticated'](),controller[_0xca82('0x10')]);router[_0xca82('0x11')]('/',auth[_0xca82('0xb')](),interaction[_0xca82('0x12')](_0xca82('0x13'),_0xca82('0x14')),controller[_0xca82('0x15')]);router[_0xca82('0x16')]('/:id',controller['update']);router[_0xca82('0x16')](_0xca82('0x17'),auth['isAuthenticated'](),controller[_0xca82('0x18')]);router['put']('/:id/reject',auth[_0xca82('0xb')](),controller[_0xca82('0x19')]);router[_0xca82('0x1a')](_0xca82('0xf'),auth[_0xca82('0xb')](),controller[_0xca82('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x5484=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','accept','reject','delete','destroy','exports'];(function(_0x4d901b,_0x5f4055){var _0x37166b=function(_0x4b47c6){while(--_0x4b47c6){_0x4d901b['push'](_0x4d901b['shift']());}};_0x37166b(++_0x5f4055);}(_0x5484,0x1ba));var _0x4548=function(_0x189e27,_0x3e45f2){_0x189e27=_0x189e27-0x0;var _0x49e893=_0x5484[_0x189e27];return _0x49e893;};'use strict';var multer=require(_0x4548('0x0'));var util=require('util');var path=require(_0x4548('0x1'));var timeout=require(_0x4548('0x2'));var express=require(_0x4548('0x3'));var router=express[_0x4548('0x4')]();var fs_extra=require(_0x4548('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4548('0x6'));var config=require('../../config/environment');var controller=require(_0x4548('0x7'));router[_0x4548('0x8')]('/',auth[_0x4548('0x9')](),controller[_0x4548('0xa')]);router[_0x4548('0x8')]('/describe',auth[_0x4548('0x9')](),controller[_0x4548('0xb')]);router[_0x4548('0x8')](_0x4548('0xc'),auth['isAuthenticated'](),controller[_0x4548('0xd')]);router[_0x4548('0xe')]('/',auth[_0x4548('0x9')](),interaction[_0x4548('0xf')](_0x4548('0x10'),_0x4548('0x11')),controller[_0x4548('0x12')]);router[_0x4548('0x13')](_0x4548('0xc'),controller[_0x4548('0x14')]);router['put']('/:id/accept',auth[_0x4548('0x9')](),controller[_0x4548('0x15')]);router[_0x4548('0x13')]('/:id/reject',auth[_0x4548('0x9')](),controller[_0x4548('0x16')]);router[_0x4548('0x17')](_0x4548('0xc'),auth[_0x4548('0x9')](),controller[_0x4548('0x18')]);module[_0x4548('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index c7772bf..a0eae74 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['medium','TEXT','exports'];(function(_0xa910d4,_0x4a33b9){var _0x3eb349=function(_0x1d628b){while(--_0x1d628b){_0xa910d4['push'](_0xa910d4['shift']());}};_0x3eb349(++_0x4a33b9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x4908cb,_0xa5f2fe){var _0x5bd163=function(_0x514a8d){while(--_0x514a8d){_0x4908cb['push'](_0x4908cb['shift']());}};_0x5bd163(++_0xa5f2fe);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32c259,_0x101e64){_0x32c259=_0x32c259-0x0;var _0x4206bf=_0x5f2f[_0x32c259];return _0x4206bf;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index e14468e..99bcbb0 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(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x7a54,0x106));var _0x47a5=function(_0x33c957,_0x1bb267){_0x33c957=_0x33c957-0x0;var _0x3339c4=_0x7a54[_0x33c957];return _0x3339c4;};'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(_0x3d96e2,_0x6f46c6){var _0x459f64=function(_0x5414a2){while(--_0x5414a2){_0x3d96e2['push'](_0x3d96e2['shift']());}};_0x459f64(++_0x6f46c6);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 ce6114c..9bbbfb9 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 _0x0e50=['events','../../mysqldb','ChatOfflineMessage','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x805b5,_0x210dd2){var _0x259373=function(_0x484f64){while(--_0x484f64){_0x805b5['push'](_0x805b5['shift']());}};_0x259373(++_0x210dd2);}(_0x0e50,0x168));var _0x00e5=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x0e50[_0x4ff09b];return _0x3f5c2e;};'use strict';var EventEmitter=require(_0x00e5('0x0'));var ChatOfflineMessage=require(_0x00e5('0x1'))['db'][_0x00e5('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x00e5('0x3'),'afterUpdate':_0x00e5('0x4'),'afterDestroy':_0x00e5('0x5')};function emitEvent(_0x12c933){return function(_0x3d2263,_0x4f38ad,_0x203d0e){ChatOfflineMessageEvents['emit'](_0x12c933+':'+_0x3d2263['id'],_0x3d2263);ChatOfflineMessageEvents[_0x00e5('0x6')](_0x12c933,_0x3d2263);_0x203d0e(null);};}for(var e in events){if(events[_0x00e5('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x00e5('0x8')](e,emitEvent(event));}}module[_0x00e5('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x72a4=['exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit','hook'];(function(_0x99a9dc,_0x35849c){var _0x49b9ab=function(_0x1419a5){while(--_0x1419a5){_0x99a9dc['push'](_0x99a9dc['shift']());}};_0x49b9ab(++_0x35849c);}(_0x72a4,0x191));var _0x472a=function(_0x31f2dc,_0x4b13bd){_0x31f2dc=_0x31f2dc-0x0;var _0x2359b2=_0x72a4[_0x31f2dc];return _0x2359b2;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x472a('0x0'))['db'][_0x472a('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x472a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x472a('0x3'),'afterDestroy':_0x472a('0x4')};function emitEvent(_0x1b5fc6){return function(_0x3c5f39,_0x3a238b,_0x40e22c){ChatOfflineMessageEvents[_0x472a('0x5')](_0x1b5fc6+':'+_0x3c5f39['id'],_0x3c5f39);ChatOfflineMessageEvents[_0x472a('0x5')](_0x1b5fc6,_0x3c5f39);_0x40e22c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x472a('0x6')](e,emitEvent(event));}}module[_0x472a('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 ef2bd48..234a53e 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 _0x652a=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x557945,_0x111c6a){var _0x45f23a=function(_0x5cba71){while(--_0x5cba71){_0x557945['push'](_0x557945['shift']());}};_0x45f23a(++_0x111c6a);}(_0x652a,0x1d5));var _0xa652=function(_0x448246,_0xc4bd77){_0x448246=_0x448246-0x0;var _0x99837d=_0x652a[_0x448246];return _0x99837d;};'use strict';var attributes=require(_0xa652('0x0'));module[_0xa652('0x1')]=function(_0xce64dd){return _0xce64dd[_0xa652('0x2')](_0xa652('0x3'),attributes,{'tableName':_0xa652('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa652('0x5'),'collate':_0xa652('0x6')});};
\ No newline at end of file
+var _0x5fb6=['utf8mb4','./chatOfflineMessage.attributes','exports','define','chat_offline_messages'];(function(_0x56b878,_0x4be9aa){var _0x32b9ec=function(_0x1511ea){while(--_0x1511ea){_0x56b878['push'](_0x56b878['shift']());}};_0x32b9ec(++_0x4be9aa);}(_0x5fb6,0x178));var _0x65fb=function(_0x2761c5,_0x2587af){_0x2761c5=_0x2761c5-0x0;var _0x378f89=_0x5fb6[_0x2761c5];return _0x378f89;};'use strict';var attributes=require(_0x65fb('0x0'));module[_0x65fb('0x1')]=function(_0x5e470d){return _0x5e470d[_0x65fb('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x65fb('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x65fb('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 64366bb..e89a55c 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 _0x220b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util'];(function(_0x4b1b49,_0x5deb64){var _0x2329a9=function(_0x1a5fab){while(--_0x1a5fab){_0x4b1b49['push'](_0x4b1b49['shift']());}};_0x2329a9(++_0x5deb64);}(_0x220b,0x1b7));var _0xb220=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x220b[_0x494d1f];return _0x457b6e;};'use strict';var _=require('lodash');var util=require(_0xb220('0x0'));var moment=require(_0xb220('0x1'));var BPromise=require(_0xb220('0x2'));var rs=require(_0xb220('0x3'));var fs=require('fs');var Redis=require(_0xb220('0x4'));var db=require(_0xb220('0x5'))['db'];var utils=require(_0xb220('0x6'));var logger=require(_0xb220('0x7'))(_0xb220('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb220('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5943d3,_0x588e99,_0x4bde5e){return new BPromise(function(_0x49c4ea,_0x3dfe0a){return client[_0xb220('0xa')](_0x5943d3,_0x4bde5e)[_0xb220('0xb')](function(_0x11769a){logger['info'](_0xb220('0xc'),_0x588e99,_0xb220('0xd'));logger[_0xb220('0xe')](_0xb220('0xf'),_0x588e99,_0xb220('0xd'),JSON[_0xb220('0x10')](_0x11769a));if(_0x11769a['error']){if(_0x11769a[_0xb220('0x11')]['code']===0x1f4){logger[_0xb220('0x11')](_0xb220('0xc'),_0x588e99,_0x11769a[_0xb220('0x11')][_0xb220('0x12')]);return _0x3dfe0a(_0x11769a['error']['message']);}logger[_0xb220('0x11')](_0xb220('0xc'),_0x588e99,_0x11769a[_0xb220('0x11')][_0xb220('0x12')]);return _0x49c4ea(_0x11769a[_0xb220('0x11')][_0xb220('0x12')]);}else{logger[_0xb220('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x588e99,_0xb220('0xd'));_0x49c4ea(_0x11769a[_0xb220('0x14')][_0xb220('0x12')]);}})[_0xb220('0x15')](function(_0x1b5fcd){logger[_0xb220('0x11')](_0xb220('0xc'),_0x588e99,_0x1b5fcd);_0x3dfe0a(_0x1b5fcd);});});}
\ No newline at end of file
+var _0x400b=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2c5f78,_0x1a7b3c){var _0x2616c2=function(_0x5b9151){while(--_0x5b9151){_0x2c5f78['push'](_0x2c5f78['shift']());}};_0x2616c2(++_0x1a7b3c);}(_0x400b,0x1e5));var _0xb400=function(_0x2cbe3e,_0x398788){_0x2cbe3e=_0x2cbe3e-0x0;var _0x49d320=_0x400b[_0x2cbe3e];return _0x49d320;};'use strict';var _=require(_0xb400('0x0'));var util=require(_0xb400('0x1'));var moment=require(_0xb400('0x2'));var BPromise=require(_0xb400('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb400('0x4'));var db=require(_0xb400('0x5'))['db'];var utils=require(_0xb400('0x6'));var logger=require(_0xb400('0x7'))(_0xb400('0x8'));var config=require(_0xb400('0x9'));var jayson=require(_0xb400('0xa'));var client=jayson['client'][_0xb400('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x482574,_0xbb632c,_0x2c6b59){return new BPromise(function(_0x30e37c,_0x17c034){return client['request'](_0x482574,_0x2c6b59)['then'](function(_0x3e1b97){logger[_0xb400('0xc')](_0xb400('0xd'),_0xbb632c,'request\x20sent');logger[_0xb400('0xe')](_0xb400('0xf'),_0xbb632c,_0xb400('0x10'),JSON[_0xb400('0x11')](_0x3e1b97));if(_0x3e1b97[_0xb400('0x12')]){if(_0x3e1b97[_0xb400('0x12')][_0xb400('0x13')]===0x1f4){logger['error'](_0xb400('0xd'),_0xbb632c,_0x3e1b97[_0xb400('0x12')][_0xb400('0x14')]);return _0x17c034(_0x3e1b97[_0xb400('0x12')]['message']);}logger[_0xb400('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0xbb632c,_0x3e1b97[_0xb400('0x12')][_0xb400('0x14')]);return _0x30e37c(_0x3e1b97[_0xb400('0x12')][_0xb400('0x14')]);}else{logger[_0xb400('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0xbb632c,_0xb400('0x10'));_0x30e37c(_0x3e1b97['result'][_0xb400('0x14')]);}})[_0xb400('0x15')](function(_0x2f2de4){logger[_0xb400('0x12')](_0xb400('0xd'),_0xbb632c,_0x2f2de4);_0x17c034(_0x2f2de4);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 06b207b..8813270 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 _0x1a10=['/:id','show','post','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1a10,0x1e4));var _0x01a1=function(_0x372447,_0x192a78){_0x372447=_0x372447-0x0;var _0x4bbae2=_0x1a10[_0x372447];return _0x4bbae2;};'use strict';var multer=require(_0x01a1('0x0'));var util=require(_0x01a1('0x1'));var path=require(_0x01a1('0x2'));var timeout=require(_0x01a1('0x3'));var express=require(_0x01a1('0x4'));var router=express[_0x01a1('0x5')]();var fs_extra=require(_0x01a1('0x6'));var auth=require(_0x01a1('0x7'));var interaction=require(_0x01a1('0x8'));var config=require(_0x01a1('0x9'));var controller=require(_0x01a1('0xa'));router['get']('/',auth[_0x01a1('0xb')](),controller[_0x01a1('0xc')]);router[_0x01a1('0xd')](_0x01a1('0xe'),auth[_0x01a1('0xb')](),controller[_0x01a1('0xf')]);router[_0x01a1('0xd')](_0x01a1('0x10'),auth[_0x01a1('0xb')](),controller[_0x01a1('0x11')]);router[_0x01a1('0x12')]('/',auth[_0x01a1('0xb')](),controller['create']);router[_0x01a1('0x13')](_0x01a1('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x01a1('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x087a=['describe','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x1cc364,_0x3f62b5){var _0x11bd5e=function(_0x35a21f){while(--_0x35a21f){_0x1cc364['push'](_0x1cc364['shift']());}};_0x11bd5e(++_0x3f62b5);}(_0x087a,0xd0));var _0xa087=function(_0x4e6e63,_0x46d1e6){_0x4e6e63=_0x4e6e63-0x0;var _0x52f08e=_0x087a[_0x4e6e63];return _0x52f08e;};'use strict';var multer=require(_0xa087('0x0'));var util=require('util');var path=require(_0xa087('0x1'));var timeout=require(_0xa087('0x2'));var express=require(_0xa087('0x3'));var router=express[_0xa087('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa087('0x5'));var config=require(_0xa087('0x6'));var controller=require(_0xa087('0x7'));router[_0xa087('0x8')]('/',auth[_0xa087('0x9')](),controller[_0xa087('0xa')]);router[_0xa087('0x8')](_0xa087('0xb'),auth[_0xa087('0x9')](),controller[_0xa087('0xc')]);router[_0xa087('0x8')](_0xa087('0xd'),auth[_0xa087('0x9')](),controller[_0xa087('0xe')]);router['post']('/',auth[_0xa087('0x9')](),controller[_0xa087('0xf')]);router[_0xa087('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa087('0x11')](_0xa087('0xd'),auth[_0xa087('0x9')](),controller[_0xa087('0x12')]);module[_0xa087('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 5bf5c9c..6262894 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 _0xb6c0=['mouseOver','timeout','exports','STRING','ENUM'];(function(_0x239cee,_0xf786c8){var _0x4fe6b6=function(_0x2d6a20){while(--_0x2d6a20){_0x239cee['push'](_0x239cee['shift']());}};_0x4fe6b6(++_0xf786c8);}(_0xb6c0,0x165));var _0x0b6c=function(_0x38f23b,_0xcda1a8){_0x38f23b=_0x38f23b-0x0;var _0x18cc03=_0xb6c0[_0x38f23b];return _0x18cc03;};'use strict';var Sequelize=require('sequelize');module[_0x0b6c('0x0')]={'name':{'type':Sequelize[_0x0b6c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0b6c('0x2')](_0x0b6c('0x3'),_0x0b6c('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x0b6c('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x6cdd=['exports','STRING','timeout','mouseOver','INTEGER'];(function(_0x1b9d8c,_0x32ed07){var _0x4d09d0=function(_0xa5b28d){while(--_0xa5b28d){_0x1b9d8c['push'](_0x1b9d8c['shift']());}};_0x4d09d0(++_0x32ed07);}(_0x6cdd,0x195));var _0xd6cd=function(_0x5a8b5c,_0x333cc2){_0x5a8b5c=_0x5a8b5c-0x0;var _0x50fc5f=_0x6cdd[_0x5a8b5c];return _0x50fc5f;};'use strict';var Sequelize=require('sequelize');module[_0xd6cd('0x0')]={'name':{'type':Sequelize[_0xd6cd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xd6cd('0x2')),'defaultValue':_0xd6cd('0x3')},'selector':{'type':Sequelize[_0xd6cd('0x1')]},'timeout':{'type':Sequelize[_0xd6cd('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 805e89b..df04516 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 _0x5900=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash'];(function(_0x47eaba,_0x14825c){var _0x4ce103=function(_0x15988f){while(--_0x15988f){_0x47eaba['push'](_0x47eaba['shift']());}};_0x4ce103(++_0x14825c);}(_0x5900,0xd2));var _0x0590=function(_0x149653,_0x3bcd29){_0x149653=_0x149653-0x0;var _0x12bfff=_0x5900[_0x149653];return _0x12bfff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0590('0x0'));var zipdir=require(_0x0590('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0590('0x2'));var moment=require(_0x0590('0x3'));var BPromise=require(_0x0590('0x4'));var Mustache=require('mustache');var util=require(_0x0590('0x5'));var path=require(_0x0590('0x6'));var sox=require('sox');var csv=require(_0x0590('0x7'));var ejs=require(_0x0590('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0590('0x9'));var squel=require(_0x0590('0xa'));var crypto=require(_0x0590('0xb'));var jsforce=require(_0x0590('0xc'));var deskjs=require(_0x0590('0xd'));var toCsv=require(_0x0590('0x7'));var querystring=require(_0x0590('0xe'));var Papa=require(_0x0590('0xf'));var Redis=require(_0x0590('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0590('0x11'));var as=require(_0x0590('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0590('0x13'))(_0x0590('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0590('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd1125,_0x3af081){_0x3af081=_0x3af081||0xcc;return function(_0xbd1743){if(_0xbd1743){return _0xd1125[_0x0590('0x16')](_0x3af081);}return _0xd1125[_0x0590('0x17')](_0x3af081)['end']();};}function respondWithResult(_0x3e3847,_0x29a79f){_0x29a79f=_0x29a79f||0xc8;return function(_0x50e005){if(_0x50e005){return _0x3e3847[_0x0590('0x17')](_0x29a79f)[_0x0590('0x18')](_0x50e005);}};}function respondWithFilteredResult(_0x9568fb,_0x49ffd1){return function(_0x22d6e2){if(_0x22d6e2){var _0x492f85=typeof _0x49ffd1[_0x0590('0x19')]===_0x0590('0x1a')&&typeof _0x49ffd1[_0x0590('0x1b')]===_0x0590('0x1a');var _0x4b1bf2=_0x22d6e2[_0x0590('0x1c')];var _0x3ab6f8=_0x492f85?0x0:_0x49ffd1['offset'];var _0x5d3f4e=_0x492f85?_0x22d6e2[_0x0590('0x1c')]:_0x49ffd1[_0x0590('0x19')]+_0x49ffd1['limit'];var _0x7543c;if(_0x5d3f4e>=_0x4b1bf2){_0x5d3f4e=_0x4b1bf2;_0x7543c=0xc8;}else{_0x7543c=0xce;}_0x9568fb[_0x0590('0x17')](_0x7543c);return _0x9568fb[_0x0590('0x1d')]('Content-Range',_0x3ab6f8+'-'+_0x5d3f4e+'/'+_0x4b1bf2)['json'](_0x22d6e2);}return null;};}function patchUpdates(_0x2c2d31){return function(_0x5779bb){try{jsonpatch['apply'](_0x5779bb,_0x2c2d31,!![]);}catch(_0x659794){return BPromise[_0x0590('0x1e')](_0x659794);}return _0x5779bb[_0x0590('0x1f')]();};}function saveUpdates(_0x58b396,_0x58f498){return function(_0x470936){if(_0x470936){return _0x470936[_0x0590('0x20')](_0x58b396)[_0x0590('0x21')](function(_0x594e6e){return _0x594e6e;});}return null;};}function removeEntity(_0x2cd67e,_0x2921f9){return function(_0x3861b5){if(_0x3861b5){return _0x3861b5[_0x0590('0x22')]()[_0x0590('0x21')](function(){_0x2cd67e[_0x0590('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58f29d,_0x3fe7d6){return function(_0x50a76d){if(!_0x50a76d){_0x58f29d[_0x0590('0x16')](0x194);}return _0x50a76d;};}function handleError(_0x19dd3d,_0x318f2e){_0x318f2e=_0x318f2e||0x1f4;return function(_0x352b2a){logger['error'](_0x352b2a[_0x0590('0x23')]);if(_0x352b2a[_0x0590('0x24')]){delete _0x352b2a[_0x0590('0x24')];}_0x19dd3d[_0x0590('0x17')](_0x318f2e)[_0x0590('0x25')](_0x352b2a);};}exports['show']=function(_0xc5b3e6,_0x3c7677){var _0x26c110={'raw':!![],'where':{'id':_0xc5b3e6[_0x0590('0x26')]['id']}},_0x2c2e3a={};_0x2c2e3a[_0x0590('0x27')]=_[_0x0590('0x28')](db[_0x0590('0x29')][_0x0590('0x2a')]);_0x2c2e3a[_0x0590('0x2b')]=_[_0x0590('0x28')](_0xc5b3e6[_0x0590('0x2b')]);_0x2c2e3a['filters']=_[_0x0590('0x2c')](_0x2c2e3a[_0x0590('0x27')],_0x2c2e3a[_0x0590('0x2b')]);_0x26c110[_0x0590('0x2d')]=_[_0x0590('0x2c')](_0x2c2e3a[_0x0590('0x27')],qs[_0x0590('0x2e')](_0xc5b3e6[_0x0590('0x2b')][_0x0590('0x2e')]));_0x26c110[_0x0590('0x2d')]=_0x26c110[_0x0590('0x2d')][_0x0590('0x2f')]?_0x26c110[_0x0590('0x2d')]:_0x2c2e3a['model'];if(_0xc5b3e6[_0x0590('0x2b')][_0x0590('0x30')]){_0x26c110[_0x0590('0x31')]=[{'all':!![]}];}_0x26c110=_[_0x0590('0x32')]({},_0x26c110,_0xc5b3e6['options']);return db[_0x0590('0x29')][_0x0590('0x33')](_0x26c110)['then'](handleEntityNotFound(_0x3c7677,null))[_0x0590('0x21')](respondWithResult(_0x3c7677,null))[_0x0590('0x34')](handleError(_0x3c7677,null));};exports[_0x0590('0x35')]=function(_0x168399,_0x84baea){return db['ChatProactiveAction']['create'](_0x168399[_0x0590('0x36')],{})[_0x0590('0x21')](respondWithResult(_0x84baea,0xc9))['catch'](handleError(_0x84baea,null));};exports[_0x0590('0x20')]=function(_0xe89460,_0x3bb916){if(_0xe89460[_0x0590('0x36')]['id']){delete _0xe89460[_0x0590('0x36')]['id'];}return db['ChatProactiveAction'][_0x0590('0x33')]({'where':{'id':_0xe89460[_0x0590('0x26')]['id']}})[_0x0590('0x21')](handleEntityNotFound(_0x3bb916,null))[_0x0590('0x21')](saveUpdates(_0xe89460[_0x0590('0x36')],null))[_0x0590('0x21')](respondWithResult(_0x3bb916,null))[_0x0590('0x34')](handleError(_0x3bb916,null));};exports[_0x0590('0x22')]=function(_0x505db4,_0xe5a94a){return db[_0x0590('0x29')][_0x0590('0x33')]({'where':{'id':_0x505db4[_0x0590('0x26')]['id']}})[_0x0590('0x21')](handleEntityNotFound(_0xe5a94a,null))[_0x0590('0x21')](removeEntity(_0xe5a94a,null))[_0x0590('0x34')](handleError(_0xe5a94a,null));};
\ No newline at end of file
+var _0xa3e6=['offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','ChatProactiveAction','keys','query','attributes','intersection','fields','merge','options','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x49de28,_0x2751c){var _0x2ac8ed=function(_0x2ce603){while(--_0x2ce603){_0x49de28['push'](_0x49de28['shift']());}};_0x2ac8ed(++_0x2751c);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x50aa06,_0x3ec2de){_0x50aa06=_0x50aa06-0x0;var _0x2dc6d9=_0xa3e6[_0x50aa06];return _0x2dc6d9;};'use strict';var emlformat=require(_0x6a3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a3e('0x2'));var moment=require(_0x6a3e('0x3'));var BPromise=require(_0x6a3e('0x4'));var Mustache=require('mustache');var util=require(_0x6a3e('0x5'));var path=require('path');var sox=require(_0x6a3e('0x6'));var csv=require(_0x6a3e('0x7'));var ejs=require(_0x6a3e('0x8'));var fs=require('fs');var fs_extra=require(_0x6a3e('0x9'));var _=require(_0x6a3e('0xa'));var squel=require('squel');var crypto=require(_0x6a3e('0xb'));var jsforce=require(_0x6a3e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a3e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a3e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6a3e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a3e('0x10'))(_0x6a3e('0x11'));var utils=require(_0x6a3e('0x12'));var config=require(_0x6a3e('0x13'));var licenseUtil=require(_0x6a3e('0x14'));var db=require(_0x6a3e('0x15'))['db'];function respondWithStatusCode(_0x4a3a97,_0x27e169){_0x27e169=_0x27e169||0xcc;return function(_0x385c29){if(_0x385c29){return _0x4a3a97[_0x6a3e('0x16')](_0x27e169);}return _0x4a3a97[_0x6a3e('0x17')](_0x27e169)[_0x6a3e('0x18')]();};}function respondWithResult(_0x31aefa,_0x222f7c){_0x222f7c=_0x222f7c||0xc8;return function(_0x4bd05f){if(_0x4bd05f){return _0x31aefa[_0x6a3e('0x17')](_0x222f7c)[_0x6a3e('0x19')](_0x4bd05f);}};}function respondWithFilteredResult(_0x8ed74b,_0x2a62a8){return function(_0x500ccd){if(_0x500ccd){var _0x462b8d=typeof _0x2a62a8[_0x6a3e('0x1a')]==='undefined'&&typeof _0x2a62a8['limit']==='undefined';var _0x58b221=_0x500ccd['count'];var _0x3693a2=_0x462b8d?0x0:_0x2a62a8[_0x6a3e('0x1a')];var _0x31a190=_0x462b8d?_0x500ccd[_0x6a3e('0x1b')]:_0x2a62a8[_0x6a3e('0x1a')]+_0x2a62a8[_0x6a3e('0x1c')];var _0x1d6ccc;if(_0x31a190>=_0x58b221){_0x31a190=_0x58b221;_0x1d6ccc=0xc8;}else{_0x1d6ccc=0xce;}_0x8ed74b[_0x6a3e('0x17')](_0x1d6ccc);return _0x8ed74b['set'](_0x6a3e('0x1d'),_0x3693a2+'-'+_0x31a190+'/'+_0x58b221)['json'](_0x500ccd);}return null;};}function patchUpdates(_0xc0452f){return function(_0x5ae73b){try{jsonpatch[_0x6a3e('0x1e')](_0x5ae73b,_0xc0452f,!![]);}catch(_0x131d80){return BPromise[_0x6a3e('0x1f')](_0x131d80);}return _0x5ae73b[_0x6a3e('0x20')]();};}function saveUpdates(_0x58721c,_0x4f7507){return function(_0x215ac1){if(_0x215ac1){return _0x215ac1[_0x6a3e('0x21')](_0x58721c)[_0x6a3e('0x22')](function(_0x4687d0){return _0x4687d0;});}return null;};}function removeEntity(_0x4e5a25,_0x1ae966){return function(_0x21b5aa){if(_0x21b5aa){return _0x21b5aa[_0x6a3e('0x23')]()[_0x6a3e('0x22')](function(){_0x4e5a25[_0x6a3e('0x17')](0xcc)[_0x6a3e('0x18')]();});}};}function handleEntityNotFound(_0x359460,_0x83e681){return function(_0x25fc14){if(!_0x25fc14){_0x359460[_0x6a3e('0x16')](0x194);}return _0x25fc14;};}function handleError(_0x5b1ed9,_0x4ec834){_0x4ec834=_0x4ec834||0x1f4;return function(_0x150992){logger[_0x6a3e('0x24')](_0x150992[_0x6a3e('0x25')]);if(_0x150992[_0x6a3e('0x26')]){delete _0x150992[_0x6a3e('0x26')];}_0x5b1ed9[_0x6a3e('0x17')](_0x4ec834)[_0x6a3e('0x27')](_0x150992);};}exports[_0x6a3e('0x28')]=function(_0xd87198,_0x436169){var _0x3a831b={'raw':!![],'where':{'id':_0xd87198['params']['id']}},_0x508a55={};_0x508a55[_0x6a3e('0x29')]=_['keys'](db[_0x6a3e('0x2a')]['rawAttributes']);_0x508a55['query']=_[_0x6a3e('0x2b')](_0xd87198[_0x6a3e('0x2c')]);_0x508a55['filters']=_['intersection'](_0x508a55[_0x6a3e('0x29')],_0x508a55[_0x6a3e('0x2c')]);_0x3a831b[_0x6a3e('0x2d')]=_[_0x6a3e('0x2e')](_0x508a55['model'],qs['fields'](_0xd87198[_0x6a3e('0x2c')][_0x6a3e('0x2f')]));_0x3a831b[_0x6a3e('0x2d')]=_0x3a831b[_0x6a3e('0x2d')]['length']?_0x3a831b[_0x6a3e('0x2d')]:_0x508a55[_0x6a3e('0x29')];if(_0xd87198['query']['includeAll']){_0x3a831b['include']=[{'all':!![]}];}_0x3a831b=_[_0x6a3e('0x30')]({},_0x3a831b,_0xd87198[_0x6a3e('0x31')]);return db[_0x6a3e('0x2a')][_0x6a3e('0x32')](_0x3a831b)[_0x6a3e('0x22')](handleEntityNotFound(_0x436169,null))[_0x6a3e('0x22')](respondWithResult(_0x436169,null))[_0x6a3e('0x33')](handleError(_0x436169,null));};exports[_0x6a3e('0x34')]=function(_0x4044d0,_0x377226){return db[_0x6a3e('0x2a')][_0x6a3e('0x34')](_0x4044d0[_0x6a3e('0x35')],{})[_0x6a3e('0x22')](respondWithResult(_0x377226,0xc9))[_0x6a3e('0x33')](handleError(_0x377226,null));};exports['update']=function(_0x19d873,_0x38deb6){if(_0x19d873[_0x6a3e('0x35')]['id']){delete _0x19d873['body']['id'];}return db[_0x6a3e('0x2a')][_0x6a3e('0x32')]({'where':{'id':_0x19d873['params']['id']}})[_0x6a3e('0x22')](handleEntityNotFound(_0x38deb6,null))[_0x6a3e('0x22')](saveUpdates(_0x19d873[_0x6a3e('0x35')],null))['then'](respondWithResult(_0x38deb6,null))[_0x6a3e('0x33')](handleError(_0x38deb6,null));};exports[_0x6a3e('0x23')]=function(_0x37e523,_0x3e604c){return db[_0x6a3e('0x2a')][_0x6a3e('0x32')]({'where':{'id':_0x37e523['params']['id']}})[_0x6a3e('0x22')](handleEntityNotFound(_0x3e604c,null))['then'](removeEntity(_0x3e604c,null))['catch'](handleError(_0x3e604c,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 6735c2e..2402d5f 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 _0xd80e=['moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api'];(function(_0x3aa9c7,_0x629939){var _0x4ed413=function(_0x496ac8){while(--_0x496ac8){_0x3aa9c7['push'](_0x3aa9c7['shift']());}};_0x4ed413(++_0x629939);}(_0xd80e,0x11d));var _0xed80=function(_0x1c8959,_0x128e5b){_0x1c8959=_0x1c8959-0x0;var _0x2888b8=_0xd80e[_0x1c8959];return _0x2888b8;};'use strict';var _=require('lodash');var util=require(_0xed80('0x0'));var logger=require(_0xed80('0x1'))(_0xed80('0x2'));var moment=require(_0xed80('0x3'));var BPromise=require(_0xed80('0x4'));var rp=require(_0xed80('0x5'));var fs=require('fs');var path=require(_0xed80('0x6'));var rimraf=require('rimraf');var config=require(_0xed80('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0xed80('0x8')]=function(_0x481a46,_0x25a499){return _0x481a46[_0xed80('0x9')](_0xed80('0xa'),attributes,{'tableName':_0xed80('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac35=['../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xac35,0x10c));var _0x5ac3=function(_0x2d79be,_0x3e7c70){_0x2d79be=_0x2d79be-0x0;var _0x3e6c80=_0xac35[_0x2d79be];return _0x3e6c80;};'use strict';var _=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var logger=require(_0x5ac3('0x2'))(_0x5ac3('0x3'));var moment=require(_0x5ac3('0x4'));var BPromise=require('bluebird');var rp=require(_0x5ac3('0x5'));var fs=require('fs');var path=require(_0x5ac3('0x6'));var rimraf=require('rimraf');var config=require(_0x5ac3('0x7'));var attributes=require(_0x5ac3('0x8'));module[_0x5ac3('0x9')]=function(_0x1e224c,_0x5462b3){return _0x1e224c['define'](_0x5ac3('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index bfcae42..9f08b45 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 _0x5e7f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x62b58e,_0x46fe1e){var _0x37fe84=function(_0x12a2ca){while(--_0x12a2ca){_0x62b58e['push'](_0x62b58e['shift']());}};_0x37fe84(++_0x46fe1e);}(_0x5e7f,0xb3));var _0xf5e7=function(_0x46387d,_0x492ba4){_0x46387d=_0x46387d-0x0;var _0x5c6f88=_0x5e7f[_0x46387d];return _0x5c6f88;};'use strict';var _=require(_0xf5e7('0x0'));var util=require(_0xf5e7('0x1'));var moment=require(_0xf5e7('0x2'));var BPromise=require(_0xf5e7('0x3'));var rs=require(_0xf5e7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5e7('0x5'))['db'];var utils=require(_0xf5e7('0x6'));var logger=require(_0xf5e7('0x7'))(_0xf5e7('0x8'));var config=require(_0xf5e7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf5e7('0xa')][_0xf5e7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6dd9,_0x2f2536,_0x96e6e3){return new BPromise(function(_0x324802,_0x4a4abf){return client['request'](_0x4c6dd9,_0x96e6e3)[_0xf5e7('0xc')](function(_0x456514){logger['info'](_0xf5e7('0xd'),_0x2f2536,'request\x20sent');logger[_0xf5e7('0xe')](_0xf5e7('0xf'),_0x2f2536,_0xf5e7('0x10'),JSON[_0xf5e7('0x11')](_0x456514));if(_0x456514[_0xf5e7('0x12')]){if(_0x456514[_0xf5e7('0x12')][_0xf5e7('0x13')]===0x1f4){logger[_0xf5e7('0x12')](_0xf5e7('0xd'),_0x2f2536,_0x456514[_0xf5e7('0x12')][_0xf5e7('0x14')]);return _0x4a4abf(_0x456514['error'][_0xf5e7('0x14')]);}logger[_0xf5e7('0x12')](_0xf5e7('0xd'),_0x2f2536,_0x456514[_0xf5e7('0x12')][_0xf5e7('0x14')]);return _0x324802(_0x456514['error'][_0xf5e7('0x14')]);}else{logger[_0xf5e7('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x2f2536,_0xf5e7('0x10'));_0x324802(_0x456514[_0xf5e7('0x16')][_0xf5e7('0x14')]);}})['catch'](function(_0xc327c8){logger['error'](_0xf5e7('0xd'),_0x2f2536,_0xc327c8);_0x4a4abf(_0xc327c8);});});}
\ No newline at end of file
+var _0x62e3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','util','moment'];(function(_0x2f4748,_0x24af55){var _0x18eece=function(_0x489dd6){while(--_0x489dd6){_0x2f4748['push'](_0x2f4748['shift']());}};_0x18eece(++_0x24af55);}(_0x62e3,0x174));var _0x362e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62e3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x362e('0x0'));var moment=require(_0x362e('0x1'));var BPromise=require(_0x362e('0x2'));var rs=require(_0x362e('0x3'));var fs=require('fs');var Redis=require(_0x362e('0x4'));var db=require(_0x362e('0x5'))['db'];var utils=require(_0x362e('0x6'));var logger=require('../../config/logger')(_0x362e('0x7'));var config=require(_0x362e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x362e('0x9')][_0x362e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c984,_0x28d705,_0x3e5843){return new BPromise(function(_0x47745f,_0x3be5e0){return client['request'](_0x16c984,_0x3e5843)[_0x362e('0xb')](function(_0x3b5485){logger['info'](_0x362e('0xc'),_0x28d705,_0x362e('0xd'));logger[_0x362e('0xe')](_0x362e('0xf'),_0x28d705,_0x362e('0xd'),JSON[_0x362e('0x10')](_0x3b5485));if(_0x3b5485['error']){if(_0x3b5485['error'][_0x362e('0x11')]===0x1f4){logger[_0x362e('0x12')](_0x362e('0xc'),_0x28d705,_0x3b5485[_0x362e('0x12')]['message']);return _0x3be5e0(_0x3b5485[_0x362e('0x12')]['message']);}logger[_0x362e('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x28d705,_0x3b5485[_0x362e('0x12')][_0x362e('0x13')]);return _0x47745f(_0x3b5485[_0x362e('0x12')][_0x362e('0x13')]);}else{logger[_0x362e('0x14')](_0x362e('0xc'),_0x28d705,_0x362e('0xd'));_0x47745f(_0x3b5485['result'][_0x362e('0x13')]);}})[_0x362e('0x15')](function(_0x47a7f8){logger[_0x362e('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x28d705,_0x47a7f8);_0x3be5e0(_0x47a7f8);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 021931a..10b6307 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 _0xc4aa=['show','post','update','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x3c82e2,_0x4e376a){var _0x12a043=function(_0x4ccef5){while(--_0x4ccef5){_0x3c82e2['push'](_0x3c82e2['shift']());}};_0x12a043(++_0x4e376a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xb')]);router[_0xac4a('0xc')]('/',auth[_0xac4a('0xa')](),controller['create']);router['put'](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xd')]);router['delete'](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','exports'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x2bd8,0x130));var _0x82bd=function(_0x419a15,_0x265401){_0x419a15=_0x419a15-0x0;var _0x22a0d8=_0x2bd8[_0x419a15];return _0x22a0d8;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')](_0x82bd('0xa'),auth['isAuthenticated'](),controller[_0x82bd('0xb')]);router[_0x82bd('0xc')]('/',auth[_0x82bd('0xd')](),controller[_0x82bd('0xe')]);router['put'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82bd('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index ecdc9fb..c67b73c 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 _0xddbb=['name','STRING','INTEGER','ENUM','rrmemory','sequelize','exports'];(function(_0x2d9579,_0x427cdf){var _0x3fb28c=function(_0x3fee20){while(--_0x3fee20){_0x2d9579['push'](_0x2d9579['shift']());}};_0x3fb28c(++_0x427cdf);}(_0xddbb,0x19b));var _0xbddb=function(_0x183872,_0x42fd36){_0x183872=_0x183872-0x0;var _0x15a657=_0xddbb[_0x183872];return _0x15a657;};'use strict';var Sequelize=require(_0xbddb('0x0'));module[_0xbddb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbddb('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbddb('0x3')]},'timeout':{'type':Sequelize[_0xbddb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbddb('0x5')](_0xbddb('0x6'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0x1fca=['sequelize','STRING','INTEGER','ENUM','beepall','roundrobin'];(function(_0x286fbe,_0x48085b){var _0x16114e=function(_0x33bd6d){while(--_0x33bd6d){_0x286fbe['push'](_0x286fbe['shift']());}};_0x16114e(++_0x48085b);}(_0x1fca,0xde));var _0xa1fc=function(_0x492fcf,_0x3f025b){_0x492fcf=_0x492fcf-0x0;var _0x41007b=_0x1fca[_0x492fcf];return _0x41007b;};'use strict';var Sequelize=require(_0xa1fc('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1fc('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa1fc('0x1')]},'timeout':{'type':Sequelize[_0xa1fc('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa1fc('0x3')]('rrmemory',_0xa1fc('0x4'),_0xa1fc('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c02a018..3795f1c 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 _0xfa03=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserChatQueue','nolimit','order','ChatQueueId','User','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','destroy','ChatQueues','end','name','send','index','ChatQueue','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','keys','find','create'];(function(_0x17dffb,_0x365d85){var _0x36dc9b=function(_0x4b8de7){while(--_0x4b8de7){_0x17dffb['push'](_0x17dffb['shift']());}};_0x36dc9b(++_0x365d85);}(_0xfa03,0xe3));var _0x3fa0=function(_0x55b64f,_0x1a0650){_0x55b64f=_0x55b64f-0x0;var _0x1eeea5=_0xfa03[_0x55b64f];return _0x1eeea5;};'use strict';var emlformat=require(_0x3fa0('0x0'));var rimraf=require(_0x3fa0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fa0('0x2'));var rp=require(_0x3fa0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3fa0('0x4'));var util=require(_0x3fa0('0x5'));var path=require(_0x3fa0('0x6'));var sox=require(_0x3fa0('0x7'));var csv=require('to-csv');var ejs=require(_0x3fa0('0x8'));var fs=require('fs');var fs_extra=require(_0x3fa0('0x9'));var _=require(_0x3fa0('0xa'));var squel=require(_0x3fa0('0xb'));var crypto=require(_0x3fa0('0xc'));var jsforce=require(_0x3fa0('0xd'));var deskjs=require(_0x3fa0('0xe'));var toCsv=require(_0x3fa0('0xf'));var querystring=require(_0x3fa0('0x10'));var Papa=require(_0x3fa0('0x11'));var Redis=require(_0x3fa0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3fa0('0x13'));var as=require(_0x3fa0('0x14'));var hardwareService=require(_0x3fa0('0x15'));var logger=require(_0x3fa0('0x16'))(_0x3fa0('0x17'));var utils=require('../../config/utils');var config=require(_0x3fa0('0x18'));var licenseUtil=require(_0x3fa0('0x19'));var db=require(_0x3fa0('0x1a'))['db'];config[_0x3fa0('0x1b')]=_[_0x3fa0('0x1c')](config[_0x3fa0('0x1b')],{'host':_0x3fa0('0x1d'),'port':0x18eb});var socket=require(_0x3fa0('0x1e'))(new Redis(config['redis']));require(_0x3fa0('0x1f'))[_0x3fa0('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3fa0('0x21')][_0x3fa0('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x3f123f,_0x19e420,_0x48e875,_0x8bf61f){return new BPromise(function(_0x252044,_0x251d0d){var _0x2c1543=_0x8bf61f||client;return _0x2c1543[_0x3fa0('0x23')](_0x3f123f,_0x48e875)[_0x3fa0('0x24')](function(_0x3c5845){logger[_0x3fa0('0x25')](_0x3fa0('0x26'),_0x19e420,_0x3fa0('0x27'));logger[_0x3fa0('0x28')](_0x3fa0('0x29'),_0x19e420,_0x3fa0('0x27'),JSON['stringify'](_0x3c5845));if(_0x3c5845[_0x3fa0('0x2a')]){if(_0x3c5845['error'][_0x3fa0('0x2b')]===0x1f4){logger[_0x3fa0('0x2a')](_0x3fa0('0x26'),_0x19e420,_0x3c5845[_0x3fa0('0x2a')][_0x3fa0('0x2c')]);return _0x251d0d(_0x3c5845['error'][_0x3fa0('0x2c')]);}logger[_0x3fa0('0x2a')](_0x3fa0('0x26'),_0x19e420,_0x3c5845[_0x3fa0('0x2a')]['message']);return _0x252044(_0x3c5845['error']['message']);}else{logger['info'](_0x3fa0('0x26'),_0x19e420,_0x3fa0('0x27'));_0x252044(_0x3c5845[_0x3fa0('0x2d')][_0x3fa0('0x2c')]);}})[_0x3fa0('0x2e')](function(_0x374843){logger[_0x3fa0('0x2a')](_0x3fa0('0x26'),_0x19e420,_0x374843);_0x251d0d(_0x374843);});});}function respondWithStatusCode(_0xfc77f2,_0x21ac0b){_0x21ac0b=_0x21ac0b||0xcc;return function(_0x588b8f){if(_0x588b8f){return _0xfc77f2[_0x3fa0('0x2f')](_0x21ac0b);}return _0xfc77f2[_0x3fa0('0x30')](_0x21ac0b)['end']();};}function respondWithResult(_0x4478b9,_0xdec09f){_0xdec09f=_0xdec09f||0xc8;return function(_0x3899a5){if(_0x3899a5){return _0x4478b9[_0x3fa0('0x30')](_0xdec09f)[_0x3fa0('0x31')](_0x3899a5);}};}function respondWithFilteredResult(_0x134b8b,_0x1f810c){return function(_0x574e61){if(_0x574e61){var _0x82f589=typeof _0x1f810c[_0x3fa0('0x32')]===_0x3fa0('0x33')&&typeof _0x1f810c['limit']==='undefined';var _0xc123bd=_0x574e61['count'];var _0xa9b1cd=_0x82f589?0x0:_0x1f810c['offset'];var _0x29629f=_0x82f589?_0x574e61[_0x3fa0('0x34')]:_0x1f810c[_0x3fa0('0x32')]+_0x1f810c['limit'];var _0x3152be;if(_0x29629f>=_0xc123bd){_0x29629f=_0xc123bd;_0x3152be=0xc8;}else{_0x3152be=0xce;}_0x134b8b['status'](_0x3152be);return _0x134b8b[_0x3fa0('0x35')](_0x3fa0('0x36'),_0xa9b1cd+'-'+_0x29629f+'/'+_0xc123bd)['json'](_0x574e61);}return null;};}function patchUpdates(_0xd0d16){return function(_0xf658e7){try{jsonpatch['apply'](_0xf658e7,_0xd0d16,!![]);}catch(_0x1256c4){return BPromise['reject'](_0x1256c4);}return _0xf658e7[_0x3fa0('0x37')]();};}function saveUpdates(_0x556613,_0x2cd5d7){return function(_0x2b27a2){if(_0x2b27a2){return _0x2b27a2[_0x3fa0('0x38')](_0x556613)[_0x3fa0('0x24')](function(_0xfbc291){return _0xfbc291;});}return null;};}function removeEntity(_0x560842,_0x33b22e){return function(_0x4c6a61){if(_0x4c6a61){return _0x4c6a61[_0x3fa0('0x39')]()[_0x3fa0('0x24')](function(){var _0x396d4d=_0x4c6a61['get']({'plain':!![]});var _0x4b606d=_0x3fa0('0x3a');return db['UserProfileResource'][_0x3fa0('0x39')]({'where':{'type':_0x4b606d,'resourceId':_0x396d4d['id']}})[_0x3fa0('0x24')](function(){return _0x4c6a61;});})[_0x3fa0('0x24')](function(){_0x560842['status'](0xcc)[_0x3fa0('0x3b')]();});}};}function handleEntityNotFound(_0x1969db,_0x3e1fee){return function(_0x1305fb){if(!_0x1305fb){_0x1969db[_0x3fa0('0x2f')](0x194);}return _0x1305fb;};}function handleError(_0x562642,_0x4ef6f){_0x4ef6f=_0x4ef6f||0x1f4;return function(_0x2e9de0){logger['error'](_0x2e9de0['stack']);if(_0x2e9de0[_0x3fa0('0x3c')]){delete _0x2e9de0[_0x3fa0('0x3c')];}_0x562642[_0x3fa0('0x30')](_0x4ef6f)[_0x3fa0('0x3d')](_0x2e9de0);};}exports[_0x3fa0('0x3e')]=function(_0x33fb3b,_0x169831){var _0x3964f7={},_0x46aeae={},_0x6dbdb2={'count':0x0,'rows':[]};var _0x4e3bdf=_['map'](db[_0x3fa0('0x3f')][_0x3fa0('0x40')],function(_0xc9ed09){return{'name':_0xc9ed09[_0x3fa0('0x41')],'type':_0xc9ed09['type'][_0x3fa0('0x42')]};});_0x46aeae[_0x3fa0('0x43')]=_[_0x3fa0('0x44')](_0x4e3bdf,_0x3fa0('0x3c'));_0x46aeae[_0x3fa0('0x45')]=_['keys'](_0x33fb3b['query']);_0x46aeae[_0x3fa0('0x46')]=_[_0x3fa0('0x47')](_0x46aeae[_0x3fa0('0x43')],_0x46aeae[_0x3fa0('0x45')]);_0x3964f7[_0x3fa0('0x48')]=_[_0x3fa0('0x47')](_0x46aeae[_0x3fa0('0x43')],qs['fields'](_0x33fb3b[_0x3fa0('0x45')][_0x3fa0('0x49')]));_0x3964f7[_0x3fa0('0x48')]=_0x3964f7[_0x3fa0('0x48')][_0x3fa0('0x4a')]?_0x3964f7[_0x3fa0('0x48')]:_0x46aeae[_0x3fa0('0x43')];if(!_0x33fb3b[_0x3fa0('0x45')][_0x3fa0('0x4b')]('nolimit')){_0x3964f7[_0x3fa0('0x4c')]=qs[_0x3fa0('0x4c')](_0x33fb3b[_0x3fa0('0x45')]['limit']);_0x3964f7['offset']=qs['offset'](_0x33fb3b[_0x3fa0('0x45')][_0x3fa0('0x32')]);}_0x3964f7['order']=qs[_0x3fa0('0x4d')](_0x33fb3b[_0x3fa0('0x45')][_0x3fa0('0x4d')]);_0x3964f7['where']=qs[_0x3fa0('0x46')](_[_0x3fa0('0x4e')](_0x33fb3b[_0x3fa0('0x45')],_0x46aeae[_0x3fa0('0x46')]),_0x4e3bdf);if(_0x33fb3b[_0x3fa0('0x45')][_0x3fa0('0x4f')]){_0x3964f7['where']=_['merge'](_0x3964f7[_0x3fa0('0x50')],{'$or':_['map'](_0x4e3bdf,function(_0xb2644){if(_0xb2644['type']!=='VIRTUAL'){var _0x3eb941={};_0x3eb941[_0xb2644['name']]={'$like':'%'+_0x33fb3b[_0x3fa0('0x45')][_0x3fa0('0x4f')]+'%'};return _0x3eb941;}})});}_0x3964f7=_[_0x3fa0('0x51')]({},_0x3964f7,_0x33fb3b[_0x3fa0('0x52')]);var _0x151c6b={'where':_0x3964f7[_0x3fa0('0x50')]};return db[_0x3fa0('0x3f')][_0x3fa0('0x34')](_0x151c6b)[_0x3fa0('0x24')](function(_0x2db895){_0x6dbdb2['count']=_0x2db895;if(_0x33fb3b[_0x3fa0('0x45')][_0x3fa0('0x53')]){_0x3964f7[_0x3fa0('0x54')]=[{'all':!![]}];}return db[_0x3fa0('0x3f')][_0x3fa0('0x55')](_0x3964f7);})[_0x3fa0('0x24')](function(_0x826152){_0x6dbdb2[_0x3fa0('0x56')]=_0x826152;return _0x6dbdb2;})[_0x3fa0('0x24')](respondWithFilteredResult(_0x169831,_0x3964f7))[_0x3fa0('0x2e')](handleError(_0x169831,null));};exports[_0x3fa0('0x57')]=function(_0x373330,_0x50d606){var _0x10a3d0={'raw':!![],'where':{'id':_0x373330['params']['id']}},_0x3074e6={};_0x3074e6['model']=_[_0x3fa0('0x58')](db['ChatQueue']['rawAttributes']);_0x3074e6['query']=_[_0x3fa0('0x58')](_0x373330[_0x3fa0('0x45')]);_0x3074e6[_0x3fa0('0x46')]=_['intersection'](_0x3074e6[_0x3fa0('0x43')],_0x3074e6[_0x3fa0('0x45')]);_0x10a3d0[_0x3fa0('0x48')]=_[_0x3fa0('0x47')](_0x3074e6[_0x3fa0('0x43')],qs[_0x3fa0('0x49')](_0x373330[_0x3fa0('0x45')]['fields']));_0x10a3d0[_0x3fa0('0x48')]=_0x10a3d0[_0x3fa0('0x48')][_0x3fa0('0x4a')]?_0x10a3d0[_0x3fa0('0x48')]:_0x3074e6[_0x3fa0('0x43')];if(_0x373330[_0x3fa0('0x45')]['includeAll']){_0x10a3d0[_0x3fa0('0x54')]=[{'all':!![]}];}_0x10a3d0=_[_0x3fa0('0x51')]({},_0x10a3d0,_0x373330[_0x3fa0('0x52')]);return db[_0x3fa0('0x3f')][_0x3fa0('0x59')](_0x10a3d0)[_0x3fa0('0x24')](handleEntityNotFound(_0x50d606,null))[_0x3fa0('0x24')](respondWithResult(_0x50d606,null))['catch'](handleError(_0x50d606,null));};exports['create']=function(_0x215f95,_0x96c88){return db['ChatQueue'][_0x3fa0('0x5a')](_0x215f95['body'],{})[_0x3fa0('0x24')](function(_0xcf5276){var _0x16144b=_0x215f95[_0x3fa0('0x5b')]['get']({'plain':!![]});if(!_0x16144b)throw new Error(_0x3fa0('0x5c'));if(_0x16144b[_0x3fa0('0x5d')]===_0x3fa0('0x5b')){var _0x4620f8=_0xcf5276[_0x3fa0('0x5e')]({'plain':!![]});var _0x39c5c9=_0x3fa0('0x3a');return db[_0x3fa0('0x5f')]['find']({'where':{'name':_0x39c5c9,'userProfileId':_0x16144b[_0x3fa0('0x60')]},'raw':!![]})[_0x3fa0('0x24')](function(_0x114628){if(_0x114628&&_0x114628[_0x3fa0('0x61')]===0x0){return db[_0x3fa0('0x62')][_0x3fa0('0x5a')]({'name':_0x4620f8[_0x3fa0('0x3c')],'resourceId':_0x4620f8['id'],'type':_0x114628[_0x3fa0('0x3c')],'sectionId':_0x114628['id']},{})['then'](function(){return _0xcf5276;});}else{return _0xcf5276;}})['catch'](function(_0x2da37f){logger[_0x3fa0('0x2a')](_0x3fa0('0x63'),_0x2da37f);throw _0x2da37f;});}return _0xcf5276;})['then'](respondWithResult(_0x96c88,0xc9))[_0x3fa0('0x2e')](handleError(_0x96c88,null));};exports[_0x3fa0('0x38')]=function(_0x47c868,_0x379392){if(_0x47c868[_0x3fa0('0x64')]['id']){delete _0x47c868[_0x3fa0('0x64')]['id'];}return db['ChatQueue'][_0x3fa0('0x59')]({'where':{'id':_0x47c868[_0x3fa0('0x65')]['id']}})[_0x3fa0('0x24')](handleEntityNotFound(_0x379392,null))['then'](saveUpdates(_0x47c868['body'],null))[_0x3fa0('0x24')](respondWithResult(_0x379392,null))[_0x3fa0('0x2e')](handleError(_0x379392,null));};exports[_0x3fa0('0x39')]=function(_0x420793,_0x483fdf){return db[_0x3fa0('0x3f')][_0x3fa0('0x59')]({'where':{'id':_0x420793[_0x3fa0('0x65')]['id']}})[_0x3fa0('0x24')](handleEntityNotFound(_0x483fdf,null))['then'](removeEntity(_0x483fdf,null))['catch'](handleError(_0x483fdf,null));};exports[_0x3fa0('0x66')]=function(_0x4a219e,_0x4a779f){return db['ChatQueue'][_0x3fa0('0x66')]()[_0x3fa0('0x24')](respondWithResult(_0x4a779f,null))[_0x3fa0('0x2e')](handleError(_0x4a779f,null));};exports[_0x3fa0('0x67')]=function(_0x17d96b,_0x5c954d,_0x48ab58){var _0x3b2a41={'raw':!![],'where':{}},_0x28adea={},_0x56d7f2;return db['ChatQueue'][_0x3fa0('0x68')]({'where':{'id':_0x17d96b[_0x3fa0('0x65')]['id']}})[_0x3fa0('0x24')](handleEntityNotFound(_0x5c954d,null))[_0x3fa0('0x24')](function(_0x552470){if(_0x552470){_0x56d7f2=_0x552470[_0x3fa0('0x5e')]({'plain':!![]});_0x28adea[_0x3fa0('0x43')]=_[_0x3fa0('0x58')](db[_0x3fa0('0x69')][_0x3fa0('0x40')]);_0x28adea[_0x3fa0('0x45')]=_[_0x3fa0('0x58')](_0x17d96b[_0x3fa0('0x45')]);_0x28adea[_0x3fa0('0x46')]=_['intersection'](_0x28adea[_0x3fa0('0x43')],_0x28adea[_0x3fa0('0x45')]);_0x3b2a41['attributes']=_['intersection'](_0x28adea[_0x3fa0('0x43')],qs[_0x3fa0('0x49')](_0x17d96b[_0x3fa0('0x45')][_0x3fa0('0x49')]));_0x3b2a41[_0x3fa0('0x48')]=_0x3b2a41[_0x3fa0('0x48')][_0x3fa0('0x4a')]?_0x3b2a41[_0x3fa0('0x48')]:_0x28adea[_0x3fa0('0x43')];if(!_0x17d96b[_0x3fa0('0x45')][_0x3fa0('0x4b')](_0x3fa0('0x6a'))){_0x3b2a41[_0x3fa0('0x4c')]=qs[_0x3fa0('0x4c')](_0x17d96b[_0x3fa0('0x45')]['limit']);_0x3b2a41[_0x3fa0('0x32')]=qs['offset'](_0x17d96b['query'][_0x3fa0('0x32')]);}_0x3b2a41[_0x3fa0('0x6b')]=qs[_0x3fa0('0x4d')](_0x17d96b[_0x3fa0('0x45')][_0x3fa0('0x4d')]);_0x3b2a41[_0x3fa0('0x50')]=qs[_0x3fa0('0x46')](_[_0x3fa0('0x4e')](_0x17d96b[_0x3fa0('0x45')],_0x28adea[_0x3fa0('0x46')]));_0x3b2a41[_0x3fa0('0x50')][_0x3fa0('0x6c')]=_0x552470['id'];if(_0x17d96b[_0x3fa0('0x45')][_0x3fa0('0x4f')]){_0x3b2a41[_0x3fa0('0x50')]=_[_0x3fa0('0x51')](_0x3b2a41[_0x3fa0('0x50')],{'$or':_[_0x3fa0('0x44')](_0x3b2a41[_0x3fa0('0x48')],function(_0x2d9150){var _0x3059f8={};_0x3059f8[_0x2d9150]={'$like':'%'+_0x17d96b[_0x3fa0('0x45')][_0x3fa0('0x4f')]+'%'};return _0x3059f8;})});}_0x3b2a41=_[_0x3fa0('0x51')]({},_0x3b2a41,_0x17d96b[_0x3fa0('0x52')]);return db['UserChatQueue'][_0x3fa0('0x55')](_0x3b2a41);}})[_0x3fa0('0x24')](function(_0x40d374){if(_0x40d374){return db[_0x3fa0('0x6d')]['findAndCountAll']({'where':{'id':_[_0x3fa0('0x44')](_0x40d374,'UserId'),'role':'agent'},'attributes':['id',_0x3fa0('0x3c'),_0x3fa0('0x6e'),_0x3fa0('0x6f'),_0x3fa0('0x70')]});}})['then'](function(_0x5324ab){if(_0x5324ab){return{'count':_0x5324ab['count'],'rows':_[_0x3fa0('0x44')](_0x5324ab[_0x3fa0('0x56')],function(_0x32ab3a){return{'membername':_0x32ab3a['name'],'UserId':_0x32ab3a['id'],'queue_name':_0x56d7f2[_0x3fa0('0x3c')],'ChatQueueId':_0x56d7f2['id'],'interface':util[_0x3fa0('0x71')](_0x3fa0('0x72'),_0x3fa0('0x73'),_0x32ab3a['name']),'penalty':0x0,'paused':_0x32ab3a['chatPause'],'createdAt':_0x32ab3a[_0x3fa0('0x70')],'updatedAt':_0x32ab3a[_0x3fa0('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3fa0('0x24')](respondWithFilteredResult(_0x5c954d,_0x3b2a41))['catch'](handleError(_0x5c954d,null));};exports['getTeams']=function(_0x5cae98,_0xd70ac7,_0x7f32f4){var _0x1ecf7e={};var _0x9fda1d={};var _0xd59d74;var _0x17f64d;return db[_0x3fa0('0x3f')]['findOne']({'where':{'id':_0x5cae98[_0x3fa0('0x65')]['id']}})['then'](handleEntityNotFound(_0xd70ac7,null))['then'](function(_0x15a29e){if(_0x15a29e){_0xd59d74=_0x15a29e;_0x9fda1d['model']=_[_0x3fa0('0x58')](db[_0x3fa0('0x74')][_0x3fa0('0x40')]);_0x9fda1d['query']=_[_0x3fa0('0x58')](_0x5cae98[_0x3fa0('0x45')]);_0x9fda1d[_0x3fa0('0x46')]=_[_0x3fa0('0x47')](_0x9fda1d[_0x3fa0('0x43')],_0x9fda1d[_0x3fa0('0x45')]);_0x1ecf7e[_0x3fa0('0x48')]=_[_0x3fa0('0x47')](_0x9fda1d[_0x3fa0('0x43')],qs[_0x3fa0('0x49')](_0x5cae98[_0x3fa0('0x45')][_0x3fa0('0x49')]));_0x1ecf7e['attributes']=_0x1ecf7e['attributes'][_0x3fa0('0x4a')]?_0x1ecf7e[_0x3fa0('0x48')]:_0x9fda1d['model'];_0x1ecf7e[_0x3fa0('0x6b')]=qs[_0x3fa0('0x4d')](_0x5cae98['query'][_0x3fa0('0x4d')]);_0x1ecf7e[_0x3fa0('0x50')]=qs[_0x3fa0('0x46')](_[_0x3fa0('0x4e')](_0x5cae98[_0x3fa0('0x45')],_0x9fda1d['filters']));if(_0x5cae98[_0x3fa0('0x45')]['filter']){_0x1ecf7e[_0x3fa0('0x50')]=_[_0x3fa0('0x51')](_0x1ecf7e['where'],{'$or':_['map'](_0x1ecf7e[_0x3fa0('0x48')],function(_0x4018e7){var _0x4094e1={};_0x4094e1[_0x4018e7]={'$like':'%'+_0x5cae98[_0x3fa0('0x45')][_0x3fa0('0x4f')]+'%'};return _0x4094e1;})});}_0x1ecf7e=_[_0x3fa0('0x51')]({},_0x1ecf7e,_0x5cae98['options']);return _0xd59d74[_0x3fa0('0x75')](_0x1ecf7e);}})[_0x3fa0('0x24')](function(_0x42a858){if(_0x42a858){_0x17f64d=_0x42a858[_0x3fa0('0x4a')];if(!_0x5cae98[_0x3fa0('0x45')]['hasOwnProperty'](_0x3fa0('0x6a'))){_0x1ecf7e[_0x3fa0('0x4c')]=qs[_0x3fa0('0x4c')](_0x5cae98[_0x3fa0('0x45')]['limit']);_0x1ecf7e[_0x3fa0('0x32')]=qs[_0x3fa0('0x32')](_0x5cae98['query'][_0x3fa0('0x32')]);}return _0xd59d74['getTeams'](_0x1ecf7e);}})['then'](function(_0x428650){if(_0x428650){return _0x428650?{'count':_0x17f64d,'rows':_0x428650}:null;}})['then'](respondWithResult(_0xd70ac7,null))['catch'](handleError(_0xd70ac7,null));};exports['addTeams']=function(_0x5841e3,_0x374108,_0x501d4c){var _0x23752e=_0x5841e3['body']['ids'];return db['Team'][_0x3fa0('0x55')]({'where':{'id':_0x23752e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3fa0('0x76'),'attributes':['id',_0x3fa0('0x3c'),_0x3fa0('0x77'),_0x3fa0('0x78'),_0x3fa0('0x79')],'raw':!![]}]})[_0x3fa0('0x24')](function(_0x1c7d28){if(_0x1c7d28){var _0x56a3b6=_[_0x3fa0('0x7a')](_0x1c7d28,function(_0x451cfe){var _0x4798d3=_0x451cfe[_0x3fa0('0x5e')]({'plain':!![]});return _0x4798d3[_0x3fa0('0x76')];});return db[_0x3fa0('0x3f')]['find']({'where':{'id':_0x5841e3[_0x3fa0('0x65')]['id']}})[_0x3fa0('0x24')](function(_0x583b4f){return db[_0x3fa0('0x7b')][_0x3fa0('0x7c')](function(_0x14dfc5){return _0x583b4f['addTeams'](_0x23752e,{'transaction':_0x14dfc5})[_0x3fa0('0x24')](function(){return BPromise[_0x3fa0('0x7d')](_0x56a3b6,function(_0x492b73){return db[_0x3fa0('0x69')][_0x3fa0('0x7e')]({'where':{'UserId':_0x492b73['id'],'ChatQueueId':_0x5841e3[_0x3fa0('0x65')]['id']},'transaction':_0x14dfc5});});})['then'](function(){_0x56a3b6[_0x3fa0('0x7f')](function(_0x1808b4){socket[_0x3fa0('0x80')]('userChatQueue:save',{'UserId':_0x1808b4['id'],'ChatQueueId':_0x583b4f['id']});});});});});}})[_0x3fa0('0x24')](respondWithStatusCode(_0x374108,null))['catch'](handleError(_0x374108,null));};exports[_0x3fa0('0x81')]=function(_0x341022,_0x2b359d,_0x47be59){return db['Team'][_0x3fa0('0x55')]({'where':{'id':_0x341022[_0x3fa0('0x45')][_0x3fa0('0x82')]},'attributes':['id'],'include':[{'model':db[_0x3fa0('0x6d')],'as':_0x3fa0('0x76'),'attributes':['id'],'raw':!![]}]})[_0x3fa0('0x24')](handleEntityNotFound(_0x2b359d,null))['then'](function(_0x6120dc){var _0x34b0e6=_['map'](_0x6120dc,'id');var _0x2291ba=[];var _0x5ef7d8=[];var _0x36de56=squel[_0x3fa0('0x83')]();_0x36de56[_0x3fa0('0x84')](_0x3fa0('0x85'))[_0x3fa0('0x86')](_0x3fa0('0x87'),'tq')[_0x3fa0('0x88')]('user_has_teams','ut',_0x3fa0('0x89'))[_0x3fa0('0x50')](_0x3fa0('0x8a'),_0x341022['params']['id']);for(var _0x1d79a8=0x0;_0x1d79a8<_0x6120dc[_0x3fa0('0x4a')];_0x1d79a8+=0x1){let _0x5359cc=_0x6120dc[_0x1d79a8];for(var _0x362e95=0x0;_0x362e95<_0x5359cc[_0x3fa0('0x76')][_0x3fa0('0x4a')];_0x362e95+=0x1){let _0x34df42=_0x5359cc[_0x3fa0('0x76')][_0x362e95];var _0x4429d4=_0x36de56[_0x3fa0('0x8b')]();_0x4429d4[_0x3fa0('0x50')](_0x3fa0('0x8c'),_0x34df42['id']);_0x5ef7d8[_0x3fa0('0x8d')](db[_0x3fa0('0x7b')]['query'](_0x4429d4[_0x3fa0('0x8e')](),{'type':db[_0x3fa0('0x7b')][_0x3fa0('0x8f')][_0x3fa0('0x90')]})[_0x3fa0('0x24')](function(_0xcc7895){if(_0xcc7895['length']===0x1){return _0x34df42['id'];}else{var _0x24c5a1=_[_0x3fa0('0x91')](_[_0x3fa0('0x44')](_0xcc7895,_0x3fa0('0x92')),function(_0x41b724){return _['includes'](_0x34b0e6,_0x41b724);});if(_0x24c5a1){return _0x34df42['id'];}}}));}}return BPromise[_0x3fa0('0x93')](_0x5ef7d8)['then'](function(_0x173a89){_0x2291ba=_(_0x2291ba)[_0x3fa0('0x94')](_0x173a89)[_0x3fa0('0x95')]()[_0x3fa0('0x96')]();return db[_0x3fa0('0x3f')]['find']({'where':{'id':_0x341022['params']['id']}})[_0x3fa0('0x24')](function(_0xc0c00d){return db[_0x3fa0('0x7b')][_0x3fa0('0x7c')](function(_0x3fcc34){return _0xc0c00d['removeTeams'](_0x341022[_0x3fa0('0x45')]['ids'],{'transaction':_0x3fcc34})['then'](function(){if(!_[_0x3fa0('0x97')](_0x2291ba)){return _0xc0c00d['removeAgents'](_0x2291ba,{'transaction':_0x3fcc34});}})[_0x3fa0('0x24')](function(){_0x2291ba[_0x3fa0('0x7f')](function(_0x17d202){socket[_0x3fa0('0x80')](_0x3fa0('0x98'),{'UserId':_0x17d202,'ChatQueueId':_0xc0c00d['id']});});});});});});})[_0x3fa0('0x24')](respondWithStatusCode(_0x2b359d,null))[_0x3fa0('0x2e')](handleError(_0x2b359d,null));};exports['addAgents']=function(_0x28a4a6,_0x4cb6b1,_0x264cc6){return db[_0x3fa0('0x3f')][_0x3fa0('0x59')]({'where':{'id':_0x28a4a6[_0x3fa0('0x65')]['id']}})['then'](handleEntityNotFound(_0x4cb6b1,null))[_0x3fa0('0x24')](function(_0x56fa86){if(_0x56fa86){return _0x56fa86[_0x3fa0('0x99')](_0x28a4a6[_0x3fa0('0x64')][_0x3fa0('0x82')],_[_0x3fa0('0x9a')](_0x28a4a6[_0x3fa0('0x64')],[_0x3fa0('0x82'),'id'])||{})[_0x3fa0('0x9b')](function(_0xb0213c){for(var _0x22b99e=0x0;_0x22b99e<_0x28a4a6[_0x3fa0('0x64')][_0x3fa0('0x82')][_0x3fa0('0x4a')];_0x22b99e+=0x1){socket[_0x3fa0('0x80')](_0x3fa0('0x9c'),{'UserId':Number(_0x28a4a6[_0x3fa0('0x64')][_0x3fa0('0x82')][_0x22b99e]),'ChatQueueId':Number(_0x28a4a6[_0x3fa0('0x65')]['id'])});}return _0xb0213c;});}})[_0x3fa0('0x24')](respondWithResult(_0x4cb6b1,null))[_0x3fa0('0x2e')](handleError(_0x4cb6b1,null));};exports[_0x3fa0('0x9d')]=function(_0x279b5a,_0x5b6d15,_0x1ad83f){return db['ChatQueue'][_0x3fa0('0x59')]({'where':{'id':_0x279b5a['params']['id']}})['then'](handleEntityNotFound(_0x5b6d15,null))[_0x3fa0('0x24')](function(_0x1c142f){if(_0x1c142f){return _0x1c142f['removeAgents'](_0x279b5a[_0x3fa0('0x45')][_0x3fa0('0x82')])[_0x3fa0('0x24')](function(){if(_['isArray'](_0x279b5a[_0x3fa0('0x45')][_0x3fa0('0x82')])){for(var _0x44a1f8=0x0;_0x44a1f8<_0x279b5a[_0x3fa0('0x45')]['ids']['length'];_0x44a1f8+=0x1){socket[_0x3fa0('0x80')](_0x3fa0('0x98'),{'UserId':Number(_0x279b5a['query'][_0x3fa0('0x82')][_0x44a1f8]),'ChatQueueId':Number(_0x279b5a[_0x3fa0('0x65')]['id'])});}}else{socket['emit'](_0x3fa0('0x98'),{'UserId':Number(_0x279b5a[_0x3fa0('0x45')][_0x3fa0('0x82')]),'ChatQueueId':Number(_0x279b5a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5b6d15,null))[_0x3fa0('0x2e')](handleError(_0x5b6d15,null));};exports[_0x3fa0('0x9e')]=function(_0x3587bd,_0x402035,_0x39fa2e){var _0x6e408f={};var _0x2e8739={};var _0x4b5c38;var _0x816468;return db[_0x3fa0('0x3f')]['findOne']({'where':{'id':_0x3587bd['params']['id']}})[_0x3fa0('0x24')](handleEntityNotFound(_0x402035,null))[_0x3fa0('0x24')](function(_0x32ceb2){if(_0x32ceb2){_0x4b5c38=_0x32ceb2;_0x2e8739[_0x3fa0('0x43')]=_['keys'](db[_0x3fa0('0x6d')][_0x3fa0('0x40')]);_0x2e8739[_0x3fa0('0x45')]=_['keys'](_0x3587bd[_0x3fa0('0x45')]);_0x2e8739['filters']=_[_0x3fa0('0x47')](_0x2e8739[_0x3fa0('0x43')],_0x2e8739[_0x3fa0('0x45')]);_0x6e408f[_0x3fa0('0x48')]=_[_0x3fa0('0x47')](_0x2e8739[_0x3fa0('0x43')],qs[_0x3fa0('0x49')](_0x3587bd['query'][_0x3fa0('0x49')]));_0x6e408f[_0x3fa0('0x48')]=_0x6e408f[_0x3fa0('0x48')][_0x3fa0('0x4a')]?_0x6e408f[_0x3fa0('0x48')]:_0x2e8739['model'];_0x6e408f['order']=qs[_0x3fa0('0x4d')](_0x3587bd[_0x3fa0('0x45')][_0x3fa0('0x4d')]);_0x6e408f[_0x3fa0('0x50')]=qs[_0x3fa0('0x46')](_[_0x3fa0('0x4e')](_0x3587bd['query'],_0x2e8739[_0x3fa0('0x46')]));if(_0x3587bd['query'][_0x3fa0('0x4f')]){_0x6e408f[_0x3fa0('0x50')]=_[_0x3fa0('0x51')](_0x6e408f['where'],{'$or':_[_0x3fa0('0x44')](_0x6e408f[_0x3fa0('0x48')],function(_0x14dabf){var _0x523e32={};_0x523e32[_0x14dabf]={'$like':'%'+_0x3587bd[_0x3fa0('0x45')][_0x3fa0('0x4f')]+'%'};return _0x523e32;})});}_0x6e408f=_[_0x3fa0('0x51')]({},_0x6e408f,_0x3587bd[_0x3fa0('0x52')]);return _0x4b5c38[_0x3fa0('0x9e')](_0x6e408f);}})[_0x3fa0('0x24')](function(_0x19bc5e){if(_0x19bc5e){_0x816468=_0x19bc5e[_0x3fa0('0x4a')];if(!_0x3587bd[_0x3fa0('0x45')]['hasOwnProperty'](_0x3fa0('0x6a'))){_0x6e408f[_0x3fa0('0x4c')]=qs[_0x3fa0('0x4c')](_0x3587bd[_0x3fa0('0x45')][_0x3fa0('0x4c')]);_0x6e408f[_0x3fa0('0x32')]=qs['offset'](_0x3587bd[_0x3fa0('0x45')][_0x3fa0('0x32')]);}return _0x4b5c38['getAgents'](_0x6e408f);}})[_0x3fa0('0x24')](function(_0x1463d9){if(_0x1463d9){return _0x1463d9?{'count':_0x816468,'rows':_0x1463d9}:null;}})['then'](respondWithResult(_0x402035,null))[_0x3fa0('0x2e')](handleError(_0x402035,null));};
\ No newline at end of file
+var _0x9a21=['value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatQueue','includeAll','include','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','UserChatQueue','hasOwnProperty','ChatQueueId','options','User','UserId','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','findAll','Agents','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','all','union'];(function(_0x451052,_0x211e27){var _0x50df1b=function(_0x315764){while(--_0x315764){_0x451052['push'](_0x451052['shift']());}};_0x50df1b(++_0x211e27);}(_0x9a21,0x12f));var _0x19a2=function(_0x4f0b22,_0x586aa8){_0x4f0b22=_0x4f0b22-0x0;var _0x5c545e=_0x9a21[_0x4f0b22];return _0x5c545e;};'use strict';var emlformat=require(_0x19a2('0x0'));var rimraf=require(_0x19a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x19a2('0x2'));var moment=require('moment');var BPromise=require(_0x19a2('0x3'));var Mustache=require(_0x19a2('0x4'));var util=require(_0x19a2('0x5'));var path=require(_0x19a2('0x6'));var sox=require(_0x19a2('0x7'));var csv=require('to-csv');var ejs=require(_0x19a2('0x8'));var fs=require('fs');var fs_extra=require(_0x19a2('0x9'));var _=require('lodash');var squel=require(_0x19a2('0xa'));var crypto=require('crypto');var jsforce=require(_0x19a2('0xb'));var deskjs=require(_0x19a2('0xc'));var toCsv=require(_0x19a2('0xd'));var querystring=require(_0x19a2('0xe'));var Papa=require(_0x19a2('0xf'));var Redis=require(_0x19a2('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x19a2('0x11'));var logger=require(_0x19a2('0x12'))(_0x19a2('0x13'));var utils=require('../../config/utils');var config=require(_0x19a2('0x14'));var licenseUtil=require(_0x19a2('0x15'));var db=require(_0x19a2('0x16'))['db'];config['redis']=_[_0x19a2('0x17')](config[_0x19a2('0x18')],{'host':_0x19a2('0x19'),'port':0x18eb});var socket=require(_0x19a2('0x1a'))(new Redis(config[_0x19a2('0x18')]));require(_0x19a2('0x1b'))[_0x19a2('0x1c')](socket);var jayson=require(_0x19a2('0x1d'));var client=jayson[_0x19a2('0x1e')][_0x19a2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1fd343,_0x38c9d6,_0x1b4dd3,_0x7bccf7){return new BPromise(function(_0x1178cf,_0x1672fd){var _0x5afed7=_0x7bccf7||client;return _0x5afed7['request'](_0x1fd343,_0x1b4dd3)['then'](function(_0x36bf41){logger[_0x19a2('0x20')](_0x19a2('0x21'),_0x38c9d6,_0x19a2('0x22'));logger[_0x19a2('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x38c9d6,'request\x20sent',JSON['stringify'](_0x36bf41));if(_0x36bf41[_0x19a2('0x24')]){if(_0x36bf41[_0x19a2('0x24')][_0x19a2('0x25')]===0x1f4){logger[_0x19a2('0x24')](_0x19a2('0x21'),_0x38c9d6,_0x36bf41[_0x19a2('0x24')]['message']);return _0x1672fd(_0x36bf41['error'][_0x19a2('0x26')]);}logger[_0x19a2('0x24')](_0x19a2('0x21'),_0x38c9d6,_0x36bf41['error']['message']);return _0x1178cf(_0x36bf41['error'][_0x19a2('0x26')]);}else{logger[_0x19a2('0x20')](_0x19a2('0x21'),_0x38c9d6,_0x19a2('0x22'));_0x1178cf(_0x36bf41['result']['message']);}})[_0x19a2('0x27')](function(_0x18717b){logger[_0x19a2('0x24')](_0x19a2('0x21'),_0x38c9d6,_0x18717b);_0x1672fd(_0x18717b);});});}function respondWithStatusCode(_0x10216f,_0x445194){_0x445194=_0x445194||0xcc;return function(_0x1bb75d){if(_0x1bb75d){return _0x10216f[_0x19a2('0x28')](_0x445194);}return _0x10216f['status'](_0x445194)['end']();};}function respondWithResult(_0x4808b9,_0x2b5695){_0x2b5695=_0x2b5695||0xc8;return function(_0x11d3c2){if(_0x11d3c2){return _0x4808b9[_0x19a2('0x29')](_0x2b5695)[_0x19a2('0x2a')](_0x11d3c2);}};}function respondWithFilteredResult(_0x441a96,_0x33ba56){return function(_0x4b1a56){if(_0x4b1a56){var _0x41a8f1=typeof _0x33ba56['offset']==='undefined'&&typeof _0x33ba56[_0x19a2('0x2b')]===_0x19a2('0x2c');var _0x5d031d=_0x4b1a56[_0x19a2('0x2d')];var _0xe06d6c=_0x41a8f1?0x0:_0x33ba56[_0x19a2('0x2e')];var _0x1d4b3b=_0x41a8f1?_0x4b1a56[_0x19a2('0x2d')]:_0x33ba56[_0x19a2('0x2e')]+_0x33ba56[_0x19a2('0x2b')];var _0x15d179;if(_0x1d4b3b>=_0x5d031d){_0x1d4b3b=_0x5d031d;_0x15d179=0xc8;}else{_0x15d179=0xce;}_0x441a96['status'](_0x15d179);return _0x441a96[_0x19a2('0x2f')](_0x19a2('0x30'),_0xe06d6c+'-'+_0x1d4b3b+'/'+_0x5d031d)[_0x19a2('0x2a')](_0x4b1a56);}return null;};}function patchUpdates(_0x5a94e9){return function(_0x486030){try{jsonpatch['apply'](_0x486030,_0x5a94e9,!![]);}catch(_0x5254c1){return BPromise[_0x19a2('0x31')](_0x5254c1);}return _0x486030[_0x19a2('0x32')]();};}function saveUpdates(_0x2c4583,_0x36e8c5){return function(_0x6b5a01){if(_0x6b5a01){return _0x6b5a01[_0x19a2('0x33')](_0x2c4583)[_0x19a2('0x34')](function(_0x16d0b5){return _0x16d0b5;});}return null;};}function removeEntity(_0x5d68ac,_0x31d4dc){return function(_0x529e6b){if(_0x529e6b){return _0x529e6b[_0x19a2('0x35')]()['then'](function(){var _0x2fa11a=_0x529e6b[_0x19a2('0x36')]({'plain':!![]});var _0x32c417=_0x19a2('0x37');return db[_0x19a2('0x38')][_0x19a2('0x35')]({'where':{'type':_0x32c417,'resourceId':_0x2fa11a['id']}})[_0x19a2('0x34')](function(){return _0x529e6b;});})['then'](function(){_0x5d68ac[_0x19a2('0x29')](0xcc)[_0x19a2('0x39')]();});}};}function handleEntityNotFound(_0x5ea584,_0x43b8a0){return function(_0x471535){if(!_0x471535){_0x5ea584['sendStatus'](0x194);}return _0x471535;};}function handleError(_0xbacec5,_0x271da1){_0x271da1=_0x271da1||0x1f4;return function(_0x1480ea){logger['error'](_0x1480ea[_0x19a2('0x3a')]);if(_0x1480ea[_0x19a2('0x3b')]){delete _0x1480ea['name'];}_0xbacec5[_0x19a2('0x29')](_0x271da1)[_0x19a2('0x3c')](_0x1480ea);};}exports[_0x19a2('0x3d')]=function(_0x3bb662,_0x2725f1){var _0x524b5f={},_0x47e617={},_0x34b099={'count':0x0,'rows':[]};var _0x58ae3d=_[_0x19a2('0x3e')](db['ChatQueue'][_0x19a2('0x3f')],function(_0x54c847){return{'name':_0x54c847[_0x19a2('0x40')],'type':_0x54c847[_0x19a2('0x41')]['key']};});_0x47e617[_0x19a2('0x42')]=_[_0x19a2('0x3e')](_0x58ae3d,'name');_0x47e617[_0x19a2('0x43')]=_[_0x19a2('0x44')](_0x3bb662[_0x19a2('0x43')]);_0x47e617[_0x19a2('0x45')]=_[_0x19a2('0x46')](_0x47e617[_0x19a2('0x42')],_0x47e617[_0x19a2('0x43')]);_0x524b5f[_0x19a2('0x47')]=_[_0x19a2('0x46')](_0x47e617['model'],qs['fields'](_0x3bb662[_0x19a2('0x43')][_0x19a2('0x48')]));_0x524b5f[_0x19a2('0x47')]=_0x524b5f[_0x19a2('0x47')][_0x19a2('0x49')]?_0x524b5f[_0x19a2('0x47')]:_0x47e617['model'];if(!_0x3bb662[_0x19a2('0x43')]['hasOwnProperty'](_0x19a2('0x4a'))){_0x524b5f[_0x19a2('0x2b')]=qs[_0x19a2('0x2b')](_0x3bb662[_0x19a2('0x43')][_0x19a2('0x2b')]);_0x524b5f['offset']=qs['offset'](_0x3bb662['query'][_0x19a2('0x2e')]);}_0x524b5f[_0x19a2('0x4b')]=qs[_0x19a2('0x4c')](_0x3bb662[_0x19a2('0x43')][_0x19a2('0x4c')]);_0x524b5f[_0x19a2('0x4d')]=qs[_0x19a2('0x45')](_[_0x19a2('0x4e')](_0x3bb662[_0x19a2('0x43')],_0x47e617[_0x19a2('0x45')]),_0x58ae3d);if(_0x3bb662[_0x19a2('0x43')][_0x19a2('0x4f')]){_0x524b5f['where']=_[_0x19a2('0x50')](_0x524b5f[_0x19a2('0x4d')],{'$or':_[_0x19a2('0x3e')](_0x58ae3d,function(_0x51f663){if(_0x51f663[_0x19a2('0x41')]!==_0x19a2('0x51')){var _0x125b9e={};_0x125b9e[_0x51f663[_0x19a2('0x3b')]]={'$like':'%'+_0x3bb662[_0x19a2('0x43')][_0x19a2('0x4f')]+'%'};return _0x125b9e;}})});}_0x524b5f=_[_0x19a2('0x50')]({},_0x524b5f,_0x3bb662['options']);var _0x13ecd3={'where':_0x524b5f['where']};return db[_0x19a2('0x52')][_0x19a2('0x2d')](_0x13ecd3)[_0x19a2('0x34')](function(_0x3349c4){_0x34b099[_0x19a2('0x2d')]=_0x3349c4;if(_0x3bb662[_0x19a2('0x43')][_0x19a2('0x53')]){_0x524b5f[_0x19a2('0x54')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x524b5f);})[_0x19a2('0x34')](function(_0x96bad6){_0x34b099[_0x19a2('0x55')]=_0x96bad6;return _0x34b099;})[_0x19a2('0x34')](respondWithFilteredResult(_0x2725f1,_0x524b5f))['catch'](handleError(_0x2725f1,null));};exports[_0x19a2('0x56')]=function(_0x87edb6,_0x55b523){var _0x43d612={'raw':!![],'where':{'id':_0x87edb6[_0x19a2('0x57')]['id']}},_0x3565ca={};_0x3565ca['model']=_[_0x19a2('0x44')](db[_0x19a2('0x52')][_0x19a2('0x3f')]);_0x3565ca[_0x19a2('0x43')]=_[_0x19a2('0x44')](_0x87edb6[_0x19a2('0x43')]);_0x3565ca[_0x19a2('0x45')]=_[_0x19a2('0x46')](_0x3565ca[_0x19a2('0x42')],_0x3565ca[_0x19a2('0x43')]);_0x43d612[_0x19a2('0x47')]=_[_0x19a2('0x46')](_0x3565ca[_0x19a2('0x42')],qs[_0x19a2('0x48')](_0x87edb6[_0x19a2('0x43')][_0x19a2('0x48')]));_0x43d612['attributes']=_0x43d612['attributes'][_0x19a2('0x49')]?_0x43d612[_0x19a2('0x47')]:_0x3565ca[_0x19a2('0x42')];if(_0x87edb6[_0x19a2('0x43')][_0x19a2('0x53')]){_0x43d612[_0x19a2('0x54')]=[{'all':!![]}];}_0x43d612=_[_0x19a2('0x50')]({},_0x43d612,_0x87edb6['options']);return db[_0x19a2('0x52')][_0x19a2('0x58')](_0x43d612)['then'](handleEntityNotFound(_0x55b523,null))[_0x19a2('0x34')](respondWithResult(_0x55b523,null))[_0x19a2('0x27')](handleError(_0x55b523,null));};exports[_0x19a2('0x59')]=function(_0x32c4ed,_0x54c95b){return db['ChatQueue'][_0x19a2('0x59')](_0x32c4ed['body'],{})['then'](function(_0x5c6b98){var _0x41e484=_0x32c4ed[_0x19a2('0x5a')][_0x19a2('0x36')]({'plain':!![]});if(!_0x41e484)throw new Error(_0x19a2('0x5b'));if(_0x41e484[_0x19a2('0x5c')]===_0x19a2('0x5a')){var _0x22ae3a=_0x5c6b98[_0x19a2('0x36')]({'plain':!![]});var _0x41655e='ChatQueues';return db[_0x19a2('0x5d')]['find']({'where':{'name':_0x41655e,'userProfileId':_0x41e484[_0x19a2('0x5e')]},'raw':!![]})[_0x19a2('0x34')](function(_0x547628){if(_0x547628&&_0x547628['autoAssociation']===0x0){return db['UserProfileResource'][_0x19a2('0x59')]({'name':_0x22ae3a[_0x19a2('0x3b')],'resourceId':_0x22ae3a['id'],'type':_0x547628['name'],'sectionId':_0x547628['id']},{})[_0x19a2('0x34')](function(){return _0x5c6b98;});}else{return _0x5c6b98;}})['catch'](function(_0x460cb6){logger[_0x19a2('0x24')](_0x19a2('0x5f'),_0x460cb6);throw _0x460cb6;});}return _0x5c6b98;})[_0x19a2('0x34')](respondWithResult(_0x54c95b,0xc9))[_0x19a2('0x27')](handleError(_0x54c95b,null));};exports['update']=function(_0x107a87,_0x12298e){if(_0x107a87[_0x19a2('0x60')]['id']){delete _0x107a87[_0x19a2('0x60')]['id'];}return db[_0x19a2('0x52')][_0x19a2('0x58')]({'where':{'id':_0x107a87['params']['id']}})[_0x19a2('0x34')](handleEntityNotFound(_0x12298e,null))[_0x19a2('0x34')](saveUpdates(_0x107a87['body'],null))['then'](respondWithResult(_0x12298e,null))[_0x19a2('0x27')](handleError(_0x12298e,null));};exports[_0x19a2('0x35')]=function(_0x3cc5b7,_0x1bd64c){return db['ChatQueue'][_0x19a2('0x58')]({'where':{'id':_0x3cc5b7[_0x19a2('0x57')]['id']}})[_0x19a2('0x34')](handleEntityNotFound(_0x1bd64c,null))[_0x19a2('0x34')](removeEntity(_0x1bd64c,null))[_0x19a2('0x27')](handleError(_0x1bd64c,null));};exports[_0x19a2('0x61')]=function(_0x5d42f5,_0x5a83cf){return db[_0x19a2('0x52')][_0x19a2('0x61')]()[_0x19a2('0x34')](respondWithResult(_0x5a83cf,null))[_0x19a2('0x27')](handleError(_0x5a83cf,null));};exports['getMembers']=function(_0x3b03d8,_0x140ba6,_0x5d1e50){var _0x41b471={'raw':!![],'where':{}},_0x486b50={},_0x214299;return db[_0x19a2('0x52')]['findOne']({'where':{'id':_0x3b03d8[_0x19a2('0x57')]['id']}})[_0x19a2('0x34')](handleEntityNotFound(_0x140ba6,null))[_0x19a2('0x34')](function(_0x1da01f){if(_0x1da01f){_0x214299=_0x1da01f[_0x19a2('0x36')]({'plain':!![]});_0x486b50[_0x19a2('0x42')]=_[_0x19a2('0x44')](db[_0x19a2('0x62')][_0x19a2('0x3f')]);_0x486b50[_0x19a2('0x43')]=_[_0x19a2('0x44')](_0x3b03d8[_0x19a2('0x43')]);_0x486b50[_0x19a2('0x45')]=_[_0x19a2('0x46')](_0x486b50[_0x19a2('0x42')],_0x486b50['query']);_0x41b471[_0x19a2('0x47')]=_[_0x19a2('0x46')](_0x486b50['model'],qs[_0x19a2('0x48')](_0x3b03d8['query'][_0x19a2('0x48')]));_0x41b471[_0x19a2('0x47')]=_0x41b471[_0x19a2('0x47')][_0x19a2('0x49')]?_0x41b471[_0x19a2('0x47')]:_0x486b50[_0x19a2('0x42')];if(!_0x3b03d8['query'][_0x19a2('0x63')](_0x19a2('0x4a'))){_0x41b471[_0x19a2('0x2b')]=qs[_0x19a2('0x2b')](_0x3b03d8[_0x19a2('0x43')][_0x19a2('0x2b')]);_0x41b471[_0x19a2('0x2e')]=qs[_0x19a2('0x2e')](_0x3b03d8[_0x19a2('0x43')]['offset']);}_0x41b471[_0x19a2('0x4b')]=qs[_0x19a2('0x4c')](_0x3b03d8[_0x19a2('0x43')][_0x19a2('0x4c')]);_0x41b471['where']=qs[_0x19a2('0x45')](_['pick'](_0x3b03d8[_0x19a2('0x43')],_0x486b50['filters']));_0x41b471[_0x19a2('0x4d')][_0x19a2('0x64')]=_0x1da01f['id'];if(_0x3b03d8[_0x19a2('0x43')]['filter']){_0x41b471[_0x19a2('0x4d')]=_[_0x19a2('0x50')](_0x41b471[_0x19a2('0x4d')],{'$or':_['map'](_0x41b471[_0x19a2('0x47')],function(_0x2921d1){var _0x2863e2={};_0x2863e2[_0x2921d1]={'$like':'%'+_0x3b03d8['query'][_0x19a2('0x4f')]+'%'};return _0x2863e2;})});}_0x41b471=_[_0x19a2('0x50')]({},_0x41b471,_0x3b03d8[_0x19a2('0x65')]);return db['UserChatQueue']['findAll'](_0x41b471);}})[_0x19a2('0x34')](function(_0x1df4b3){if(_0x1df4b3){return db[_0x19a2('0x66')]['findAndCountAll']({'where':{'id':_['map'](_0x1df4b3,_0x19a2('0x67')),'role':'agent'},'attributes':['id',_0x19a2('0x3b'),'chatPause',_0x19a2('0x68'),_0x19a2('0x69')]});}})[_0x19a2('0x34')](function(_0x3b600f){if(_0x3b600f){return{'count':_0x3b600f['count'],'rows':_['map'](_0x3b600f[_0x19a2('0x55')],function(_0x4a5be6){return{'membername':_0x4a5be6[_0x19a2('0x3b')],'UserId':_0x4a5be6['id'],'queue_name':_0x214299[_0x19a2('0x3b')],'ChatQueueId':_0x214299['id'],'interface':util['format'](_0x19a2('0x6a'),_0x19a2('0x6b'),_0x4a5be6[_0x19a2('0x3b')]),'penalty':0x0,'paused':_0x4a5be6['chatPause'],'createdAt':_0x4a5be6['createdAt'],'updatedAt':_0x4a5be6[_0x19a2('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x140ba6,_0x41b471))[_0x19a2('0x27')](handleError(_0x140ba6,null));};exports[_0x19a2('0x6c')]=function(_0x123a32,_0x4a40fb,_0x32694e){var _0x509392={};var _0x24984a={};var _0x2a56f0;var _0x1fed33;return db[_0x19a2('0x52')][_0x19a2('0x6d')]({'where':{'id':_0x123a32['params']['id']}})['then'](handleEntityNotFound(_0x4a40fb,null))[_0x19a2('0x34')](function(_0x5ccaac){if(_0x5ccaac){_0x2a56f0=_0x5ccaac;_0x24984a[_0x19a2('0x42')]=_[_0x19a2('0x44')](db[_0x19a2('0x6e')][_0x19a2('0x3f')]);_0x24984a[_0x19a2('0x43')]=_[_0x19a2('0x44')](_0x123a32[_0x19a2('0x43')]);_0x24984a[_0x19a2('0x45')]=_[_0x19a2('0x46')](_0x24984a[_0x19a2('0x42')],_0x24984a[_0x19a2('0x43')]);_0x509392[_0x19a2('0x47')]=_['intersection'](_0x24984a[_0x19a2('0x42')],qs['fields'](_0x123a32[_0x19a2('0x43')][_0x19a2('0x48')]));_0x509392[_0x19a2('0x47')]=_0x509392[_0x19a2('0x47')][_0x19a2('0x49')]?_0x509392[_0x19a2('0x47')]:_0x24984a[_0x19a2('0x42')];_0x509392[_0x19a2('0x4b')]=qs[_0x19a2('0x4c')](_0x123a32[_0x19a2('0x43')][_0x19a2('0x4c')]);_0x509392[_0x19a2('0x4d')]=qs[_0x19a2('0x45')](_[_0x19a2('0x4e')](_0x123a32['query'],_0x24984a[_0x19a2('0x45')]));if(_0x123a32[_0x19a2('0x43')]['filter']){_0x509392[_0x19a2('0x4d')]=_[_0x19a2('0x50')](_0x509392[_0x19a2('0x4d')],{'$or':_[_0x19a2('0x3e')](_0x509392[_0x19a2('0x47')],function(_0x11ffeb){var _0x5b1ea6={};_0x5b1ea6[_0x11ffeb]={'$like':'%'+_0x123a32['query'][_0x19a2('0x4f')]+'%'};return _0x5b1ea6;})});}_0x509392=_[_0x19a2('0x50')]({},_0x509392,_0x123a32[_0x19a2('0x65')]);return _0x2a56f0['getTeams'](_0x509392);}})[_0x19a2('0x34')](function(_0x496626){if(_0x496626){_0x1fed33=_0x496626['length'];if(!_0x123a32[_0x19a2('0x43')]['hasOwnProperty'](_0x19a2('0x4a'))){_0x509392[_0x19a2('0x2b')]=qs[_0x19a2('0x2b')](_0x123a32[_0x19a2('0x43')][_0x19a2('0x2b')]);_0x509392[_0x19a2('0x2e')]=qs[_0x19a2('0x2e')](_0x123a32['query'][_0x19a2('0x2e')]);}return _0x2a56f0['getTeams'](_0x509392);}})[_0x19a2('0x34')](function(_0x58ae10){if(_0x58ae10){return _0x58ae10?{'count':_0x1fed33,'rows':_0x58ae10}:null;}})[_0x19a2('0x34')](respondWithResult(_0x4a40fb,null))[_0x19a2('0x27')](handleError(_0x4a40fb,null));};exports[_0x19a2('0x6f')]=function(_0x219957,_0x382dcf,_0x1a20c5){var _0x3ecb0c=_0x219957[_0x19a2('0x60')][_0x19a2('0x70')];return db[_0x19a2('0x6e')][_0x19a2('0x71')]({'where':{'id':_0x3ecb0c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x19a2('0x72'),'attributes':['id',_0x19a2('0x3b'),'online','voicePause',_0x19a2('0x73')],'raw':!![]}]})['then'](function(_0x4f217b){if(_0x4f217b){var _0xe6876b=_['flatMap'](_0x4f217b,function(_0x4423f0){var _0x3b1381=_0x4423f0[_0x19a2('0x36')]({'plain':!![]});return _0x3b1381['Agents'];});return db[_0x19a2('0x52')]['find']({'where':{'id':_0x219957[_0x19a2('0x57')]['id']}})['then'](function(_0x72d337){return db[_0x19a2('0x74')][_0x19a2('0x75')](function(_0x241db7){return _0x72d337[_0x19a2('0x6f')](_0x3ecb0c,{'transaction':_0x241db7})[_0x19a2('0x34')](function(){return BPromise[_0x19a2('0x76')](_0xe6876b,function(_0x6f1ce4){return db['UserChatQueue'][_0x19a2('0x77')]({'where':{'UserId':_0x6f1ce4['id'],'ChatQueueId':_0x219957[_0x19a2('0x57')]['id']},'transaction':_0x241db7});});})[_0x19a2('0x34')](function(){_0xe6876b[_0x19a2('0x78')](function(_0x3bb7b0){socket[_0x19a2('0x79')](_0x19a2('0x7a'),{'UserId':_0x3bb7b0['id'],'ChatQueueId':_0x72d337['id']});});});});});}})[_0x19a2('0x34')](respondWithStatusCode(_0x382dcf,null))[_0x19a2('0x27')](handleError(_0x382dcf,null));};exports[_0x19a2('0x7b')]=function(_0x1f1de8,_0x39f30c,_0x4f5e9a){return db[_0x19a2('0x6e')][_0x19a2('0x71')]({'where':{'id':_0x1f1de8[_0x19a2('0x43')]['ids']},'attributes':['id'],'include':[{'model':db[_0x19a2('0x66')],'as':_0x19a2('0x72'),'attributes':['id'],'raw':!![]}]})[_0x19a2('0x34')](handleEntityNotFound(_0x39f30c,null))[_0x19a2('0x34')](function(_0x31344e){var _0x3e584a=_['map'](_0x31344e,'id');var _0x20f5bb=[];var _0x1c14b7=[];var _0xe5836c=squel[_0x19a2('0x7c')]();_0xe5836c[_0x19a2('0x7d')](_0x19a2('0x7e'))[_0x19a2('0x7f')](_0x19a2('0x80'),'tq')[_0x19a2('0x81')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x19a2('0x4d')](_0x19a2('0x82'),_0x1f1de8['params']['id']);for(var _0x6e5519=0x0;_0x6e5519<_0x31344e['length'];_0x6e5519+=0x1){let _0x404683=_0x31344e[_0x6e5519];for(var _0x5c9ec0=0x0;_0x5c9ec0<_0x404683[_0x19a2('0x72')][_0x19a2('0x49')];_0x5c9ec0+=0x1){let _0x63c4c7=_0x404683[_0x19a2('0x72')][_0x5c9ec0];var _0x105133=_0xe5836c[_0x19a2('0x83')]();_0x105133['where']('ut.UserId\x20=\x20?',_0x63c4c7['id']);_0x1c14b7['push'](db[_0x19a2('0x74')][_0x19a2('0x43')](_0x105133[_0x19a2('0x84')](),{'type':db[_0x19a2('0x74')][_0x19a2('0x85')][_0x19a2('0x86')]})[_0x19a2('0x34')](function(_0x2a23f3){if(_0x2a23f3['length']===0x1){return _0x63c4c7['id'];}else{var _0x5491e9=_['every'](_[_0x19a2('0x3e')](_0x2a23f3,_0x19a2('0x87')),function(_0x5ca18d){return _['includes'](_0x3e584a,_0x5ca18d);});if(_0x5491e9){return _0x63c4c7['id'];}}}));}}return BPromise[_0x19a2('0x88')](_0x1c14b7)[_0x19a2('0x34')](function(_0x3892af){_0x20f5bb=_(_0x20f5bb)[_0x19a2('0x89')](_0x3892af)['compact']()[_0x19a2('0x8a')]();return db[_0x19a2('0x52')][_0x19a2('0x58')]({'where':{'id':_0x1f1de8['params']['id']}})['then'](function(_0x13ca6c){return db[_0x19a2('0x74')][_0x19a2('0x75')](function(_0x44d833){return _0x13ca6c['removeTeams'](_0x1f1de8[_0x19a2('0x43')]['ids'],{'transaction':_0x44d833})[_0x19a2('0x34')](function(){if(!_[_0x19a2('0x8b')](_0x20f5bb)){return _0x13ca6c[_0x19a2('0x8c')](_0x20f5bb,{'transaction':_0x44d833});}})[_0x19a2('0x34')](function(){_0x20f5bb[_0x19a2('0x78')](function(_0x387a4a){socket['emit'](_0x19a2('0x8d'),{'UserId':_0x387a4a,'ChatQueueId':_0x13ca6c['id']});});});});});});})[_0x19a2('0x34')](respondWithStatusCode(_0x39f30c,null))[_0x19a2('0x27')](handleError(_0x39f30c,null));};exports[_0x19a2('0x8e')]=function(_0x4146e2,_0x4ea9ee,_0x230f17){return db['ChatQueue'][_0x19a2('0x58')]({'where':{'id':_0x4146e2[_0x19a2('0x57')]['id']}})[_0x19a2('0x34')](handleEntityNotFound(_0x4ea9ee,null))[_0x19a2('0x34')](function(_0x33bb7d){if(_0x33bb7d){return _0x33bb7d['addAgents'](_0x4146e2[_0x19a2('0x60')][_0x19a2('0x70')],_[_0x19a2('0x8f')](_0x4146e2[_0x19a2('0x60')],[_0x19a2('0x70'),'id'])||{})[_0x19a2('0x90')](function(_0x5be906){for(var _0x1ffce1=0x0;_0x1ffce1<_0x4146e2['body'][_0x19a2('0x70')]['length'];_0x1ffce1+=0x1){socket[_0x19a2('0x79')](_0x19a2('0x7a'),{'UserId':Number(_0x4146e2[_0x19a2('0x60')][_0x19a2('0x70')][_0x1ffce1]),'ChatQueueId':Number(_0x4146e2[_0x19a2('0x57')]['id'])});}return _0x5be906;});}})['then'](respondWithResult(_0x4ea9ee,null))['catch'](handleError(_0x4ea9ee,null));};exports[_0x19a2('0x8c')]=function(_0x475aed,_0x4713c0,_0x589fd0){return db['ChatQueue']['find']({'where':{'id':_0x475aed[_0x19a2('0x57')]['id']}})[_0x19a2('0x34')](handleEntityNotFound(_0x4713c0,null))['then'](function(_0x25afc9){if(_0x25afc9){return _0x25afc9[_0x19a2('0x8c')](_0x475aed[_0x19a2('0x43')][_0x19a2('0x70')])[_0x19a2('0x34')](function(){if(_[_0x19a2('0x91')](_0x475aed[_0x19a2('0x43')][_0x19a2('0x70')])){for(var _0x3d2f5e=0x0;_0x3d2f5e<_0x475aed[_0x19a2('0x43')][_0x19a2('0x70')]['length'];_0x3d2f5e+=0x1){socket[_0x19a2('0x79')]('userChatQueue:remove',{'UserId':Number(_0x475aed[_0x19a2('0x43')][_0x19a2('0x70')][_0x3d2f5e]),'ChatQueueId':Number(_0x475aed['params']['id'])});}}else{socket[_0x19a2('0x79')](_0x19a2('0x8d'),{'UserId':Number(_0x475aed[_0x19a2('0x43')]['ids']),'ChatQueueId':Number(_0x475aed[_0x19a2('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x4713c0,null))['catch'](handleError(_0x4713c0,null));};exports[_0x19a2('0x92')]=function(_0x235aba,_0x21dcf0,_0x322821){var _0x33279f={};var _0x361dc6={};var _0x2c8683;var _0x3730d3;return db[_0x19a2('0x52')][_0x19a2('0x6d')]({'where':{'id':_0x235aba[_0x19a2('0x57')]['id']}})[_0x19a2('0x34')](handleEntityNotFound(_0x21dcf0,null))[_0x19a2('0x34')](function(_0x861e6c){if(_0x861e6c){_0x2c8683=_0x861e6c;_0x361dc6[_0x19a2('0x42')]=_[_0x19a2('0x44')](db[_0x19a2('0x66')]['rawAttributes']);_0x361dc6[_0x19a2('0x43')]=_[_0x19a2('0x44')](_0x235aba[_0x19a2('0x43')]);_0x361dc6[_0x19a2('0x45')]=_[_0x19a2('0x46')](_0x361dc6[_0x19a2('0x42')],_0x361dc6['query']);_0x33279f[_0x19a2('0x47')]=_[_0x19a2('0x46')](_0x361dc6[_0x19a2('0x42')],qs[_0x19a2('0x48')](_0x235aba[_0x19a2('0x43')]['fields']));_0x33279f[_0x19a2('0x47')]=_0x33279f['attributes']['length']?_0x33279f[_0x19a2('0x47')]:_0x361dc6[_0x19a2('0x42')];_0x33279f['order']=qs[_0x19a2('0x4c')](_0x235aba['query'][_0x19a2('0x4c')]);_0x33279f['where']=qs[_0x19a2('0x45')](_[_0x19a2('0x4e')](_0x235aba[_0x19a2('0x43')],_0x361dc6[_0x19a2('0x45')]));if(_0x235aba['query'][_0x19a2('0x4f')]){_0x33279f[_0x19a2('0x4d')]=_['merge'](_0x33279f[_0x19a2('0x4d')],{'$or':_['map'](_0x33279f[_0x19a2('0x47')],function(_0x22c6b8){var _0x44157a={};_0x44157a[_0x22c6b8]={'$like':'%'+_0x235aba['query'][_0x19a2('0x4f')]+'%'};return _0x44157a;})});}_0x33279f=_[_0x19a2('0x50')]({},_0x33279f,_0x235aba['options']);return _0x2c8683[_0x19a2('0x92')](_0x33279f);}})[_0x19a2('0x34')](function(_0x170f5a){if(_0x170f5a){_0x3730d3=_0x170f5a[_0x19a2('0x49')];if(!_0x235aba[_0x19a2('0x43')]['hasOwnProperty'](_0x19a2('0x4a'))){_0x33279f[_0x19a2('0x2b')]=qs[_0x19a2('0x2b')](_0x235aba[_0x19a2('0x43')][_0x19a2('0x2b')]);_0x33279f[_0x19a2('0x2e')]=qs['offset'](_0x235aba[_0x19a2('0x43')][_0x19a2('0x2e')]);}return _0x2c8683[_0x19a2('0x92')](_0x33279f);}})[_0x19a2('0x34')](function(_0x11c1a5){if(_0x11c1a5){return _0x11c1a5?{'count':_0x3730d3,'rows':_0x11c1a5}:null;}})[_0x19a2('0x34')](respondWithResult(_0x21dcf0,null))[_0x19a2('0x27')](handleError(_0x21dcf0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 96186ed..f0ca3b8 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 _0x05c2=['update','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x05c2,0x174));var _0x205c=function(_0xaf3b1a,_0x8a3a33){_0xaf3b1a=_0xaf3b1a-0x0;var _0x1aeaae=_0x05c2[_0xaf3b1a];return _0x1aeaae;};'use strict';var EventEmitter=require(_0x205c('0x0'));var ChatQueue=require(_0x205c('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x205c('0x2')](0x0);var events={'afterCreate':_0x205c('0x3'),'afterUpdate':_0x205c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x200cb3){return function(_0x3ac35e,_0x1a34fc,_0xa6a803){ChatQueueEvents[_0x205c('0x5')](_0x200cb3+':'+_0x3ac35e['id'],_0x3ac35e);ChatQueueEvents[_0x205c('0x5')](_0x200cb3,_0x3ac35e);_0xa6a803(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x205c('0x6')](e,emitEvent(event));}}module[_0x205c('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xf8fa=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue'];(function(_0x3fe77c,_0xb71097){var _0x1be0cb=function(_0x14ea84){while(--_0x14ea84){_0x3fe77c['push'](_0x3fe77c['shift']());}};_0x1be0cb(++_0xb71097);}(_0xf8fa,0x1ec));var _0xaf8f=function(_0x4d8524,_0x1e8925){_0x4d8524=_0x4d8524-0x0;var _0xbdb413=_0xf8fa[_0x4d8524];return _0xbdb413;};'use strict';var EventEmitter=require(_0xaf8f('0x0'));var ChatQueue=require(_0xaf8f('0x1'))['db'][_0xaf8f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaf8f('0x3')](0x0);var events={'afterCreate':_0xaf8f('0x4'),'afterUpdate':'update','afterDestroy':_0xaf8f('0x5')};function emitEvent(_0x339b84){return function(_0x2ac6ff,_0x34d773,_0x15d05f){ChatQueueEvents[_0xaf8f('0x6')](_0x339b84+':'+_0x2ac6ff['id'],_0x2ac6ff);ChatQueueEvents['emit'](_0x339b84,_0x2ac6ff);_0x15d05f(null);};}for(var e in events){if(events[_0xaf8f('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xaf8f('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 63425c2..d30904b 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 _0xb9a7=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','ChatQueue','chat_queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9a7,0x96));var _0x7b9a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xb9a7[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x7b9a('0x0'));var util=require('util');var logger=require(_0x7b9a('0x1'))(_0x7b9a('0x2'));var moment=require(_0x7b9a('0x3'));var BPromise=require('bluebird');var rp=require(_0x7b9a('0x4'));var fs=require('fs');var path=require(_0x7b9a('0x5'));var rimraf=require(_0x7b9a('0x6'));var config=require(_0x7b9a('0x7'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0xd49b0,_0x31574b){return _0xd49b0['define'](_0x7b9a('0x8'),attributes,{'tableName':_0x7b9a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x77f5=['moment','bluebird','path','exports','define','ChatQueue','chat_queues','../../config/logger','api'];(function(_0x5cc203,_0x229868){var _0x13cdf5=function(_0x38f94e){while(--_0x38f94e){_0x5cc203['push'](_0x5cc203['shift']());}};_0x13cdf5(++_0x229868);}(_0x77f5,0x154));var _0x577f=function(_0x473b3a,_0x4889de){_0x473b3a=_0x473b3a-0x0;var _0x557b97=_0x77f5[_0x473b3a];return _0x557b97;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x577f('0x0'))(_0x577f('0x1'));var moment=require(_0x577f('0x2'));var BPromise=require(_0x577f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x577f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x577f('0x5')]=function(_0x2eb541,_0x2e86e8){return _0x2eb541[_0x577f('0x6')](_0x577f('0x7'),attributes,{'tableName':_0x577f('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 ac56618..632100f 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 _0x98d4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','ChatQueue','findAll','options','where','attributes','limit','include','model','map','GetChatQueue','stringify','ShowChatQueue','find','raw','lodash'];(function(_0x528651,_0x85fecd){var _0x425450=function(_0x438f0d){while(--_0x438f0d){_0x528651['push'](_0x528651['shift']());}};_0x425450(++_0x85fecd);}(_0x98d4,0xa3));var _0x498d=function(_0x1b6ce0,_0x23dd4d){_0x1b6ce0=_0x1b6ce0-0x0;var _0x4d724f=_0x98d4[_0x1b6ce0];return _0x4d724f;};'use strict';var _=require(_0x498d('0x0'));var util=require(_0x498d('0x1'));var moment=require(_0x498d('0x2'));var BPromise=require(_0x498d('0x3'));var rs=require(_0x498d('0x4'));var fs=require('fs');var Redis=require(_0x498d('0x5'));var db=require(_0x498d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x498d('0x7'))(_0x498d('0x8'));var config=require('../../config/environment');var jayson=require(_0x498d('0x9'));var client=jayson[_0x498d('0xa')][_0x498d('0xb')]({'port':0x232a});config[_0x498d('0xc')]=_[_0x498d('0xd')](config[_0x498d('0xc')],{'host':_0x498d('0xe'),'port':0x18eb});var socket=require(_0x498d('0xf'))(new Redis(config[_0x498d('0xc')]));require(_0x498d('0x10'))[_0x498d('0x11')](socket);function respondWithRpcPromise(_0x2763bf,_0x42e4d0,_0x4db366){return new BPromise(function(_0x23b8d0,_0x33c956){return client[_0x498d('0x12')](_0x2763bf,_0x4db366)[_0x498d('0x13')](function(_0x54c8c1){logger[_0x498d('0x14')](_0x498d('0x15'),_0x42e4d0,'request\x20sent');logger[_0x498d('0x16')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x42e4d0,_0x498d('0x17'),JSON['stringify'](_0x54c8c1));if(_0x54c8c1[_0x498d('0x18')]){if(_0x54c8c1['error']['code']===0x1f4){logger[_0x498d('0x18')](_0x498d('0x15'),_0x42e4d0,_0x54c8c1[_0x498d('0x18')][_0x498d('0x19')]);return _0x33c956(_0x54c8c1['error'][_0x498d('0x19')]);}logger[_0x498d('0x18')](_0x498d('0x15'),_0x42e4d0,_0x54c8c1[_0x498d('0x18')][_0x498d('0x19')]);return _0x23b8d0(_0x54c8c1[_0x498d('0x18')][_0x498d('0x19')]);}else{logger[_0x498d('0x14')](_0x498d('0x15'),_0x42e4d0,_0x498d('0x17'));_0x23b8d0(_0x54c8c1['result'][_0x498d('0x19')]);}})[_0x498d('0x1a')](function(_0x16ed1e){logger[_0x498d('0x18')](_0x498d('0x15'),_0x42e4d0,_0x16ed1e);_0x33c956(_0x16ed1e);});});}exports['GetChatQueue']=function(_0x421fbe){var _0x22e393=this;return new Promise(function(_0x4f04db,_0x2a820c){return db[_0x498d('0x1b')][_0x498d('0x1c')]({'raw':_0x421fbe[_0x498d('0x1d')]?_0x421fbe[_0x498d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x421fbe[_0x498d('0x1d')]?_0x421fbe['options'][_0x498d('0x1e')]||null:null,'attributes':_0x421fbe[_0x498d('0x1d')]?_0x421fbe[_0x498d('0x1d')][_0x498d('0x1f')]||null:null,'limit':_0x421fbe[_0x498d('0x1d')]?_0x421fbe[_0x498d('0x1d')][_0x498d('0x20')]||null:null,'include':_0x421fbe[_0x498d('0x1d')]?_0x421fbe[_0x498d('0x1d')][_0x498d('0x21')]?_['map'](_0x421fbe['options'][_0x498d('0x21')],function(_0x2656a2){return{'model':db[_0x2656a2[_0x498d('0x22')]],'as':_0x2656a2['as'],'attributes':_0x2656a2[_0x498d('0x1f')],'include':_0x2656a2[_0x498d('0x21')]?_[_0x498d('0x23')](_0x2656a2['include'],function(_0x2d590a){return{'model':db[_0x2d590a[_0x498d('0x22')]],'as':_0x2d590a['as'],'attributes':_0x2d590a[_0x498d('0x1f')],'include':_0x2d590a['include']?_[_0x498d('0x23')](_0x2d590a[_0x498d('0x21')],function(_0x257b59){return{'model':db[_0x257b59[_0x498d('0x22')]],'as':_0x257b59['as'],'attributes':_0x257b59[_0x498d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b75a2){logger[_0x498d('0x14')](_0x498d('0x24'),_0x421fbe);logger[_0x498d('0x16')]('GetChatQueue',_0x421fbe,JSON[_0x498d('0x25')](_0x1b75a2));_0x4f04db(_0x1b75a2);})[_0x498d('0x1a')](function(_0x277734){logger[_0x498d('0x18')]('GetChatQueue',_0x277734[_0x498d('0x19')],_0x421fbe);_0x2a820c(_0x22e393[_0x498d('0x18')](0x1f4,_0x277734['message']));});});};exports[_0x498d('0x26')]=function(_0x321296){var _0x41b9af=this;return new Promise(function(_0x492bb1,_0x360cfc){return db[_0x498d('0x1b')][_0x498d('0x27')]({'raw':_0x321296['options']?_0x321296[_0x498d('0x1d')][_0x498d('0x28')]===undefined?!![]:![]:!![],'where':_0x321296[_0x498d('0x1d')]?_0x321296[_0x498d('0x1d')][_0x498d('0x1e')]||null:null,'attributes':_0x321296[_0x498d('0x1d')]?_0x321296[_0x498d('0x1d')][_0x498d('0x1f')]||null:null,'include':_0x321296['options']?_0x321296[_0x498d('0x1d')][_0x498d('0x21')]?_[_0x498d('0x23')](_0x321296['options'][_0x498d('0x21')],function(_0x5be43b){return{'model':db[_0x5be43b[_0x498d('0x22')]],'as':_0x5be43b['as'],'attributes':_0x5be43b[_0x498d('0x1f')],'include':_0x5be43b[_0x498d('0x21')]?_['map'](_0x5be43b[_0x498d('0x21')],function(_0x5d8e48){return{'model':db[_0x5d8e48[_0x498d('0x22')]],'as':_0x5d8e48['as'],'attributes':_0x5d8e48[_0x498d('0x1f')],'include':_0x5d8e48[_0x498d('0x21')]?_[_0x498d('0x23')](_0x5d8e48['include'],function(_0x19ea2c){return{'model':db[_0x19ea2c[_0x498d('0x22')]],'as':_0x19ea2c['as'],'attributes':_0x19ea2c['attributes']};}):[]};}):[]};}):[]:[]})[_0x498d('0x13')](function(_0x3df946){logger[_0x498d('0x14')](_0x498d('0x26'),_0x321296);logger[_0x498d('0x16')]('ShowChatQueue',_0x321296,JSON[_0x498d('0x25')](_0x3df946));_0x492bb1(_0x3df946);})['catch'](function(_0x2492c3){logger[_0x498d('0x18')](_0x498d('0x26'),_0x2492c3['message'],_0x321296);_0x360cfc(_0x41b9af[_0x498d('0x18')](0x1f4,_0x2492c3[_0x498d('0x19')]));});});};
\ No newline at end of file
+var _0xdb2b=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ChatQueue','findAll','options','raw','include','attributes','map','model','then','catch','GetChatQueue','ShowChatQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0xdb2b,0xa2));var _0xbdb2=function(_0x137ef8,_0x3384dc){_0x137ef8=_0x137ef8-0x0;var _0x3b7d28=_0xdb2b[_0x137ef8];return _0x3b7d28;};'use strict';var _=require(_0xbdb2('0x0'));var util=require('util');var moment=require(_0xbdb2('0x1'));var BPromise=require(_0xbdb2('0x2'));var rs=require(_0xbdb2('0x3'));var fs=require('fs');var Redis=require(_0xbdb2('0x4'));var db=require(_0xbdb2('0x5'))['db'];var utils=require(_0xbdb2('0x6'));var logger=require(_0xbdb2('0x7'))(_0xbdb2('0x8'));var config=require(_0xbdb2('0x9'));var jayson=require(_0xbdb2('0xa'));var client=jayson[_0xbdb2('0xb')][_0xbdb2('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbdb2('0xd')],{'host':_0xbdb2('0xe'),'port':0x18eb});var socket=require(_0xbdb2('0xf'))(new Redis(config[_0xbdb2('0xd')]));require(_0xbdb2('0x10'))[_0xbdb2('0x11')](socket);function respondWithRpcPromise(_0x4cbf3b,_0xeae40,_0x4582bf){return new BPromise(function(_0x493c97,_0x209b90){return client[_0xbdb2('0x12')](_0x4cbf3b,_0x4582bf)['then'](function(_0x3fcedd){logger[_0xbdb2('0x13')](_0xbdb2('0x14'),_0xeae40,'request\x20sent');logger[_0xbdb2('0x15')](_0xbdb2('0x16'),_0xeae40,_0xbdb2('0x17'),JSON[_0xbdb2('0x18')](_0x3fcedd));if(_0x3fcedd['error']){if(_0x3fcedd[_0xbdb2('0x19')][_0xbdb2('0x1a')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0xeae40,_0x3fcedd[_0xbdb2('0x19')][_0xbdb2('0x1b')]);return _0x209b90(_0x3fcedd[_0xbdb2('0x19')][_0xbdb2('0x1b')]);}logger[_0xbdb2('0x19')](_0xbdb2('0x14'),_0xeae40,_0x3fcedd[_0xbdb2('0x19')][_0xbdb2('0x1b')]);return _0x493c97(_0x3fcedd['error'][_0xbdb2('0x1b')]);}else{logger['info'](_0xbdb2('0x14'),_0xeae40,_0xbdb2('0x17'));_0x493c97(_0x3fcedd[_0xbdb2('0x1c')]['message']);}})['catch'](function(_0xd912eb){logger[_0xbdb2('0x19')]('ChatQueue,\x20%s,\x20%s',_0xeae40,_0xd912eb);_0x209b90(_0xd912eb);});});}exports['GetChatQueue']=function(_0x59ac40){var _0x2bb1ed=this;return new Promise(function(_0x20a754,_0x3a9629){return db[_0xbdb2('0x1d')][_0xbdb2('0x1e')]({'raw':_0x59ac40[_0xbdb2('0x1f')]?_0x59ac40['options'][_0xbdb2('0x20')]===undefined?!![]:![]:!![],'where':_0x59ac40['options']?_0x59ac40[_0xbdb2('0x1f')]['where']||null:null,'attributes':_0x59ac40[_0xbdb2('0x1f')]?_0x59ac40[_0xbdb2('0x1f')]['attributes']||null:null,'limit':_0x59ac40[_0xbdb2('0x1f')]?_0x59ac40[_0xbdb2('0x1f')]['limit']||null:null,'include':_0x59ac40[_0xbdb2('0x1f')]?_0x59ac40[_0xbdb2('0x1f')][_0xbdb2('0x21')]?_['map'](_0x59ac40['options'][_0xbdb2('0x21')],function(_0x386af6){return{'model':db[_0x386af6['model']],'as':_0x386af6['as'],'attributes':_0x386af6[_0xbdb2('0x22')],'include':_0x386af6[_0xbdb2('0x21')]?_['map'](_0x386af6['include'],function(_0x4bb221){return{'model':db[_0x4bb221['model']],'as':_0x4bb221['as'],'attributes':_0x4bb221['attributes'],'include':_0x4bb221[_0xbdb2('0x21')]?_[_0xbdb2('0x23')](_0x4bb221[_0xbdb2('0x21')],function(_0x49aace){return{'model':db[_0x49aace[_0xbdb2('0x24')]],'as':_0x49aace['as'],'attributes':_0x49aace[_0xbdb2('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbdb2('0x25')](function(_0x3c3bae){logger['info']('GetChatQueue',_0x59ac40);logger['debug']('GetChatQueue',_0x59ac40,JSON[_0xbdb2('0x18')](_0x3c3bae));_0x20a754(_0x3c3bae);})[_0xbdb2('0x26')](function(_0xcc2e74){logger[_0xbdb2('0x19')](_0xbdb2('0x27'),_0xcc2e74[_0xbdb2('0x1b')],_0x59ac40);_0x3a9629(_0x2bb1ed['error'](0x1f4,_0xcc2e74['message']));});});};exports[_0xbdb2('0x28')]=function(_0x13ad0e){var _0x41c264=this;return new Promise(function(_0x2d8969,_0x58a686){return db[_0xbdb2('0x1d')][_0xbdb2('0x29')]({'raw':_0x13ad0e[_0xbdb2('0x1f')]?_0x13ad0e[_0xbdb2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x13ad0e[_0xbdb2('0x1f')]?_0x13ad0e[_0xbdb2('0x1f')][_0xbdb2('0x2a')]||null:null,'attributes':_0x13ad0e[_0xbdb2('0x1f')]?_0x13ad0e[_0xbdb2('0x1f')][_0xbdb2('0x22')]||null:null,'include':_0x13ad0e[_0xbdb2('0x1f')]?_0x13ad0e['options'][_0xbdb2('0x21')]?_['map'](_0x13ad0e[_0xbdb2('0x1f')][_0xbdb2('0x21')],function(_0x3ccdec){return{'model':db[_0x3ccdec[_0xbdb2('0x24')]],'as':_0x3ccdec['as'],'attributes':_0x3ccdec[_0xbdb2('0x22')],'include':_0x3ccdec[_0xbdb2('0x21')]?_['map'](_0x3ccdec[_0xbdb2('0x21')],function(_0xc53a09){return{'model':db[_0xc53a09[_0xbdb2('0x24')]],'as':_0xc53a09['as'],'attributes':_0xc53a09['attributes'],'include':_0xc53a09['include']?_[_0xbdb2('0x23')](_0xc53a09[_0xbdb2('0x21')],function(_0x58b83c){return{'model':db[_0x58b83c[_0xbdb2('0x24')]],'as':_0x58b83c['as'],'attributes':_0x58b83c[_0xbdb2('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbdb2('0x25')](function(_0x364290){logger['info']('ShowChatQueue',_0x13ad0e);logger[_0xbdb2('0x15')](_0xbdb2('0x28'),_0x13ad0e,JSON['stringify'](_0x364290));_0x2d8969(_0x364290);})[_0xbdb2('0x26')](function(_0x36e957){logger[_0xbdb2('0x19')](_0xbdb2('0x28'),_0x36e957['message'],_0x13ad0e);_0x58a686(_0x41c264[_0xbdb2('0x19')](0x1f4,_0x36e957[_0xbdb2('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 5929468..8218e1e 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 _0x9c44=['emit','removeListener','length','chatQueue:','remove','update'];(function(_0xe2a8ca,_0x16c7c5){var _0x40ea0d=function(_0x2666d8){while(--_0x2666d8){_0xe2a8ca['push'](_0xe2a8ca['shift']());}};_0x40ea0d(++_0x16c7c5);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){ChatQueueEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);ChatQueueEvents['on'](_0x436234,_0x511d53);}};
\ No newline at end of file
+var _0x4b19=['remove','update','emit','removeListener','register','chatQueue:','./chatQueue.events'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0x4b19,0x195));var _0x94b1=function(_0x12e32a,_0x27eb0a){_0x12e32a=_0x12e32a-0x0;var _0xb907ba=_0x4b19[_0x12e32a];return _0xb907ba;};'use strict';var ChatQueueEvents=require(_0x94b1('0x0'));var events=['save',_0x94b1('0x1'),_0x94b1('0x2')];function createListener(_0x221ab3,_0x577f52){return function(_0x1ffdb7){_0x577f52[_0x94b1('0x3')](_0x221ab3,_0x1ffdb7);};}function removeListener(_0x2240b9,_0x4f607f){return function(){ChatQueueEvents[_0x94b1('0x4')](_0x2240b9,_0x4f607f);};}exports[_0x94b1('0x5')]=function(_0x52d6c1){for(var _0x24df76=0x0,_0x110a52=events['length'];_0x24df76<_0x110a52;_0x24df76++){var _0x40c69c=events[_0x24df76];var _0x201a02=createListener(_0x94b1('0x6')+_0x40c69c,_0x52d6c1);ChatQueueEvents['on'](_0x40c69c,_0x201a02);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index f35201f..321587d 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(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x5fc3[_0x5bd426];return _0x23a7eb;};'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 _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(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x5fc3,0xa8));var _0x35fc=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0x5fc3[_0x409deb];return _0x15a4f7;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 48aa493..419f998 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 _0x2353=['STRING','DATE','moment'];(function(_0xd7f799,_0x749051){var _0x587c44=function(_0x466581){while(--_0x466581){_0xd7f799['push'](_0xd7f799['shift']());}};_0x587c44(++_0x749051);}(_0x2353,0xe3));var _0x3235=function(_0x519a4b,_0x1dac0a){_0x519a4b=_0x519a4b-0x0;var _0x17c925=_0x2353[_0x519a4b];return _0x17c925;};'use strict';var moment=require(_0x3235('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3235('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x3235('0x1')]},'joinAt':{'type':Sequelize[_0x3235('0x2')]},'leaveAt':{'type':Sequelize[_0x3235('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3235('0x2')]},'reason':{'type':Sequelize[_0x3235('0x1')]}};
\ No newline at end of file
+var _0x1672=['sequelize','exports','STRING','DATE','moment'];(function(_0x167516,_0x24d7ff){var _0x177343=function(_0x35d192){while(--_0x35d192){_0x167516['push'](_0x167516['shift']());}};_0x177343(++_0x24d7ff);}(_0x1672,0x121));var _0x2167=function(_0x57a8f,_0x490836){_0x57a8f=_0x57a8f-0x0;var _0x3d67aa=_0x1672[_0x57a8f];return _0x3d67aa;};'use strict';var moment=require(_0x2167('0x0'));var Sequelize=require(_0x2167('0x1'));module[_0x2167('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2167('0x3')]},'joinAt':{'type':Sequelize[_0x2167('0x4')]},'leaveAt':{'type':Sequelize[_0x2167('0x4')]},'acceptAt':{'type':Sequelize[_0x2167('0x4')]},'exitAt':{'type':Sequelize[_0x2167('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9dd8062..e9ee5e2 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 _0x869e=['undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','ChatQueueReport','includeAll','findAll','catch','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x869e,0x15c));var _0xe869=function(_0x9bb804,_0x47d494){_0x9bb804=_0x9bb804-0x0;var _0x2f6536=_0x869e[_0x9bb804];return _0x2f6536;};'use strict';var emlformat=require(_0xe869('0x0'));var rimraf=require(_0xe869('0x1'));var zipdir=require(_0xe869('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe869('0x3'));var moment=require(_0xe869('0x4'));var BPromise=require(_0xe869('0x5'));var Mustache=require(_0xe869('0x6'));var util=require(_0xe869('0x7'));var path=require('path');var sox=require(_0xe869('0x8'));var csv=require(_0xe869('0x9'));var ejs=require(_0xe869('0xa'));var fs=require('fs');var fs_extra=require(_0xe869('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe869('0xc'));var jsforce=require(_0xe869('0xd'));var deskjs=require(_0xe869('0xe'));var toCsv=require(_0xe869('0x9'));var querystring=require(_0xe869('0xf'));var Papa=require(_0xe869('0x10'));var Redis=require(_0xe869('0x11'));var authService=require(_0xe869('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe869('0x13'));var logger=require(_0xe869('0x14'))(_0xe869('0x15'));var utils=require(_0xe869('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe869('0x17'))['db'];function respondWithStatusCode(_0x5a5197,_0x907d3f){_0x907d3f=_0x907d3f||0xcc;return function(_0x412429){if(_0x412429){return _0x5a5197['sendStatus'](_0x907d3f);}return _0x5a5197[_0xe869('0x18')](_0x907d3f)[_0xe869('0x19')]();};}function respondWithResult(_0x3239d1,_0x17ee8f){_0x17ee8f=_0x17ee8f||0xc8;return function(_0x4046e4){if(_0x4046e4){return _0x3239d1['status'](_0x17ee8f)['json'](_0x4046e4);}};}function respondWithFilteredResult(_0x52fd40,_0x262f2f){return function(_0x4ed173){if(_0x4ed173){var _0x201091=typeof _0x262f2f[_0xe869('0x1a')]===_0xe869('0x1b')&&typeof _0x262f2f['limit']===_0xe869('0x1b');var _0x10f5e1=_0x4ed173['count'];var _0x33f5a7=_0x201091?0x0:_0x262f2f['offset'];var _0x26c67c=_0x201091?_0x4ed173[_0xe869('0x1c')]:_0x262f2f['offset']+_0x262f2f['limit'];var _0x40692c;if(_0x26c67c>=_0x10f5e1){_0x26c67c=_0x10f5e1;_0x40692c=0xc8;}else{_0x40692c=0xce;}_0x52fd40['status'](_0x40692c);return _0x52fd40[_0xe869('0x1d')](_0xe869('0x1e'),_0x33f5a7+'-'+_0x26c67c+'/'+_0x10f5e1)[_0xe869('0x1f')](_0x4ed173);}return null;};}function patchUpdates(_0x3e8c47){return function(_0x171c18){try{jsonpatch[_0xe869('0x20')](_0x171c18,_0x3e8c47,!![]);}catch(_0xa13c53){return BPromise[_0xe869('0x21')](_0xa13c53);}return _0x171c18[_0xe869('0x22')]();};}function saveUpdates(_0x10de1e,_0x59e73f){return function(_0x1a30e8){if(_0x1a30e8){return _0x1a30e8[_0xe869('0x23')](_0x10de1e)[_0xe869('0x24')](function(_0x342640){return _0x342640;});}return null;};}function removeEntity(_0x9c22cd,_0x4ddc31){return function(_0x429301){if(_0x429301){return _0x429301[_0xe869('0x25')]()[_0xe869('0x24')](function(){_0x9c22cd[_0xe869('0x18')](0xcc)[_0xe869('0x19')]();});}};}function handleEntityNotFound(_0x42320b,_0x311be8){return function(_0x44efa3){if(!_0x44efa3){_0x42320b[_0xe869('0x26')](0x194);}return _0x44efa3;};}function handleError(_0x30df68,_0x2775bc){_0x2775bc=_0x2775bc||0x1f4;return function(_0x31fec7){logger[_0xe869('0x27')](_0x31fec7['stack']);if(_0x31fec7[_0xe869('0x28')]){delete _0x31fec7[_0xe869('0x28')];}_0x30df68[_0xe869('0x18')](_0x2775bc)[_0xe869('0x29')](_0x31fec7);};}exports[_0xe869('0x2a')]=function(_0x22a823,_0x4f0e7f){var _0x367969={},_0x3f3574={},_0x57e22c={'count':0x0,'rows':[]};var _0x558c32=_[_0xe869('0x2b')](db['ChatQueueReport'][_0xe869('0x2c')],function(_0x4ed370){return{'name':_0x4ed370['fieldName'],'type':_0x4ed370[_0xe869('0x2d')][_0xe869('0x2e')]};});_0x3f3574[_0xe869('0x2f')]=_['map'](_0x558c32,_0xe869('0x28'));_0x3f3574['query']=_[_0xe869('0x30')](_0x22a823[_0xe869('0x31')]);_0x3f3574[_0xe869('0x32')]=_[_0xe869('0x33')](_0x3f3574[_0xe869('0x2f')],_0x3f3574[_0xe869('0x31')]);_0x367969[_0xe869('0x34')]=_['intersection'](_0x3f3574[_0xe869('0x2f')],qs[_0xe869('0x35')](_0x22a823[_0xe869('0x31')]['fields']));_0x367969['attributes']=_0x367969[_0xe869('0x34')]['length']?_0x367969['attributes']:_0x3f3574[_0xe869('0x2f')];if(!_0x22a823[_0xe869('0x31')]['hasOwnProperty'](_0xe869('0x36'))){_0x367969[_0xe869('0x37')]=qs[_0xe869('0x37')](_0x22a823[_0xe869('0x31')]['limit']);_0x367969[_0xe869('0x1a')]=qs[_0xe869('0x1a')](_0x22a823[_0xe869('0x31')]['offset']);}_0x367969[_0xe869('0x38')]=qs[_0xe869('0x39')](_0x22a823['query'][_0xe869('0x39')]);_0x367969[_0xe869('0x3a')]=qs['filters'](_[_0xe869('0x3b')](_0x22a823['query'],_0x3f3574[_0xe869('0x32')]),_0x558c32);if(_0x22a823[_0xe869('0x31')]['filter']){_0x367969[_0xe869('0x3a')]=_[_0xe869('0x3c')](_0x367969[_0xe869('0x3a')],{'$or':_[_0xe869('0x2b')](_0x558c32,function(_0x15502e){if(_0x15502e['type']!==_0xe869('0x3d')){var _0xee8898={};_0xee8898[_0x15502e[_0xe869('0x28')]]={'$like':'%'+_0x22a823['query'][_0xe869('0x3e')]+'%'};return _0xee8898;}})});}_0x367969=_[_0xe869('0x3c')]({},_0x367969,_0x22a823[_0xe869('0x3f')]);var _0x3bf052={'where':_0x367969[_0xe869('0x3a')]};return db[_0xe869('0x40')]['count'](_0x3bf052)[_0xe869('0x24')](function(_0x3352a7){_0x57e22c[_0xe869('0x1c')]=_0x3352a7;if(_0x22a823['query'][_0xe869('0x41')]){_0x367969['include']=[{'all':!![]}];}return db[_0xe869('0x40')][_0xe869('0x42')](_0x367969);})[_0xe869('0x24')](function(_0x14398a){_0x57e22c['rows']=_0x14398a;return _0x57e22c;})[_0xe869('0x24')](respondWithFilteredResult(_0x4f0e7f,_0x367969))[_0xe869('0x43')](handleError(_0x4f0e7f,null));};exports['show']=function(_0x1e550e,_0x3d55df){var _0x26ebd8={'raw':!![],'where':{'id':_0x1e550e[_0xe869('0x44')]['id']}},_0x4130a6={};_0x4130a6[_0xe869('0x2f')]=_['keys'](db[_0xe869('0x40')]['rawAttributes']);_0x4130a6[_0xe869('0x31')]=_[_0xe869('0x30')](_0x1e550e[_0xe869('0x31')]);_0x4130a6[_0xe869('0x32')]=_[_0xe869('0x33')](_0x4130a6[_0xe869('0x2f')],_0x4130a6[_0xe869('0x31')]);_0x26ebd8[_0xe869('0x34')]=_[_0xe869('0x33')](_0x4130a6[_0xe869('0x2f')],qs[_0xe869('0x35')](_0x1e550e[_0xe869('0x31')][_0xe869('0x35')]));_0x26ebd8[_0xe869('0x34')]=_0x26ebd8['attributes'][_0xe869('0x45')]?_0x26ebd8[_0xe869('0x34')]:_0x4130a6['model'];if(_0x1e550e[_0xe869('0x31')]['includeAll']){_0x26ebd8[_0xe869('0x46')]=[{'all':!![]}];}_0x26ebd8=_[_0xe869('0x3c')]({},_0x26ebd8,_0x1e550e[_0xe869('0x3f')]);return db[_0xe869('0x40')][_0xe869('0x47')](_0x26ebd8)[_0xe869('0x24')](handleEntityNotFound(_0x3d55df,null))[_0xe869('0x24')](respondWithResult(_0x3d55df,null))[_0xe869('0x43')](handleError(_0x3d55df,null));};exports[_0xe869('0x48')]=function(_0x39e5e9,_0x5d5349){return db[_0xe869('0x40')][_0xe869('0x48')](_0x39e5e9[_0xe869('0x49')],{})[_0xe869('0x24')](respondWithResult(_0x5d5349,0xc9))[_0xe869('0x43')](handleError(_0x5d5349,null));};exports[_0xe869('0x23')]=function(_0x5aa2b5,_0x1976c0){if(_0x5aa2b5['body']['id']){delete _0x5aa2b5[_0xe869('0x49')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5aa2b5[_0xe869('0x44')]['id']}})['then'](handleEntityNotFound(_0x1976c0,null))['then'](saveUpdates(_0x5aa2b5[_0xe869('0x49')],null))[_0xe869('0x24')](respondWithResult(_0x1976c0,null))[_0xe869('0x43')](handleError(_0x1976c0,null));};exports[_0xe869('0x25')]=function(_0x2acfee,_0x59bae1){return db['ChatQueueReport']['find']({'where':{'id':_0x2acfee[_0xe869('0x44')]['id']}})['then'](handleEntityNotFound(_0x59bae1,null))[_0xe869('0x24')](removeEntity(_0x59bae1,null))[_0xe869('0x43')](handleError(_0x59bae1,null));};exports['describe']=function(_0x98ee8f,_0x5ec184){return db[_0xe869('0x40')][_0xe869('0x4a')]()[_0xe869('0x24')](respondWithResult(_0x5ec184,null))[_0xe869('0x43')](handleError(_0x5ec184,null));};
\ No newline at end of file
+var _0x07d7=['undefined','limit','status','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatQueueReport','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','offset'];(function(_0x145520,_0xaa3c75){var _0x1ae3e3=function(_0x1532da){while(--_0x1532da){_0x145520['push'](_0x145520['shift']());}};_0x1ae3e3(++_0xaa3c75);}(_0x07d7,0x85));var _0x707d=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0x07d7[_0x3d27ba];return _0xf01885;};'use strict';var emlformat=require(_0x707d('0x0'));var rimraf=require(_0x707d('0x1'));var zipdir=require(_0x707d('0x2'));var jsonpatch=require(_0x707d('0x3'));var rp=require(_0x707d('0x4'));var moment=require(_0x707d('0x5'));var BPromise=require(_0x707d('0x6'));var Mustache=require(_0x707d('0x7'));var util=require(_0x707d('0x8'));var path=require(_0x707d('0x9'));var sox=require(_0x707d('0xa'));var csv=require(_0x707d('0xb'));var ejs=require(_0x707d('0xc'));var fs=require('fs');var fs_extra=require(_0x707d('0xd'));var _=require(_0x707d('0xe'));var squel=require(_0x707d('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x707d('0x10'));var toCsv=require(_0x707d('0xb'));var querystring=require(_0x707d('0x11'));var Papa=require(_0x707d('0x12'));var Redis=require(_0x707d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x707d('0x14'));var as=require(_0x707d('0x15'));var hardwareService=require(_0x707d('0x16'));var logger=require('../../config/logger')(_0x707d('0x17'));var utils=require(_0x707d('0x18'));var config=require(_0x707d('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aabfe,_0x252e8c){_0x252e8c=_0x252e8c||0xcc;return function(_0x7cd32b){if(_0x7cd32b){return _0x5aabfe[_0x707d('0x1a')](_0x252e8c);}return _0x5aabfe['status'](_0x252e8c)[_0x707d('0x1b')]();};}function respondWithResult(_0x52c447,_0x1c18a6){_0x1c18a6=_0x1c18a6||0xc8;return function(_0x42e27f){if(_0x42e27f){return _0x52c447['status'](_0x1c18a6)['json'](_0x42e27f);}};}function respondWithFilteredResult(_0x30d583,_0x5b4700){return function(_0x2f993c){if(_0x2f993c){var _0x2c63c9=typeof _0x5b4700[_0x707d('0x1c')]===_0x707d('0x1d')&&typeof _0x5b4700[_0x707d('0x1e')]===_0x707d('0x1d');var _0x318251=_0x2f993c['count'];var _0x1d3fe6=_0x2c63c9?0x0:_0x5b4700[_0x707d('0x1c')];var _0x3617c3=_0x2c63c9?_0x2f993c['count']:_0x5b4700[_0x707d('0x1c')]+_0x5b4700[_0x707d('0x1e')];var _0xf5375f;if(_0x3617c3>=_0x318251){_0x3617c3=_0x318251;_0xf5375f=0xc8;}else{_0xf5375f=0xce;}_0x30d583[_0x707d('0x1f')](_0xf5375f);return _0x30d583[_0x707d('0x20')](_0x707d('0x21'),_0x1d3fe6+'-'+_0x3617c3+'/'+_0x318251)[_0x707d('0x22')](_0x2f993c);}return null;};}function patchUpdates(_0x446629){return function(_0x33a726){try{jsonpatch[_0x707d('0x23')](_0x33a726,_0x446629,!![]);}catch(_0x2da0c0){return BPromise[_0x707d('0x24')](_0x2da0c0);}return _0x33a726[_0x707d('0x25')]();};}function saveUpdates(_0x3dc9c9,_0xd97d6b){return function(_0x30d175){if(_0x30d175){return _0x30d175[_0x707d('0x26')](_0x3dc9c9)['then'](function(_0x24ba23){return _0x24ba23;});}return null;};}function removeEntity(_0x487a9c,_0xe548a4){return function(_0x139ad5){if(_0x139ad5){return _0x139ad5[_0x707d('0x27')]()[_0x707d('0x28')](function(){_0x487a9c[_0x707d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x115e5c,_0x5b2db7){return function(_0x3760bb){if(!_0x3760bb){_0x115e5c[_0x707d('0x1a')](0x194);}return _0x3760bb;};}function handleError(_0x2d8830,_0x26d4ee){_0x26d4ee=_0x26d4ee||0x1f4;return function(_0x40551d){logger[_0x707d('0x29')](_0x40551d[_0x707d('0x2a')]);if(_0x40551d[_0x707d('0x2b')]){delete _0x40551d[_0x707d('0x2b')];}_0x2d8830[_0x707d('0x1f')](_0x26d4ee)[_0x707d('0x2c')](_0x40551d);};}exports[_0x707d('0x2d')]=function(_0x38b44b,_0xeb85df){var _0x2102e6={},_0x309ded={},_0x599ba6={'count':0x0,'rows':[]};var _0x17bb4e=_[_0x707d('0x2e')](db[_0x707d('0x2f')]['rawAttributes'],function(_0x5e0ff9){return{'name':_0x5e0ff9['fieldName'],'type':_0x5e0ff9[_0x707d('0x30')][_0x707d('0x31')]};});_0x309ded[_0x707d('0x32')]=_[_0x707d('0x2e')](_0x17bb4e,_0x707d('0x2b'));_0x309ded[_0x707d('0x33')]=_[_0x707d('0x34')](_0x38b44b[_0x707d('0x33')]);_0x309ded[_0x707d('0x35')]=_[_0x707d('0x36')](_0x309ded[_0x707d('0x32')],_0x309ded[_0x707d('0x33')]);_0x2102e6['attributes']=_[_0x707d('0x36')](_0x309ded[_0x707d('0x32')],qs[_0x707d('0x37')](_0x38b44b[_0x707d('0x33')][_0x707d('0x37')]));_0x2102e6['attributes']=_0x2102e6[_0x707d('0x38')][_0x707d('0x39')]?_0x2102e6['attributes']:_0x309ded[_0x707d('0x32')];if(!_0x38b44b[_0x707d('0x33')][_0x707d('0x3a')](_0x707d('0x3b'))){_0x2102e6[_0x707d('0x1e')]=qs[_0x707d('0x1e')](_0x38b44b[_0x707d('0x33')][_0x707d('0x1e')]);_0x2102e6[_0x707d('0x1c')]=qs['offset'](_0x38b44b[_0x707d('0x33')][_0x707d('0x1c')]);}_0x2102e6[_0x707d('0x3c')]=qs[_0x707d('0x3d')](_0x38b44b[_0x707d('0x33')]['sort']);_0x2102e6[_0x707d('0x3e')]=qs[_0x707d('0x35')](_[_0x707d('0x3f')](_0x38b44b['query'],_0x309ded[_0x707d('0x35')]),_0x17bb4e);if(_0x38b44b['query'][_0x707d('0x40')]){_0x2102e6[_0x707d('0x3e')]=_[_0x707d('0x41')](_0x2102e6[_0x707d('0x3e')],{'$or':_['map'](_0x17bb4e,function(_0x5b3260){if(_0x5b3260[_0x707d('0x30')]!==_0x707d('0x42')){var _0x48d8e6={};_0x48d8e6[_0x5b3260['name']]={'$like':'%'+_0x38b44b[_0x707d('0x33')]['filter']+'%'};return _0x48d8e6;}})});}_0x2102e6=_['merge']({},_0x2102e6,_0x38b44b[_0x707d('0x43')]);var _0x35d3a0={'where':_0x2102e6[_0x707d('0x3e')]};return db[_0x707d('0x2f')][_0x707d('0x44')](_0x35d3a0)['then'](function(_0x59aba7){_0x599ba6[_0x707d('0x44')]=_0x59aba7;if(_0x38b44b[_0x707d('0x33')][_0x707d('0x45')]){_0x2102e6[_0x707d('0x46')]=[{'all':!![]}];}return db[_0x707d('0x2f')][_0x707d('0x47')](_0x2102e6);})[_0x707d('0x28')](function(_0x6553d2){_0x599ba6[_0x707d('0x48')]=_0x6553d2;return _0x599ba6;})[_0x707d('0x28')](respondWithFilteredResult(_0xeb85df,_0x2102e6))['catch'](handleError(_0xeb85df,null));};exports[_0x707d('0x49')]=function(_0x1b5acb,_0x483ecf){var _0xd27541={'raw':!![],'where':{'id':_0x1b5acb[_0x707d('0x4a')]['id']}},_0x186035={};_0x186035[_0x707d('0x32')]=_[_0x707d('0x34')](db['ChatQueueReport'][_0x707d('0x4b')]);_0x186035[_0x707d('0x33')]=_[_0x707d('0x34')](_0x1b5acb[_0x707d('0x33')]);_0x186035[_0x707d('0x35')]=_[_0x707d('0x36')](_0x186035[_0x707d('0x32')],_0x186035[_0x707d('0x33')]);_0xd27541[_0x707d('0x38')]=_['intersection'](_0x186035[_0x707d('0x32')],qs['fields'](_0x1b5acb[_0x707d('0x33')][_0x707d('0x37')]));_0xd27541[_0x707d('0x38')]=_0xd27541[_0x707d('0x38')][_0x707d('0x39')]?_0xd27541[_0x707d('0x38')]:_0x186035[_0x707d('0x32')];if(_0x1b5acb[_0x707d('0x33')]['includeAll']){_0xd27541[_0x707d('0x46')]=[{'all':!![]}];}_0xd27541=_[_0x707d('0x41')]({},_0xd27541,_0x1b5acb[_0x707d('0x43')]);return db[_0x707d('0x2f')][_0x707d('0x4c')](_0xd27541)[_0x707d('0x28')](handleEntityNotFound(_0x483ecf,null))['then'](respondWithResult(_0x483ecf,null))[_0x707d('0x4d')](handleError(_0x483ecf,null));};exports[_0x707d('0x4e')]=function(_0x39843d,_0x3986d4){return db[_0x707d('0x2f')][_0x707d('0x4e')](_0x39843d['body'],{})['then'](respondWithResult(_0x3986d4,0xc9))[_0x707d('0x4d')](handleError(_0x3986d4,null));};exports[_0x707d('0x26')]=function(_0x5e1c34,_0x31ac73){if(_0x5e1c34[_0x707d('0x4f')]['id']){delete _0x5e1c34[_0x707d('0x4f')]['id'];}return db[_0x707d('0x2f')]['find']({'where':{'id':_0x5e1c34[_0x707d('0x4a')]['id']}})[_0x707d('0x28')](handleEntityNotFound(_0x31ac73,null))[_0x707d('0x28')](saveUpdates(_0x5e1c34['body'],null))[_0x707d('0x28')](respondWithResult(_0x31ac73,null))[_0x707d('0x4d')](handleError(_0x31ac73,null));};exports['destroy']=function(_0xe8a696,_0x4fa0f8){return db['ChatQueueReport']['find']({'where':{'id':_0xe8a696[_0x707d('0x4a')]['id']}})[_0x707d('0x28')](handleEntityNotFound(_0x4fa0f8,null))[_0x707d('0x28')](removeEntity(_0x4fa0f8,null))[_0x707d('0x4d')](handleError(_0x4fa0f8,null));};exports[_0x707d('0x50')]=function(_0x19c741,_0x4d85a9){return db[_0x707d('0x2f')][_0x707d('0x50')]()['then'](respondWithResult(_0x4d85a9,null))['catch'](handleError(_0x4d85a9,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 11cd3aa..47b0cac 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2881d2,_0x1787a0){var _0x683ce3=function(_0x1095a1){while(--_0x1095a1){_0x2881d2['push'](_0x2881d2['shift']());}};_0x683ce3(++_0x1787a0);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x277889,_0x15b424){var _0x505e98=function(_0x3b48d7){while(--_0x3b48d7){_0x277889['push'](_0x277889['shift']());}};_0x505e98(++_0x15b424);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 6944ff2..b8265b6 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 _0xa552=['UpdateChatQueueReport','update','body','where','attributes','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0xa552,0x147));var _0x2a55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa552[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2a55('0x0'));var util=require(_0x2a55('0x1'));var moment=require(_0x2a55('0x2'));var BPromise=require(_0x2a55('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a55('0x4'));var db=require(_0x2a55('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a55('0x6'));var config=require(_0x2a55('0x7'));var jayson=require(_0x2a55('0x8'));var client=jayson[_0x2a55('0x9')][_0x2a55('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa94c5,_0x2a996f,_0x54e0b5){return new BPromise(function(_0x1b87fb,_0x39118d){return client['request'](_0xa94c5,_0x54e0b5)[_0x2a55('0xb')](function(_0x36dbfb){logger['info'](_0x2a55('0xc'),_0x2a996f,_0x2a55('0xd'));logger[_0x2a55('0xe')](_0x2a55('0xf'),_0x2a996f,_0x2a55('0xd'),JSON[_0x2a55('0x10')](_0x36dbfb));if(_0x36dbfb[_0x2a55('0x11')]){if(_0x36dbfb[_0x2a55('0x11')]['code']===0x1f4){logger[_0x2a55('0x11')](_0x2a55('0xc'),_0x2a996f,_0x36dbfb['error'][_0x2a55('0x12')]);return _0x39118d(_0x36dbfb['error']['message']);}logger[_0x2a55('0x11')](_0x2a55('0xc'),_0x2a996f,_0x36dbfb[_0x2a55('0x11')]['message']);return _0x1b87fb(_0x36dbfb[_0x2a55('0x11')]['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x2a996f,_0x2a55('0xd'));_0x1b87fb(_0x36dbfb[_0x2a55('0x13')][_0x2a55('0x12')]);}})['catch'](function(_0x1986d9){logger[_0x2a55('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x2a996f,_0x1986d9);_0x39118d(_0x1986d9);});});}exports[_0x2a55('0x14')]=function(_0x537a2b){var _0x284337=this;return new Promise(function(_0x540350,_0x1628f0){return db[_0x2a55('0x15')][_0x2a55('0x16')](_0x537a2b['body'],{'raw':_0x537a2b[_0x2a55('0x17')]?_0x537a2b[_0x2a55('0x17')][_0x2a55('0x18')]===undefined?!![]:![]:!![]})[_0x2a55('0xb')](function(_0x4b1cc5){logger['info'](_0x2a55('0x14'),_0x537a2b);logger[_0x2a55('0xe')]('CreateChatQueueReport',_0x537a2b,JSON[_0x2a55('0x10')](_0x4b1cc5));_0x540350(_0x4b1cc5);})['catch'](function(_0x2c4617){logger[_0x2a55('0x11')](_0x2a55('0x14'),_0x2c4617['message'],_0x537a2b);_0x1628f0(_0x284337[_0x2a55('0x11')](0x1f4,_0x2c4617[_0x2a55('0x12')]));});});};exports[_0x2a55('0x19')]=function(_0x3619cf){var _0x580057=this;return new Promise(function(_0x5425ac,_0x47d6ff){return db[_0x2a55('0x15')][_0x2a55('0x1a')](_0x3619cf[_0x2a55('0x1b')],{'raw':_0x3619cf[_0x2a55('0x17')]?_0x3619cf['options'][_0x2a55('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3619cf[_0x2a55('0x17')]?_0x3619cf[_0x2a55('0x17')][_0x2a55('0x1c')]||null:null,'attributes':_0x3619cf[_0x2a55('0x17')]?_0x3619cf[_0x2a55('0x17')][_0x2a55('0x1d')]||null:null,'limit':_0x3619cf[_0x2a55('0x17')]?_0x3619cf[_0x2a55('0x17')]['limit']||null:null})['then'](function(_0x4eec64){logger[_0x2a55('0x1e')]('UpdateChatQueueReport',_0x3619cf);logger[_0x2a55('0xe')]('UpdateChatQueueReport',_0x3619cf,JSON[_0x2a55('0x10')](_0x4eec64));_0x5425ac(_0x4eec64);})[_0x2a55('0x1f')](function(_0x14feb9){logger[_0x2a55('0x11')](_0x2a55('0x19'),_0x14feb9[_0x2a55('0x12')],_0x3619cf);_0x47d6ff(_0x580057[_0x2a55('0x11')](0x1f4,_0x14feb9[_0x2a55('0x12')]));});});};
\ No newline at end of file
+var _0x6146=['attributes','limit','UpdateChatQueueReport','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','options','raw','update','body','where'];(function(_0x1e123b,_0x2482e5){var _0x31b527=function(_0x166e1a){while(--_0x166e1a){_0x1e123b['push'](_0x1e123b['shift']());}};_0x31b527(++_0x2482e5);}(_0x6146,0x111));var _0x6614=function(_0x590b72,_0x2f603e){_0x590b72=_0x590b72-0x0;var _0x37df5b=_0x6146[_0x590b72];return _0x37df5b;};'use strict';var _=require('lodash');var util=require(_0x6614('0x0'));var moment=require('moment');var BPromise=require(_0x6614('0x1'));var rs=require(_0x6614('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6614('0x3'))['db'];var utils=require(_0x6614('0x4'));var logger=require(_0x6614('0x5'))(_0x6614('0x6'));var config=require(_0x6614('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d9fce,_0x23d03a,_0x46224e){return new BPromise(function(_0x41725f,_0x181fdd){return client[_0x6614('0x8')](_0x1d9fce,_0x46224e)[_0x6614('0x9')](function(_0x1e4be8){logger[_0x6614('0xa')](_0x6614('0xb'),_0x23d03a,_0x6614('0xc'));logger[_0x6614('0xd')](_0x6614('0xe'),_0x23d03a,_0x6614('0xc'),JSON[_0x6614('0xf')](_0x1e4be8));if(_0x1e4be8[_0x6614('0x10')]){if(_0x1e4be8[_0x6614('0x10')][_0x6614('0x11')]===0x1f4){logger[_0x6614('0x10')](_0x6614('0xb'),_0x23d03a,_0x1e4be8[_0x6614('0x10')]['message']);return _0x181fdd(_0x1e4be8[_0x6614('0x10')]['message']);}logger[_0x6614('0x10')](_0x6614('0xb'),_0x23d03a,_0x1e4be8[_0x6614('0x10')][_0x6614('0x12')]);return _0x41725f(_0x1e4be8['error'][_0x6614('0x12')]);}else{logger[_0x6614('0xa')](_0x6614('0xb'),_0x23d03a,_0x6614('0xc'));_0x41725f(_0x1e4be8['result'][_0x6614('0x12')]);}})[_0x6614('0x13')](function(_0x11ab1a){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x23d03a,_0x11ab1a);_0x181fdd(_0x11ab1a);});});}exports[_0x6614('0x14')]=function(_0x4d1496){var _0x30e2d6=this;return new Promise(function(_0x5529fc,_0x4ead5a){return db[_0x6614('0x15')]['create'](_0x4d1496['body'],{'raw':_0x4d1496[_0x6614('0x16')]?_0x4d1496['options'][_0x6614('0x17')]===undefined?!![]:![]:!![]})[_0x6614('0x9')](function(_0x675ee6){logger[_0x6614('0xa')](_0x6614('0x14'),_0x4d1496);logger[_0x6614('0xd')](_0x6614('0x14'),_0x4d1496,JSON[_0x6614('0xf')](_0x675ee6));_0x5529fc(_0x675ee6);})[_0x6614('0x13')](function(_0x40ee29){logger[_0x6614('0x10')](_0x6614('0x14'),_0x40ee29[_0x6614('0x12')],_0x4d1496);_0x4ead5a(_0x30e2d6[_0x6614('0x10')](0x1f4,_0x40ee29[_0x6614('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x285a35){var _0x1c2d69=this;return new Promise(function(_0x205c71,_0x2bb1f8){return db[_0x6614('0x15')][_0x6614('0x18')](_0x285a35[_0x6614('0x19')],{'raw':_0x285a35[_0x6614('0x16')]?_0x285a35[_0x6614('0x16')][_0x6614('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x285a35[_0x6614('0x16')]?_0x285a35[_0x6614('0x16')][_0x6614('0x1a')]||null:null,'attributes':_0x285a35[_0x6614('0x16')]?_0x285a35['options'][_0x6614('0x1b')]||null:null,'limit':_0x285a35[_0x6614('0x16')]?_0x285a35[_0x6614('0x16')][_0x6614('0x1c')]||null:null})['then'](function(_0x45c15d){logger[_0x6614('0xa')](_0x6614('0x1d'),_0x285a35);logger[_0x6614('0xd')](_0x6614('0x1d'),_0x285a35,JSON[_0x6614('0xf')](_0x45c15d));_0x205c71(_0x45c15d);})[_0x6614('0x13')](function(_0x37975d){logger[_0x6614('0x10')]('UpdateChatQueueReport',_0x37975d[_0x6614('0x12')],_0x285a35);_0x2bb1f8(_0x1c2d69[_0x6614('0x10')](0x1f4,_0x37975d['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index c3383db..0c9a5c4 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 _0x7444=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','show','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x7444,0x112));var _0x4744=function(_0x4723e3,_0x2f7530){_0x4723e3=_0x4723e3-0x0;var _0x47ec31=_0x7444[_0x4723e3];return _0x47ec31;};'use strict';var multer=require(_0x4744('0x0'));var util=require(_0x4744('0x1'));var path=require(_0x4744('0x2'));var timeout=require(_0x4744('0x3'));var express=require(_0x4744('0x4'));var router=express[_0x4744('0x5')]();var fs_extra=require(_0x4744('0x6'));var auth=require(_0x4744('0x7'));var interaction=require(_0x4744('0x8'));var config=require(_0x4744('0x9'));var controller=require(_0x4744('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x4744('0xb')]);router[_0x4744('0xc')](_0x4744('0xd'),auth[_0x4744('0xe')](),controller[_0x4744('0xf')]);router['get']('/:id',auth[_0x4744('0xe')](),controller[_0x4744('0x10')]);router[_0x4744('0x11')]('/',auth[_0x4744('0xe')](),controller['create']);router['put'](_0x4744('0x12'),auth[_0x4744('0xe')](),controller[_0x4744('0x13')]);router[_0x4744('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x4744('0x15')]);module[_0x4744('0x16')]=router;
\ No newline at end of file
+var _0x54be=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete'];(function(_0x4bdbf3,_0xc32415){var _0xa54c8b=function(_0x2a2f60){while(--_0x2a2f60){_0x4bdbf3['push'](_0x4bdbf3['shift']());}};_0xa54c8b(++_0xc32415);}(_0x54be,0x18e));var _0xe54b=function(_0x1ee65d,_0x13e80f){_0x1ee65d=_0x1ee65d-0x0;var _0x2eb5bb=_0x54be[_0x1ee65d];return _0x2eb5bb;};'use strict';var multer=require(_0xe54b('0x0'));var util=require(_0xe54b('0x1'));var path=require(_0xe54b('0x2'));var timeout=require(_0xe54b('0x3'));var express=require('express');var router=express[_0xe54b('0x4')]();var fs_extra=require(_0xe54b('0x5'));var auth=require(_0xe54b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe54b('0x7'));var controller=require(_0xe54b('0x8'));router['get']('/',auth[_0xe54b('0x9')](),controller[_0xe54b('0xa')]);router[_0xe54b('0xb')](_0xe54b('0xc'),auth[_0xe54b('0x9')](),controller[_0xe54b('0xd')]);router[_0xe54b('0xb')](_0xe54b('0xe'),auth[_0xe54b('0x9')](),controller[_0xe54b('0xf')]);router[_0xe54b('0x10')]('/',auth[_0xe54b('0x9')](),controller[_0xe54b('0x11')]);router['put'](_0xe54b('0xe'),auth['isAuthenticated'](),controller[_0xe54b('0x12')]);router[_0xe54b('0x13')]('/:id',auth[_0xe54b('0x9')](),controller[_0xe54b('0x14')]);module[_0xe54b('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index f0ba842..84e3a23 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x2c1164,_0x420c4d){var _0xee3b5a=function(_0x5d4355){while(--_0x5d4355){_0x2c1164['push'](_0x2c1164['shift']());}};_0xee3b5a(++_0x420c4d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0xf3cd[_0x3042c5];return _0x7cd140;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xf866c5,_0x23111f){var _0x3f70c1=function(_0x141b04){while(--_0x141b04){_0xf866c5['push'](_0xf866c5['shift']());}};_0x3f70c1(++_0x23111f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1fa841,_0x37a70c){_0x1fa841=_0x1fa841-0x0;var _0x384b67=_0xf3cd[_0x1fa841];return _0x384b67;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index a14c25e..34ee7e9 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 _0x3bc7=['request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','include','rows','show','params','keys','fields','length','includeAll','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bc7,0x16f));var _0x73bc=function(_0x3b199a,_0x37a6a3){_0x3b199a=_0x3b199a-0x0;var _0x3716bb=_0x3bc7[_0x3b199a];return _0x3716bb;};'use strict';var emlformat=require(_0x73bc('0x0'));var rimraf=require(_0x73bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73bc('0x2'));var rp=require(_0x73bc('0x3'));var moment=require('moment');var BPromise=require(_0x73bc('0x4'));var Mustache=require(_0x73bc('0x5'));var util=require(_0x73bc('0x6'));var path=require(_0x73bc('0x7'));var sox=require('sox');var csv=require(_0x73bc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73bc('0x9'));var _=require(_0x73bc('0xa'));var squel=require(_0x73bc('0xb'));var crypto=require(_0x73bc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x73bc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x73bc('0xe'));var Papa=require(_0x73bc('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x73bc('0x10'));var as=require(_0x73bc('0x11'));var hardwareService=require(_0x73bc('0x12'));var logger=require(_0x73bc('0x13'))(_0x73bc('0x14'));var utils=require('../../config/utils');var config=require(_0x73bc('0x15'));var licenseUtil=require(_0x73bc('0x16'));var db=require(_0x73bc('0x17'))['db'];function respondWithStatusCode(_0x11af65,_0x41609a){_0x41609a=_0x41609a||0xcc;return function(_0x5d5f8b){if(_0x5d5f8b){return _0x11af65[_0x73bc('0x18')](_0x41609a);}return _0x11af65[_0x73bc('0x19')](_0x41609a)[_0x73bc('0x1a')]();};}function respondWithResult(_0x48111e,_0x4f41ac){_0x4f41ac=_0x4f41ac||0xc8;return function(_0x33fc2d){if(_0x33fc2d){return _0x48111e['status'](_0x4f41ac)['json'](_0x33fc2d);}};}function respondWithFilteredResult(_0x35dc66,_0x2a0426){return function(_0x1e44d2){if(_0x1e44d2){var _0x59ed17=typeof _0x2a0426['offset']===_0x73bc('0x1b')&&typeof _0x2a0426[_0x73bc('0x1c')]===_0x73bc('0x1b');var _0x2a9517=_0x1e44d2['count'];var _0x34a30c=_0x59ed17?0x0:_0x2a0426[_0x73bc('0x1d')];var _0x272fb6=_0x59ed17?_0x1e44d2[_0x73bc('0x1e')]:_0x2a0426[_0x73bc('0x1d')]+_0x2a0426['limit'];var _0x10ffae;if(_0x272fb6>=_0x2a9517){_0x272fb6=_0x2a9517;_0x10ffae=0xc8;}else{_0x10ffae=0xce;}_0x35dc66['status'](_0x10ffae);return _0x35dc66[_0x73bc('0x1f')](_0x73bc('0x20'),_0x34a30c+'-'+_0x272fb6+'/'+_0x2a9517)[_0x73bc('0x21')](_0x1e44d2);}return null;};}function patchUpdates(_0x5a2c6b){return function(_0x384a26){try{jsonpatch[_0x73bc('0x22')](_0x384a26,_0x5a2c6b,!![]);}catch(_0x7f5907){return BPromise[_0x73bc('0x23')](_0x7f5907);}return _0x384a26['save']();};}function saveUpdates(_0x1095c7,_0x2632f7){return function(_0xf0cc53){if(_0xf0cc53){return _0xf0cc53[_0x73bc('0x24')](_0x1095c7)[_0x73bc('0x25')](function(_0xa804fe){return _0xa804fe;});}return null;};}function removeEntity(_0x4f26a9,_0x46fbf3){return function(_0x328bd4){if(_0x328bd4){return _0x328bd4[_0x73bc('0x26')]()[_0x73bc('0x25')](function(){_0x4f26a9['status'](0xcc)[_0x73bc('0x1a')]();});}};}function handleEntityNotFound(_0x4166e1,_0xefd034){return function(_0x458a35){if(!_0x458a35){_0x4166e1[_0x73bc('0x18')](0x194);}return _0x458a35;};}function handleError(_0x261678,_0x95ee6f){_0x95ee6f=_0x95ee6f||0x1f4;return function(_0x35fbb6){logger['error'](_0x35fbb6[_0x73bc('0x27')]);if(_0x35fbb6[_0x73bc('0x28')]){delete _0x35fbb6[_0x73bc('0x28')];}_0x261678['status'](_0x95ee6f)[_0x73bc('0x29')](_0x35fbb6);};}exports['index']=function(_0x191c61,_0x23e333){var _0x39986e={},_0x13c363={},_0x3f7808={'count':0x0,'rows':[]};var _0x1afbec=_[_0x73bc('0x2a')](db[_0x73bc('0x2b')][_0x73bc('0x2c')],function(_0x125e8f){return{'name':_0x125e8f[_0x73bc('0x2d')],'type':_0x125e8f[_0x73bc('0x2e')][_0x73bc('0x2f')]};});_0x13c363[_0x73bc('0x30')]=_[_0x73bc('0x2a')](_0x1afbec,_0x73bc('0x28'));_0x13c363[_0x73bc('0x31')]=_['keys'](_0x191c61[_0x73bc('0x31')]);_0x13c363['filters']=_['intersection'](_0x13c363[_0x73bc('0x30')],_0x13c363[_0x73bc('0x31')]);_0x39986e['attributes']=_[_0x73bc('0x32')](_0x13c363['model'],qs['fields'](_0x191c61[_0x73bc('0x31')]['fields']));_0x39986e[_0x73bc('0x33')]=_0x39986e[_0x73bc('0x33')]['length']?_0x39986e[_0x73bc('0x33')]:_0x13c363[_0x73bc('0x30')];if(!_0x191c61['query'][_0x73bc('0x34')](_0x73bc('0x35'))){_0x39986e[_0x73bc('0x1c')]=qs[_0x73bc('0x1c')](_0x191c61[_0x73bc('0x31')]['limit']);_0x39986e[_0x73bc('0x1d')]=qs[_0x73bc('0x1d')](_0x191c61['query'][_0x73bc('0x1d')]);}_0x39986e[_0x73bc('0x36')]=qs['sort'](_0x191c61['query'][_0x73bc('0x37')]);_0x39986e[_0x73bc('0x38')]=qs['filters'](_[_0x73bc('0x39')](_0x191c61[_0x73bc('0x31')],_0x13c363[_0x73bc('0x3a')]),_0x1afbec);if(_0x191c61['query']['filter']){_0x39986e[_0x73bc('0x38')]=_[_0x73bc('0x3b')](_0x39986e[_0x73bc('0x38')],{'$or':_[_0x73bc('0x2a')](_0x1afbec,function(_0x357939){if(_0x357939[_0x73bc('0x2e')]!==_0x73bc('0x3c')){var _0x26a2de={};_0x26a2de[_0x357939[_0x73bc('0x28')]]={'$like':'%'+_0x191c61[_0x73bc('0x31')]['filter']+'%'};return _0x26a2de;}})});}_0x39986e=_[_0x73bc('0x3b')]({},_0x39986e,_0x191c61['options']);var _0x45da5c={'where':_0x39986e[_0x73bc('0x38')]};return db[_0x73bc('0x2b')][_0x73bc('0x1e')](_0x45da5c)[_0x73bc('0x25')](function(_0x92d780){_0x3f7808[_0x73bc('0x1e')]=_0x92d780;if(_0x191c61[_0x73bc('0x31')]['includeAll']){_0x39986e[_0x73bc('0x3d')]=[{'all':!![]}];}return db[_0x73bc('0x2b')]['findAll'](_0x39986e);})['then'](function(_0x260426){_0x3f7808[_0x73bc('0x3e')]=_0x260426;return _0x3f7808;})[_0x73bc('0x25')](respondWithFilteredResult(_0x23e333,_0x39986e))['catch'](handleError(_0x23e333,null));};exports[_0x73bc('0x3f')]=function(_0x180c02,_0x2f2a81){var _0x4be710={'raw':!![],'where':{'id':_0x180c02[_0x73bc('0x40')]['id']}},_0x17b808={};_0x17b808['model']=_[_0x73bc('0x41')](db[_0x73bc('0x2b')]['rawAttributes']);_0x17b808[_0x73bc('0x31')]=_[_0x73bc('0x41')](_0x180c02[_0x73bc('0x31')]);_0x17b808[_0x73bc('0x3a')]=_[_0x73bc('0x32')](_0x17b808[_0x73bc('0x30')],_0x17b808['query']);_0x4be710[_0x73bc('0x33')]=_[_0x73bc('0x32')](_0x17b808[_0x73bc('0x30')],qs[_0x73bc('0x42')](_0x180c02['query'][_0x73bc('0x42')]));_0x4be710[_0x73bc('0x33')]=_0x4be710['attributes'][_0x73bc('0x43')]?_0x4be710[_0x73bc('0x33')]:_0x17b808[_0x73bc('0x30')];if(_0x180c02['query'][_0x73bc('0x44')]){_0x4be710[_0x73bc('0x3d')]=[{'all':!![]}];}_0x4be710=_[_0x73bc('0x3b')]({},_0x4be710,_0x180c02['options']);return db[_0x73bc('0x2b')][_0x73bc('0x45')](_0x4be710)[_0x73bc('0x25')](handleEntityNotFound(_0x2f2a81,null))['then'](respondWithResult(_0x2f2a81,null))[_0x73bc('0x46')](handleError(_0x2f2a81,null));};exports['create']=function(_0x336fd3,_0x264bf5){return db[_0x73bc('0x2b')][_0x73bc('0x47')](_0x336fd3[_0x73bc('0x48')],{})[_0x73bc('0x25')](respondWithResult(_0x264bf5,0xc9))[_0x73bc('0x46')](handleError(_0x264bf5,null));};exports[_0x73bc('0x24')]=function(_0x2f1dcd,_0x243d11){if(_0x2f1dcd[_0x73bc('0x48')]['id']){delete _0x2f1dcd['body']['id'];}return db['ChatTransferReport'][_0x73bc('0x45')]({'where':{'id':_0x2f1dcd[_0x73bc('0x40')]['id']}})[_0x73bc('0x25')](handleEntityNotFound(_0x243d11,null))[_0x73bc('0x25')](saveUpdates(_0x2f1dcd['body'],null))[_0x73bc('0x25')](respondWithResult(_0x243d11,null))[_0x73bc('0x46')](handleError(_0x243d11,null));};exports[_0x73bc('0x26')]=function(_0x1e7168,_0x50e6fa){return db[_0x73bc('0x2b')]['find']({'where':{'id':_0x1e7168[_0x73bc('0x40')]['id']}})[_0x73bc('0x25')](handleEntityNotFound(_0x50e6fa,null))[_0x73bc('0x25')](removeEntity(_0x50e6fa,null))[_0x73bc('0x46')](handleError(_0x50e6fa,null));};exports[_0x73bc('0x49')]=function(_0x1d4b86,_0x5cd31f){return db['ChatTransferReport']['describe']()[_0x73bc('0x25')](respondWithResult(_0x5cd31f,null))[_0x73bc('0x46')](handleError(_0x5cd31f,null));};
\ No newline at end of file
+var _0x856c=['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','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','ejs','fs-extra','crypto','jsforce'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x856c,0x171));var _0xc856=function(_0x2c6535,_0x3ad8ca){_0x2c6535=_0x2c6535-0x0;var _0x4f3575=_0x856c[_0x2c6535];return _0x4f3575;};'use strict';var emlformat=require(_0xc856('0x0'));var rimraf=require(_0xc856('0x1'));var zipdir=require(_0xc856('0x2'));var jsonpatch=require(_0xc856('0x3'));var rp=require('request-promise');var moment=require(_0xc856('0x4'));var BPromise=require(_0xc856('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc856('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc856('0x7'));var fs=require('fs');var fs_extra=require(_0xc856('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc856('0x9'));var jsforce=require(_0xc856('0xa'));var deskjs=require(_0xc856('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc856('0xc'));var Papa=require(_0xc856('0xd'));var Redis=require(_0xc856('0xe'));var authService=require(_0xc856('0xf'));var qs=require(_0xc856('0x10'));var as=require(_0xc856('0x11'));var hardwareService=require(_0xc856('0x12'));var logger=require(_0xc856('0x13'))(_0xc856('0x14'));var utils=require(_0xc856('0x15'));var config=require(_0xc856('0x16'));var licenseUtil=require(_0xc856('0x17'));var db=require(_0xc856('0x18'))['db'];function respondWithStatusCode(_0x40b0a9,_0x472f6d){_0x472f6d=_0x472f6d||0xcc;return function(_0x1ad7e4){if(_0x1ad7e4){return _0x40b0a9[_0xc856('0x19')](_0x472f6d);}return _0x40b0a9[_0xc856('0x1a')](_0x472f6d)[_0xc856('0x1b')]();};}function respondWithResult(_0x51edf3,_0xeb83c){_0xeb83c=_0xeb83c||0xc8;return function(_0x147330){if(_0x147330){return _0x51edf3[_0xc856('0x1a')](_0xeb83c)[_0xc856('0x1c')](_0x147330);}};}function respondWithFilteredResult(_0x5ae5b6,_0x20601f){return function(_0x115a88){if(_0x115a88){var _0x52342c=typeof _0x20601f[_0xc856('0x1d')]===_0xc856('0x1e')&&typeof _0x20601f['limit']===_0xc856('0x1e');var _0x57ee9e=_0x115a88[_0xc856('0x1f')];var _0x5b805d=_0x52342c?0x0:_0x20601f[_0xc856('0x1d')];var _0x35735f=_0x52342c?_0x115a88['count']:_0x20601f[_0xc856('0x1d')]+_0x20601f['limit'];var _0xe04962;if(_0x35735f>=_0x57ee9e){_0x35735f=_0x57ee9e;_0xe04962=0xc8;}else{_0xe04962=0xce;}_0x5ae5b6[_0xc856('0x1a')](_0xe04962);return _0x5ae5b6['set'](_0xc856('0x20'),_0x5b805d+'-'+_0x35735f+'/'+_0x57ee9e)[_0xc856('0x1c')](_0x115a88);}return null;};}function patchUpdates(_0x2e9237){return function(_0x268e61){try{jsonpatch[_0xc856('0x21')](_0x268e61,_0x2e9237,!![]);}catch(_0x2cf990){return BPromise[_0xc856('0x22')](_0x2cf990);}return _0x268e61[_0xc856('0x23')]();};}function saveUpdates(_0x9133cf,_0x269f92){return function(_0x2da829){if(_0x2da829){return _0x2da829[_0xc856('0x24')](_0x9133cf)[_0xc856('0x25')](function(_0x5a37f5){return _0x5a37f5;});}return null;};}function removeEntity(_0x1994f5,_0x6421e7){return function(_0x5e6e13){if(_0x5e6e13){return _0x5e6e13[_0xc856('0x26')]()['then'](function(){_0x1994f5[_0xc856('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58c81e,_0x1b7a6f){return function(_0x259f76){if(!_0x259f76){_0x58c81e[_0xc856('0x19')](0x194);}return _0x259f76;};}function handleError(_0x501055,_0x340d50){_0x340d50=_0x340d50||0x1f4;return function(_0x1b2162){logger['error'](_0x1b2162[_0xc856('0x27')]);if(_0x1b2162[_0xc856('0x28')]){delete _0x1b2162[_0xc856('0x28')];}_0x501055['status'](_0x340d50)[_0xc856('0x29')](_0x1b2162);};}exports[_0xc856('0x2a')]=function(_0x1e246f,_0x554768){var _0x3ed6bc={},_0x431b27={},_0x3158d7={'count':0x0,'rows':[]};var _0x352f13=_[_0xc856('0x2b')](db[_0xc856('0x2c')][_0xc856('0x2d')],function(_0x15f315){return{'name':_0x15f315[_0xc856('0x2e')],'type':_0x15f315[_0xc856('0x2f')]['key']};});_0x431b27[_0xc856('0x30')]=_[_0xc856('0x2b')](_0x352f13,_0xc856('0x28'));_0x431b27[_0xc856('0x31')]=_[_0xc856('0x32')](_0x1e246f[_0xc856('0x31')]);_0x431b27['filters']=_[_0xc856('0x33')](_0x431b27[_0xc856('0x30')],_0x431b27[_0xc856('0x31')]);_0x3ed6bc[_0xc856('0x34')]=_[_0xc856('0x33')](_0x431b27[_0xc856('0x30')],qs[_0xc856('0x35')](_0x1e246f[_0xc856('0x31')][_0xc856('0x35')]));_0x3ed6bc['attributes']=_0x3ed6bc[_0xc856('0x34')][_0xc856('0x36')]?_0x3ed6bc[_0xc856('0x34')]:_0x431b27[_0xc856('0x30')];if(!_0x1e246f[_0xc856('0x31')][_0xc856('0x37')]('nolimit')){_0x3ed6bc[_0xc856('0x38')]=qs['limit'](_0x1e246f[_0xc856('0x31')]['limit']);_0x3ed6bc[_0xc856('0x1d')]=qs[_0xc856('0x1d')](_0x1e246f[_0xc856('0x31')][_0xc856('0x1d')]);}_0x3ed6bc[_0xc856('0x39')]=qs[_0xc856('0x3a')](_0x1e246f[_0xc856('0x31')]['sort']);_0x3ed6bc[_0xc856('0x3b')]=qs[_0xc856('0x3c')](_[_0xc856('0x3d')](_0x1e246f['query'],_0x431b27[_0xc856('0x3c')]),_0x352f13);if(_0x1e246f['query'][_0xc856('0x3e')]){_0x3ed6bc['where']=_[_0xc856('0x3f')](_0x3ed6bc['where'],{'$or':_[_0xc856('0x2b')](_0x352f13,function(_0x3f8ec6){if(_0x3f8ec6[_0xc856('0x2f')]!==_0xc856('0x40')){var _0x460ce2={};_0x460ce2[_0x3f8ec6[_0xc856('0x28')]]={'$like':'%'+_0x1e246f[_0xc856('0x31')][_0xc856('0x3e')]+'%'};return _0x460ce2;}})});}_0x3ed6bc=_[_0xc856('0x3f')]({},_0x3ed6bc,_0x1e246f[_0xc856('0x41')]);var _0x4f73ca={'where':_0x3ed6bc[_0xc856('0x3b')]};return db[_0xc856('0x2c')]['count'](_0x4f73ca)[_0xc856('0x25')](function(_0x44dc8f){_0x3158d7[_0xc856('0x1f')]=_0x44dc8f;if(_0x1e246f[_0xc856('0x31')]['includeAll']){_0x3ed6bc[_0xc856('0x42')]=[{'all':!![]}];}return db[_0xc856('0x2c')][_0xc856('0x43')](_0x3ed6bc);})[_0xc856('0x25')](function(_0x432f20){_0x3158d7[_0xc856('0x44')]=_0x432f20;return _0x3158d7;})[_0xc856('0x25')](respondWithFilteredResult(_0x554768,_0x3ed6bc))[_0xc856('0x45')](handleError(_0x554768,null));};exports[_0xc856('0x46')]=function(_0x188b0a,_0x19c5e6){var _0xabf2b8={'raw':!![],'where':{'id':_0x188b0a[_0xc856('0x47')]['id']}},_0x561267={};_0x561267[_0xc856('0x30')]=_[_0xc856('0x32')](db['ChatTransferReport'][_0xc856('0x2d')]);_0x561267[_0xc856('0x31')]=_[_0xc856('0x32')](_0x188b0a[_0xc856('0x31')]);_0x561267[_0xc856('0x3c')]=_[_0xc856('0x33')](_0x561267[_0xc856('0x30')],_0x561267['query']);_0xabf2b8['attributes']=_[_0xc856('0x33')](_0x561267[_0xc856('0x30')],qs[_0xc856('0x35')](_0x188b0a[_0xc856('0x31')][_0xc856('0x35')]));_0xabf2b8[_0xc856('0x34')]=_0xabf2b8[_0xc856('0x34')][_0xc856('0x36')]?_0xabf2b8[_0xc856('0x34')]:_0x561267[_0xc856('0x30')];if(_0x188b0a[_0xc856('0x31')]['includeAll']){_0xabf2b8[_0xc856('0x42')]=[{'all':!![]}];}_0xabf2b8=_[_0xc856('0x3f')]({},_0xabf2b8,_0x188b0a[_0xc856('0x41')]);return db['ChatTransferReport'][_0xc856('0x48')](_0xabf2b8)['then'](handleEntityNotFound(_0x19c5e6,null))[_0xc856('0x25')](respondWithResult(_0x19c5e6,null))[_0xc856('0x45')](handleError(_0x19c5e6,null));};exports[_0xc856('0x49')]=function(_0x1a72f2,_0x232e67){return db[_0xc856('0x2c')][_0xc856('0x49')](_0x1a72f2[_0xc856('0x4a')],{})[_0xc856('0x25')](respondWithResult(_0x232e67,0xc9))[_0xc856('0x45')](handleError(_0x232e67,null));};exports[_0xc856('0x24')]=function(_0x3821b3,_0xb32852){if(_0x3821b3['body']['id']){delete _0x3821b3[_0xc856('0x4a')]['id'];}return db[_0xc856('0x2c')][_0xc856('0x48')]({'where':{'id':_0x3821b3[_0xc856('0x47')]['id']}})[_0xc856('0x25')](handleEntityNotFound(_0xb32852,null))[_0xc856('0x25')](saveUpdates(_0x3821b3[_0xc856('0x4a')],null))[_0xc856('0x25')](respondWithResult(_0xb32852,null))[_0xc856('0x45')](handleError(_0xb32852,null));};exports[_0xc856('0x26')]=function(_0x48868e,_0x38b3bc){return db['ChatTransferReport']['find']({'where':{'id':_0x48868e[_0xc856('0x47')]['id']}})[_0xc856('0x25')](handleEntityNotFound(_0x38b3bc,null))['then'](removeEntity(_0x38b3bc,null))['catch'](handleError(_0x38b3bc,null));};exports[_0xc856('0x4b')]=function(_0x2fe959,_0x2cbe01){return db[_0xc856('0x2c')][_0xc856('0x4b')]()['then'](respondWithResult(_0x2cbe01,null))[_0xc856('0x45')](handleError(_0x2cbe01,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 3502795..638ca40 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 _0x7037=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','moment','request-promise'];(function(_0x305e0a,_0x461a01){var _0x2b31f6=function(_0x3d6eb6){while(--_0x3d6eb6){_0x305e0a['push'](_0x305e0a['shift']());}};_0x2b31f6(++_0x461a01);}(_0x7037,0x19e));var _0x7703=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7037[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x7703('0x0'));var util=require(_0x7703('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7703('0x2'));var BPromise=require('bluebird');var rp=require(_0x7703('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7703('0x4'));var config=require(_0x7703('0x5'));var attributes=require(_0x7703('0x6'));module[_0x7703('0x7')]=function(_0x230234,_0x83b115){return _0x230234[_0x7703('0x8')]('ChatTransferReport',attributes,{'tableName':_0x7703('0x9'),'paranoid':![],'indexes':[{'name':_0x7703('0xa'),'fields':[_0x7703('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x67ad=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x5eb6e0,_0x3cf0aa){var _0x3b5419=function(_0x3f8a86){while(--_0x3f8a86){_0x5eb6e0['push'](_0x5eb6e0['shift']());}};_0x3b5419(++_0x3cf0aa);}(_0x67ad,0x179));var _0xd67a=function(_0x18a80a,_0x5cbf2f){_0x18a80a=_0x18a80a-0x0;var _0x4eed55=_0x67ad[_0x18a80a];return _0x4eed55;};'use strict';var _=require(_0xd67a('0x0'));var util=require(_0xd67a('0x1'));var logger=require(_0xd67a('0x2'))(_0xd67a('0x3'));var moment=require('moment');var BPromise=require(_0xd67a('0x4'));var rp=require(_0xd67a('0x5'));var fs=require('fs');var path=require(_0xd67a('0x6'));var rimraf=require(_0xd67a('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x31ed92,_0x59ab4e){return _0x31ed92['define'](_0xd67a('0x8'),attributes,{'tableName':_0xd67a('0x9'),'paranoid':![],'indexes':[{'name':_0xd67a('0xa'),'fields':[_0xd67a('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 8108c04..63fbd5c 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 _0x030d=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','randomstring','ioredis'];(function(_0xa76940,_0x1b9ee1){var _0x32d671=function(_0x3cdb2b){while(--_0x3cdb2b){_0xa76940['push'](_0xa76940['shift']());}};_0x32d671(++_0x1b9ee1);}(_0x030d,0x123));var _0xd030=function(_0x4b3d88,_0x49a095){_0x4b3d88=_0x4b3d88-0x0;var _0x11dbf5=_0x030d[_0x4b3d88];return _0x11dbf5;};'use strict';var _=require('lodash');var util=require(_0xd030('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd030('0x1'));var fs=require('fs');var Redis=require(_0xd030('0x2'));var db=require(_0xd030('0x3'))['db'];var utils=require(_0xd030('0x4'));var logger=require('../../config/logger')(_0xd030('0x5'));var config=require(_0xd030('0x6'));var jayson=require(_0xd030('0x7'));var client=jayson[_0xd030('0x8')][_0xd030('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x101410,_0x2b1d4a,_0x10f66a){return new BPromise(function(_0x2b1743,_0x4ff280){return client[_0xd030('0xa')](_0x101410,_0x10f66a)[_0xd030('0xb')](function(_0x5c57f0){logger['info'](_0xd030('0xc'),_0x2b1d4a,_0xd030('0xd'));logger['debug'](_0xd030('0xe'),_0x2b1d4a,_0xd030('0xd'),JSON[_0xd030('0xf')](_0x5c57f0));if(_0x5c57f0['error']){if(_0x5c57f0['error']['code']===0x1f4){logger['error'](_0xd030('0xc'),_0x2b1d4a,_0x5c57f0[_0xd030('0x10')][_0xd030('0x11')]);return _0x4ff280(_0x5c57f0[_0xd030('0x10')][_0xd030('0x11')]);}logger[_0xd030('0x10')](_0xd030('0xc'),_0x2b1d4a,_0x5c57f0[_0xd030('0x10')][_0xd030('0x11')]);return _0x2b1743(_0x5c57f0['error'][_0xd030('0x11')]);}else{logger[_0xd030('0x12')](_0xd030('0xc'),_0x2b1d4a,_0xd030('0xd'));_0x2b1743(_0x5c57f0[_0xd030('0x13')][_0xd030('0x11')]);}})[_0xd030('0x14')](function(_0x51b72c){logger[_0xd030('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x2b1d4a,_0x51b72c);_0x4ff280(_0x51b72c);});});}
\ No newline at end of file
+var _0x35e5=['result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x5d34d5,_0x4f1b38){var _0xa0ac47=function(_0x54f959){while(--_0x54f959){_0x5d34d5['push'](_0x5d34d5['shift']());}};_0xa0ac47(++_0x4f1b38);}(_0x35e5,0x1cf));var _0x535e=function(_0x4ea598,_0x43d6c4){_0x4ea598=_0x4ea598-0x0;var _0x553d08=_0x35e5[_0x4ea598];return _0x553d08;};'use strict';var _=require(_0x535e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x535e('0x1'));var rs=require(_0x535e('0x2'));var fs=require('fs');var Redis=require(_0x535e('0x3'));var db=require(_0x535e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x535e('0x5'))(_0x535e('0x6'));var config=require(_0x535e('0x7'));var jayson=require(_0x535e('0x8'));var client=jayson[_0x535e('0x9')][_0x535e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50ab57,_0x28efee,_0x37a08c){return new BPromise(function(_0x2b1c18,_0x32a0b6){return client[_0x535e('0xb')](_0x50ab57,_0x37a08c)[_0x535e('0xc')](function(_0x52ad5a){logger[_0x535e('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x28efee,'request\x20sent');logger[_0x535e('0xe')](_0x535e('0xf'),_0x28efee,'request\x20sent',JSON['stringify'](_0x52ad5a));if(_0x52ad5a[_0x535e('0x10')]){if(_0x52ad5a[_0x535e('0x10')]['code']===0x1f4){logger[_0x535e('0x10')](_0x535e('0x11'),_0x28efee,_0x52ad5a[_0x535e('0x10')][_0x535e('0x12')]);return _0x32a0b6(_0x52ad5a[_0x535e('0x10')][_0x535e('0x12')]);}logger['error'](_0x535e('0x11'),_0x28efee,_0x52ad5a[_0x535e('0x10')][_0x535e('0x12')]);return _0x2b1c18(_0x52ad5a[_0x535e('0x10')][_0x535e('0x12')]);}else{logger['info'](_0x535e('0x11'),_0x28efee,_0x535e('0x13'));_0x2b1c18(_0x52ad5a[_0x535e('0x14')]['message']);}})['catch'](function(_0x7d1e2f){logger[_0x535e('0x10')](_0x535e('0x11'),_0x28efee,_0x7d1e2f);_0x32a0b6(_0x7d1e2f);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index b83736d..7eb4e7a 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 _0x891e=['get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x891e,0xff));var _0xe891=function(_0x575a31,_0x56336f){_0x575a31=_0x575a31-0x0;var _0x5d7dad=_0x891e[_0x575a31];return _0x5d7dad;};'use strict';var multer=require(_0xe891('0x0'));var util=require(_0xe891('0x1'));var path=require(_0xe891('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe891('0x3')]();var fs_extra=require(_0xe891('0x4'));var auth=require(_0xe891('0x5'));var interaction=require(_0xe891('0x6'));var config=require(_0xe891('0x7'));var controller=require(_0xe891('0x8'));router[_0xe891('0x9')]('/',auth[_0xe891('0xa')](),controller[_0xe891('0xb')]);router[_0xe891('0x9')](_0xe891('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xe891('0x9')]('/:id',auth[_0xe891('0xa')](),controller[_0xe891('0xd')]);router[_0xe891('0xe')]('/',auth[_0xe891('0xa')](),controller[_0xe891('0xf')]);router[_0xe891('0x10')](_0xe891('0x11'),auth[_0xe891('0xa')](),controller[_0xe891('0x12')]);router[_0xe891('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe891('0x14')]);module[_0xe891('0x15')]=router;
\ No newline at end of file
+var _0xd149=['exports','multer','util','connect-timeout','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','delete','destroy'];(function(_0x3b3bbc,_0x5c0e75){var _0x32d1f2=function(_0x449c0b){while(--_0x449c0b){_0x3b3bbc['push'](_0x3b3bbc['shift']());}};_0x32d1f2(++_0x5c0e75);}(_0xd149,0x1d1));var _0x9d14=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xd149[_0xfa634c];return _0x73e478;};'use strict';var multer=require(_0x9d14('0x0'));var util=require(_0x9d14('0x1'));var path=require('path');var timeout=require(_0x9d14('0x2'));var express=require('express');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(_0x9d14('0x3'));var controller=require(_0x9d14('0x4'));router['get']('/',auth[_0x9d14('0x5')](),controller[_0x9d14('0x6')]);router[_0x9d14('0x7')](_0x9d14('0x8'),auth[_0x9d14('0x5')](),controller[_0x9d14('0x9')]);router['get'](_0x9d14('0xa'),auth[_0x9d14('0x5')](),controller[_0x9d14('0xb')]);router[_0x9d14('0xc')]('/',auth[_0x9d14('0x5')](),controller['create']);router['put'](_0x9d14('0xa'),auth[_0x9d14('0x5')](),controller['update']);router[_0x9d14('0xd')](_0x9d14('0xa'),auth['isAuthenticated'](),controller[_0x9d14('0xe')]);module[_0x9d14('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 3ced09d..5e727f5 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 _0xaa88=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Send','Skip','Feedback','star','thumb','input','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','INTEGER','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xaa88,0x137));var _0x8aa8=function(_0x3ee1fe,_0x59f2a1){_0x3ee1fe=_0x3ee1fe-0x0;var _0x1ae57a=_0xaa88[_0x3ee1fe];return _0x1ae57a;};'use strict';var Sequelize=require(_0x8aa8('0x0'));var rs=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'name':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8aa8('0x4')},'description':{'type':Sequelize[_0x8aa8('0x3')]},'mapKey':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'mapKeyOffline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8aa8('0x3')]},'animation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0xb'),'squared'),'defaultValue':_0x8aa8('0xb')},'header_online':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xc')},'offline_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xd')},'download_transcript':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8aa8('0xe')]},'closingQuestion':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x11')},'noteTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x13')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x14')},'conditionAgreement':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x15')},'ratingType':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0x16'),_0x8aa8('0x17')),'defaultValue':_0x8aa8('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x8aa8('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x8aa8('0x18'),'props':{'title':_0x8aa8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8aa8('0x1a')](_0x8aa8('0x1b'))?JSON[_0x8aa8('0x1c')](this['getDataValue']('onlineForm')):{};},'set':function(_0x2d1508){return this[_0x8aa8('0x1d')](_0x8aa8('0x1b'),JSON[_0x8aa8('0x1e')](_0x2d1508));}},'offlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':_0x8aa8('0x5')},'variable':null},{'type':_0x8aa8('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x8aa8('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8aa8('0x21'))?JSON[_0x8aa8('0x1c')](this[_0x8aa8('0x1a')](_0x8aa8('0x21'))):{};},'set':function(_0xe07a83){return this['setDataValue'](_0x8aa8('0x21'),JSON[_0x8aa8('0x1e')](_0xe07a83));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8aa8('0x22')]();}},'autoclose':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8aa8('0x3')]},'forwardOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8aa8('0x3')]},'waitingTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x23')},'waitingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x25')},'offlineMessageBody':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x27')},'skipUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x14')},'sendUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return _0x8aa8('0x28');}},'notificationSound':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2a')},'verticalAlignment':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2c')},'messagesAlignment':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x8aa8('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8aa8('0x2b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8aa8('0x2b')],'comment':_0x8aa8('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8aa8('0x30'),'set':function(_0x3c6115){if(!_0x3c6115)this[_0x8aa8('0x1d')](_0x8aa8('0x31'),null);this[_0x8aa8('0x1d')](_0x8aa8('0x32'),_0x3c6115);}},'vidaooEscalation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8aa8('0x3')]},'vidaooTopic':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x33')},'vidaooNote':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':function(){return _0x8aa8('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8aa8('0xe')]}};
\ No newline at end of file
+var _0xd2ea=['Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#011F6A','INTEGER','BOOLEAN','ENUM','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea'];(function(_0xd933cf,_0x1d96c7){var _0xd88807=function(_0x3422ab){while(--_0x3422ab){_0xd933cf['push'](_0xd933cf['shift']());}};_0xd88807(++_0x1d96c7);}(_0xd2ea,0x15f));var _0xad2e=function(_0x241b5b,_0x388051){_0x241b5b=_0x241b5b-0x0;var _0x28b94b=_0xd2ea[_0x241b5b];return _0x28b94b;};'use strict';var Sequelize=require(_0xad2e('0x0'));var rs=require(_0xad2e('0x1'));module[_0xad2e('0x2')]={'name':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xad2e('0x3')]},'mapKey':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x4')},'mapKeyOffline':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x4')},'key':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':_0xad2e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xad2e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xad2e('0x3')]},'animation':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xad2e('0x8')]('rounded',_0xad2e('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xa')},'start_chat_button':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xad2e('0xe')]},'closingQuestion':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x11')},'noteTitle':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x12')},'placeholderMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x13')},'closingMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x14')},'closingMessageButton':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x16')},'ratingType':{'type':Sequelize[_0xad2e('0x8')](_0xad2e('0x17'),_0xad2e('0x18')),'defaultValue':_0xad2e('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xad2e('0xe')],'defaultValue':function(){return JSON[_0xad2e('0x19')]({'items':[{'type':_0xad2e('0x1a'),'variable':null,'config':{'placeholder':_0xad2e('0x1b'),'type':_0xad2e('0x1c'),'required':!![]},'props':{'title':_0xad2e('0x1b'),'helpText':''}},{'type':_0xad2e('0x1a'),'props':{'title':_0xad2e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xad2e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xad2e('0x1d')](_0xad2e('0x1e'))?JSON[_0xad2e('0x1f')](this[_0xad2e('0x1d')](_0xad2e('0x1e'))):{};},'set':function(_0x58acc8){return this[_0xad2e('0x20')](_0xad2e('0x1e'),JSON[_0xad2e('0x19')](_0x58acc8));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xad2e('0x19')]({'items':[{'type':'input','props':{'title':_0xad2e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xad2e('0x4'),'type':_0xad2e('0x4')},'variable':null},{'type':_0xad2e('0x21'),'config':{'placeholder':_0xad2e('0x22')},'props':{'title':_0xad2e('0x22'),'helpText':_0xad2e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xad2e('0x1d')](_0xad2e('0x24'))?JSON[_0xad2e('0x1f')](this['getDataValue'](_0xad2e('0x24'))):{};},'set':function(_0xfd2087){return this[_0xad2e('0x20')](_0xad2e('0x24'),JSON[_0xad2e('0x19')](_0xfd2087));}},'token':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':function(){return rs[_0xad2e('0x25')]();}},'autoclose':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xad2e('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xad2e('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x26')},'waitingMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xad2e('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xad2e('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xad2e('0x2b');}},'notificationSound':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xad2e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2e')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2f')},'defaultTitle':{'type':Sequelize[_0xad2e('0x3')]},'customerAvatar':{'type':Sequelize[_0xad2e('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xad2e('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xad2e('0x6')],'comment':_0xad2e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![],'comment':_0xad2e('0x32'),'set':function(_0x6f4fbc){if(!_0x6f4fbc)this[_0xad2e('0x20')](_0xad2e('0x33'),null);this['setDataValue'](_0xad2e('0x34'),_0x6f4fbc);}},'vidaooEscalation':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xad2e('0x3')]},'vidaooTopic':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':_0xad2e('0x35')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xad2e('0x36');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xad2e('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index a713838..ce4c68e 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 _0xb490=['x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','offline','no\x20available\x20attributes','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','fromString','originalname','mimetype','server','files','attachments','offline-chat','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','readFileSync','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','addAgents','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','html-to-text','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','set','json','update','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options','count','includeAll','include','show','params','keys','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','filter','findAll','removeDispositions','CannedAnswer','getAnswers','rows','removeAnswers','ids','addLogo','sitepic','filename','addCustomerAvatar','customerAvatar','file','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','getResult','chat','CmContact','Sequelize','difference','createdAt','updatedAt','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','ChatApplication','Applications','account','applications','priority','asc','contact','cf-connecting-ip','headers','x-forwarded-for','first','firstName'];(function(_0x30f2a1,_0x18304f){var _0x56c1f1=function(_0x543611){while(--_0x543611){_0x30f2a1['push'](_0x30f2a1['shift']());}};_0x56c1f1(++_0x18304f);}(_0xb490,0x1af));var _0x0b49=function(_0x11b23d,_0x47a519){_0x11b23d=_0x11b23d-0x0;var _0x1553e1=_0xb490[_0x11b23d];return _0x1553e1;};'use strict';var BPromise=require(_0x0b49('0x0'));var Mustache=require(_0x0b49('0x1'));var util=require(_0x0b49('0x2'));var path=require(_0x0b49('0x3'));var ejs=require(_0x0b49('0x4'));var fs=require('fs');var fs_extra=require(_0x0b49('0x5'));var _=require(_0x0b49('0x6'));var querystring=require(_0x0b49('0x7'));var Redis=require(_0x0b49('0x8'));var qs=require(_0x0b49('0x9'));var logger=require(_0x0b49('0xa'))(_0x0b49('0xb'));var config=require(_0x0b49('0xc'));var url=require(_0x0b49('0xd'));var db=require(_0x0b49('0xe'))['db'];config[_0x0b49('0xf')]=_[_0x0b49('0x10')](config[_0x0b49('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b49('0x11'))(new Redis(config[_0x0b49('0xf')]));require(_0x0b49('0x12'))['register'](socket);var htmlToText=require(_0x0b49('0x13'));var jayson=require('jayson/promise');var client=jayson[_0x0b49('0x14')][_0x0b49('0x15')]({'port':0x232c});var client9002=jayson[_0x0b49('0x14')]['http']({'port':0x232a});var client9003=jayson[_0x0b49('0x14')][_0x0b49('0x15')]({'port':0x232b});var client9001=jayson[_0x0b49('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4129,_0x2f34d8,_0x4fec4a,_0x5dbef2){return new BPromise(function(_0x325206,_0x20d872){var _0x1af11b=_0x5dbef2||client;return _0x1af11b[_0x0b49('0x16')](_0x4129,_0x4fec4a)[_0x0b49('0x17')](function(_0x1b803e){logger['info'](_0x0b49('0x18'),_0x2f34d8,_0x0b49('0x19'));logger[_0x0b49('0x1a')](_0x0b49('0x1b'),_0x2f34d8,'request\x20sent',JSON['stringify'](_0x1b803e));if(_0x1b803e[_0x0b49('0x1c')]){if(_0x1b803e['error'][_0x0b49('0x1d')]===0x1f4){logger[_0x0b49('0x1c')](_0x0b49('0x18'),_0x2f34d8,_0x1b803e[_0x0b49('0x1c')][_0x0b49('0x1e')]);return _0x20d872(_0x1b803e[_0x0b49('0x1c')][_0x0b49('0x1e')]);}logger[_0x0b49('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x2f34d8,_0x1b803e[_0x0b49('0x1c')][_0x0b49('0x1e')]);return _0x325206(_0x1b803e[_0x0b49('0x1c')]['message']);}else{logger['info'](_0x0b49('0x18'),_0x2f34d8,_0x0b49('0x19'));_0x325206(_0x1b803e[_0x0b49('0x1f')]['message']);}})[_0x0b49('0x20')](function(_0x4461ff){logger[_0x0b49('0x1c')](_0x0b49('0x18'),_0x2f34d8,_0x4461ff);_0x20d872(_0x4461ff);});});}function respondWithStatusCode(_0x2247ce,_0x237c31){_0x237c31=_0x237c31||0xcc;return function(_0x3802b2){if(_0x3802b2){return _0x2247ce[_0x0b49('0x21')](_0x237c31);}return _0x2247ce[_0x0b49('0x22')](_0x237c31)['end']();};}function respondWithResult(_0x586fc6,_0x14bfc0){_0x14bfc0=_0x14bfc0||0xc8;return function(_0x295163){if(_0x295163){return _0x586fc6[_0x0b49('0x22')](_0x14bfc0)['json'](_0x295163);}};}function respondWithFilteredResult(_0x1bd810,_0x517904){return function(_0x4493ac){if(_0x4493ac){var _0x2feb62=typeof _0x517904[_0x0b49('0x23')]===_0x0b49('0x24')&&typeof _0x517904['limit']===_0x0b49('0x24');var _0x5ea894=_0x4493ac['count'];var _0x49acd1=_0x2feb62?0x0:_0x517904[_0x0b49('0x23')];var _0x4e55d9=_0x2feb62?_0x4493ac['count']:_0x517904[_0x0b49('0x23')]+_0x517904[_0x0b49('0x25')];var _0xcb7b68;if(_0x4e55d9>=_0x5ea894){_0x4e55d9=_0x5ea894;_0xcb7b68=0xc8;}else{_0xcb7b68=0xce;}_0x1bd810[_0x0b49('0x22')](_0xcb7b68);return _0x1bd810[_0x0b49('0x26')]('Content-Range',_0x49acd1+'-'+_0x4e55d9+'/'+_0x5ea894)[_0x0b49('0x27')](_0x4493ac);}return null;};}function saveUpdates(_0x200269){return function(_0x5696e4){if(_0x5696e4){return _0x5696e4[_0x0b49('0x28')](_0x200269)['then'](function(_0x3c819e){return _0x3c819e;});}return null;};}function removeEntity(_0x52e696){return function(_0x4060a9){if(_0x4060a9){return _0x4060a9['destroy']()[_0x0b49('0x17')](function(){var _0x3d01af=_0x4060a9['get']({'plain':!![]});var _0x4bfa79='ChatWebsites';return db['UserProfileResource']['destroy']({'where':{'type':_0x4bfa79,'resourceId':_0x3d01af['id']}})[_0x0b49('0x17')](function(){return _0x4060a9;});})['then'](function(){_0x52e696['status'](0xcc)[_0x0b49('0x29')]();});}};}function handleEntityNotFound(_0x39c3b4){return function(_0x1e2d1a){if(!_0x1e2d1a){_0x39c3b4[_0x0b49('0x21')](0x194);}return _0x1e2d1a;};}function handleError(_0x591096,_0xbfdc88){_0xbfdc88=_0xbfdc88||0x1f4;return function(_0x4a9587){logger[_0x0b49('0x1c')](_0x4a9587[_0x0b49('0x2a')]);if(_0x4a9587[_0x0b49('0x2b')]){delete _0x4a9587[_0x0b49('0x2b')];}_0x591096[_0x0b49('0x22')](_0xbfdc88)[_0x0b49('0x2c')](_0x4a9587);};}exports[_0x0b49('0x2d')]=function(_0x58ef46,_0x1fa3f3){var _0x47f103={'include':[{'model':db[_0x0b49('0x2e')],'as':_0x0b49('0x2f')}]},_0x1999da={},_0x4914aa={'count':0x0,'rows':[]};var _0x127d65=_[_0x0b49('0x30')](db[_0x0b49('0x31')][_0x0b49('0x32')],function(_0x9bffd3){return{'name':_0x9bffd3[_0x0b49('0x33')],'type':_0x9bffd3[_0x0b49('0x34')][_0x0b49('0x35')]};});_0x1999da[_0x0b49('0x36')]=_['map'](_0x127d65,_0x0b49('0x2b'));_0x1999da['query']=_['keys'](_0x58ef46[_0x0b49('0x37')]);_0x1999da[_0x0b49('0x38')]=_[_0x0b49('0x39')](_0x1999da[_0x0b49('0x36')],_0x1999da[_0x0b49('0x37')]);_0x47f103[_0x0b49('0x3a')]=_['intersection'](_0x1999da[_0x0b49('0x36')],qs[_0x0b49('0x3b')](_0x58ef46['query'][_0x0b49('0x3b')]));_0x47f103[_0x0b49('0x3a')]=_0x47f103[_0x0b49('0x3a')]['length']?_0x47f103[_0x0b49('0x3a')]:_0x1999da[_0x0b49('0x36')];if(!_0x58ef46['query'][_0x0b49('0x3c')]('nolimit')){_0x47f103[_0x0b49('0x25')]=qs['limit'](_0x58ef46[_0x0b49('0x37')]['limit']);_0x47f103['offset']=qs[_0x0b49('0x23')](_0x58ef46[_0x0b49('0x37')][_0x0b49('0x23')]);}_0x47f103[_0x0b49('0x3d')]=qs['sort'](_0x58ef46[_0x0b49('0x37')][_0x0b49('0x3e')]);_0x47f103[_0x0b49('0x3f')]=qs[_0x0b49('0x38')](_[_0x0b49('0x40')](_0x58ef46['query'],_0x1999da[_0x0b49('0x38')]),_0x127d65);if(_0x58ef46['query']['filter']){_0x47f103[_0x0b49('0x3f')]=_['merge'](_0x47f103[_0x0b49('0x3f')],{'$or':_[_0x0b49('0x30')](_0x127d65,function(_0xd2d9b2){if(_0xd2d9b2[_0x0b49('0x34')]!==_0x0b49('0x41')){var _0x33da0c={};_0x33da0c[_0xd2d9b2[_0x0b49('0x2b')]]={'$like':'%'+_0x58ef46[_0x0b49('0x37')]['filter']+'%'};return _0x33da0c;}})});}_0x47f103=_[_0x0b49('0x42')]({},_0x47f103,_0x58ef46[_0x0b49('0x43')]);var _0x26407b={'where':_0x47f103[_0x0b49('0x3f')]};return db['ChatWebsite'][_0x0b49('0x44')](_0x26407b)['then'](function(_0x46d2db){_0x4914aa[_0x0b49('0x44')]=_0x46d2db;if(_0x58ef46['query'][_0x0b49('0x45')]){_0x47f103[_0x0b49('0x46')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x47f103);})['then'](function(_0x56a485){_0x4914aa['rows']=_0x56a485;return _0x4914aa;})[_0x0b49('0x17')](respondWithFilteredResult(_0x1fa3f3,_0x47f103))[_0x0b49('0x20')](handleError(_0x1fa3f3,null));};exports[_0x0b49('0x47')]=function(_0x37212b,_0xbce6bc){var _0x37c015={'raw':![],'where':{'id':_0x37212b[_0x0b49('0x48')]['id']},'include':[{'model':db['Pause'],'as':_0x0b49('0x2f')}]},_0x86d9e8={};_0x86d9e8[_0x0b49('0x36')]=_['keys'](db['ChatWebsite']['rawAttributes']);_0x86d9e8[_0x0b49('0x37')]=_[_0x0b49('0x49')](_0x37212b[_0x0b49('0x37')]);_0x86d9e8[_0x0b49('0x38')]=_['intersection'](_0x86d9e8[_0x0b49('0x36')],_0x86d9e8[_0x0b49('0x37')]);_0x37c015[_0x0b49('0x3a')]=_[_0x0b49('0x39')](_0x86d9e8[_0x0b49('0x36')],qs[_0x0b49('0x3b')](_0x37212b[_0x0b49('0x37')]['fields']));_0x37c015[_0x0b49('0x3a')]=_0x37c015['attributes'][_0x0b49('0x4a')]?_0x37c015[_0x0b49('0x3a')]:_0x86d9e8[_0x0b49('0x36')];if(_0x37212b[_0x0b49('0x37')][_0x0b49('0x45')]){_0x37c015[_0x0b49('0x46')]=[{'all':!![]}];}_0x37c015=_[_0x0b49('0x42')]({},_0x37c015,_0x37212b[_0x0b49('0x43')]);return db[_0x0b49('0x31')]['find'](_0x37c015)[_0x0b49('0x17')](handleEntityNotFound(_0xbce6bc,null))[_0x0b49('0x17')](respondWithResult(_0xbce6bc,null))[_0x0b49('0x20')](handleError(_0xbce6bc,null));};exports[_0x0b49('0x4b')]=function(_0x2cf4ba,_0x2da6ba){return db[_0x0b49('0x31')][_0x0b49('0x4b')](_0x2cf4ba[_0x0b49('0x4c')],{})['then'](function(_0x169e08){var _0x10c0fe=_0x2cf4ba[_0x0b49('0x4d')][_0x0b49('0x4e')]({'plain':!![]});if(!_0x10c0fe)throw new Error(_0x0b49('0x4f'));if(_0x10c0fe['role']==='user'){var _0x1dc091=_0x169e08[_0x0b49('0x4e')]({'plain':!![]});var _0x5e8a62=_0x0b49('0x50');return db['UserProfileSection'][_0x0b49('0x51')]({'where':{'name':_0x5e8a62,'userProfileId':_0x10c0fe['userProfileId']},'raw':!![]})[_0x0b49('0x17')](function(_0x40fc75){if(_0x40fc75&&_0x40fc75['autoAssociation']===0x0){return db[_0x0b49('0x52')]['create']({'name':_0x1dc091['name'],'resourceId':_0x1dc091['id'],'type':_0x40fc75['name'],'sectionId':_0x40fc75['id']},{})[_0x0b49('0x17')](function(){return _0x169e08;});}else{return _0x169e08;}})[_0x0b49('0x20')](function(_0x129344){logger[_0x0b49('0x1c')](_0x0b49('0x53'),_0x129344);throw _0x129344;});}return _0x169e08;})[_0x0b49('0x17')](respondWithResult(_0x2da6ba,0xc9))[_0x0b49('0x20')](handleError(_0x2da6ba,null));};exports['update']=function(_0x4b38a3,_0xf8bede){if(_0x4b38a3[_0x0b49('0x4c')]['id']){delete _0x4b38a3[_0x0b49('0x4c')]['id'];}return db[_0x0b49('0x31')][_0x0b49('0x51')]({'where':{'id':_0x4b38a3[_0x0b49('0x48')]['id']},'include':[{'model':db[_0x0b49('0x2e')],'as':_0x0b49('0x2f')}]})[_0x0b49('0x17')](handleEntityNotFound(_0xf8bede,null))[_0x0b49('0x17')](saveUpdates(_0x4b38a3['body'],null))[_0x0b49('0x17')](respondWithResult(_0xf8bede,null))[_0x0b49('0x20')](handleError(_0xf8bede,null));};exports[_0x0b49('0x54')]=function(_0x222ed9,_0x11161d){return db['ChatWebsite']['find']({'where':{'id':_0x222ed9[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x11161d,null))[_0x0b49('0x17')](removeEntity(_0x11161d,null))[_0x0b49('0x20')](handleError(_0x11161d,null));};exports[_0x0b49('0x55')]=function(_0x270567,_0x5004c5){return db['ChatWebsite']['describe']()['then'](respondWithResult(_0x5004c5,null))[_0x0b49('0x20')](handleError(_0x5004c5,null));};exports[_0x0b49('0x56')]=function(_0x402e79,_0x11d048){if(_0x402e79[_0x0b49('0x4c')]['id']){delete _0x402e79[_0x0b49('0x4c')]['id'];}return db[_0x0b49('0x31')][_0x0b49('0x51')]({'where':{'id':_0x402e79['params']['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x11d048,null))[_0x0b49('0x17')](function(_0x3cfb6b){if(_0x3cfb6b){_0x402e79[_0x0b49('0x4c')][_0x0b49('0x57')]=_0x3cfb6b['id'];return db[_0x0b49('0x58')]['create'](_0x402e79['body']);}})[_0x0b49('0x17')](respondWithResult(_0x11d048,null))['catch'](handleError(_0x11d048,null));};exports[_0x0b49('0x59')]=function(_0x49f4a8,_0x573d0b){var _0x2b033c={'raw':![],'where':{}};var _0x55f494={};var _0x58d53f={'count':0x0,'rows':[]};return db[_0x0b49('0x31')][_0x0b49('0x5a')]({'where':{'id':_0x49f4a8[_0x0b49('0x48')]['id']}})['then'](handleEntityNotFound(_0x573d0b,null))[_0x0b49('0x17')](function(_0x37ef8f){if(_0x37ef8f){_0x55f494['model']=_[_0x0b49('0x49')](db[_0x0b49('0x58')][_0x0b49('0x32')]);_0x55f494['query']=_[_0x0b49('0x49')](_0x49f4a8['query']);_0x55f494['filters']=_[_0x0b49('0x39')](_0x55f494['model'],_0x55f494[_0x0b49('0x37')]);_0x2b033c[_0x0b49('0x3a')]=_[_0x0b49('0x39')](_0x55f494[_0x0b49('0x36')],qs[_0x0b49('0x3b')](_0x49f4a8[_0x0b49('0x37')]['fields']));_0x2b033c[_0x0b49('0x3a')]=_0x2b033c[_0x0b49('0x3a')][_0x0b49('0x4a')]?_0x2b033c[_0x0b49('0x3a')]:_0x55f494[_0x0b49('0x36')];if(!_0x49f4a8[_0x0b49('0x37')][_0x0b49('0x3c')](_0x0b49('0x5b'))){_0x2b033c[_0x0b49('0x25')]=qs['limit'](_0x49f4a8['query'][_0x0b49('0x25')]);_0x2b033c['offset']=qs[_0x0b49('0x23')](_0x49f4a8['query'][_0x0b49('0x23')]);}_0x2b033c[_0x0b49('0x3d')]=qs[_0x0b49('0x3e')](_0x49f4a8[_0x0b49('0x37')][_0x0b49('0x3e')]);_0x2b033c['where']=qs[_0x0b49('0x38')](_[_0x0b49('0x40')](_0x49f4a8[_0x0b49('0x37')],_0x55f494['filters']));_0x2b033c[_0x0b49('0x3f')][_0x0b49('0x57')]=_0x37ef8f['id'];if(_0x49f4a8[_0x0b49('0x37')][_0x0b49('0x5c')]){_0x2b033c[_0x0b49('0x3f')]=_['merge'](_0x2b033c[_0x0b49('0x3f')],{'$or':_['map'](_0x2b033c['attributes'],function(_0x4e3f7c){var _0x15a885={};_0x15a885[_0x4e3f7c]={'$like':'%'+_0x49f4a8[_0x0b49('0x37')]['filter']+'%'};return _0x15a885;})});}_0x2b033c=_['merge']({},_0x2b033c,_0x49f4a8[_0x0b49('0x43')]);return db['Disposition'][_0x0b49('0x44')]({'where':_0x2b033c[_0x0b49('0x3f')]})[_0x0b49('0x17')](function(_0x9a2991){_0x58d53f['count']=_0x9a2991;if(_0x49f4a8['query'][_0x0b49('0x45')]){_0x2b033c['include']=[{'all':!![]}];}return db[_0x0b49('0x58')][_0x0b49('0x5d')](_0x2b033c);})[_0x0b49('0x17')](function(_0x56a2bc){_0x58d53f['rows']=_0x56a2bc;return _0x58d53f;});}})[_0x0b49('0x17')](respondWithFilteredResult(_0x573d0b,_0x2b033c))[_0x0b49('0x20')](handleError(_0x573d0b,null));};exports[_0x0b49('0x5e')]=function(_0x57ef35,_0xb597f8){return db[_0x0b49('0x31')][_0x0b49('0x51')]({'where':{'id':_0x57ef35[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0xb597f8,null))[_0x0b49('0x17')](function(_0x439c37){if(_0x439c37){return _0x439c37[_0x0b49('0x5e')](_0x57ef35[_0x0b49('0x37')]['ids']);}})[_0x0b49('0x17')](respondWithStatusCode(_0xb597f8,null))['catch'](handleError(_0xb597f8,null));};exports['addAnswer']=function(_0x4cd537,_0x498c3d){if(_0x4cd537['body']['id']){delete _0x4cd537[_0x0b49('0x4c')]['id'];}return db[_0x0b49('0x31')][_0x0b49('0x51')]({'where':{'id':_0x4cd537[_0x0b49('0x48')]['id']}})['then'](handleEntityNotFound(_0x498c3d,null))[_0x0b49('0x17')](function(_0x44b4dc){if(_0x44b4dc){_0x4cd537[_0x0b49('0x4c')][_0x0b49('0x57')]=_0x44b4dc['id'];return db[_0x0b49('0x5f')][_0x0b49('0x4b')](_0x4cd537[_0x0b49('0x4c')]);}})['then'](respondWithResult(_0x498c3d,null))[_0x0b49('0x20')](handleError(_0x498c3d,null));};exports[_0x0b49('0x60')]=function(_0x11e0e6,_0x3cbe7d){var _0x5e2c0c={'raw':![],'where':{}};var _0x3e0b02={};var _0x276292={'count':0x0,'rows':[]};return db[_0x0b49('0x31')][_0x0b49('0x5a')]({'where':{'id':_0x11e0e6['params']['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x3cbe7d,null))[_0x0b49('0x17')](function(_0x3d199d){if(_0x3d199d){_0x3e0b02[_0x0b49('0x36')]=_[_0x0b49('0x49')](db[_0x0b49('0x5f')][_0x0b49('0x32')]);_0x3e0b02['query']=_[_0x0b49('0x49')](_0x11e0e6['query']);_0x3e0b02[_0x0b49('0x38')]=_[_0x0b49('0x39')](_0x3e0b02[_0x0b49('0x36')],_0x3e0b02[_0x0b49('0x37')]);_0x5e2c0c[_0x0b49('0x3a')]=_[_0x0b49('0x39')](_0x3e0b02['model'],qs[_0x0b49('0x3b')](_0x11e0e6[_0x0b49('0x37')][_0x0b49('0x3b')]));_0x5e2c0c[_0x0b49('0x3a')]=_0x5e2c0c[_0x0b49('0x3a')][_0x0b49('0x4a')]?_0x5e2c0c['attributes']:_0x3e0b02[_0x0b49('0x36')];if(!_0x11e0e6[_0x0b49('0x37')][_0x0b49('0x3c')](_0x0b49('0x5b'))){_0x5e2c0c[_0x0b49('0x25')]=qs[_0x0b49('0x25')](_0x11e0e6[_0x0b49('0x37')][_0x0b49('0x25')]);_0x5e2c0c[_0x0b49('0x23')]=qs['offset'](_0x11e0e6['query'][_0x0b49('0x23')]);}_0x5e2c0c[_0x0b49('0x3d')]=qs[_0x0b49('0x3e')](_0x11e0e6[_0x0b49('0x37')]['sort']);_0x5e2c0c[_0x0b49('0x3f')]=qs[_0x0b49('0x38')](_[_0x0b49('0x40')](_0x11e0e6[_0x0b49('0x37')],_0x3e0b02[_0x0b49('0x38')]));_0x5e2c0c[_0x0b49('0x3f')][_0x0b49('0x57')]=_0x3d199d['id'];if(_0x11e0e6[_0x0b49('0x37')][_0x0b49('0x5c')]){_0x5e2c0c[_0x0b49('0x3f')]=_[_0x0b49('0x42')](_0x5e2c0c[_0x0b49('0x3f')],{'$or':_['map'](_0x5e2c0c[_0x0b49('0x3a')],function(_0x50114d){var _0x55e1b9={};_0x55e1b9[_0x50114d]={'$like':'%'+_0x11e0e6[_0x0b49('0x37')]['filter']+'%'};return _0x55e1b9;})});}_0x5e2c0c=_[_0x0b49('0x42')]({},_0x5e2c0c,_0x11e0e6[_0x0b49('0x43')]);return db[_0x0b49('0x5f')][_0x0b49('0x44')]({'where':_0x5e2c0c[_0x0b49('0x3f')]})[_0x0b49('0x17')](function(_0x28abcb){_0x276292[_0x0b49('0x44')]=_0x28abcb;if(_0x11e0e6[_0x0b49('0x37')][_0x0b49('0x45')]){_0x5e2c0c['include']=[{'all':!![]}];}return db[_0x0b49('0x5f')][_0x0b49('0x5d')](_0x5e2c0c);})['then'](function(_0x428316){_0x276292[_0x0b49('0x61')]=_0x428316;return _0x276292;});}})[_0x0b49('0x17')](respondWithFilteredResult(_0x3cbe7d,_0x5e2c0c))[_0x0b49('0x20')](handleError(_0x3cbe7d,null));};exports[_0x0b49('0x62')]=function(_0x1fb625,_0x382fe4){return db[_0x0b49('0x31')]['find']({'where':{'id':_0x1fb625[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x382fe4,null))[_0x0b49('0x17')](function(_0x3b101e){if(_0x3b101e){return _0x3b101e['removeAnswers'](_0x1fb625[_0x0b49('0x37')][_0x0b49('0x63')]);}})[_0x0b49('0x17')](respondWithStatusCode(_0x382fe4,null))['catch'](handleError(_0x382fe4,null));};exports[_0x0b49('0x64')]=function(_0x34abda,_0xf9730a){_0x34abda[_0x0b49('0x4c')][_0x0b49('0x65')]=_0x34abda['file'][_0x0b49('0x66')];return db[_0x0b49('0x31')][_0x0b49('0x51')]({'where':{'id':_0x34abda['params']['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0xf9730a,null))[_0x0b49('0x17')](saveUpdates(_0x34abda['body'],null))[_0x0b49('0x17')](respondWithResult(_0xf9730a,null))[_0x0b49('0x20')](handleError(_0xf9730a,null));};exports['addAvatar']=function(_0x24bf29,_0x5a0ab7){_0x24bf29[_0x0b49('0x4c')]['agentAvatar']=_0x24bf29['file']['filename'];return db[_0x0b49('0x31')]['find']({'where':{'id':_0x24bf29['params']['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x5a0ab7,null))[_0x0b49('0x17')](saveUpdates(_0x24bf29[_0x0b49('0x4c')],null))[_0x0b49('0x17')](respondWithResult(_0x5a0ab7,null))['catch'](handleError(_0x5a0ab7,null));};exports[_0x0b49('0x67')]=function(_0x26f0a8,_0x5ba80a){_0x26f0a8['body'][_0x0b49('0x68')]=_0x26f0a8[_0x0b49('0x69')][_0x0b49('0x66')];return db[_0x0b49('0x31')][_0x0b49('0x51')]({'where':{'id':_0x26f0a8[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x5ba80a,null))[_0x0b49('0x17')](saveUpdates(_0x26f0a8['body'],null))[_0x0b49('0x17')](respondWithResult(_0x5ba80a,null))[_0x0b49('0x20')](handleError(_0x5ba80a,null));};exports[_0x0b49('0x6a')]=function(_0x35542c,_0x446319){_0x35542c[_0x0b49('0x4c')][_0x0b49('0x6b')]=_0x35542c[_0x0b49('0x69')]['filename'];return db['ChatWebsite'][_0x0b49('0x51')]({'where':{'id':_0x35542c['params']['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x446319,null))[_0x0b49('0x17')](saveUpdates(_0x35542c['body'],null))[_0x0b49('0x17')](respondWithResult(_0x446319,null))['catch'](handleError(_0x446319,null));};exports[_0x0b49('0x6c')]=function(_0x17685f,_0x5682ac){var _0x203283=path[_0x0b49('0x6d')](config['root'],_0x0b49('0x6e'));var _0x27d9c3={'where':{'id':_0x17685f[_0x0b49('0x48')]['id']},'attributes':['id',_0x0b49('0x65')],'raw':!![]};var _0x571288=![];return require(_0x0b49('0x6f'))[_0x0b49('0x70')]()[_0x0b49('0x17')](function(_0x1a35c8){if(_0x1a35c8){_0x571288=_0x1a35c8[_0x0b49('0x71')];}})[_0x0b49('0x17')](function(){return db[_0x0b49('0x31')]['find'](_0x27d9c3);})['then'](handleEntityNotFound(_0x5682ac,null))[_0x0b49('0x17')](function(_0x5a7874){if(_0x5a7874){if(!_['isNil'](_0x5a7874[_0x0b49('0x65')])){if(fs[_0x0b49('0x72')](path[_0x0b49('0x6d')](config[_0x0b49('0x73')],'server/files/images/logos/',_0x5a7874[_0x0b49('0x65')]))&&_0x571288){_0x203283=path['join'](config[_0x0b49('0x73')],_0x0b49('0x74'),_0x5a7874[_0x0b49('0x65')]);}}return _0x5682ac[_0x0b49('0x75')](_0x203283);}})['catch'](handleError(_0x5682ac,null));};exports[_0x0b49('0x76')]=function(_0x2b6583,_0x101f14){var _0x850288=path['join'](config[_0x0b49('0x73')],_0x0b49('0x77'));var _0xb9d69f={'where':{'id':_0x2b6583[_0x0b49('0x48')]['id']},'attributes':['id',_0x0b49('0x78')],'raw':!![]};return db[_0x0b49('0x31')][_0x0b49('0x51')](_0xb9d69f)[_0x0b49('0x17')](handleEntityNotFound(_0x101f14,null))[_0x0b49('0x17')](function(_0x37263f){if(_0x37263f){if(!_[_0x0b49('0x79')](_0x37263f[_0x0b49('0x78')])){if(fs[_0x0b49('0x72')](path[_0x0b49('0x6d')](config[_0x0b49('0x73')],_0x0b49('0x7a'),_0x37263f[_0x0b49('0x78')]))){_0x850288=path['join'](config[_0x0b49('0x73')],_0x0b49('0x7a'),_0x37263f[_0x0b49('0x78')]);}}return _0x101f14[_0x0b49('0x75')](_0x850288);}})[_0x0b49('0x20')](handleError(_0x101f14,null));};exports[_0x0b49('0x7b')]=function(_0x269fe6,_0x44786e){var _0x28b870=path[_0x0b49('0x6d')](config['root'],_0x0b49('0x7c'));var _0x200c26={'where':{'id':_0x269fe6[_0x0b49('0x48')]['id']},'attributes':['id',_0x0b49('0x68'),'showCustomerAvatar'],'raw':!![]};return db[_0x0b49('0x31')]['find'](_0x200c26)[_0x0b49('0x17')](handleEntityNotFound(_0x44786e,null))['then'](function(_0x33f0b1){if(_0x33f0b1){if(!_[_0x0b49('0x79')](_0x33f0b1[_0x0b49('0x68')])){if(fs[_0x0b49('0x72')](path['join'](config[_0x0b49('0x73')],_0x0b49('0x7a'),_0x33f0b1['customerAvatar']))&&_0x33f0b1[_0x0b49('0x7d')]){_0x28b870=path[_0x0b49('0x6d')](config[_0x0b49('0x73')],_0x0b49('0x7a'),_0x33f0b1[_0x0b49('0x68')]);}}return _0x44786e[_0x0b49('0x75')](_0x28b870);}})[_0x0b49('0x20')](handleError(_0x44786e,null));};exports[_0x0b49('0x7e')]=function(_0x39258c,_0x554308){var _0x5c8557=path[_0x0b49('0x6d')](config['root'],_0x0b49('0x7f'));var _0x1ddcac={'where':{'id':_0x39258c[_0x0b49('0x48')]['id']},'attributes':['id',_0x0b49('0x6b')],'raw':!![]};return db[_0x0b49('0x31')]['find'](_0x1ddcac)[_0x0b49('0x17')](handleEntityNotFound(_0x554308,null))['then'](function(_0x3df20f){if(_0x3df20f){if(!_[_0x0b49('0x79')](_0x3df20f[_0x0b49('0x6b')])){if(fs[_0x0b49('0x72')](path[_0x0b49('0x6d')](config[_0x0b49('0x73')],_0x0b49('0x7a'),_0x3df20f[_0x0b49('0x6b')]))){_0x5c8557=path[_0x0b49('0x6d')](config[_0x0b49('0x73')],_0x0b49('0x7a'),_0x3df20f[_0x0b49('0x6b')]);}}return _0x554308[_0x0b49('0x75')](_0x5c8557);}})[_0x0b49('0x20')](handleError(_0x554308,null));};exports[_0x0b49('0x80')]=function(_0x40f6eb,_0x146b96){var _0x429989=require(_0x0b49('0x81'));var _0x30284a=new _0x429989();var _0x32249d=_0x30284a[_0x0b49('0x82')](_0x40f6eb['headers']['user-agent'])[_0x0b49('0x83')]();var _0x5cf27e={'body':_0x40f6eb['body'],'channel':_0x0b49('0x84')};var _0x134e82=[];var _0x398429=[];var _0x976c81={};var _0x471a7f=![];return db[_0x0b49('0x85')]['describe']()[_0x0b49('0x17')](function(_0x363893){if(!_0x363893){throw new db[(_0x0b49('0x86'))]['ValidationError']('no\x20available\x20attributes');}_0x134e82=_[_0x0b49('0x87')](_['keys'](_0x363893),[_0x0b49('0x88'),'updatedAt']);_0x398429=_['difference'](_['keys'](_0x363893),['createdAt',_0x0b49('0x89'),'CompanyId',_0x0b49('0x8a')]);if(_0x40f6eb['body']['id']){delete _0x40f6eb['body']['id'];}if(_['isNil'](_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0x8b')])){throw new db[(_0x0b49('0x86'))][(_0x0b49('0x8c'))](_0x0b49('0x8d'));}if(_[_0x0b49('0x79')](_0x40f6eb[_0x0b49('0x4c')]['body'])||_0x40f6eb['body'][_0x0b49('0x4c')]===''){throw new db['Sequelize'][(_0x0b49('0x8c'))](_0x0b49('0x8e'));}if(_[_0x0b49('0x79')](_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0x8f')])){throw new db[(_0x0b49('0x86'))]['ValidationError'](_0x0b49('0x90')+_0x398429);}if(!_[_0x0b49('0x91')](_0x398429,_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0x8f')])){throw new db[(_0x0b49('0x86'))][(_0x0b49('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x398429);}_0x976c81[_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0x8f')]]=_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0x8b')];})[_0x0b49('0x17')](function(){return db[_0x0b49('0x31')][_0x0b49('0x51')]({'where':{'id':_0x40f6eb['params']['id']},'include':[{'model':db[_0x0b49('0x92')],'as':_0x0b49('0x93'),'include':[{'model':db[_0x0b49('0x85')],'as':_0x0b49('0x94'),'where':_0x976c81,'limit':0x1,'order':[[_0x0b49('0x89'),'DESC']]}]},{'model':db[_0x0b49('0x95')],'as':_0x0b49('0x96')}]});})['then'](handleEntityNotFound(_0x146b96,null))[_0x0b49('0x17')](function(_0x4a064c){if(_0x4a064c&&_0x4a064c[_0x0b49('0x93')]){_0x5cf27e[_0x0b49('0x97')]=_0x4a064c;_0x5cf27e[_0x0b49('0x98')]=_0x4a064c['Applications'];_0x5cf27e['list']=_0x4a064c[_0x0b49('0x93')];_0x5cf27e[_0x0b49('0x98')]=_['orderBy'](_0x5cf27e[_0x0b49('0x98')],[_0x0b49('0x99')],[_0x0b49('0x9a')]);if(_0x5cf27e[_0x0b49('0x97')][_0x0b49('0x96')]){delete _0x5cf27e[_0x0b49('0x97')][_0x0b49('0x96')];}if(_0x5cf27e[_0x0b49('0x97')]['List']&&_0x5cf27e[_0x0b49('0x97')][_0x0b49('0x93')][_0x0b49('0x94')][_0x0b49('0x4a')]){return _0x5cf27e[_0x0b49('0x97')]['List'][_0x0b49('0x94')][0x0];}var _0x175208=_[_0x0b49('0x10')](_0x40f6eb[_0x0b49('0x4c')],{'firstName':_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0x8b')],'ListId':_0x4a064c['ListId']});_0x175208[_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0x8f')]]=_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0x8b')];return db[_0x0b49('0x85')]['create'](_0x175208,{'fields':_0x134e82,'raw':!![]});}})[_0x0b49('0x17')](handleEntityNotFound(_0x146b96,null))['then'](function(_0x4ad0e8){_0x5cf27e[_0x0b49('0x9b')]=_0x4ad0e8;var _0x4a3eda=_0x40f6eb[_0x0b49('0x4c')]['customerIp'];if(_0x40f6eb['headers']['cf-connecting-ip']){_0x4a3eda=_0x40f6eb['headers'][_0x0b49('0x9c')];}else if(_0x40f6eb[_0x0b49('0x9d')][_0x0b49('0x9e')]){_0x4a3eda=_[_0x0b49('0x9f')](_0x40f6eb['headers'][_0x0b49('0x9e')]['split'](','));}if(_0x4ad0e8){var _0x336e2b={'ContactId':_0x4ad0e8['id'],'ChatWebsiteId':_0x40f6eb[_0x0b49('0x48')]['id'],'from':(_0x4ad0e8[_0x0b49('0xa0')]||'')+'\x20'+(_0x4ad0e8['lastName']||''),'customerIp':_0x4a3eda,'customerPort':_0x40f6eb[_0x0b49('0x9d')][_0x0b49('0xa1')]?_0x40f6eb[_0x0b49('0x9d')]['x-real-port']:null,'referer':_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0xa2')],'browserName':_0x32249d['browser'][_0x0b49('0x2b')]&&_0x32249d[_0x0b49('0xa3')][_0x0b49('0xa4')]?util[_0x0b49('0xa5')](_0x0b49('0xa6'),_0x32249d[_0x0b49('0xa3')][_0x0b49('0x2b')],_0x32249d[_0x0b49('0xa3')][_0x0b49('0xa4')]):_0x0b49('0xa7'),'browserVersion':_0x32249d[_0x0b49('0xa3')][_0x0b49('0xa4')]||_0x0b49('0xa7'),'osName':util[_0x0b49('0xa5')]('%s\x20%s',_0x32249d['os']['name'],_0x32249d['os'][_0x0b49('0xa4')]),'osVersion':_0x32249d['os'][_0x0b49('0xa4')],'deviceModel':_0x32249d[_0x0b49('0xa8')]['model']&&_0x32249d[_0x0b49('0xa8')]['vendor']?util[_0x0b49('0xa5')](_0x0b49('0xa9'),_0x32249d[_0x0b49('0xa8')][_0x0b49('0x36')],_0x32249d['device'][_0x0b49('0xaa')],_0x32249d[_0x0b49('0xa8')]['type']):null,'deviceVendor':_0x32249d['device']['vendor'],'deviceType':_0x32249d[_0x0b49('0xa8')][_0x0b49('0x34')],'formData':JSON[_0x0b49('0xab')](_0x40f6eb[_0x0b49('0x4c')])};var _0x2574c3={'ChatWebsiteId':_0x40f6eb['params']['id'],'closed':![]};if(_0x40f6eb['body'][_0x0b49('0xac')]){_0x2574c3['threadId']=_0x40f6eb[_0x0b49('0x4c')]['threadId'];return db[_0x0b49('0xad')][_0x0b49('0x51')]({'where':_0x2574c3})['then'](function(_0x27a9bd){if(_0x27a9bd){return[_0x27a9bd,![]];}_0x336e2b[_0x0b49('0xac')]=_0x40f6eb[_0x0b49('0x4c')]['threadId'];_0x336e2b[_0x0b49('0xae')]=_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0xae')];return db[_0x0b49('0xad')][_0x0b49('0x4b')](_0x336e2b)[_0x0b49('0x17')](function(_0x48f08f){return[_0x48f08f,!![]];});});}_0x2574c3[_0x0b49('0xaf')]=_0x4ad0e8['id'];if(_0x40f6eb[_0x0b49('0x4c')]['interaction']&&_0x40f6eb['body'][_0x0b49('0xb0')]['id']){_0x2574c3['id']=_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0xb0')]['id'];return db[_0x0b49('0xad')][_0x0b49('0x51')]({'where':_0x2574c3})[_0x0b49('0x17')](function(_0x3d2235){if(_0x3d2235){return[_0x3d2235,![]];}return db[_0x0b49('0xad')][_0x0b49('0x4b')](_0x336e2b)[_0x0b49('0x17')](function(_0x40f0c3){return[_0x40f0c3,!![]];});});}return db[_0x0b49('0xad')]['create'](_0x336e2b)[_0x0b49('0x17')](function(_0x105f10){return[_0x105f10,!![]];});}})[_0x0b49('0xb1')](function(_0x4f7faf,_0x187e68){if(_0x4f7faf){_0x471a7f=_0x187e68;if(!_0x187e68){var _0x53da61={'from':(_0x5cf27e[_0x0b49('0x9b')][_0x0b49('0xa0')]||'')+'\x20'+(_0x5cf27e['contact'][_0x0b49('0xb2')]||'')};if(_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0xac')]&&_0x40f6eb[_0x0b49('0x4c')]['messageId']&&_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0xac')]!=_0x40f6eb['body']['messageId']){_0x53da61['threadId']=_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0xb3')];}return _0x4f7faf[_0x0b49('0x28')](_0x53da61);}else{return _0x4f7faf;}}})['then'](function(_0x360c1f){_0x5cf27e['interaction']=_0x360c1f[_0x0b49('0x4e')]({'plain':!![]});_0x5cf27e[_0x0b49('0xb0')]['created']=_0x471a7f;if(_0x5cf27e[_0x0b49('0xb0')][_0x0b49('0xb4')]){if(_0x5cf27e[_0x0b49('0x97')][_0x0b49('0xb5')]){_0x5cf27e[_0x0b49('0x98')][_0x0b49('0xb6')]({'id':0x0,'priority':_0x5cf27e[_0x0b49('0x98')][_0x0b49('0x4a')]+0x1,'app':_0x0b49('0xb7'),'appdata':_0x0b49('0xb8'),'interval':_0x0b49('0xb9')});}}return db[_0x0b49('0xba')][_0x0b49('0x4b')]({'body':_0x40f6eb[_0x0b49('0x4c')][_0x0b49('0x4c')],'ChatWebsiteId':_0x40f6eb[_0x0b49('0x48')]['id'],'ChatInteractionId':_0x360c1f['id'],'direction':'in','ContactId':_0x5cf27e[_0x0b49('0x9b')]['id'],'AttachmentId':_0x40f6eb['body'][_0x0b49('0xbb')]});})[_0x0b49('0x17')](function(_0x3ff8e4){_0x5cf27e['message']=_0x3ff8e4;if(_0x5cf27e[_0x0b49('0xb0')][_0x0b49('0xbc')]){return db[_0x0b49('0xbd')][_0x0b49('0x51')]({'attributes':['id',_0x0b49('0x2b')],'where':{'id':_0x5cf27e[_0x0b49('0xb0')]['UserId']}})[_0x0b49('0x17')](function(_0x1e4670){if(_0x1e4670){_0x5cf27e[_0x0b49('0x98')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0b49('0xbe'),'appdata':_0x1e4670['name']+','+(_0x5cf27e['account'][_0x0b49('0xbf')]||0xa),'interval':_0x0b49('0xb9')});_0x5cf27e[_0x0b49('0xc0')]=!![];}return respondWithRpcPromise(_0x0b49('0xc1'),_0x0b49('0xc2'),_0x5cf27e);});}return respondWithRpcPromise(_0x0b49('0xc1'),_0x0b49('0xc2'),_0x5cf27e);})['then'](function(_0x14a139){respondWithRpcPromise('EventManager','EventManager',{'event':_0x0b49('0x80'),'message':_0x14a139},client9002);return _0x14a139;})[_0x0b49('0x17')](respondWithResult(_0x146b96,null))[_0x0b49('0x20')](handleError(_0x146b96,null));};exports[_0x0b49('0xc3')]=function(_0x31c47b,_0x3262e1){var _0x38cd77,_0x598974,_0xeb47de;var _0x16c3d4=[];var _0x14a17e={};var _0xe59207=_0x31c47b['files']||[];var _0x2fd488=[];var _0xf299b3;return db['CmContact']['describe']()[_0x0b49('0x17')](function(_0x4c4e61){if(!_0x4c4e61){throw new db[(_0x0b49('0x86'))][(_0x0b49('0x8c'))](_0x0b49('0xc4'));}_0x16c3d4=_[_0x0b49('0x87')](_[_0x0b49('0x49')](_0x4c4e61),[_0x0b49('0x88'),'updatedAt',_0x0b49('0xc5'),_0x0b49('0x8a')]);if(_0x31c47b[_0x0b49('0x4c')]['id']){delete _0x31c47b['body']['id'];}if(_['isNil'](_0x31c47b[_0x0b49('0x4c')][_0x0b49('0x8b')])){throw _0x3262e1['status'](0x1f4)[_0x0b49('0x2c')](new db[(_0x0b49('0x86'))]['ValidationError'](_0x0b49('0x8d')));}if(_['isNil'](_0x31c47b['body']['body'])||_0x31c47b[_0x0b49('0x4c')][_0x0b49('0x4c')]===''){throw _0x3262e1[_0x0b49('0x22')](0x1f4)['send'](new db[(_0x0b49('0x86'))][(_0x0b49('0x8c'))](_0x0b49('0x8e')));}if(_[_0x0b49('0x79')](_0x31c47b[_0x0b49('0x4c')][_0x0b49('0xc6')])){throw _0x3262e1[_0x0b49('0x22')](0x1f4)[_0x0b49('0x2c')](new db[(_0x0b49('0x86'))][(_0x0b49('0x8c'))](_0x0b49('0xc7')+_0x16c3d4));}if(!_[_0x0b49('0x91')](_0x16c3d4,_0x31c47b['body'][_0x0b49('0xc6')])){throw _0x3262e1[_0x0b49('0x22')](0x1f4)[_0x0b49('0x2c')](new db[(_0x0b49('0x86'))][(_0x0b49('0x8c'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16c3d4));}_0x14a17e[_0x31c47b[_0x0b49('0x4c')][_0x0b49('0xc6')]]=_0x31c47b[_0x0b49('0x4c')][_0x0b49('0x8b')];})[_0x0b49('0x17')](function(){return db[_0x0b49('0x31')]['find']({'where':{'id':_0x31c47b['params']['id']},'include':[{'model':db[_0x0b49('0x92')],'as':'List'},{'model':db[_0x0b49('0xc8')],'as':_0x0b49('0xc8')}]});})[_0x0b49('0x17')](handleEntityNotFound(_0x3262e1,null))[_0x0b49('0x17')](function(_0x15f94f){if(_0x15f94f&&_0x15f94f['List']){_0x598974=_0x15f94f;var _0x4d385a=_[_0x0b49('0x10')](_0x31c47b[_0x0b49('0x4c')],{'firstName':_0x31c47b[_0x0b49('0x4c')][_0x0b49('0x8b')],'phone':_0x31c47b['body'][_0x0b49('0x8b')],'ListId':_0x15f94f[_0x0b49('0x8a')]});_0x4d385a[_0x31c47b[_0x0b49('0x4c')][_0x0b49('0xc6')]]=_0x31c47b['body'][_0x0b49('0x8b')];return db[_0x0b49('0x85')][_0x0b49('0xc9')]({'where':_0x14a17e,'defaults':_0x4d385a});}})[_0x0b49('0xb1')](function(_0x24d1b6){if(_0x24d1b6){_0xeb47de=_0x24d1b6;var _0x452106=fs['readFileSync'](path['join'](config[_0x0b49('0x73')],_0x0b49('0xca')),_0x0b49('0xcb'));var _0x38698d=ejs[_0x0b49('0xcc')](_0x452106,{'body':_['toPairs'](_0x31c47b[_0x0b49('0x4c')][_0x0b49('0x4c')]),'bodyTitle':_0x598974[_0x0b49('0xcd')]});return db['ChatOfflineMessage'][_0x0b49('0x4b')]({'body':_0x38698d,'plainBody':htmlToText[_0x0b49('0xce')](_0x38698d),'ContactId':_0x24d1b6['id'],'ChatWebsiteId':_0x598974['id']});}})[_0x0b49('0x17')](function(_0x1b8297){_0xf299b3=_0x1b8297;if(_0xe59207[_0x0b49('0x4a')]){var _0x4c9393=_0xe59207[_0x0b49('0x30')](function(_0x37c1a0){return{'name':_0x37c1a0[_0x0b49('0xcf')],'basename':_0x37c1a0[_0x0b49('0x66')],'type':_0x37c1a0[_0x0b49('0xd0')],'ChatOfflineMessageId':_0x1b8297['id']};});_0x2fd488=_0x4c9393['map'](_0x557752=>{var _0x4d247f={'filename':_0x557752[_0x0b49('0x2b')],'path':path[_0x0b49('0x6d')](config[_0x0b49('0x73')],_0x0b49('0xd1'),_0x0b49('0xd2'),_0x0b49('0xd3'),_0x0b49('0xd4'),_0x557752['basename'])};return _0x4d247f;});if(!_0x598974['openNewInteraction']){return db['sequelize'][_0x0b49('0xd5')](function(_0x26a234){return db[_0x0b49('0xd6')][_0x0b49('0xd7')](_0x4c9393,{'transaction':_0x26a234});});}}})[_0x0b49('0x17')](function(){if(_0xf299b3){_0x38cd77=_0xf299b3;return db[_0x0b49('0xc8')][_0x0b49('0x5a')]({'where':{'service':!![]},'include':[{'model':db[_0x0b49('0xd8')],'as':_0x0b49('0xd9'),'raw':!![],'include':[{'model':db[_0x0b49('0xda')],'as':_0x0b49('0xda'),'raw':!![]}]}]});}})['then'](function(_0x10917e){if(_0x10917e&&_0x10917e[_0x0b49('0xd9')]&&_0x598974[_0x0b49('0xdb')]&&_0x598974[_0x0b49('0xdc')]){var _0xb1444c=_0x10917e[_0x0b49('0xdd')]();return respondWithRpcPromise(_0x0b49('0xde'),_0x0b49('0xdf'),{'account':_0xb1444c,'message':{'from':util[_0x0b49('0xa5')](_0x0b49('0xe0'),_0x10917e['name'],_0x10917e[_0x0b49('0xe1')]||_0x10917e[_0x0b49('0xd9')][_0x0b49('0x4d')]),'to':_0x598974[_0x0b49('0xdc')],'subject':_0x598974[_0x0b49('0xe2')],'html':_0x38cd77['body'],'attachments':_0x2fd488}},client9003)['then'](function(){return _0x38cd77;})[_0x0b49('0x20')](function(_0x3e310b){logger[_0x0b49('0x1c')](_0x3e310b);});}})[_0x0b49('0x17')](function(){if(_0x598974&&_0x598974['openNewInteraction']&&_0x598974[_0x0b49('0xe3')]){var _0x37be73=[];if(_0xe59207['length']){_0x37be73=_0xe59207['map'](function(_0x428ca6){return{'name':_0x428ca6['originalname'],'basename':_0x428ca6['filename'],'type':_0x428ca6[_0x0b49('0xd0')],'ChatOfflineMessageId':_0xf299b3['id']};});}var _0x2fceec;if(!_['isNil'](_0x598974[_0x0b49('0xe4')])){var _0xb01ee5=_[_0x0b49('0x30')](_0x31c47b[_0x0b49('0x4c')],function(_0x29d846){return _0x29d846;});var _0x3bef7e=_[_0x0b49('0xe5')](_0xb01ee5)[0x0];var _0x2666d9=_['mapValues'](_0x3bef7e,function(_0x147911){return _0x147911;});_0x2fceec=_0x2666d9[0x1][_0x598974[_0x0b49('0xe4')]];}var _0x15bb17={'from':_0xeb47de[_0x0b49('0xe1')],'firstName':_0xeb47de['firstName'],'lastName':_0xeb47de[_0x0b49('0xb2')],'mapKey':_0x0b49('0xe1'),'message':{'from':_0xeb47de[_0x0b49('0xe1')],'to':_0x598974[_0x0b49('0xc8')][_0x0b49('0xe1')],'cc':'','subject':_[_0x0b49('0x79')](_0x2fceec)?_0x598974[_0x0b49('0xe2')]:_0x2fceec,'messageId':'','sentAt':new Date(),'attach':_0x37be73[_0x0b49('0x4a')],'attachments':_0x37be73,'originChannel':_0x0b49('0xe6'),'ChatWebsiteId':_0x598974['id'],'ChatOfflineMessageId':_0x38cd77['id'],'originTo':_0x598974[_0x0b49('0xc8')]['email']},'body':_0x38cd77[_0x0b49('0x4c')]};var _0xb1b32b={'account':{'id':_0x598974[_0x0b49('0xe3')]},'body':_0x15bb17,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x0b49('0xe7'),'notifyMail',_0xb1b32b,client9001)[_0x0b49('0x17')](function(){return _0x38cd77;})[_0x0b49('0x20')](function(_0x16cf68){logger[_0x0b49('0x1c')](_0x16cf68);});}return;})[_0x0b49('0x17')](function(){if(_0x38cd77){return _0x38cd77;}})[_0x0b49('0x17')](respondWithResult(_0x3262e1,null))[_0x0b49('0x20')](function(_0x467156){logger[_0x0b49('0x1c')]('catch',_0x467156);for(var _0x11bf45 of _0xe59207){var _0x50d27c=path[_0x0b49('0x6d')](config[_0x0b49('0x73')],'server','files','attachments',_0x0b49('0xd4'),_0x11bf45[_0x0b49('0x66')]);fs_extra[_0x0b49('0xe8')](_0x50d27c)[_0x0b49('0x20')](function(_0xed00fc){logger[_0x0b49('0x1c')](_0x0b49('0xe9'),_0x50d27c,_0xed00fc);});}});};exports[_0x0b49('0xea')]=function(_0x4c9d12,_0x15f7cd){return db[_0x0b49('0xad')][_0x0b49('0x51')]({'where':{'id':_0x4c9d12[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x15f7cd,null))[_0x0b49('0x17')](function(_0x28e46f){if(_0x28e46f){return _0x28e46f[_0x0b49('0xea')](_0x4c9d12[_0x0b49('0x4c')][_0x0b49('0x63')],_[_0x0b49('0xeb')](_0x4c9d12[_0x0b49('0x4c')],['ids','id'])||{});}})[_0x0b49('0x17')](respondWithResult(_0x15f7cd,null))[_0x0b49('0x20')](handleError(_0x15f7cd,null));};exports[_0x0b49('0xec')]=function(_0x1029f2,_0x37a307){var _0x44ffa4={'raw':![],'where':{}};var _0x366323={};var _0xac4fed={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0b49('0x5a')]({'where':{'id':_0x1029f2[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x37a307,null))['then'](function(_0x57b6af){if(_0x57b6af){_0x366323[_0x0b49('0x36')]=_[_0x0b49('0x49')](db[_0x0b49('0xad')][_0x0b49('0x32')]);_0x366323[_0x0b49('0x37')]=_[_0x0b49('0x49')](_0x1029f2[_0x0b49('0x37')]);_0x366323['filters']=_[_0x0b49('0x39')](_0x366323[_0x0b49('0x36')],_0x366323[_0x0b49('0x37')]);_0x44ffa4[_0x0b49('0x3a')]=_[_0x0b49('0x39')](_0x366323[_0x0b49('0x36')],qs[_0x0b49('0x3b')](_0x1029f2[_0x0b49('0x37')][_0x0b49('0x3b')]));_0x44ffa4[_0x0b49('0x3a')]=_0x44ffa4[_0x0b49('0x3a')][_0x0b49('0x4a')]?_0x44ffa4['attributes']:_0x366323[_0x0b49('0x36')];if(!_0x1029f2[_0x0b49('0x37')][_0x0b49('0x3c')]('nolimit')){_0x44ffa4[_0x0b49('0x25')]=qs[_0x0b49('0x25')](_0x1029f2['query'][_0x0b49('0x25')]);_0x44ffa4[_0x0b49('0x23')]=qs['offset'](_0x1029f2[_0x0b49('0x37')][_0x0b49('0x23')]);}_0x44ffa4[_0x0b49('0x3d')]=qs[_0x0b49('0x3e')](_0x1029f2[_0x0b49('0x37')][_0x0b49('0x3e')]);_0x44ffa4[_0x0b49('0x3f')]=qs[_0x0b49('0x38')](_[_0x0b49('0x40')](_0x1029f2['query'],_0x366323[_0x0b49('0x38')]));_0x44ffa4['where'][_0x0b49('0x57')]=_0x57b6af['id'];if(_0x1029f2[_0x0b49('0x37')][_0x0b49('0x5c')]){_0x44ffa4[_0x0b49('0x3f')]=_['merge'](_0x44ffa4[_0x0b49('0x3f')],{'$or':_[_0x0b49('0x30')](_0x44ffa4['attributes'],function(_0x38cfd){var _0x2e4383={};_0x2e4383[_0x38cfd]={'$like':'%'+_0x1029f2[_0x0b49('0x37')][_0x0b49('0x5c')]+'%'};return _0x2e4383;})});}_0x44ffa4=_['merge']({},_0x44ffa4,_0x1029f2[_0x0b49('0x43')]);return db[_0x0b49('0xad')][_0x0b49('0x44')]({'where':_0x44ffa4[_0x0b49('0x3f')]})['then'](function(_0xa0700){_0xac4fed['count']=_0xa0700;if(_0x1029f2[_0x0b49('0x37')]['includeAll']){_0x44ffa4[_0x0b49('0x46')]=[{'model':db[_0x0b49('0x85')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x0b49('0xed'),'attributes':['name',_0x0b49('0xee'),_0x0b49('0xef')],'required':![]},{'model':db['Tag'],'as':_0x0b49('0xf0'),'attributes':['id','name',_0x0b49('0xf1')],'where':_0x1029f2[_0x0b49('0x37')][_0x0b49('0xf2')]?{'id':_0x1029f2['query']['tag']}:undefined,'required':_0x1029f2[_0x0b49('0x37')][_0x0b49('0xf2')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x44ffa4);})[_0x0b49('0x17')](function(_0x214b83){_0xac4fed[_0x0b49('0x61')]=_0x214b83;return _0xac4fed;});}})['then'](respondWithFilteredResult(_0x37a307,_0x44ffa4))[_0x0b49('0x20')](handleError(_0x37a307,null));};function iftimePromise(_0x59368b,_0x44f19d){return respondWithRpcPromise('Command',_0x0b49('0xf3'),{'command':_0x44f19d[_0x0b49('0xf4')]?util[_0x0b49('0xa5')](_0x0b49('0xf5'),_0x59368b[_0x0b49('0xf6')],_0x44f19d[_0x0b49('0xf4')]):util[_0x0b49('0xa5')](_0x0b49('0xf7'),_0x59368b[_0x0b49('0xf6')])},client9002)[_0x0b49('0x17')](function(_0x16329e){var _0x4c3f3d=_0x16329e&&_0x16329e['indexOf'](_0x0b49('0xf8'))>=0x0?!![]:![];logger[_0x0b49('0xf9')](_0x0b49('0xfa'),_0x44f19d['id'],_0x59368b['id'],_0x59368b['interval'],_0x4c3f3d?_0x0b49('0xfb'):'OFFLINE',_0x44f19d[_0x0b49('0xf4')]?_0x44f19d[_0x0b49('0xf4')]:_0x0b49('0xfc'));return _0x4c3f3d;})[_0x0b49('0x20')](function(_0x9bb969){logger[_0x0b49('0x1c')](_0x0b49('0xfa'),_0x44f19d['id'],_0x59368b['id'],_0x59368b['interval'],util['inspect'](_0x9bb969,{'showHidden':![],'depth':null}),_0x44f19d[_0x0b49('0xf4')]?_0x44f19d[_0x0b49('0xf4')]:_0x0b49('0xfc'));return![];});}exports['getSnippet']=function(_0xb3a02a,_0x560820){var _0x44d9c9=0x0;var _0x141736=0x0;var _0x40b87d=![];var _0x1d02bd;var _0x1a2586;return db[_0x0b49('0x31')]['find']({'where':{'id':_0xb3a02a[_0x0b49('0x48')]['id']},'include':[{'model':db['Interval'],'as':_0x0b49('0xfd'),'include':[{'model':db['Interval'],'as':_0x0b49('0xfe'),'attributes':['id',_0x0b49('0xf6')],'raw':!![]}]}]})[_0x0b49('0x17')](handleEntityNotFound(_0x560820,null))[_0x0b49('0x17')](function(_0x58c8f2){if(_0x58c8f2){_0x1d02bd=_0x58c8f2;return _0x58c8f2[_0x0b49('0xff')]({'raw':!![]});}})[_0x0b49('0x17')](function(_0x2d0bc9){if(_0x1d02bd){if(_0x2d0bc9){_0x1a2586=_0x2d0bc9;}}return require(_0x0b49('0x6f'))[_0x0b49('0x70')]();})['then'](function(_0x233e7f){if(_0x233e7f){_0x141736=_0x233e7f[_0x0b49('0x100')];_0x40b87d=_0x233e7f[_0x0b49('0x71')];}})[_0x0b49('0x17')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x0b49('0x17')](function(_0x24ae45){_0x44d9c9=_0x24ae45;if(_0x141736&&_0x24ae45>_0x141736){return db['License'][_0x0b49('0x5a')]({'where':{'id':0x1}})[_0x0b49('0x17')](function(_0x32c703){if(_0x32c703){_0x32c703[_0x0b49('0x101')](_0x0b49('0x102'));}});}})[_0x0b49('0x17')](function(){if(_0x1d02bd['Interval']&&_0x1d02bd[_0x0b49('0xfd')][_0x0b49('0xfe')]){var _0x95d2b5=[];for(var _0x539176=0x0;_0x539176<_0x1d02bd[_0x0b49('0xfd')][_0x0b49('0xfe')]['length'];_0x539176++){var _0x381a11=_0x1d02bd['Interval'][_0x0b49('0xfe')][_0x539176]['get']({'plain':!![]});_0x95d2b5['push'](iftimePromise(_0x381a11,_0x1d02bd));}return BPromise['all'](_0x95d2b5)[_0x0b49('0x17')](function(_0x5034f5){return _['some'](_0x5034f5);});}else{return!![];}})[_0x0b49('0x17')](function(_0x336ae6){var _0x2a7393=fs[_0x0b49('0x103')](path[_0x0b49('0x6d')](config['root'],'server/files/chat/iframe.ejs'),'utf8');var _0x943157=new url[(_0x0b49('0x104'))](_0x1d02bd[_0x0b49('0x105')])[_0x0b49('0x106')];var _0x57d6cc=_0x0b49('0x107');var _0x248ba5=![];var _0x2a57fa={'chatVersion':_0x57d6cc,'chatWebsiteAddressOrigin':_0x943157,'remote':_0x1d02bd[_0x0b49('0x108')],'query':querystring[_0x0b49('0xab')](_['merge'](_0x1d02bd[_0x0b49('0x4e')]({'plain':!![]}),{'customerIp':_0xb3a02a[_0x0b49('0x9d')]['x-forwarded-for']||_0xb3a02a['headers'][_0x0b49('0x109')]||_0xb3a02a[_0x0b49('0x10a')][_0x0b49('0x10b')]||_0xb3a02a['ip'],'referer':_0xb3a02a[_0x0b49('0x9d')][_0x0b49('0xa2')],'openedInteractions':_0x44d9c9,'maxInteractions':_0x141736,'virtual':_0x40b87d['virtual'],'online':_0x336ae6,'custom':_0x40b87d}))['replace'](/'/g,'\x5c\x27')};_0x560820[_0x0b49('0x2c')](ejs['render'](Mustache['render'](_0x2a7393,_0x2a57fa),{'proactiveActions':_0x1a2586,'alignment':_0x1d02bd[_0x0b49('0x10c')],'verticalAlignment':_0x1d02bd[_0x0b49('0x10d')],'div_color':_0x1d02bd['color'],'labelText':_0x1d02bd[_0x0b49('0x10e')],'text_color':_0x1d02bd[_0x0b49('0x10f')],'text_button_color':_0x1d02bd['textButtonColor'],'button_color':_0x1d02bd[_0x0b49('0x110')],'background_color':_0x1d02bd[_0x0b49('0x111')],'hideWhenOffline':_0x1d02bd['hideWhenOffline'],'intervalId':_0x1d02bd[_0x0b49('0x112')],'isDevelopment':_0x248ba5,'chatVersion':_0x57d6cc}));})[_0x0b49('0x20')](handleError(_0x560820,null));};exports['addApplications']=function(_0x5ce587,_0x1ee899){var _0x26282c=_0x5ce587['params']['id'];var _0x29d7a2=_0x5ce587['body'];var _0x373a94=0xc8;var _0x4fbc8a=null;return db['sequelize'][_0x0b49('0xd5')]({'isolationLevel':db['sequelize'][_0x0b49('0x113')][_0x0b49('0x114')][_0x0b49('0x115')]},function(_0x6ca91f){return db[_0x0b49('0x31')][_0x0b49('0x5a')]({'where':{'id':_0x26282c},'transaction':_0x6ca91f})[_0x0b49('0x17')](function(_0x1fcaa8){if(_0x1fcaa8){return db[_0x0b49('0x95')]['destroy']({'where':{'ChatWebsiteId':_0x26282c},'transaction':_0x6ca91f})[_0x0b49('0x17')](function(){var _0x5334de=_[_0x0b49('0x30')](_0x29d7a2,function(_0x825f){_0x825f['ChatWebsiteId']=_0x26282c;return _0x825f;});return db[_0x0b49('0x95')]['bulkCreate'](_0x5334de,{'transaction':_0x6ca91f});});}else{_0x373a94=0x194;_0x4fbc8a=[];}});})[_0x0b49('0x17')](function(){if(_0x373a94!==0x194){return db[_0x0b49('0x95')][_0x0b49('0x116')]({'where':{'ChatWebsiteId':_0x26282c},'order':_0x0b49('0x99')})[_0x0b49('0x17')](function(_0x1bb125){_0x4fbc8a=_0x1bb125;});}})[_0x0b49('0x20')](function(_0x549762){_0x373a94=0x1f4;logger[_0x0b49('0x1c')](_0x549762[_0x0b49('0x2a')]);if(_0x549762[_0x0b49('0x2b')]){delete _0x549762[_0x0b49('0x2b')];}_0x4fbc8a=_0x549762;})['finally'](function(){if(_0x4fbc8a===null){_0x1ee899['sendStatus'](_0x373a94);}else{if(_0x373a94===0x1f4){_0x1ee899[_0x0b49('0x22')](_0x373a94)[_0x0b49('0x2c')](_0x4fbc8a);}else{_0x1ee899[_0x0b49('0x22')](_0x373a94)[_0x0b49('0x27')](_0x4fbc8a);}}});};exports[_0x0b49('0x117')]=function(_0x284390,_0x4ccc35){var _0x5620cd={};var _0x4f48c8={};var _0x726973;var _0xb835ac;return db[_0x0b49('0x31')]['findOne']({'where':{'id':_0x284390[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x4ccc35,null))[_0x0b49('0x17')](function(_0x4320a0){if(_0x4320a0){_0x726973=_0x4320a0;_0x4f48c8['model']=_[_0x0b49('0x49')](db[_0x0b49('0x95')]['rawAttributes']);_0x4f48c8['query']=_[_0x0b49('0x49')](_0x284390[_0x0b49('0x37')]);_0x4f48c8[_0x0b49('0x38')]=_[_0x0b49('0x39')](_0x4f48c8[_0x0b49('0x36')],_0x4f48c8[_0x0b49('0x37')]);_0x5620cd[_0x0b49('0x3a')]=_['intersection'](_0x4f48c8[_0x0b49('0x36')],qs[_0x0b49('0x3b')](_0x284390[_0x0b49('0x37')]['fields']));_0x5620cd[_0x0b49('0x3a')]=_0x5620cd[_0x0b49('0x3a')][_0x0b49('0x4a')]?_0x5620cd[_0x0b49('0x3a')]:_0x4f48c8[_0x0b49('0x36')];_0x5620cd['order']=qs[_0x0b49('0x3e')](_0x284390['query'][_0x0b49('0x3e')]);_0x5620cd[_0x0b49('0x3f')]=qs[_0x0b49('0x38')](_['pick'](_0x284390[_0x0b49('0x37')],_0x4f48c8[_0x0b49('0x38')]));if(_0x284390['query'][_0x0b49('0x5c')]){_0x5620cd['where']=_['merge'](_0x5620cd[_0x0b49('0x3f')],{'$or':_['map'](_0x5620cd['attributes'],function(_0x4f2adb){var _0x4f8602={};_0x4f8602[_0x4f2adb]={'$like':'%'+_0x284390[_0x0b49('0x37')][_0x0b49('0x5c')]+'%'};return _0x4f8602;})});}_0x5620cd=_['merge']({},_0x5620cd,_0x284390['options']);return _0x726973[_0x0b49('0x117')](_0x5620cd);}})[_0x0b49('0x17')](function(_0x339e16){if(_0x339e16){_0xb835ac=_0x339e16[_0x0b49('0x4a')];if(!_0x284390['query'][_0x0b49('0x3c')](_0x0b49('0x5b'))){_0x5620cd[_0x0b49('0x25')]=qs[_0x0b49('0x25')](_0x284390['query'][_0x0b49('0x25')]);_0x5620cd[_0x0b49('0x23')]=qs[_0x0b49('0x23')](_0x284390['query'][_0x0b49('0x23')]);}return _0x726973[_0x0b49('0x117')](_0x5620cd);}})[_0x0b49('0x17')](function(_0x3cf089){if(_0x3cf089){return _0x3cf089?{'count':_0xb835ac,'rows':_0x3cf089}:null;}})[_0x0b49('0x17')](respondWithResult(_0x4ccc35,null))[_0x0b49('0x20')](handleError(_0x4ccc35,null));};exports[_0x0b49('0x118')]=function(_0x328d90,_0x2ef888){return db[_0x0b49('0x119')][_0x0b49('0x51')]({'where':{'id':_0x328d90['params']['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x2ef888,null))[_0x0b49('0x17')](function(_0x5324ec){if(_0x5324ec){return _0x5324ec[_0x0b49('0x118')](_0x328d90['body']['ids'],_[_0x0b49('0xeb')](_0x328d90[_0x0b49('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x2ef888,null))[_0x0b49('0x20')](handleError(_0x2ef888,null));};exports[_0x0b49('0xff')]=function(_0x3e3460,_0x105b40){var _0x3b75b6={};var _0x4c6418={};var _0x3cd517;var _0x681834;return db[_0x0b49('0x31')][_0x0b49('0x5a')]({'where':{'id':_0x3e3460[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x105b40,null))['then'](function(_0x1d97f0){if(_0x1d97f0){_0x3cd517=_0x1d97f0;_0x4c6418['model']=_['keys'](db[_0x0b49('0x11a')][_0x0b49('0x32')]);_0x4c6418[_0x0b49('0x37')]=_['keys'](_0x3e3460[_0x0b49('0x37')]);_0x4c6418['filters']=_[_0x0b49('0x39')](_0x4c6418['model'],_0x4c6418[_0x0b49('0x37')]);_0x3b75b6[_0x0b49('0x3a')]=_[_0x0b49('0x39')](_0x4c6418[_0x0b49('0x36')],qs[_0x0b49('0x3b')](_0x3e3460[_0x0b49('0x37')][_0x0b49('0x3b')]));_0x3b75b6['attributes']=_0x3b75b6[_0x0b49('0x3a')][_0x0b49('0x4a')]?_0x3b75b6[_0x0b49('0x3a')]:_0x4c6418['model'];_0x3b75b6['order']=qs[_0x0b49('0x3e')](_0x3e3460[_0x0b49('0x37')]['sort']);_0x3b75b6['where']=qs[_0x0b49('0x38')](_[_0x0b49('0x40')](_0x3e3460[_0x0b49('0x37')],_0x4c6418[_0x0b49('0x38')]));if(_0x3e3460['query'][_0x0b49('0x5c')]){_0x3b75b6[_0x0b49('0x3f')]=_[_0x0b49('0x42')](_0x3b75b6[_0x0b49('0x3f')],{'$or':_['map'](_0x3b75b6[_0x0b49('0x3a')],function(_0x3b3e95){var _0x289736={};_0x289736[_0x3b3e95]={'$like':'%'+_0x3e3460['query'][_0x0b49('0x5c')]+'%'};return _0x289736;})});}_0x3b75b6=_['merge']({},_0x3b75b6,_0x3e3460[_0x0b49('0x43')]);return _0x3cd517[_0x0b49('0xff')](_0x3b75b6);}})['then'](function(_0x1acb1b){if(_0x1acb1b){_0x681834=_0x1acb1b[_0x0b49('0x4a')];if(!_0x3e3460[_0x0b49('0x37')][_0x0b49('0x3c')](_0x0b49('0x5b'))){_0x3b75b6[_0x0b49('0x25')]=qs[_0x0b49('0x25')](_0x3e3460[_0x0b49('0x37')][_0x0b49('0x25')]);_0x3b75b6[_0x0b49('0x23')]=qs[_0x0b49('0x23')](_0x3e3460['query'][_0x0b49('0x23')]);}return _0x3cd517[_0x0b49('0xff')](_0x3b75b6);}})[_0x0b49('0x17')](function(_0x110273){if(_0x110273){return _0x110273?{'count':_0x681834,'rows':_0x110273}:null;}})['then'](respondWithResult(_0x105b40,null))[_0x0b49('0x20')](handleError(_0x105b40,null));};exports['getFields']=function(_0x30aa62,_0x427957){var _0xe206d8=_0x30aa62[_0x0b49('0x37')]['online']==='false'?_0x0b49('0x11b'):_0x0b49('0x11c');return db['ChatWebsite'][_0x0b49('0x51')]({'attributes':['id',_0xe206d8],'where':{'id':_0x30aa62['params']['id']}})['then'](handleEntityNotFound(_0x427957,null))['then'](function(_0x12c232){if(_0x12c232){var _0xc9305b=_0x12c232[_0xe206d8];var _0x23c111=_0xc9305b&&_0xc9305b['items']?_0xc9305b[_0x0b49('0x11d')]:[];_0x427957[_0x0b49('0x2c')]({'fromKey':_[_0x0b49('0x79')](_0xc9305b[_0x0b49('0x11e')])?undefined:_0xc9305b[_0x0b49('0x11e')],'count':_0x23c111[_0x0b49('0x4a')],'rows':_0x23c111});}})[_0x0b49('0x20')](handleError(_0x427957,null));};exports[_0x0b49('0x11f')]=function(_0x53e747,_0x40c504){var _0xd317c0={'raw':![],'where':{}};var _0x4867f3={};var _0xa27233={'count':0x0,'rows':[]};return db[_0x0b49('0x31')][_0x0b49('0x5a')]({'where':{'id':_0x53e747[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x40c504,null))['then'](function(_0x28faf6){if(_0x28faf6){_0x4867f3[_0x0b49('0x36')]=_['keys'](db[_0x0b49('0x120')]['rawAttributes']);_0x4867f3['query']=_[_0x0b49('0x49')](_0x53e747[_0x0b49('0x37')]);_0x4867f3[_0x0b49('0x38')]=_[_0x0b49('0x39')](_0x4867f3['model'],_0x4867f3[_0x0b49('0x37')]);_0xd317c0[_0x0b49('0x3a')]=_[_0x0b49('0x39')](_0x4867f3['model'],qs[_0x0b49('0x3b')](_0x53e747[_0x0b49('0x37')]['fields']));_0xd317c0['attributes']=_0xd317c0[_0x0b49('0x3a')][_0x0b49('0x4a')]?_0xd317c0[_0x0b49('0x3a')]:_0x4867f3[_0x0b49('0x36')];if(!_0x53e747[_0x0b49('0x37')][_0x0b49('0x3c')](_0x0b49('0x5b'))){_0xd317c0[_0x0b49('0x25')]=qs[_0x0b49('0x25')](_0x53e747[_0x0b49('0x37')]['limit']);_0xd317c0['offset']=qs[_0x0b49('0x23')](_0x53e747['query'][_0x0b49('0x23')]);}_0xd317c0['order']=qs[_0x0b49('0x3e')](_0x53e747[_0x0b49('0x37')][_0x0b49('0x3e')]);_0xd317c0[_0x0b49('0x3f')]=qs[_0x0b49('0x38')](_['pick'](_0x53e747[_0x0b49('0x37')],_0x4867f3[_0x0b49('0x38')]));_0xd317c0[_0x0b49('0x3f')][_0x0b49('0x57')]=_0x28faf6['id'];if(_0x53e747[_0x0b49('0x37')][_0x0b49('0x5c')]){_0xd317c0[_0x0b49('0x3f')]=_['merge'](_0xd317c0['where'],{'$or':_[_0x0b49('0x30')](_0xd317c0[_0x0b49('0x3a')],function(_0xb63d45){var _0x2c6d55={};_0x2c6d55[_0xb63d45]={'$like':'%'+_0x53e747[_0x0b49('0x37')][_0x0b49('0x5c')]+'%'};return _0x2c6d55;})});}_0xd317c0=_[_0x0b49('0x42')]({},_0xd317c0,_0x53e747['options']);return db[_0x0b49('0x120')][_0x0b49('0x44')]({'where':_0xd317c0[_0x0b49('0x3f')]})[_0x0b49('0x17')](function(_0x2d0eff){_0xa27233[_0x0b49('0x44')]=_0x2d0eff;if(_0x53e747[_0x0b49('0x37')]['includeAll']){_0xd317c0[_0x0b49('0x46')]=[{'all':!![]}];}else{_0xd317c0[_0x0b49('0x46')]=[{'model':db[_0x0b49('0x85')],'as':_0x0b49('0x121'),'required':![]},{'model':db[_0x0b49('0xd6')],'as':_0x0b49('0x122'),'required':![]}];}return db[_0x0b49('0x120')][_0x0b49('0x5d')](_0xd317c0);})[_0x0b49('0x17')](function(_0x8db4ea){_0xa27233[_0x0b49('0x61')]=_0x8db4ea;return _0xa27233;});}})[_0x0b49('0x17')](respondWithFilteredResult(_0x40c504,_0xd317c0))[_0x0b49('0x20')](handleError(_0x40c504,null));};exports[_0x0b49('0x123')]=function(_0x113146,_0x3a0d3a){return db[_0x0b49('0x31')][_0x0b49('0x51')]({'where':{'id':_0x113146['params']['id']}})['then'](handleEntityNotFound(_0x3a0d3a,null))[_0x0b49('0x17')](function(_0x1d7003){if(_0x1d7003){return _0x1d7003[_0x0b49('0x123')](_0x113146[_0x0b49('0x4c')][_0x0b49('0x63')],_[_0x0b49('0xeb')](_0x113146[_0x0b49('0x4c')],[_0x0b49('0x63'),'id'])||{})[_0x0b49('0xb1')](function(_0x49640d){for(var _0x445c07=0x0;_0x445c07<_0x113146[_0x0b49('0x4c')]['ids'][_0x0b49('0x4a')];_0x445c07+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x113146[_0x0b49('0x4c')][_0x0b49('0x63')][_0x445c07]),'ChatWebsiteId':Number(_0x113146['params']['id'])});}return _0x49640d;});}})[_0x0b49('0x17')](respondWithResult(_0x3a0d3a,null))[_0x0b49('0x20')](handleError(_0x3a0d3a,null));};exports['removeAgents']=function(_0x262316,_0x36e63d){return db[_0x0b49('0x31')][_0x0b49('0x51')]({'where':{'id':_0x262316[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x36e63d,null))[_0x0b49('0x17')](function(_0x320c49){if(_0x320c49){return _0x320c49[_0x0b49('0x124')](_0x262316[_0x0b49('0x37')][_0x0b49('0x63')])['then'](function(){if(_['isArray'](_0x262316[_0x0b49('0x37')][_0x0b49('0x63')])){for(var _0xe1e810=0x0;_0xe1e810<_0x262316[_0x0b49('0x37')][_0x0b49('0x63')]['length'];_0xe1e810+=0x1){socket[_0x0b49('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x262316[_0x0b49('0x37')][_0x0b49('0x63')][_0xe1e810]),'ChatWebsiteId':Number(_0x262316[_0x0b49('0x48')]['id'])});}}else{socket[_0x0b49('0x125')](_0x0b49('0x126'),{'UserId':Number(_0x262316[_0x0b49('0x37')][_0x0b49('0x63')]),'ChatWebsiteId':Number(_0x262316[_0x0b49('0x48')]['id'])});}});}})[_0x0b49('0x17')](respondWithStatusCode(_0x36e63d,null))['catch'](handleError(_0x36e63d,null));};exports[_0x0b49('0x127')]=function(_0xa69331,_0x5b0a8b){var _0x4c7f75={};var _0x5ddc73={};var _0xe584a;var _0xc68a69;return db[_0x0b49('0x31')][_0x0b49('0x5a')]({'where':{'id':_0xa69331[_0x0b49('0x48')]['id']}})[_0x0b49('0x17')](handleEntityNotFound(_0x5b0a8b,null))[_0x0b49('0x17')](function(_0xd3169e){if(_0xd3169e){_0xe584a=_0xd3169e;_0x5ddc73[_0x0b49('0x36')]=_['keys'](db[_0x0b49('0xbd')][_0x0b49('0x32')]);_0x5ddc73['query']=_[_0x0b49('0x49')](_0xa69331[_0x0b49('0x37')]);_0x5ddc73['filters']=_[_0x0b49('0x39')](_0x5ddc73[_0x0b49('0x36')],_0x5ddc73[_0x0b49('0x37')]);_0x4c7f75[_0x0b49('0x3a')]=_[_0x0b49('0x39')](_0x5ddc73[_0x0b49('0x36')],qs[_0x0b49('0x3b')](_0xa69331[_0x0b49('0x37')][_0x0b49('0x3b')]));_0x4c7f75[_0x0b49('0x3a')]=_0x4c7f75[_0x0b49('0x3a')][_0x0b49('0x4a')]?_0x4c7f75[_0x0b49('0x3a')]:_0x5ddc73[_0x0b49('0x36')];_0x4c7f75['order']=qs[_0x0b49('0x3e')](_0xa69331[_0x0b49('0x37')][_0x0b49('0x3e')]);_0x4c7f75[_0x0b49('0x3f')]=qs[_0x0b49('0x38')](_[_0x0b49('0x40')](_0xa69331[_0x0b49('0x37')],_0x5ddc73['filters']));if(_0xa69331['query'][_0x0b49('0x5c')]){_0x4c7f75[_0x0b49('0x3f')]=_[_0x0b49('0x42')](_0x4c7f75[_0x0b49('0x3f')],{'$or':_['map'](_0x4c7f75['attributes'],function(_0x492a39){var _0x583bc0={};_0x583bc0[_0x492a39]={'$like':'%'+_0xa69331[_0x0b49('0x37')]['filter']+'%'};return _0x583bc0;})});}_0x4c7f75=_[_0x0b49('0x42')]({},_0x4c7f75,_0xa69331[_0x0b49('0x43')]);return _0xe584a[_0x0b49('0x127')](_0x4c7f75);}})['then'](function(_0x33fde1){if(_0x33fde1){_0xc68a69=_0x33fde1[_0x0b49('0x4a')];if(!_0xa69331['query'][_0x0b49('0x3c')](_0x0b49('0x5b'))){_0x4c7f75[_0x0b49('0x25')]=qs[_0x0b49('0x25')](_0xa69331[_0x0b49('0x37')]['limit']);_0x4c7f75[_0x0b49('0x23')]=qs[_0x0b49('0x23')](_0xa69331[_0x0b49('0x37')]['offset']);}return _0xe584a['getAgents'](_0x4c7f75);}})['then'](function(_0x207f59){if(_0x207f59){return _0x207f59?{'count':_0xc68a69,'rows':_0x207f59}:null;}})[_0x0b49('0x17')](respondWithResult(_0x5b0a8b,null))['catch'](handleError(_0x5b0a8b,null));};
\ No newline at end of file
+var _0x53a4=['MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','originalname','mimetype','server','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url','../../mysqldb','redis','localhost','register','html-to-text','jayson/promise','http','client','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','offset','undefined','limit','count','set','json','update','destroy','ChatWebsites','UserProfileResource','end','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','includeAll','include','findAll','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','findOne','Disposition','nolimit','pick','ChatWebsiteId','filter','rows','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','join','download','root','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','orderBy','priority','asc','account','defaults','contact','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','files','no\x20available\x20attributes','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x53a4,0x19d));var _0x453a=function(_0x22ea80,_0x2e80ca){_0x22ea80=_0x22ea80-0x0;var _0x4adadf=_0x53a4[_0x22ea80];return _0x4adadf;};'use strict';var BPromise=require(_0x453a('0x0'));var Mustache=require(_0x453a('0x1'));var util=require(_0x453a('0x2'));var path=require(_0x453a('0x3'));var ejs=require(_0x453a('0x4'));var fs=require('fs');var fs_extra=require(_0x453a('0x5'));var _=require(_0x453a('0x6'));var querystring=require('querystring');var Redis=require(_0x453a('0x7'));var qs=require(_0x453a('0x8'));var logger=require(_0x453a('0x9'))('api');var config=require(_0x453a('0xa'));var url=require(_0x453a('0xb'));var db=require(_0x453a('0xc'))['db'];config[_0x453a('0xd')]=_['defaults'](config['redis'],{'host':_0x453a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x453a('0xf')](socket);var htmlToText=require(_0x453a('0x10'));var jayson=require(_0x453a('0x11'));var client=jayson['client'][_0x453a('0x12')]({'port':0x232c});var client9002=jayson[_0x453a('0x13')][_0x453a('0x12')]({'port':0x232a});var client9003=jayson[_0x453a('0x13')][_0x453a('0x12')]({'port':0x232b});var client9001=jayson[_0x453a('0x13')][_0x453a('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x118c36,_0x347f27,_0x20acef,_0x5ab583){return new BPromise(function(_0x33e339,_0x49d1dd){var _0x517258=_0x5ab583||client;return _0x517258[_0x453a('0x14')](_0x118c36,_0x20acef)[_0x453a('0x15')](function(_0x17c0a7){logger['info'](_0x453a('0x16'),_0x347f27,_0x453a('0x17'));logger['debug'](_0x453a('0x18'),_0x347f27,_0x453a('0x17'),JSON[_0x453a('0x19')](_0x17c0a7));if(_0x17c0a7['error']){if(_0x17c0a7['error'][_0x453a('0x1a')]===0x1f4){logger[_0x453a('0x1b')](_0x453a('0x16'),_0x347f27,_0x17c0a7['error']['message']);return _0x49d1dd(_0x17c0a7[_0x453a('0x1b')][_0x453a('0x1c')]);}logger[_0x453a('0x1b')](_0x453a('0x16'),_0x347f27,_0x17c0a7[_0x453a('0x1b')]['message']);return _0x33e339(_0x17c0a7[_0x453a('0x1b')][_0x453a('0x1c')]);}else{logger[_0x453a('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x347f27,'request\x20sent');_0x33e339(_0x17c0a7[_0x453a('0x1e')][_0x453a('0x1c')]);}})[_0x453a('0x1f')](function(_0x36ba87){logger[_0x453a('0x1b')](_0x453a('0x16'),_0x347f27,_0x36ba87);_0x49d1dd(_0x36ba87);});});}function respondWithStatusCode(_0x1aa74c,_0x180b1f){_0x180b1f=_0x180b1f||0xcc;return function(_0x1b230a){if(_0x1b230a){return _0x1aa74c[_0x453a('0x20')](_0x180b1f);}return _0x1aa74c[_0x453a('0x21')](_0x180b1f)['end']();};}function respondWithResult(_0x26b3c2,_0x415353){_0x415353=_0x415353||0xc8;return function(_0x208dac){if(_0x208dac){return _0x26b3c2['status'](_0x415353)['json'](_0x208dac);}};}function respondWithFilteredResult(_0x14d9d2,_0x3a0dd8){return function(_0x2e78e4){if(_0x2e78e4){var _0x6a5bca=typeof _0x3a0dd8[_0x453a('0x22')]===_0x453a('0x23')&&typeof _0x3a0dd8[_0x453a('0x24')]===_0x453a('0x23');var _0x3686c5=_0x2e78e4['count'];var _0x10433d=_0x6a5bca?0x0:_0x3a0dd8['offset'];var _0x7b6795=_0x6a5bca?_0x2e78e4[_0x453a('0x25')]:_0x3a0dd8[_0x453a('0x22')]+_0x3a0dd8[_0x453a('0x24')];var _0x30c977;if(_0x7b6795>=_0x3686c5){_0x7b6795=_0x3686c5;_0x30c977=0xc8;}else{_0x30c977=0xce;}_0x14d9d2[_0x453a('0x21')](_0x30c977);return _0x14d9d2[_0x453a('0x26')]('Content-Range',_0x10433d+'-'+_0x7b6795+'/'+_0x3686c5)[_0x453a('0x27')](_0x2e78e4);}return null;};}function saveUpdates(_0x35437c){return function(_0x3b42f8){if(_0x3b42f8){return _0x3b42f8[_0x453a('0x28')](_0x35437c)[_0x453a('0x15')](function(_0x51ec9e){return _0x51ec9e;});}return null;};}function removeEntity(_0x4c3bd8){return function(_0x23b0f0){if(_0x23b0f0){return _0x23b0f0[_0x453a('0x29')]()[_0x453a('0x15')](function(){var _0x128245=_0x23b0f0['get']({'plain':!![]});var _0x2ccb22=_0x453a('0x2a');return db[_0x453a('0x2b')][_0x453a('0x29')]({'where':{'type':_0x2ccb22,'resourceId':_0x128245['id']}})['then'](function(){return _0x23b0f0;});})[_0x453a('0x15')](function(){_0x4c3bd8['status'](0xcc)[_0x453a('0x2c')]();});}};}function handleEntityNotFound(_0x56c7fa){return function(_0x5abe84){if(!_0x5abe84){_0x56c7fa[_0x453a('0x20')](0x194);}return _0x5abe84;};}function handleError(_0x4f2c73,_0x1c7867){_0x1c7867=_0x1c7867||0x1f4;return function(_0xfe7463){logger['error'](_0xfe7463['stack']);if(_0xfe7463[_0x453a('0x2d')]){delete _0xfe7463[_0x453a('0x2d')];}_0x4f2c73['status'](_0x1c7867)[_0x453a('0x2e')](_0xfe7463);};}exports[_0x453a('0x2f')]=function(_0x35184c,_0xa2becd){var _0x7ce78={'include':[{'model':db[_0x453a('0x30')],'as':_0x453a('0x31')}]},_0x2e8438={},_0x2f7991={'count':0x0,'rows':[]};var _0x1beef2=_['map'](db[_0x453a('0x32')][_0x453a('0x33')],function(_0x3db016){return{'name':_0x3db016[_0x453a('0x34')],'type':_0x3db016[_0x453a('0x35')][_0x453a('0x36')]};});_0x2e8438[_0x453a('0x37')]=_['map'](_0x1beef2,_0x453a('0x2d'));_0x2e8438['query']=_[_0x453a('0x38')](_0x35184c[_0x453a('0x39')]);_0x2e8438[_0x453a('0x3a')]=_[_0x453a('0x3b')](_0x2e8438[_0x453a('0x37')],_0x2e8438[_0x453a('0x39')]);_0x7ce78[_0x453a('0x3c')]=_[_0x453a('0x3b')](_0x2e8438[_0x453a('0x37')],qs[_0x453a('0x3d')](_0x35184c[_0x453a('0x39')][_0x453a('0x3d')]));_0x7ce78['attributes']=_0x7ce78[_0x453a('0x3c')][_0x453a('0x3e')]?_0x7ce78[_0x453a('0x3c')]:_0x2e8438['model'];if(!_0x35184c[_0x453a('0x39')][_0x453a('0x3f')]('nolimit')){_0x7ce78['limit']=qs[_0x453a('0x24')](_0x35184c['query'][_0x453a('0x24')]);_0x7ce78['offset']=qs['offset'](_0x35184c['query'][_0x453a('0x22')]);}_0x7ce78[_0x453a('0x40')]=qs[_0x453a('0x41')](_0x35184c[_0x453a('0x39')][_0x453a('0x41')]);_0x7ce78[_0x453a('0x42')]=qs[_0x453a('0x3a')](_['pick'](_0x35184c[_0x453a('0x39')],_0x2e8438[_0x453a('0x3a')]),_0x1beef2);if(_0x35184c[_0x453a('0x39')]['filter']){_0x7ce78['where']=_[_0x453a('0x43')](_0x7ce78[_0x453a('0x42')],{'$or':_[_0x453a('0x44')](_0x1beef2,function(_0x2afd82){if(_0x2afd82[_0x453a('0x35')]!==_0x453a('0x45')){var _0xbc6e59={};_0xbc6e59[_0x2afd82[_0x453a('0x2d')]]={'$like':'%'+_0x35184c[_0x453a('0x39')]['filter']+'%'};return _0xbc6e59;}})});}_0x7ce78=_[_0x453a('0x43')]({},_0x7ce78,_0x35184c['options']);var _0x1219b0={'where':_0x7ce78['where']};return db[_0x453a('0x32')][_0x453a('0x25')](_0x1219b0)[_0x453a('0x15')](function(_0x5bd1a6){_0x2f7991[_0x453a('0x25')]=_0x5bd1a6;if(_0x35184c[_0x453a('0x39')][_0x453a('0x46')]){_0x7ce78[_0x453a('0x47')]=[{'all':!![]}];}return db[_0x453a('0x32')][_0x453a('0x48')](_0x7ce78);})[_0x453a('0x15')](function(_0x177552){_0x2f7991['rows']=_0x177552;return _0x2f7991;})[_0x453a('0x15')](respondWithFilteredResult(_0xa2becd,_0x7ce78))[_0x453a('0x1f')](handleError(_0xa2becd,null));};exports[_0x453a('0x49')]=function(_0x2e77f5,_0x46284c){var _0x4aa129={'raw':![],'where':{'id':_0x2e77f5[_0x453a('0x4a')]['id']},'include':[{'model':db[_0x453a('0x30')],'as':_0x453a('0x31')}]},_0x56a17e={};_0x56a17e[_0x453a('0x37')]=_[_0x453a('0x38')](db[_0x453a('0x32')][_0x453a('0x33')]);_0x56a17e[_0x453a('0x39')]=_[_0x453a('0x38')](_0x2e77f5['query']);_0x56a17e[_0x453a('0x3a')]=_[_0x453a('0x3b')](_0x56a17e[_0x453a('0x37')],_0x56a17e[_0x453a('0x39')]);_0x4aa129[_0x453a('0x3c')]=_[_0x453a('0x3b')](_0x56a17e['model'],qs[_0x453a('0x3d')](_0x2e77f5[_0x453a('0x39')][_0x453a('0x3d')]));_0x4aa129[_0x453a('0x3c')]=_0x4aa129[_0x453a('0x3c')][_0x453a('0x3e')]?_0x4aa129[_0x453a('0x3c')]:_0x56a17e[_0x453a('0x37')];if(_0x2e77f5[_0x453a('0x39')][_0x453a('0x46')]){_0x4aa129[_0x453a('0x47')]=[{'all':!![]}];}_0x4aa129=_[_0x453a('0x43')]({},_0x4aa129,_0x2e77f5[_0x453a('0x4b')]);return db['ChatWebsite'][_0x453a('0x4c')](_0x4aa129)['then'](handleEntityNotFound(_0x46284c,null))[_0x453a('0x15')](respondWithResult(_0x46284c,null))[_0x453a('0x1f')](handleError(_0x46284c,null));};exports[_0x453a('0x4d')]=function(_0x5576f1,_0x2b472e){return db[_0x453a('0x32')][_0x453a('0x4d')](_0x5576f1[_0x453a('0x4e')],{})[_0x453a('0x15')](function(_0x5eb883){var _0x356bb2=_0x5576f1[_0x453a('0x4f')][_0x453a('0x50')]({'plain':!![]});if(!_0x356bb2)throw new Error(_0x453a('0x51'));if(_0x356bb2[_0x453a('0x52')]===_0x453a('0x4f')){var _0x28d4ff=_0x5eb883[_0x453a('0x50')]({'plain':!![]});var _0x45eff4=_0x453a('0x2a');return db[_0x453a('0x53')][_0x453a('0x4c')]({'where':{'name':_0x45eff4,'userProfileId':_0x356bb2[_0x453a('0x54')]},'raw':!![]})[_0x453a('0x15')](function(_0x3c733c){if(_0x3c733c&&_0x3c733c[_0x453a('0x55')]===0x0){return db['UserProfileResource'][_0x453a('0x4d')]({'name':_0x28d4ff[_0x453a('0x2d')],'resourceId':_0x28d4ff['id'],'type':_0x3c733c[_0x453a('0x2d')],'sectionId':_0x3c733c['id']},{})['then'](function(){return _0x5eb883;});}else{return _0x5eb883;}})[_0x453a('0x1f')](function(_0x7dd73f){logger[_0x453a('0x1b')](_0x453a('0x56'),_0x7dd73f);throw _0x7dd73f;});}return _0x5eb883;})['then'](respondWithResult(_0x2b472e,0xc9))['catch'](handleError(_0x2b472e,null));};exports[_0x453a('0x28')]=function(_0x24154f,_0x11e154){if(_0x24154f[_0x453a('0x4e')]['id']){delete _0x24154f[_0x453a('0x4e')]['id'];}return db[_0x453a('0x32')]['find']({'where':{'id':_0x24154f[_0x453a('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0x453a('0x31')}]})[_0x453a('0x15')](handleEntityNotFound(_0x11e154,null))[_0x453a('0x15')](saveUpdates(_0x24154f[_0x453a('0x4e')],null))['then'](respondWithResult(_0x11e154,null))[_0x453a('0x1f')](handleError(_0x11e154,null));};exports[_0x453a('0x29')]=function(_0x1db30c,_0x3fa2a1){return db[_0x453a('0x32')]['find']({'where':{'id':_0x1db30c[_0x453a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3fa2a1,null))[_0x453a('0x15')](removeEntity(_0x3fa2a1,null))['catch'](handleError(_0x3fa2a1,null));};exports[_0x453a('0x57')]=function(_0x315b45,_0x41d527){return db[_0x453a('0x32')]['describe']()[_0x453a('0x15')](respondWithResult(_0x41d527,null))[_0x453a('0x1f')](handleError(_0x41d527,null));};exports[_0x453a('0x58')]=function(_0x5e7457,_0x30361d){if(_0x5e7457[_0x453a('0x4e')]['id']){delete _0x5e7457['body']['id'];}return db[_0x453a('0x32')][_0x453a('0x4c')]({'where':{'id':_0x5e7457[_0x453a('0x4a')]['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x30361d,null))[_0x453a('0x15')](function(_0xb866b9){if(_0xb866b9){_0x5e7457['body']['ChatWebsiteId']=_0xb866b9['id'];return db['Disposition'][_0x453a('0x4d')](_0x5e7457[_0x453a('0x4e')]);}})[_0x453a('0x15')](respondWithResult(_0x30361d,null))[_0x453a('0x1f')](handleError(_0x30361d,null));};exports[_0x453a('0x59')]=function(_0x1210f1,_0x5ccef4){var _0x16cbb1={'raw':![],'where':{}};var _0x3990a8={};var _0x133d62={'count':0x0,'rows':[]};return db[_0x453a('0x32')][_0x453a('0x5a')]({'where':{'id':_0x1210f1['params']['id']}})['then'](handleEntityNotFound(_0x5ccef4,null))[_0x453a('0x15')](function(_0x4fca76){if(_0x4fca76){_0x3990a8[_0x453a('0x37')]=_['keys'](db[_0x453a('0x5b')]['rawAttributes']);_0x3990a8[_0x453a('0x39')]=_[_0x453a('0x38')](_0x1210f1['query']);_0x3990a8['filters']=_[_0x453a('0x3b')](_0x3990a8['model'],_0x3990a8[_0x453a('0x39')]);_0x16cbb1[_0x453a('0x3c')]=_[_0x453a('0x3b')](_0x3990a8[_0x453a('0x37')],qs['fields'](_0x1210f1['query'][_0x453a('0x3d')]));_0x16cbb1['attributes']=_0x16cbb1[_0x453a('0x3c')][_0x453a('0x3e')]?_0x16cbb1[_0x453a('0x3c')]:_0x3990a8['model'];if(!_0x1210f1[_0x453a('0x39')][_0x453a('0x3f')](_0x453a('0x5c'))){_0x16cbb1[_0x453a('0x24')]=qs['limit'](_0x1210f1['query'][_0x453a('0x24')]);_0x16cbb1[_0x453a('0x22')]=qs[_0x453a('0x22')](_0x1210f1['query'][_0x453a('0x22')]);}_0x16cbb1['order']=qs[_0x453a('0x41')](_0x1210f1[_0x453a('0x39')][_0x453a('0x41')]);_0x16cbb1['where']=qs[_0x453a('0x3a')](_[_0x453a('0x5d')](_0x1210f1[_0x453a('0x39')],_0x3990a8[_0x453a('0x3a')]));_0x16cbb1[_0x453a('0x42')][_0x453a('0x5e')]=_0x4fca76['id'];if(_0x1210f1['query'][_0x453a('0x5f')]){_0x16cbb1[_0x453a('0x42')]=_[_0x453a('0x43')](_0x16cbb1[_0x453a('0x42')],{'$or':_['map'](_0x16cbb1['attributes'],function(_0x436f32){var _0x498752={};_0x498752[_0x436f32]={'$like':'%'+_0x1210f1[_0x453a('0x39')][_0x453a('0x5f')]+'%'};return _0x498752;})});}_0x16cbb1=_[_0x453a('0x43')]({},_0x16cbb1,_0x1210f1[_0x453a('0x4b')]);return db[_0x453a('0x5b')][_0x453a('0x25')]({'where':_0x16cbb1[_0x453a('0x42')]})[_0x453a('0x15')](function(_0xbdf14c){_0x133d62[_0x453a('0x25')]=_0xbdf14c;if(_0x1210f1['query']['includeAll']){_0x16cbb1[_0x453a('0x47')]=[{'all':!![]}];}return db['Disposition'][_0x453a('0x48')](_0x16cbb1);})[_0x453a('0x15')](function(_0x500fc5){_0x133d62[_0x453a('0x60')]=_0x500fc5;return _0x133d62;});}})[_0x453a('0x15')](respondWithFilteredResult(_0x5ccef4,_0x16cbb1))[_0x453a('0x1f')](handleError(_0x5ccef4,null));};exports[_0x453a('0x61')]=function(_0x29de34,_0x394c60){return db['ChatWebsite']['find']({'where':{'id':_0x29de34[_0x453a('0x4a')]['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x394c60,null))[_0x453a('0x15')](function(_0x58bb96){if(_0x58bb96){return _0x58bb96[_0x453a('0x61')](_0x29de34[_0x453a('0x39')][_0x453a('0x62')]);}})[_0x453a('0x15')](respondWithStatusCode(_0x394c60,null))[_0x453a('0x1f')](handleError(_0x394c60,null));};exports['addAnswer']=function(_0x2933e0,_0x135667){if(_0x2933e0[_0x453a('0x4e')]['id']){delete _0x2933e0[_0x453a('0x4e')]['id'];}return db[_0x453a('0x32')][_0x453a('0x4c')]({'where':{'id':_0x2933e0[_0x453a('0x4a')]['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x135667,null))[_0x453a('0x15')](function(_0x24857c){if(_0x24857c){_0x2933e0[_0x453a('0x4e')][_0x453a('0x5e')]=_0x24857c['id'];return db['CannedAnswer'][_0x453a('0x4d')](_0x2933e0[_0x453a('0x4e')]);}})[_0x453a('0x15')](respondWithResult(_0x135667,null))[_0x453a('0x1f')](handleError(_0x135667,null));};exports[_0x453a('0x63')]=function(_0x362fe3,_0x4a5fb0){var _0x3d98b6={'raw':![],'where':{}};var _0x10e604={};var _0x1e832e={'count':0x0,'rows':[]};return db[_0x453a('0x32')][_0x453a('0x5a')]({'where':{'id':_0x362fe3[_0x453a('0x4a')]['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x4a5fb0,null))[_0x453a('0x15')](function(_0xd079b3){if(_0xd079b3){_0x10e604[_0x453a('0x37')]=_[_0x453a('0x38')](db['CannedAnswer'][_0x453a('0x33')]);_0x10e604[_0x453a('0x39')]=_[_0x453a('0x38')](_0x362fe3['query']);_0x10e604[_0x453a('0x3a')]=_[_0x453a('0x3b')](_0x10e604[_0x453a('0x37')],_0x10e604[_0x453a('0x39')]);_0x3d98b6[_0x453a('0x3c')]=_[_0x453a('0x3b')](_0x10e604[_0x453a('0x37')],qs['fields'](_0x362fe3[_0x453a('0x39')][_0x453a('0x3d')]));_0x3d98b6[_0x453a('0x3c')]=_0x3d98b6[_0x453a('0x3c')][_0x453a('0x3e')]?_0x3d98b6[_0x453a('0x3c')]:_0x10e604[_0x453a('0x37')];if(!_0x362fe3['query'][_0x453a('0x3f')](_0x453a('0x5c'))){_0x3d98b6['limit']=qs['limit'](_0x362fe3[_0x453a('0x39')][_0x453a('0x24')]);_0x3d98b6[_0x453a('0x22')]=qs[_0x453a('0x22')](_0x362fe3[_0x453a('0x39')][_0x453a('0x22')]);}_0x3d98b6[_0x453a('0x40')]=qs['sort'](_0x362fe3[_0x453a('0x39')][_0x453a('0x41')]);_0x3d98b6[_0x453a('0x42')]=qs['filters'](_[_0x453a('0x5d')](_0x362fe3[_0x453a('0x39')],_0x10e604[_0x453a('0x3a')]));_0x3d98b6[_0x453a('0x42')][_0x453a('0x5e')]=_0xd079b3['id'];if(_0x362fe3['query'][_0x453a('0x5f')]){_0x3d98b6[_0x453a('0x42')]=_[_0x453a('0x43')](_0x3d98b6[_0x453a('0x42')],{'$or':_['map'](_0x3d98b6[_0x453a('0x3c')],function(_0xd2be9){var _0x5bc533={};_0x5bc533[_0xd2be9]={'$like':'%'+_0x362fe3[_0x453a('0x39')]['filter']+'%'};return _0x5bc533;})});}_0x3d98b6=_[_0x453a('0x43')]({},_0x3d98b6,_0x362fe3[_0x453a('0x4b')]);return db[_0x453a('0x64')][_0x453a('0x25')]({'where':_0x3d98b6[_0x453a('0x42')]})[_0x453a('0x15')](function(_0x5e2187){_0x1e832e[_0x453a('0x25')]=_0x5e2187;if(_0x362fe3[_0x453a('0x39')][_0x453a('0x46')]){_0x3d98b6[_0x453a('0x47')]=[{'all':!![]}];}return db[_0x453a('0x64')][_0x453a('0x48')](_0x3d98b6);})[_0x453a('0x15')](function(_0x5e1253){_0x1e832e['rows']=_0x5e1253;return _0x1e832e;});}})['then'](respondWithFilteredResult(_0x4a5fb0,_0x3d98b6))[_0x453a('0x1f')](handleError(_0x4a5fb0,null));};exports[_0x453a('0x65')]=function(_0x221535,_0x166c3b){return db[_0x453a('0x32')]['find']({'where':{'id':_0x221535['params']['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x166c3b,null))['then'](function(_0x500a43){if(_0x500a43){return _0x500a43[_0x453a('0x65')](_0x221535[_0x453a('0x39')][_0x453a('0x62')]);}})[_0x453a('0x15')](respondWithStatusCode(_0x166c3b,null))[_0x453a('0x1f')](handleError(_0x166c3b,null));};exports['addLogo']=function(_0x546da1,_0x5009d6){_0x546da1[_0x453a('0x4e')][_0x453a('0x66')]=_0x546da1[_0x453a('0x67')][_0x453a('0x68')];return db[_0x453a('0x32')][_0x453a('0x4c')]({'where':{'id':_0x546da1[_0x453a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5009d6,null))[_0x453a('0x15')](saveUpdates(_0x546da1['body'],null))[_0x453a('0x15')](respondWithResult(_0x5009d6,null))['catch'](handleError(_0x5009d6,null));};exports[_0x453a('0x69')]=function(_0x1b9b91,_0x4c58da){_0x1b9b91['body'][_0x453a('0x6a')]=_0x1b9b91['file']['filename'];return db[_0x453a('0x32')][_0x453a('0x4c')]({'where':{'id':_0x1b9b91[_0x453a('0x4a')]['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x4c58da,null))[_0x453a('0x15')](saveUpdates(_0x1b9b91[_0x453a('0x4e')],null))['then'](respondWithResult(_0x4c58da,null))[_0x453a('0x1f')](handleError(_0x4c58da,null));};exports['addCustomerAvatar']=function(_0x5d2632,_0x485a86){_0x5d2632[_0x453a('0x4e')][_0x453a('0x6b')]=_0x5d2632[_0x453a('0x67')][_0x453a('0x68')];return db['ChatWebsite'][_0x453a('0x4c')]({'where':{'id':_0x5d2632['params']['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x485a86,null))['then'](saveUpdates(_0x5d2632[_0x453a('0x4e')],null))[_0x453a('0x15')](respondWithResult(_0x485a86,null))[_0x453a('0x1f')](handleError(_0x485a86,null));};exports[_0x453a('0x6c')]=function(_0x553c7b,_0x2dd440){_0x553c7b[_0x453a('0x4e')][_0x453a('0x6d')]=_0x553c7b[_0x453a('0x67')][_0x453a('0x68')];return db[_0x453a('0x32')]['find']({'where':{'id':_0x553c7b['params']['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x2dd440,null))[_0x453a('0x15')](saveUpdates(_0x553c7b[_0x453a('0x4e')],null))[_0x453a('0x15')](respondWithResult(_0x2dd440,null))['catch'](handleError(_0x2dd440,null));};exports['getLogo']=function(_0x20dbb0,_0x2ffa37){var _0x4027a3=path['join'](config['root'],_0x453a('0x6e'));var _0x206614={'where':{'id':_0x20dbb0['params']['id']},'attributes':['id',_0x453a('0x66')],'raw':!![]};var _0x1fad9c=![];return require(_0x453a('0x6f'))[_0x453a('0x70')]()[_0x453a('0x15')](function(_0x4d707d){if(_0x4d707d){_0x1fad9c=_0x4d707d[_0x453a('0x71')];}})[_0x453a('0x15')](function(){return db[_0x453a('0x32')][_0x453a('0x4c')](_0x206614);})[_0x453a('0x15')](handleEntityNotFound(_0x2ffa37,null))['then'](function(_0x3cd5d8){if(_0x3cd5d8){if(!_[_0x453a('0x72')](_0x3cd5d8[_0x453a('0x66')])){if(fs[_0x453a('0x73')](path['join'](config['root'],_0x453a('0x74'),_0x3cd5d8[_0x453a('0x66')]))&&_0x1fad9c){_0x4027a3=path[_0x453a('0x75')](config['root'],_0x453a('0x74'),_0x3cd5d8[_0x453a('0x66')]);}}return _0x2ffa37[_0x453a('0x76')](_0x4027a3);}})['catch'](handleError(_0x2ffa37,null));};exports['getAvatar']=function(_0x3465c8,_0x5b2bc5){var _0x15b287=path[_0x453a('0x75')](config[_0x453a('0x77')],_0x453a('0x78'));var _0xcaefcd={'where':{'id':_0x3465c8[_0x453a('0x4a')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x453a('0x32')]['find'](_0xcaefcd)[_0x453a('0x15')](handleEntityNotFound(_0x5b2bc5,null))[_0x453a('0x15')](function(_0x2ec4a4){if(_0x2ec4a4){if(!_[_0x453a('0x72')](_0x2ec4a4[_0x453a('0x6a')])){if(fs[_0x453a('0x73')](path[_0x453a('0x75')](config['root'],_0x453a('0x79'),_0x2ec4a4[_0x453a('0x6a')]))){_0x15b287=path[_0x453a('0x75')](config[_0x453a('0x77')],'server/files/images/avatars/',_0x2ec4a4[_0x453a('0x6a')]);}}return _0x5b2bc5[_0x453a('0x76')](_0x15b287);}})[_0x453a('0x1f')](handleError(_0x5b2bc5,null));};exports[_0x453a('0x7a')]=function(_0x4cf273,_0x372af8){var _0x4abafc=path[_0x453a('0x75')](config[_0x453a('0x77')],_0x453a('0x7b'));var _0x682c7c={'where':{'id':_0x4cf273[_0x453a('0x4a')]['id']},'attributes':['id',_0x453a('0x6b'),_0x453a('0x7c')],'raw':!![]};return db['ChatWebsite'][_0x453a('0x4c')](_0x682c7c)[_0x453a('0x15')](handleEntityNotFound(_0x372af8,null))[_0x453a('0x15')](function(_0x44f8be){if(_0x44f8be){if(!_[_0x453a('0x72')](_0x44f8be[_0x453a('0x6b')])){if(fs[_0x453a('0x73')](path[_0x453a('0x75')](config[_0x453a('0x77')],'server/files/images/avatars/',_0x44f8be['customerAvatar']))&&_0x44f8be[_0x453a('0x7c')]){_0x4abafc=path[_0x453a('0x75')](config[_0x453a('0x77')],'server/files/images/avatars/',_0x44f8be[_0x453a('0x6b')]);}}return _0x372af8[_0x453a('0x76')](_0x4abafc);}})[_0x453a('0x1f')](handleError(_0x372af8,null));};exports[_0x453a('0x7d')]=function(_0x422e1e,_0x50c3ff){var _0x54e29d=path[_0x453a('0x75')](config[_0x453a('0x77')],_0x453a('0x7e'));var _0x33892={'where':{'id':_0x422e1e[_0x453a('0x4a')]['id']},'attributes':['id',_0x453a('0x6d')],'raw':!![]};return db[_0x453a('0x32')][_0x453a('0x4c')](_0x33892)['then'](handleEntityNotFound(_0x50c3ff,null))['then'](function(_0x492504){if(_0x492504){if(!_[_0x453a('0x72')](_0x492504['systemAvatar'])){if(fs[_0x453a('0x73')](path[_0x453a('0x75')](config[_0x453a('0x77')],_0x453a('0x79'),_0x492504['systemAvatar']))){_0x54e29d=path[_0x453a('0x75')](config[_0x453a('0x77')],_0x453a('0x79'),_0x492504[_0x453a('0x6d')]);}}return _0x50c3ff[_0x453a('0x76')](_0x54e29d);}})[_0x453a('0x1f')](handleError(_0x50c3ff,null));};exports['notify']=function(_0x263751,_0x25728d){var _0x34dd8a=require(_0x453a('0x7f'));var _0x3313ba=new _0x34dd8a();var _0x22dce7=_0x3313ba[_0x453a('0x80')](_0x263751[_0x453a('0x81')][_0x453a('0x82')])['getResult']();var _0x29ef2a={'body':_0x263751[_0x453a('0x4e')],'channel':_0x453a('0x83')};var _0x287566=[];var _0xa76ba7=[];var _0x2c24ce={};var _0x543f44=![];return db[_0x453a('0x84')][_0x453a('0x57')]()[_0x453a('0x15')](function(_0x5cb76c){if(!_0x5cb76c){throw new db[(_0x453a('0x85'))][(_0x453a('0x86'))]('no\x20available\x20attributes');}_0x287566=_['difference'](_['keys'](_0x5cb76c),[_0x453a('0x87'),_0x453a('0x88')]);_0xa76ba7=_['difference'](_[_0x453a('0x38')](_0x5cb76c),[_0x453a('0x87'),_0x453a('0x88'),_0x453a('0x89'),_0x453a('0x8a')]);if(_0x263751[_0x453a('0x4e')]['id']){delete _0x263751['body']['id'];}if(_[_0x453a('0x72')](_0x263751['body'][_0x453a('0x8b')])){throw new db['Sequelize']['ValidationError'](_0x453a('0x8c'));}if(_[_0x453a('0x72')](_0x263751[_0x453a('0x4e')][_0x453a('0x4e')])||_0x263751['body']['body']===''){throw new db[(_0x453a('0x85'))][(_0x453a('0x86'))](_0x453a('0x8d'));}if(_[_0x453a('0x72')](_0x263751['body'][_0x453a('0x8e')])){throw new db[(_0x453a('0x85'))][(_0x453a('0x86'))](_0x453a('0x8f')+_0xa76ba7);}if(!_['includes'](_0xa76ba7,_0x263751[_0x453a('0x4e')][_0x453a('0x8e')])){throw new db[(_0x453a('0x85'))][(_0x453a('0x86'))](_0x453a('0x90')+_0xa76ba7);}_0x2c24ce[_0x263751[_0x453a('0x4e')]['mapKey']]=_0x263751[_0x453a('0x4e')][_0x453a('0x8b')];})['then'](function(){return db[_0x453a('0x32')][_0x453a('0x4c')]({'where':{'id':_0x263751[_0x453a('0x4a')]['id']},'include':[{'model':db[_0x453a('0x91')],'as':_0x453a('0x92'),'include':[{'model':db[_0x453a('0x84')],'as':_0x453a('0x93'),'where':_0x2c24ce,'limit':0x1,'order':[[_0x453a('0x88'),_0x453a('0x94')]]}]},{'model':db[_0x453a('0x95')],'as':_0x453a('0x96')}]});})[_0x453a('0x15')](handleEntityNotFound(_0x25728d,null))['then'](function(_0x4e6ace){if(_0x4e6ace&&_0x4e6ace[_0x453a('0x92')]){_0x29ef2a['account']=_0x4e6ace;_0x29ef2a[_0x453a('0x97')]=_0x4e6ace[_0x453a('0x96')];_0x29ef2a['list']=_0x4e6ace['List'];_0x29ef2a['applications']=_[_0x453a('0x98')](_0x29ef2a['applications'],[_0x453a('0x99')],[_0x453a('0x9a')]);if(_0x29ef2a['account'][_0x453a('0x96')]){delete _0x29ef2a[_0x453a('0x9b')][_0x453a('0x96')];}if(_0x29ef2a[_0x453a('0x9b')][_0x453a('0x92')]&&_0x29ef2a['account']['List']['Contacts'][_0x453a('0x3e')]){return _0x29ef2a['account'][_0x453a('0x92')][_0x453a('0x93')][0x0];}var _0x2e66d3=_[_0x453a('0x9c')](_0x263751[_0x453a('0x4e')],{'firstName':_0x263751[_0x453a('0x4e')][_0x453a('0x8b')],'ListId':_0x4e6ace[_0x453a('0x8a')]});_0x2e66d3[_0x263751[_0x453a('0x4e')][_0x453a('0x8e')]]=_0x263751['body'][_0x453a('0x8b')];return db[_0x453a('0x84')][_0x453a('0x4d')](_0x2e66d3,{'fields':_0x287566,'raw':!![]});}})[_0x453a('0x15')](handleEntityNotFound(_0x25728d,null))[_0x453a('0x15')](function(_0x5c78e9){_0x29ef2a[_0x453a('0x9d')]=_0x5c78e9;var _0x1d4092=_0x263751[_0x453a('0x4e')]['customerIp'];if(_0x263751[_0x453a('0x81')]['cf-connecting-ip']){_0x1d4092=_0x263751[_0x453a('0x81')][_0x453a('0x9e')];}else if(_0x263751[_0x453a('0x81')][_0x453a('0x9f')]){_0x1d4092=_[_0x453a('0xa0')](_0x263751[_0x453a('0x81')][_0x453a('0x9f')]['split'](','));}if(_0x5c78e9){var _0x3fd6={'ContactId':_0x5c78e9['id'],'ChatWebsiteId':_0x263751[_0x453a('0x4a')]['id'],'from':(_0x5c78e9[_0x453a('0xa1')]||'')+'\x20'+(_0x5c78e9['lastName']||''),'customerIp':_0x1d4092,'customerPort':_0x263751[_0x453a('0x81')][_0x453a('0xa2')]?_0x263751[_0x453a('0x81')][_0x453a('0xa2')]:null,'referer':_0x263751[_0x453a('0x4e')][_0x453a('0xa3')],'browserName':_0x22dce7[_0x453a('0xa4')]['name']&&_0x22dce7[_0x453a('0xa4')][_0x453a('0xa5')]?util['format']('%s\x20%s',_0x22dce7['browser'][_0x453a('0x2d')],_0x22dce7[_0x453a('0xa4')]['version']):_0x453a('0xa6'),'browserVersion':_0x22dce7[_0x453a('0xa4')][_0x453a('0xa5')]||_0x453a('0xa6'),'osName':util[_0x453a('0xa7')](_0x453a('0xa8'),_0x22dce7['os'][_0x453a('0x2d')],_0x22dce7['os']['version']),'osVersion':_0x22dce7['os']['version'],'deviceModel':_0x22dce7[_0x453a('0xa9')]['model']&&_0x22dce7[_0x453a('0xa9')][_0x453a('0xaa')]?util[_0x453a('0xa7')]('%s\x20%s\x20%s',_0x22dce7[_0x453a('0xa9')][_0x453a('0x37')],_0x22dce7[_0x453a('0xa9')][_0x453a('0xaa')],_0x22dce7[_0x453a('0xa9')][_0x453a('0x35')]):null,'deviceVendor':_0x22dce7[_0x453a('0xa9')][_0x453a('0xaa')],'deviceType':_0x22dce7[_0x453a('0xa9')]['type'],'formData':JSON[_0x453a('0x19')](_0x263751['body'])};var _0x2d9189={'ChatWebsiteId':_0x263751[_0x453a('0x4a')]['id'],'closed':![]};if(_0x263751[_0x453a('0x4e')]['threadId']){_0x2d9189[_0x453a('0xab')]=_0x263751['body']['threadId'];return db[_0x453a('0xac')][_0x453a('0x4c')]({'where':_0x2d9189})[_0x453a('0x15')](function(_0x56fea5){if(_0x56fea5){return[_0x56fea5,![]];}_0x3fd6['threadId']=_0x263751[_0x453a('0x4e')][_0x453a('0xab')];_0x3fd6[_0x453a('0xad')]=_0x263751[_0x453a('0x4e')][_0x453a('0xad')];return db[_0x453a('0xac')]['create'](_0x3fd6)[_0x453a('0x15')](function(_0x3a99d8){return[_0x3a99d8,!![]];});});}_0x2d9189[_0x453a('0xae')]=_0x5c78e9['id'];if(_0x263751[_0x453a('0x4e')]['interaction']&&_0x263751[_0x453a('0x4e')][_0x453a('0xaf')]['id']){_0x2d9189['id']=_0x263751['body']['interaction']['id'];return db[_0x453a('0xac')][_0x453a('0x4c')]({'where':_0x2d9189})[_0x453a('0x15')](function(_0xcb85e6){if(_0xcb85e6){return[_0xcb85e6,![]];}return db[_0x453a('0xac')][_0x453a('0x4d')](_0x3fd6)[_0x453a('0x15')](function(_0x8a868e){return[_0x8a868e,!![]];});});}return db[_0x453a('0xac')]['create'](_0x3fd6)[_0x453a('0x15')](function(_0x5bcad1){return[_0x5bcad1,!![]];});}})[_0x453a('0xb0')](function(_0x354211,_0x3a502a){if(_0x354211){_0x543f44=_0x3a502a;if(!_0x3a502a){var _0x396875={'from':(_0x29ef2a[_0x453a('0x9d')][_0x453a('0xa1')]||'')+'\x20'+(_0x29ef2a[_0x453a('0x9d')][_0x453a('0xb1')]||'')};if(_0x263751[_0x453a('0x4e')][_0x453a('0xab')]&&_0x263751[_0x453a('0x4e')][_0x453a('0xb2')]&&_0x263751[_0x453a('0x4e')][_0x453a('0xab')]!=_0x263751[_0x453a('0x4e')][_0x453a('0xb2')]){_0x396875['threadId']=_0x263751[_0x453a('0x4e')][_0x453a('0xb2')];}return _0x354211[_0x453a('0x28')](_0x396875);}else{return _0x354211;}}})[_0x453a('0x15')](function(_0x429cef){_0x29ef2a[_0x453a('0xaf')]=_0x429cef[_0x453a('0x50')]({'plain':!![]});_0x29ef2a[_0x453a('0xaf')][_0x453a('0xb3')]=_0x543f44;if(_0x29ef2a[_0x453a('0xaf')][_0x453a('0xb3')]){if(_0x29ef2a[_0x453a('0x9b')][_0x453a('0xb4')]){_0x29ef2a['applications'][_0x453a('0xb5')]({'id':0x0,'priority':_0x29ef2a['applications'][_0x453a('0x3e')]+0x1,'app':_0x453a('0xb6'),'appdata':_0x453a('0xb7'),'interval':_0x453a('0xb8')});}}return db[_0x453a('0xb9')][_0x453a('0x4d')]({'body':_0x263751[_0x453a('0x4e')]['body'],'ChatWebsiteId':_0x263751['params']['id'],'ChatInteractionId':_0x429cef['id'],'direction':'in','ContactId':_0x29ef2a[_0x453a('0x9d')]['id'],'AttachmentId':_0x263751[_0x453a('0x4e')]['AttachmentId']});})[_0x453a('0x15')](function(_0x566255){_0x29ef2a[_0x453a('0x1c')]=_0x566255;if(_0x29ef2a[_0x453a('0xaf')][_0x453a('0xba')]){return db[_0x453a('0xbb')][_0x453a('0x4c')]({'attributes':['id','name'],'where':{'id':_0x29ef2a[_0x453a('0xaf')][_0x453a('0xba')]}})['then'](function(_0x10b583){if(_0x10b583){_0x29ef2a[_0x453a('0x97')][_0x453a('0xbc')]({'id':0x0,'priority':0x0,'app':_0x453a('0xbd'),'appdata':_0x10b583[_0x453a('0x2d')]+','+(_0x29ef2a[_0x453a('0x9b')][_0x453a('0xbe')]||0xa),'interval':_0x453a('0xb8')});_0x29ef2a[_0x453a('0xbf')]=!![];}return respondWithRpcPromise(_0x453a('0xc0'),_0x453a('0xc1'),_0x29ef2a);});}return respondWithRpcPromise('Start',_0x453a('0xc1'),_0x29ef2a);})['then'](function(_0x2d1de4){respondWithRpcPromise(_0x453a('0xc2'),_0x453a('0xc2'),{'event':_0x453a('0xc3'),'message':_0x2d1de4},client9002);return _0x2d1de4;})['then'](respondWithResult(_0x25728d,null))[_0x453a('0x1f')](handleError(_0x25728d,null));};exports['offline']=function(_0xd7b74e,_0x60c0a8){var _0x2152fe,_0x1d7dc0,_0x27e805;var _0x5900cb=[];var _0x49425b={};var _0x503757=_0xd7b74e[_0x453a('0xc4')]||[];var _0x157db4=[];var _0x2960e6;return db[_0x453a('0x84')][_0x453a('0x57')]()['then'](function(_0x19754b){if(!_0x19754b){throw new db['Sequelize'][(_0x453a('0x86'))](_0x453a('0xc5'));}_0x5900cb=_['difference'](_[_0x453a('0x38')](_0x19754b),[_0x453a('0x87'),_0x453a('0x88'),'CompanyId','ListId']);if(_0xd7b74e['body']['id']){delete _0xd7b74e[_0x453a('0x4e')]['id'];}if(_[_0x453a('0x72')](_0xd7b74e['body']['from'])){throw _0x60c0a8[_0x453a('0x21')](0x1f4)['send'](new db[(_0x453a('0x85'))][(_0x453a('0x86'))](_0x453a('0x8c')));}if(_['isNil'](_0xd7b74e['body'][_0x453a('0x4e')])||_0xd7b74e[_0x453a('0x4e')][_0x453a('0x4e')]===''){throw _0x60c0a8[_0x453a('0x21')](0x1f4)[_0x453a('0x2e')](new db[(_0x453a('0x85'))][(_0x453a('0x86'))](_0x453a('0x8d')));}if(_[_0x453a('0x72')](_0xd7b74e[_0x453a('0x4e')]['mapKeyOffline'])){throw _0x60c0a8[_0x453a('0x21')](0x1f4)['send'](new db[(_0x453a('0x85'))]['ValidationError'](_0x453a('0xc6')+_0x5900cb));}if(!_[_0x453a('0xc7')](_0x5900cb,_0xd7b74e[_0x453a('0x4e')][_0x453a('0xc8')])){throw _0x60c0a8[_0x453a('0x21')](0x1f4)[_0x453a('0x2e')](new db[(_0x453a('0x85'))][(_0x453a('0x86'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5900cb));}_0x49425b[_0xd7b74e['body'][_0x453a('0xc8')]]=_0xd7b74e['body'][_0x453a('0x8b')];})[_0x453a('0x15')](function(){return db[_0x453a('0x32')][_0x453a('0x4c')]({'where':{'id':_0xd7b74e[_0x453a('0x4a')]['id']},'include':[{'model':db[_0x453a('0x91')],'as':'List'},{'model':db[_0x453a('0xc9')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x60c0a8,null))[_0x453a('0x15')](function(_0x2df5d4){if(_0x2df5d4&&_0x2df5d4[_0x453a('0x92')]){_0x1d7dc0=_0x2df5d4;var _0x26a8b9=_[_0x453a('0x9c')](_0xd7b74e['body'],{'firstName':_0xd7b74e[_0x453a('0x4e')]['from'],'phone':_0xd7b74e[_0x453a('0x4e')][_0x453a('0x8b')],'ListId':_0x2df5d4[_0x453a('0x8a')]});_0x26a8b9[_0xd7b74e['body'][_0x453a('0xc8')]]=_0xd7b74e['body'][_0x453a('0x8b')];return db[_0x453a('0x84')][_0x453a('0xca')]({'where':_0x49425b,'defaults':_0x26a8b9});}})['spread'](function(_0x1f3f16){if(_0x1f3f16){_0x27e805=_0x1f3f16;var _0x3db39b=fs[_0x453a('0xcb')](path[_0x453a('0x75')](config[_0x453a('0x77')],_0x453a('0xcc')),_0x453a('0xcd'));var _0x111d87=ejs[_0x453a('0xce')](_0x3db39b,{'body':_['toPairs'](_0xd7b74e['body'][_0x453a('0x4e')]),'bodyTitle':_0x1d7dc0['offlineMessageBody']});return db[_0x453a('0xcf')][_0x453a('0x4d')]({'body':_0x111d87,'plainBody':htmlToText[_0x453a('0xd0')](_0x111d87),'ContactId':_0x1f3f16['id'],'ChatWebsiteId':_0x1d7dc0['id']});}})[_0x453a('0x15')](function(_0x39ca46){_0x2960e6=_0x39ca46;if(_0x503757[_0x453a('0x3e')]){var _0x45aaf8=_0x503757['map'](function(_0x5d000a){return{'name':_0x5d000a[_0x453a('0xd1')],'basename':_0x5d000a[_0x453a('0x68')],'type':_0x5d000a[_0x453a('0xd2')],'ChatOfflineMessageId':_0x39ca46['id']};});_0x157db4=_0x45aaf8[_0x453a('0x44')](_0x1a0ae0=>{var _0xc79bf1={'filename':_0x1a0ae0['name'],'path':path[_0x453a('0x75')](config[_0x453a('0x77')],_0x453a('0xd3'),_0x453a('0xc4'),'attachments','offline-chat',_0x1a0ae0[_0x453a('0xd4')])};return _0xc79bf1;});if(!_0x1d7dc0[_0x453a('0xd5')]){return db[_0x453a('0xd6')]['transaction'](function(_0x17c124){return db[_0x453a('0xd7')][_0x453a('0xd8')](_0x45aaf8,{'transaction':_0x17c124});});}}})[_0x453a('0x15')](function(){if(_0x2960e6){_0x2152fe=_0x2960e6;return db[_0x453a('0xc9')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x453a('0xd9')],'as':_0x453a('0xda'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x453a('0xdb'),'raw':!![]}]}]});}})[_0x453a('0x15')](function(_0x3e435a){if(_0x3e435a&&_0x3e435a['Smtp']&&_0x1d7dc0[_0x453a('0xdc')]&&_0x1d7dc0[_0x453a('0xdd')]){var _0xa7e127=_0x3e435a[_0x453a('0xde')]();return respondWithRpcPromise(_0x453a('0xdf'),_0x453a('0xe0'),{'account':_0xa7e127,'message':{'from':util[_0x453a('0xa7')](_0x453a('0xe1'),_0x3e435a[_0x453a('0x2d')],_0x3e435a[_0x453a('0xe2')]||_0x3e435a['Smtp'][_0x453a('0x4f')]),'to':_0x1d7dc0[_0x453a('0xdd')],'subject':_0x1d7dc0[_0x453a('0xe3')],'html':_0x2152fe['body'],'attachments':_0x157db4}},client9003)[_0x453a('0x15')](function(){return _0x2152fe;})[_0x453a('0x1f')](function(_0x5ca414){logger[_0x453a('0x1b')](_0x5ca414);});}})[_0x453a('0x15')](function(){if(_0x1d7dc0&&_0x1d7dc0[_0x453a('0xd5')]&&_0x1d7dc0['MailAccountId']){var _0x199d28=[];if(_0x503757[_0x453a('0x3e')]){_0x199d28=_0x503757[_0x453a('0x44')](function(_0x121c1e){return{'name':_0x121c1e[_0x453a('0xd1')],'basename':_0x121c1e[_0x453a('0x68')],'type':_0x121c1e[_0x453a('0xd2')],'ChatOfflineMessageId':_0x2960e6['id']};});}var _0x470065;if(!_[_0x453a('0x72')](_0x1d7dc0[_0x453a('0xe4')])){var _0x3507db=_[_0x453a('0x44')](_0xd7b74e[_0x453a('0x4e')],function(_0x1c176d){return _0x1c176d;});var _0x116c37=_[_0x453a('0xe5')](_0x3507db)[0x0];var _0x32458d=_[_0x453a('0xe6')](_0x116c37,function(_0xefb33e){return _0xefb33e;});_0x470065=_0x32458d[0x1][_0x1d7dc0[_0x453a('0xe4')]];}var _0xb9b44c={'from':_0x27e805[_0x453a('0xe2')],'firstName':_0x27e805[_0x453a('0xa1')],'lastName':_0x27e805['lastName'],'mapKey':'email','message':{'from':_0x27e805[_0x453a('0xe2')],'to':_0x1d7dc0['MailAccount'][_0x453a('0xe2')],'cc':'','subject':_[_0x453a('0x72')](_0x470065)?_0x1d7dc0['offlineMessageSubject']:_0x470065,'messageId':'','sentAt':new Date(),'attach':_0x199d28[_0x453a('0x3e')],'attachments':_0x199d28,'originChannel':_0x453a('0xe7'),'ChatWebsiteId':_0x1d7dc0['id'],'ChatOfflineMessageId':_0x2152fe['id'],'originTo':_0x1d7dc0[_0x453a('0xc9')]['email']},'body':_0x2152fe[_0x453a('0x4e')]};var _0xf26067={'account':{'id':_0x1d7dc0[_0x453a('0xe8')]},'body':_0xb9b44c,'log':_0x453a('0xe9')};return respondWithRpcPromise(_0x453a('0xe9'),_0x453a('0xea'),_0xf26067,client9001)[_0x453a('0x15')](function(){return _0x2152fe;})['catch'](function(_0x412566){logger[_0x453a('0x1b')](_0x412566);});}return;})[_0x453a('0x15')](function(){if(_0x2152fe){return _0x2152fe;}})[_0x453a('0x15')](respondWithResult(_0x60c0a8,null))[_0x453a('0x1f')](function(_0x40a2b3){logger[_0x453a('0x1b')](_0x453a('0x1f'),_0x40a2b3);for(var _0xb30d92 of _0x503757){var _0x4b8b18=path['join'](config['root'],_0x453a('0xd3'),_0x453a('0xc4'),'attachments',_0x453a('0xeb'),_0xb30d92[_0x453a('0x68')]);fs_extra[_0x453a('0xec')](_0x4b8b18)[_0x453a('0x1f')](function(_0x135e5c){logger[_0x453a('0x1b')](_0x453a('0xed'),_0x4b8b18,_0x135e5c);});}});};exports[_0x453a('0xee')]=function(_0x381112,_0x45138f){return db[_0x453a('0xac')]['find']({'where':{'id':_0x381112[_0x453a('0x4a')]['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x45138f,null))[_0x453a('0x15')](function(_0x2ccec2){if(_0x2ccec2){return _0x2ccec2[_0x453a('0xee')](_0x381112[_0x453a('0x4e')][_0x453a('0x62')],_[_0x453a('0xef')](_0x381112['body'],[_0x453a('0x62'),'id'])||{});}})[_0x453a('0x15')](respondWithResult(_0x45138f,null))['catch'](handleError(_0x45138f,null));};exports[_0x453a('0xf0')]=function(_0x291e4b,_0x38d114){var _0x440789={'raw':![],'where':{}};var _0x253c07={};var _0x5ed466={'count':0x0,'rows':[]};return db[_0x453a('0x32')][_0x453a('0x5a')]({'where':{'id':_0x291e4b[_0x453a('0x4a')]['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x38d114,null))[_0x453a('0x15')](function(_0x41c4f7){if(_0x41c4f7){_0x253c07[_0x453a('0x37')]=_[_0x453a('0x38')](db[_0x453a('0xac')][_0x453a('0x33')]);_0x253c07[_0x453a('0x39')]=_[_0x453a('0x38')](_0x291e4b[_0x453a('0x39')]);_0x253c07['filters']=_[_0x453a('0x3b')](_0x253c07[_0x453a('0x37')],_0x253c07[_0x453a('0x39')]);_0x440789['attributes']=_[_0x453a('0x3b')](_0x253c07[_0x453a('0x37')],qs['fields'](_0x291e4b['query'][_0x453a('0x3d')]));_0x440789[_0x453a('0x3c')]=_0x440789[_0x453a('0x3c')][_0x453a('0x3e')]?_0x440789[_0x453a('0x3c')]:_0x253c07[_0x453a('0x37')];if(!_0x291e4b[_0x453a('0x39')][_0x453a('0x3f')]('nolimit')){_0x440789[_0x453a('0x24')]=qs['limit'](_0x291e4b['query']['limit']);_0x440789[_0x453a('0x22')]=qs['offset'](_0x291e4b[_0x453a('0x39')][_0x453a('0x22')]);}_0x440789[_0x453a('0x40')]=qs[_0x453a('0x41')](_0x291e4b['query'][_0x453a('0x41')]);_0x440789[_0x453a('0x42')]=qs['filters'](_['pick'](_0x291e4b[_0x453a('0x39')],_0x253c07[_0x453a('0x3a')]));_0x440789[_0x453a('0x42')][_0x453a('0x5e')]=_0x41c4f7['id'];if(_0x291e4b[_0x453a('0x39')][_0x453a('0x5f')]){_0x440789[_0x453a('0x42')]=_[_0x453a('0x43')](_0x440789[_0x453a('0x42')],{'$or':_[_0x453a('0x44')](_0x440789[_0x453a('0x3c')],function(_0x2b2137){var _0x5e4afc={};_0x5e4afc[_0x2b2137]={'$like':'%'+_0x291e4b['query'][_0x453a('0x5f')]+'%'};return _0x5e4afc;})});}_0x440789=_[_0x453a('0x43')]({},_0x440789,_0x291e4b[_0x453a('0x4b')]);return db[_0x453a('0xac')]['count']({'where':_0x440789[_0x453a('0x42')]})['then'](function(_0x4ebf88){_0x5ed466[_0x453a('0x25')]=_0x4ebf88;if(_0x291e4b[_0x453a('0x39')][_0x453a('0x46')]){_0x440789[_0x453a('0x47')]=[{'model':db[_0x453a('0x84')],'as':'Contact','required':![]},{'model':db[_0x453a('0xbb')],'as':_0x453a('0xf1'),'attributes':[_0x453a('0x2d'),_0x453a('0xf2'),_0x453a('0xf3')],'required':![]},{'model':db[_0x453a('0xf4')],'as':_0x453a('0xf5'),'attributes':['id','name',_0x453a('0xf6')],'where':_0x291e4b[_0x453a('0x39')]['tag']?{'id':_0x291e4b[_0x453a('0x39')]['tag']}:undefined,'required':_0x291e4b[_0x453a('0x39')][_0x453a('0xf7')]?!![]:![]}];}return db[_0x453a('0xac')]['findAll'](_0x440789);})[_0x453a('0x15')](function(_0x3656ef){_0x5ed466[_0x453a('0x60')]=_0x3656ef;return _0x5ed466;});}})[_0x453a('0x15')](respondWithFilteredResult(_0x38d114,_0x440789))[_0x453a('0x1f')](handleError(_0x38d114,null));};function iftimePromise(_0x54dd36,_0x1ff128){return respondWithRpcPromise(_0x453a('0xf8'),_0x453a('0xf9'),{'command':_0x1ff128[_0x453a('0xfa')]?util[_0x453a('0xa7')]('iftime\x20%s,%s',_0x54dd36['interval'],_0x1ff128[_0x453a('0xfa')]):util['format'](_0x453a('0xfb'),_0x54dd36[_0x453a('0xfc')])},client9002)[_0x453a('0x15')](function(_0x5bf365){var _0x235aa4=_0x5bf365&&_0x5bf365[_0x453a('0xfd')]('true')>=0x0?!![]:![];logger[_0x453a('0x1d')](_0x453a('0xfe'),_0x1ff128['id'],_0x54dd36['id'],_0x54dd36[_0x453a('0xfc')],_0x235aa4?'ONLINE':_0x453a('0xff'),_0x1ff128['timezone']?_0x1ff128[_0x453a('0xfa')]:'No\x20timezone');return _0x235aa4;})[_0x453a('0x1f')](function(_0x1e336f){logger[_0x453a('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1ff128['id'],_0x54dd36['id'],_0x54dd36[_0x453a('0xfc')],util[_0x453a('0x100')](_0x1e336f,{'showHidden':![],'depth':null}),_0x1ff128[_0x453a('0xfa')]?_0x1ff128[_0x453a('0xfa')]:_0x453a('0x101'));return![];});}exports['getSnippet']=function(_0x28301d,_0x3b6b19){var _0x44352c=0x0;var _0x56f3e8=0x0;var _0x51c95a=![];var _0x21ace3;var _0x2ac643;return db[_0x453a('0x32')][_0x453a('0x4c')]({'where':{'id':_0x28301d[_0x453a('0x4a')]['id']},'include':[{'model':db[_0x453a('0x102')],'as':'Interval','include':[{'model':db[_0x453a('0x102')],'as':_0x453a('0x103'),'attributes':['id',_0x453a('0xfc')],'raw':!![]}]}]})[_0x453a('0x15')](handleEntityNotFound(_0x3b6b19,null))[_0x453a('0x15')](function(_0x526ca0){if(_0x526ca0){_0x21ace3=_0x526ca0;return _0x526ca0['getProactiveActions']({'raw':!![]});}})[_0x453a('0x15')](function(_0x34b1a7){if(_0x21ace3){if(_0x34b1a7){_0x2ac643=_0x34b1a7;}}return require(_0x453a('0x6f'))[_0x453a('0x70')]();})[_0x453a('0x15')](function(_0x307bf2){if(_0x307bf2){_0x56f3e8=_0x307bf2[_0x453a('0x104')];_0x51c95a=_0x307bf2[_0x453a('0x71')];}})['then'](function(){return db[_0x453a('0xac')]['count']({'where':{'closed':![]}});})[_0x453a('0x15')](function(_0x3484b4){_0x44352c=_0x3484b4;if(_0x56f3e8&&_0x3484b4>_0x56f3e8){return db[_0x453a('0x105')][_0x453a('0x5a')]({'where':{'id':0x1}})[_0x453a('0x15')](function(_0x41e25c){if(_0x41e25c){_0x41e25c[_0x453a('0x106')](_0x453a('0x107'));}});}})[_0x453a('0x15')](function(){if(_0x21ace3['Interval']&&_0x21ace3['Interval'][_0x453a('0x103')]){var _0x5d58d3=[];for(var _0x2231c2=0x0;_0x2231c2<_0x21ace3[_0x453a('0x102')][_0x453a('0x103')]['length'];_0x2231c2++){var _0x216e19=_0x21ace3[_0x453a('0x102')][_0x453a('0x103')][_0x2231c2]['get']({'plain':!![]});_0x5d58d3['push'](iftimePromise(_0x216e19,_0x21ace3));}return BPromise[_0x453a('0x108')](_0x5d58d3)[_0x453a('0x15')](function(_0x573944){return _[_0x453a('0x109')](_0x573944);});}else{return!![];}})[_0x453a('0x15')](function(_0x58d099){var _0xfef048=fs[_0x453a('0xcb')](path['join'](config[_0x453a('0x77')],_0x453a('0x10a')),_0x453a('0xcd'));var _0x2417ee=new url[(_0x453a('0x10b'))](_0x21ace3[_0x453a('0x10c')])[_0x453a('0x10d')];var _0x4cc71d=_0x453a('0x10e');var _0x4de4ee=![];var _0x1c4aae={'chatVersion':_0x4cc71d,'chatWebsiteAddressOrigin':_0x2417ee,'remote':_0x21ace3[_0x453a('0x10f')],'query':querystring[_0x453a('0x19')](_[_0x453a('0x43')](_0x21ace3[_0x453a('0x50')]({'plain':!![]}),{'customerIp':_0x28301d[_0x453a('0x81')][_0x453a('0x9f')]||_0x28301d[_0x453a('0x81')][_0x453a('0x110')]||_0x28301d[_0x453a('0x111')][_0x453a('0x112')]||_0x28301d['ip'],'referer':_0x28301d[_0x453a('0x81')]['referer'],'openedInteractions':_0x44352c,'maxInteractions':_0x56f3e8,'virtual':_0x51c95a[_0x453a('0x104')],'online':_0x58d099,'custom':_0x51c95a}))[_0x453a('0x113')](/'/g,'\x5c\x27')};_0x3b6b19[_0x453a('0x2e')](ejs['render'](Mustache[_0x453a('0xce')](_0xfef048,_0x1c4aae),{'proactiveActions':_0x2ac643,'alignment':_0x21ace3[_0x453a('0x114')],'verticalAlignment':_0x21ace3[_0x453a('0x115')],'div_color':_0x21ace3[_0x453a('0xf6')],'labelText':_0x21ace3[_0x453a('0x116')],'text_color':_0x21ace3[_0x453a('0x117')],'text_button_color':_0x21ace3[_0x453a('0x118')],'button_color':_0x21ace3[_0x453a('0x119')],'background_color':_0x21ace3[_0x453a('0x11a')],'hideWhenOffline':_0x21ace3['hideWhenOffline'],'intervalId':_0x21ace3['IntervalId'],'isDevelopment':_0x4de4ee,'chatVersion':_0x4cc71d}));})[_0x453a('0x1f')](handleError(_0x3b6b19,null));};exports[_0x453a('0x11b')]=function(_0x47d2ea,_0x3fd330){var _0x30ad99=_0x47d2ea['params']['id'];var _0x453e6c=_0x47d2ea[_0x453a('0x4e')];var _0xc8c833=0xc8;var _0x56c4b3=null;return db[_0x453a('0xd6')]['transaction']({'isolationLevel':db['sequelize'][_0x453a('0x11c')][_0x453a('0x11d')][_0x453a('0x11e')]},function(_0x242e12){return db[_0x453a('0x32')]['findOne']({'where':{'id':_0x30ad99},'transaction':_0x242e12})['then'](function(_0x2d61a5){if(_0x2d61a5){return db[_0x453a('0x95')][_0x453a('0x29')]({'where':{'ChatWebsiteId':_0x30ad99},'transaction':_0x242e12})[_0x453a('0x15')](function(){var _0x713f12=_[_0x453a('0x44')](_0x453e6c,function(_0x2e6dd5){_0x2e6dd5[_0x453a('0x5e')]=_0x30ad99;return _0x2e6dd5;});return db[_0x453a('0x95')][_0x453a('0xd8')](_0x713f12,{'transaction':_0x242e12});});}else{_0xc8c833=0x194;_0x56c4b3=[];}});})[_0x453a('0x15')](function(){if(_0xc8c833!==0x194){return db[_0x453a('0x95')][_0x453a('0x11f')]({'where':{'ChatWebsiteId':_0x30ad99},'order':_0x453a('0x99')})[_0x453a('0x15')](function(_0x4ac145){_0x56c4b3=_0x4ac145;});}})[_0x453a('0x1f')](function(_0x433dd8){_0xc8c833=0x1f4;logger[_0x453a('0x1b')](_0x433dd8[_0x453a('0x120')]);if(_0x433dd8[_0x453a('0x2d')]){delete _0x433dd8[_0x453a('0x2d')];}_0x56c4b3=_0x433dd8;})[_0x453a('0x121')](function(){if(_0x56c4b3===null){_0x3fd330[_0x453a('0x20')](_0xc8c833);}else{if(_0xc8c833===0x1f4){_0x3fd330[_0x453a('0x21')](_0xc8c833)[_0x453a('0x2e')](_0x56c4b3);}else{_0x3fd330[_0x453a('0x21')](_0xc8c833)['json'](_0x56c4b3);}}});};exports['getApplications']=function(_0x2cf1cb,_0x15a9fb){var _0x1f0cc0={};var _0x82ab8b={};var _0x17f1ff;var _0x577d55;return db[_0x453a('0x32')][_0x453a('0x5a')]({'where':{'id':_0x2cf1cb[_0x453a('0x4a')]['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x15a9fb,null))['then'](function(_0x26e9dc){if(_0x26e9dc){_0x17f1ff=_0x26e9dc;_0x82ab8b['model']=_['keys'](db[_0x453a('0x95')]['rawAttributes']);_0x82ab8b[_0x453a('0x39')]=_[_0x453a('0x38')](_0x2cf1cb[_0x453a('0x39')]);_0x82ab8b[_0x453a('0x3a')]=_[_0x453a('0x3b')](_0x82ab8b[_0x453a('0x37')],_0x82ab8b['query']);_0x1f0cc0['attributes']=_[_0x453a('0x3b')](_0x82ab8b[_0x453a('0x37')],qs[_0x453a('0x3d')](_0x2cf1cb[_0x453a('0x39')][_0x453a('0x3d')]));_0x1f0cc0[_0x453a('0x3c')]=_0x1f0cc0[_0x453a('0x3c')][_0x453a('0x3e')]?_0x1f0cc0['attributes']:_0x82ab8b[_0x453a('0x37')];_0x1f0cc0[_0x453a('0x40')]=qs[_0x453a('0x41')](_0x2cf1cb[_0x453a('0x39')]['sort']);_0x1f0cc0[_0x453a('0x42')]=qs[_0x453a('0x3a')](_[_0x453a('0x5d')](_0x2cf1cb['query'],_0x82ab8b[_0x453a('0x3a')]));if(_0x2cf1cb[_0x453a('0x39')]['filter']){_0x1f0cc0['where']=_[_0x453a('0x43')](_0x1f0cc0[_0x453a('0x42')],{'$or':_['map'](_0x1f0cc0[_0x453a('0x3c')],function(_0x485128){var _0x1d3541={};_0x1d3541[_0x485128]={'$like':'%'+_0x2cf1cb[_0x453a('0x39')][_0x453a('0x5f')]+'%'};return _0x1d3541;})});}_0x1f0cc0=_[_0x453a('0x43')]({},_0x1f0cc0,_0x2cf1cb[_0x453a('0x4b')]);return _0x17f1ff[_0x453a('0x122')](_0x1f0cc0);}})['then'](function(_0x2b6dc5){if(_0x2b6dc5){_0x577d55=_0x2b6dc5['length'];if(!_0x2cf1cb['query'][_0x453a('0x3f')](_0x453a('0x5c'))){_0x1f0cc0['limit']=qs['limit'](_0x2cf1cb[_0x453a('0x39')][_0x453a('0x24')]);_0x1f0cc0[_0x453a('0x22')]=qs['offset'](_0x2cf1cb['query'][_0x453a('0x22')]);}return _0x17f1ff[_0x453a('0x122')](_0x1f0cc0);}})[_0x453a('0x15')](function(_0x4055a4){if(_0x4055a4){return _0x4055a4?{'count':_0x577d55,'rows':_0x4055a4}:null;}})['then'](respondWithResult(_0x15a9fb,null))[_0x453a('0x1f')](handleError(_0x15a9fb,null));};exports[_0x453a('0x123')]=function(_0x3fae40,_0x330412){return db['chatProactiveAction'][_0x453a('0x4c')]({'where':{'id':_0x3fae40['params']['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x330412,null))[_0x453a('0x15')](function(_0x7009a4){if(_0x7009a4){return _0x7009a4[_0x453a('0x123')](_0x3fae40[_0x453a('0x4e')][_0x453a('0x62')],_[_0x453a('0xef')](_0x3fae40['body'],[_0x453a('0x62'),'id'])||{});}})[_0x453a('0x15')](respondWithResult(_0x330412,null))[_0x453a('0x1f')](handleError(_0x330412,null));};exports[_0x453a('0x124')]=function(_0x1a1a38,_0x55caca){var _0x4cd115={};var _0x20f951={};var _0xbc6bea;var _0x13481f;return db[_0x453a('0x32')][_0x453a('0x5a')]({'where':{'id':_0x1a1a38[_0x453a('0x4a')]['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x55caca,null))[_0x453a('0x15')](function(_0x3f90b3){if(_0x3f90b3){_0xbc6bea=_0x3f90b3;_0x20f951[_0x453a('0x37')]=_[_0x453a('0x38')](db[_0x453a('0x125')][_0x453a('0x33')]);_0x20f951[_0x453a('0x39')]=_[_0x453a('0x38')](_0x1a1a38[_0x453a('0x39')]);_0x20f951[_0x453a('0x3a')]=_[_0x453a('0x3b')](_0x20f951['model'],_0x20f951[_0x453a('0x39')]);_0x4cd115['attributes']=_[_0x453a('0x3b')](_0x20f951[_0x453a('0x37')],qs[_0x453a('0x3d')](_0x1a1a38[_0x453a('0x39')][_0x453a('0x3d')]));_0x4cd115[_0x453a('0x3c')]=_0x4cd115[_0x453a('0x3c')][_0x453a('0x3e')]?_0x4cd115[_0x453a('0x3c')]:_0x20f951[_0x453a('0x37')];_0x4cd115['order']=qs[_0x453a('0x41')](_0x1a1a38[_0x453a('0x39')]['sort']);_0x4cd115[_0x453a('0x42')]=qs[_0x453a('0x3a')](_[_0x453a('0x5d')](_0x1a1a38[_0x453a('0x39')],_0x20f951[_0x453a('0x3a')]));if(_0x1a1a38[_0x453a('0x39')][_0x453a('0x5f')]){_0x4cd115[_0x453a('0x42')]=_[_0x453a('0x43')](_0x4cd115[_0x453a('0x42')],{'$or':_[_0x453a('0x44')](_0x4cd115[_0x453a('0x3c')],function(_0xb9583e){var _0x51ec83={};_0x51ec83[_0xb9583e]={'$like':'%'+_0x1a1a38['query']['filter']+'%'};return _0x51ec83;})});}_0x4cd115=_[_0x453a('0x43')]({},_0x4cd115,_0x1a1a38[_0x453a('0x4b')]);return _0xbc6bea['getProactiveActions'](_0x4cd115);}})[_0x453a('0x15')](function(_0x4e9528){if(_0x4e9528){_0x13481f=_0x4e9528[_0x453a('0x3e')];if(!_0x1a1a38[_0x453a('0x39')][_0x453a('0x3f')](_0x453a('0x5c'))){_0x4cd115[_0x453a('0x24')]=qs[_0x453a('0x24')](_0x1a1a38[_0x453a('0x39')]['limit']);_0x4cd115['offset']=qs['offset'](_0x1a1a38[_0x453a('0x39')][_0x453a('0x22')]);}return _0xbc6bea[_0x453a('0x124')](_0x4cd115);}})[_0x453a('0x15')](function(_0xa154b0){if(_0xa154b0){return _0xa154b0?{'count':_0x13481f,'rows':_0xa154b0}:null;}})[_0x453a('0x15')](respondWithResult(_0x55caca,null))[_0x453a('0x1f')](handleError(_0x55caca,null));};exports['getFields']=function(_0x19bbb1,_0x39ae2e){var _0x6eee22=_0x19bbb1[_0x453a('0x39')]['online']===_0x453a('0x126')?_0x453a('0x127'):_0x453a('0x128');return db[_0x453a('0x32')][_0x453a('0x4c')]({'attributes':['id',_0x6eee22],'where':{'id':_0x19bbb1[_0x453a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39ae2e,null))[_0x453a('0x15')](function(_0x3546e2){if(_0x3546e2){var _0x5e0ffc=_0x3546e2[_0x6eee22];var _0x1a5024=_0x5e0ffc&&_0x5e0ffc[_0x453a('0x129')]?_0x5e0ffc[_0x453a('0x129')]:[];_0x39ae2e[_0x453a('0x2e')]({'fromKey':_[_0x453a('0x72')](_0x5e0ffc['fromKey'])?undefined:_0x5e0ffc[_0x453a('0x12a')],'count':_0x1a5024[_0x453a('0x3e')],'rows':_0x1a5024});}})['catch'](handleError(_0x39ae2e,null));};exports[_0x453a('0x12b')]=function(_0x1117fc,_0x29c4f3){var _0x38a199={'raw':![],'where':{}};var _0x37629c={};var _0x1739c1={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x1117fc[_0x453a('0x4a')]['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x29c4f3,null))['then'](function(_0x466bb7){if(_0x466bb7){_0x37629c['model']=_[_0x453a('0x38')](db[_0x453a('0xcf')][_0x453a('0x33')]);_0x37629c[_0x453a('0x39')]=_[_0x453a('0x38')](_0x1117fc['query']);_0x37629c[_0x453a('0x3a')]=_['intersection'](_0x37629c[_0x453a('0x37')],_0x37629c[_0x453a('0x39')]);_0x38a199[_0x453a('0x3c')]=_[_0x453a('0x3b')](_0x37629c[_0x453a('0x37')],qs[_0x453a('0x3d')](_0x1117fc[_0x453a('0x39')][_0x453a('0x3d')]));_0x38a199[_0x453a('0x3c')]=_0x38a199[_0x453a('0x3c')][_0x453a('0x3e')]?_0x38a199['attributes']:_0x37629c[_0x453a('0x37')];if(!_0x1117fc[_0x453a('0x39')]['hasOwnProperty'](_0x453a('0x5c'))){_0x38a199[_0x453a('0x24')]=qs['limit'](_0x1117fc[_0x453a('0x39')][_0x453a('0x24')]);_0x38a199['offset']=qs[_0x453a('0x22')](_0x1117fc[_0x453a('0x39')][_0x453a('0x22')]);}_0x38a199['order']=qs[_0x453a('0x41')](_0x1117fc[_0x453a('0x39')][_0x453a('0x41')]);_0x38a199[_0x453a('0x42')]=qs[_0x453a('0x3a')](_[_0x453a('0x5d')](_0x1117fc[_0x453a('0x39')],_0x37629c['filters']));_0x38a199[_0x453a('0x42')][_0x453a('0x5e')]=_0x466bb7['id'];if(_0x1117fc[_0x453a('0x39')][_0x453a('0x5f')]){_0x38a199[_0x453a('0x42')]=_[_0x453a('0x43')](_0x38a199['where'],{'$or':_[_0x453a('0x44')](_0x38a199[_0x453a('0x3c')],function(_0x1f4a6e){var _0x216645={};_0x216645[_0x1f4a6e]={'$like':'%'+_0x1117fc['query']['filter']+'%'};return _0x216645;})});}_0x38a199=_['merge']({},_0x38a199,_0x1117fc[_0x453a('0x4b')]);return db[_0x453a('0xcf')]['count']({'where':_0x38a199['where']})[_0x453a('0x15')](function(_0x46b79e){_0x1739c1[_0x453a('0x25')]=_0x46b79e;if(_0x1117fc[_0x453a('0x39')][_0x453a('0x46')]){_0x38a199[_0x453a('0x47')]=[{'all':!![]}];}else{_0x38a199[_0x453a('0x47')]=[{'model':db['CmContact'],'as':_0x453a('0x12c'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x453a('0x48')](_0x38a199);})[_0x453a('0x15')](function(_0xdc43f5){_0x1739c1[_0x453a('0x60')]=_0xdc43f5;return _0x1739c1;});}})[_0x453a('0x15')](respondWithFilteredResult(_0x29c4f3,_0x38a199))[_0x453a('0x1f')](handleError(_0x29c4f3,null));};exports[_0x453a('0x12d')]=function(_0x5c37e7,_0x5c2898){return db[_0x453a('0x32')][_0x453a('0x4c')]({'where':{'id':_0x5c37e7['params']['id']}})[_0x453a('0x15')](handleEntityNotFound(_0x5c2898,null))[_0x453a('0x15')](function(_0x16568e){if(_0x16568e){return _0x16568e[_0x453a('0x12d')](_0x5c37e7[_0x453a('0x4e')][_0x453a('0x62')],_[_0x453a('0xef')](_0x5c37e7['body'],['ids','id'])||{})[_0x453a('0xb0')](function(_0x2a7978){for(var _0x1198d5=0x0;_0x1198d5<_0x5c37e7[_0x453a('0x4e')][_0x453a('0x62')][_0x453a('0x3e')];_0x1198d5+=0x1){socket[_0x453a('0x12e')](_0x453a('0x12f'),{'UserId':Number(_0x5c37e7[_0x453a('0x4e')]['ids'][_0x1198d5]),'ChatWebsiteId':Number(_0x5c37e7['params']['id'])});}return _0x2a7978;});}})['then'](respondWithResult(_0x5c2898,null))[_0x453a('0x1f')](handleError(_0x5c2898,null));};exports[_0x453a('0x130')]=function(_0xa75ca5,_0x51949a){return db[_0x453a('0x32')]['find']({'where':{'id':_0xa75ca5[_0x453a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x51949a,null))[_0x453a('0x15')](function(_0x4ce464){if(_0x4ce464){return _0x4ce464[_0x453a('0x130')](_0xa75ca5['query'][_0x453a('0x62')])[_0x453a('0x15')](function(){if(_['isArray'](_0xa75ca5['query'][_0x453a('0x62')])){for(var _0x1a275d=0x0;_0x1a275d<_0xa75ca5['query'][_0x453a('0x62')][_0x453a('0x3e')];_0x1a275d+=0x1){socket['emit'](_0x453a('0x131'),{'UserId':Number(_0xa75ca5['query']['ids'][_0x1a275d]),'ChatWebsiteId':Number(_0xa75ca5[_0x453a('0x4a')]['id'])});}}else{socket[_0x453a('0x12e')](_0x453a('0x131'),{'UserId':Number(_0xa75ca5[_0x453a('0x39')]['ids']),'ChatWebsiteId':Number(_0xa75ca5[_0x453a('0x4a')]['id'])});}});}})[_0x453a('0x15')](respondWithStatusCode(_0x51949a,null))[_0x453a('0x1f')](handleError(_0x51949a,null));};exports[_0x453a('0x132')]=function(_0x96dccb,_0xd5af15){var _0x151997={};var _0x1f58bf={};var _0xbe29d2;var _0x1606cf;return db[_0x453a('0x32')][_0x453a('0x5a')]({'where':{'id':_0x96dccb['params']['id']}})[_0x453a('0x15')](handleEntityNotFound(_0xd5af15,null))[_0x453a('0x15')](function(_0x37fb68){if(_0x37fb68){_0xbe29d2=_0x37fb68;_0x1f58bf['model']=_[_0x453a('0x38')](db[_0x453a('0xbb')][_0x453a('0x33')]);_0x1f58bf[_0x453a('0x39')]=_['keys'](_0x96dccb['query']);_0x1f58bf[_0x453a('0x3a')]=_[_0x453a('0x3b')](_0x1f58bf[_0x453a('0x37')],_0x1f58bf['query']);_0x151997[_0x453a('0x3c')]=_['intersection'](_0x1f58bf['model'],qs[_0x453a('0x3d')](_0x96dccb[_0x453a('0x39')][_0x453a('0x3d')]));_0x151997['attributes']=_0x151997[_0x453a('0x3c')][_0x453a('0x3e')]?_0x151997[_0x453a('0x3c')]:_0x1f58bf[_0x453a('0x37')];_0x151997[_0x453a('0x40')]=qs[_0x453a('0x41')](_0x96dccb[_0x453a('0x39')][_0x453a('0x41')]);_0x151997['where']=qs[_0x453a('0x3a')](_['pick'](_0x96dccb['query'],_0x1f58bf[_0x453a('0x3a')]));if(_0x96dccb[_0x453a('0x39')][_0x453a('0x5f')]){_0x151997[_0x453a('0x42')]=_['merge'](_0x151997[_0x453a('0x42')],{'$or':_[_0x453a('0x44')](_0x151997[_0x453a('0x3c')],function(_0xbf11ef){var _0x5b029f={};_0x5b029f[_0xbf11ef]={'$like':'%'+_0x96dccb[_0x453a('0x39')]['filter']+'%'};return _0x5b029f;})});}_0x151997=_['merge']({},_0x151997,_0x96dccb[_0x453a('0x4b')]);return _0xbe29d2[_0x453a('0x132')](_0x151997);}})[_0x453a('0x15')](function(_0x45e79a){if(_0x45e79a){_0x1606cf=_0x45e79a[_0x453a('0x3e')];if(!_0x96dccb[_0x453a('0x39')][_0x453a('0x3f')](_0x453a('0x5c'))){_0x151997[_0x453a('0x24')]=qs[_0x453a('0x24')](_0x96dccb[_0x453a('0x39')]['limit']);_0x151997['offset']=qs[_0x453a('0x22')](_0x96dccb[_0x453a('0x39')][_0x453a('0x22')]);}return _0xbe29d2[_0x453a('0x132')](_0x151997);}})[_0x453a('0x15')](function(_0x537878){if(_0x537878){return _0x537878?{'count':_0x1606cf,'rows':_0x537878}:null;}})['then'](respondWithResult(_0xd5af15,null))[_0x453a('0x1f')](handleError(_0xd5af15,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index e33ae08..8e4f9e5 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 _0xc01b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x582844,_0x5c2c02){var _0x3ae71f=function(_0x5241f5){while(--_0x5241f5){_0x582844['push'](_0x582844['shift']());}};_0x3ae71f(++_0x5c2c02);}(_0xc01b,0x74));var _0xbc01=function(_0x652582,_0x6c6679){_0x652582=_0x652582-0x0;var _0x320a26=_0xc01b[_0x652582];return _0x320a26;};'use strict';var EventEmitter=require(_0xbc01('0x0'));var ChatWebsite=require(_0xbc01('0x1'))['db'][_0xbc01('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbc01('0x3')](0x0);var events={'afterCreate':_0xbc01('0x4'),'afterUpdate':_0xbc01('0x5'),'afterDestroy':_0xbc01('0x6')};function emitEvent(_0x5ede59){return function(_0x2c35d0,_0x133078,_0x222fa3){ChatWebsiteEvents[_0xbc01('0x7')](_0x5ede59+':'+_0x2c35d0['id'],_0x2c35d0);ChatWebsiteEvents[_0xbc01('0x7')](_0x5ede59,_0x2c35d0);_0x222fa3(null);};}for(var e in events){if(events[_0xbc01('0x8')](e)){var event=events[e];ChatWebsite[_0xbc01('0x9')](e,emitEvent(event));}}module[_0xbc01('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x9221=['hasOwnProperty','exports','../../mysqldb','ChatWebsite','save','update','emit'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x9221,0x64));var _0x1922=function(_0x995f33,_0x17fdce){_0x995f33=_0x995f33-0x0;var _0x587aec=_0x9221[_0x995f33];return _0x587aec;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x1922('0x0'))['db'][_0x1922('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1922('0x2'),'afterUpdate':_0x1922('0x3'),'afterDestroy':'remove'};function emitEvent(_0x309b6b){return function(_0x43c8a3,_0x459eee,_0xa19ed6){ChatWebsiteEvents[_0x1922('0x4')](_0x309b6b+':'+_0x43c8a3['id'],_0x43c8a3);ChatWebsiteEvents[_0x1922('0x4')](_0x309b6b,_0x43c8a3);_0xa19ed6(null);};}for(var e in events){if(events[_0x1922('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x1922('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index d38e26b..775bcc2 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 _0xeca6=['path','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','api','moment','bluebird','request-promise'];(function(_0x13baf8,_0x3c906a){var _0x5545d1=function(_0xa738e4){while(--_0xa738e4){_0x13baf8['push'](_0x13baf8['shift']());}};_0x5545d1(++_0x3c906a);}(_0xeca6,0x1b6));var _0x6eca=function(_0x56238b,_0x29de3d){_0x56238b=_0x56238b-0x0;var _0x3d9acf=_0xeca6[_0x56238b];return _0x3d9acf;};'use strict';var _=require(_0x6eca('0x0'));var util=require(_0x6eca('0x1'));var logger=require('../../config/logger')(_0x6eca('0x2'));var moment=require(_0x6eca('0x3'));var BPromise=require(_0x6eca('0x4'));var rp=require(_0x6eca('0x5'));var fs=require('fs');var path=require(_0x6eca('0x6'));var rimraf=require('rimraf');var config=require(_0x6eca('0x7'));var attributes=require(_0x6eca('0x8'));module[_0x6eca('0x9')]=function(_0x2805c0,_0x75096b){return _0x2805c0['define'](_0x6eca('0xa'),attributes,{'tableName':_0x6eca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x89fa=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','lodash'];(function(_0xedcdc0,_0x224c29){var _0xbeac85=function(_0x3f333b){while(--_0x3f333b){_0xedcdc0['push'](_0xedcdc0['shift']());}};_0xbeac85(++_0x224c29);}(_0x89fa,0x6b));var _0xa89f=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x89fa[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0xa89f('0x0'));var util=require(_0xa89f('0x1'));var logger=require(_0xa89f('0x2'))('api');var moment=require(_0xa89f('0x3'));var BPromise=require(_0xa89f('0x4'));var rp=require(_0xa89f('0x5'));var fs=require('fs');var path=require(_0xa89f('0x6'));var rimraf=require(_0xa89f('0x7'));var config=require(_0xa89f('0x8'));var attributes=require(_0xa89f('0x9'));module[_0xa89f('0xa')]=function(_0x2612bd,_0x5db5f4){return _0x2612bd[_0xa89f('0xb')]('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 dd60d3e..aef1ac9 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 _0xcab2=['info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message'];(function(_0x3da85d,_0xafd4fa){var _0x40bb54=function(_0x42214d){while(--_0x42214d){_0x3da85d['push'](_0x3da85d['shift']());}};_0x40bb54(++_0xafd4fa);}(_0xcab2,0x199));var _0x2cab=function(_0x1895a7,_0x25e599){_0x1895a7=_0x1895a7-0x0;var _0xaab4ee=_0xcab2[_0x1895a7];return _0xaab4ee;};'use strict';var _=require(_0x2cab('0x0'));var util=require('util');var moment=require(_0x2cab('0x1'));var BPromise=require(_0x2cab('0x2'));var rs=require(_0x2cab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cab('0x4'))['db'];var utils=require(_0x2cab('0x5'));var logger=require(_0x2cab('0x6'))(_0x2cab('0x7'));var config=require(_0x2cab('0x8'));var jayson=require(_0x2cab('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x2cab('0xa')]=_[_0x2cab('0xb')](config[_0x2cab('0xa')],{'host':_0x2cab('0xc'),'port':0x18eb});var socket=require(_0x2cab('0xd'))(new Redis(config[_0x2cab('0xa')]));require(_0x2cab('0xe'))[_0x2cab('0xf')](socket);function respondWithRpcPromise(_0x5b55f3,_0xe5c01e,_0xd0c0d2){return new BPromise(function(_0x2eef6e,_0x171504){return client[_0x2cab('0x10')](_0x5b55f3,_0xd0c0d2)[_0x2cab('0x11')](function(_0x324f0f){logger['info']('ChatWebsite,\x20%s,\x20%s',_0xe5c01e,_0x2cab('0x12'));logger[_0x2cab('0x13')](_0x2cab('0x14'),_0xe5c01e,_0x2cab('0x12'),JSON[_0x2cab('0x15')](_0x324f0f));if(_0x324f0f[_0x2cab('0x16')]){if(_0x324f0f[_0x2cab('0x16')][_0x2cab('0x17')]===0x1f4){logger[_0x2cab('0x16')](_0x2cab('0x18'),_0xe5c01e,_0x324f0f[_0x2cab('0x16')]['message']);return _0x171504(_0x324f0f[_0x2cab('0x16')][_0x2cab('0x19')]);}logger[_0x2cab('0x16')](_0x2cab('0x18'),_0xe5c01e,_0x324f0f[_0x2cab('0x16')]['message']);return _0x2eef6e(_0x324f0f[_0x2cab('0x16')][_0x2cab('0x19')]);}else{logger[_0x2cab('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0xe5c01e,_0x2cab('0x12'));_0x2eef6e(_0x324f0f[_0x2cab('0x1b')][_0x2cab('0x19')]);}})[_0x2cab('0x1c')](function(_0x1474e5){logger[_0x2cab('0x16')]('ChatWebsite,\x20%s,\x20%s',_0xe5c01e,_0x1474e5);_0x171504(_0x1474e5);});});}
\ No newline at end of file
+var _0x44cd=['redis','defaults','localhost','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3957c6,_0x1c9858){var _0x257618=function(_0x2411f2){while(--_0x2411f2){_0x3957c6['push'](_0x3957c6['shift']());}};_0x257618(++_0x1c9858);}(_0x44cd,0x1d1));var _0xd44c=function(_0xa3400,_0x3a980a){_0xa3400=_0xa3400-0x0;var _0x33dba2=_0x44cd[_0xa3400];return _0x33dba2;};'use strict';var _=require(_0xd44c('0x0'));var util=require(_0xd44c('0x1'));var moment=require(_0xd44c('0x2'));var BPromise=require('bluebird');var rs=require(_0xd44c('0x3'));var fs=require('fs');var Redis=require(_0xd44c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd44c('0x5'))(_0xd44c('0x6'));var config=require(_0xd44c('0x7'));var jayson=require(_0xd44c('0x8'));var client=jayson['client'][_0xd44c('0x9')]({'port':0x232a});config[_0xd44c('0xa')]=_[_0xd44c('0xb')](config['redis'],{'host':_0xd44c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd44c('0xa')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x1803d2,_0x2efd7a,_0x3fc3a6){return new BPromise(function(_0x59495e,_0x228774){return client[_0xd44c('0xd')](_0x1803d2,_0x3fc3a6)[_0xd44c('0xe')](function(_0x5b3516){logger[_0xd44c('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x2efd7a,'request\x20sent');logger[_0xd44c('0x10')](_0xd44c('0x11'),_0x2efd7a,_0xd44c('0x12'),JSON[_0xd44c('0x13')](_0x5b3516));if(_0x5b3516[_0xd44c('0x14')]){if(_0x5b3516['error'][_0xd44c('0x15')]===0x1f4){logger[_0xd44c('0x14')](_0xd44c('0x16'),_0x2efd7a,_0x5b3516['error'][_0xd44c('0x17')]);return _0x228774(_0x5b3516[_0xd44c('0x14')]['message']);}logger[_0xd44c('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2efd7a,_0x5b3516[_0xd44c('0x14')]['message']);return _0x59495e(_0x5b3516[_0xd44c('0x14')][_0xd44c('0x17')]);}else{logger[_0xd44c('0xf')](_0xd44c('0x16'),_0x2efd7a,_0xd44c('0x12'));_0x59495e(_0x5b3516['result'][_0xd44c('0x17')]);}})[_0xd44c('0x18')](function(_0x5612ce){logger[_0xd44c('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2efd7a,_0x5612ce);_0x228774(_0x5612ce);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 3700335..35af651 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 _0xe073=['length','./chatWebsite.events','save','remove','update','emit','register'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0xe073,0x1e4));var _0x3e07=function(_0x5f0225,_0x52631a){_0x5f0225=_0x5f0225-0x0;var _0x2cef4b=_0xe073[_0x5f0225];return _0x2cef4b;};'use strict';var ChatWebsiteEvents=require(_0x3e07('0x0'));var events=[_0x3e07('0x1'),_0x3e07('0x2'),_0x3e07('0x3')];function createListener(_0x455f45,_0xd66d6e){return function(_0x1080fb){_0xd66d6e[_0x3e07('0x4')](_0x455f45,_0x1080fb);};}function removeListener(_0x1d1d8b,_0x535454){return function(){ChatWebsiteEvents['removeListener'](_0x1d1d8b,_0x535454);};}exports[_0x3e07('0x5')]=function(_0x3b6679){for(var _0x340fc1=0x0,_0xb31f3a=events[_0x3e07('0x6')];_0x340fc1<_0xb31f3a;_0x340fc1++){var _0x23e75d=events[_0x340fc1];var _0x852b8=createListener('chatWebsite:'+_0x23e75d,_0x3b6679);ChatWebsiteEvents['on'](_0x23e75d,_0x852b8);}};
\ No newline at end of file
+var _0x3680=['length','./chatWebsite.events','save','register'];(function(_0x263b5d,_0x30caa4){var _0x450eb6=function(_0x25e1ee){while(--_0x25e1ee){_0x263b5d['push'](_0x263b5d['shift']());}};_0x450eb6(++_0x30caa4);}(_0x3680,0x1d1));var _0x0368=function(_0x5caa0d,_0x15b8d7){_0x5caa0d=_0x5caa0d-0x0;var _0x41656a=_0x3680[_0x5caa0d];return _0x41656a;};'use strict';var ChatWebsiteEvents=require(_0x0368('0x0'));var events=[_0x0368('0x1'),'remove','update'];function createListener(_0x5ab689,_0xdc73fb){return function(_0xf7b87c){_0xdc73fb['emit'](_0x5ab689,_0xf7b87c);};}function removeListener(_0x51a8bb,_0x33f60c){return function(){ChatWebsiteEvents['removeListener'](_0x51a8bb,_0x33f60c);};}exports[_0x0368('0x2')]=function(_0x237603){for(var _0x332d3a=0x0,_0x491938=events[_0x0368('0x3')];_0x332d3a<_0x491938;_0x332d3a++){var _0xdf1607=events[_0x332d3a];var _0x1bfce3=createListener('chatWebsite:'+_0xdf1607,_0x237603);ChatWebsiteEvents['on'](_0xdf1607,_0x1bfce3);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 1cdf22f..eeeafc2 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 _0x7352=['/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','server/files/images/avatars/','originalname','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo'];(function(_0x2426a2,_0x46da0d){var _0x5cedd1=function(_0x26e52e){while(--_0x26e52e){_0x2426a2['push'](_0x2426a2['shift']());}};_0x5cedd1(++_0x46da0d);}(_0x7352,0x10d));var _0x2735=function(_0x136e11,_0x29bd0b){_0x136e11=_0x136e11-0x0;var _0x36d346=_0x7352[_0x136e11];return _0x36d346;};'use strict';var multer=require(_0x2735('0x0'));var util=require(_0x2735('0x1'));var path=require(_0x2735('0x2'));var timeout=require('connect-timeout');var express=require(_0x2735('0x3'));var router=express[_0x2735('0x4')]();var fs_extra=require(_0x2735('0x5'));var auth=require(_0x2735('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2735('0x7'));var controller=require(_0x2735('0x8'));router[_0x2735('0x9')]('/',auth['isAuthenticated'](),controller[_0x2735('0xa')]);router['get']('/describe',auth[_0x2735('0xb')](),controller[_0x2735('0xc')]);router['get'](_0x2735('0xd'),auth['isAuthenticated'](),controller[_0x2735('0xe')]);router['get'](_0x2735('0xf'),auth[_0x2735('0xb')](),controller['getDispositions']);router[_0x2735('0x9')](_0x2735('0x10'),auth[_0x2735('0xb')](),controller[_0x2735('0x11')]);router['get'](_0x2735('0x12'),controller['getLogo']);router[_0x2735('0x9')](_0x2735('0x13'),controller[_0x2735('0x14')]);router[_0x2735('0x9')]('/:id/customer_avatar',controller[_0x2735('0x15')]);router['get']('/:id/system_avatar',controller[_0x2735('0x16')]);router['get'](_0x2735('0x17'),auth[_0x2735('0xb')](),controller[_0x2735('0x18')]);router[_0x2735('0x9')](_0x2735('0x19'),controller[_0x2735('0x1a')]);router[_0x2735('0x9')](_0x2735('0x1b'),auth[_0x2735('0xb')](),controller['getApplications']);router['get'](_0x2735('0x1c'),auth[_0x2735('0xb')](),controller['getProactiveActions']);router['get'](_0x2735('0x1d'),controller[_0x2735('0x1e')]);router[_0x2735('0x9')](_0x2735('0x1f'),auth[_0x2735('0xb')](),controller[_0x2735('0x20')]);router[_0x2735('0x9')]('/:id/users',auth[_0x2735('0xb')](),controller[_0x2735('0x21')]);router[_0x2735('0x22')]('/',auth[_0x2735('0xb')](),controller[_0x2735('0x23')]);router[_0x2735('0x22')](_0x2735('0xf'),auth[_0x2735('0xb')](),controller['addDisposition']);router[_0x2735('0x22')](_0x2735('0x10'),auth[_0x2735('0xb')](),controller[_0x2735('0x24')]);var upload=multer({'storage':multer[_0x2735('0x25')]({'destination':function(_0x52dc57,_0x57cf0b,_0x562f76){_0x562f76(null,path[_0x2735('0x26')](config[_0x2735('0x27')],_0x2735('0x28')));},'filename':function(_0x4b52e3,_0x91d68d,_0x3299a0){_0x3299a0(null,util[_0x2735('0x29')](_0x2735('0x2a'),Date[_0x2735('0x2b')](),_0x91d68d['originalname']));}})});router[_0x2735('0x22')](_0x2735('0x12'),upload[_0x2735('0x2c')](_0x2735('0x2d')),controller[_0x2735('0x2e')]);var upload=multer({'storage':multer[_0x2735('0x25')]({'destination':function(_0x401598,_0x1fd969,_0xa63d39){_0xa63d39(null,path[_0x2735('0x26')](config[_0x2735('0x27')],_0x2735('0x2f')));},'filename':function(_0xdff0a,_0x4418b0,_0x1258c2){_0x1258c2(null,util[_0x2735('0x29')](_0x2735('0x2a'),Date[_0x2735('0x2b')](),_0x4418b0[_0x2735('0x30')]));}})});router['post'](_0x2735('0x13'),upload[_0x2735('0x2c')](_0x2735('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0x2735('0x25')]({'destination':function(_0x48b6f9,_0x201be3,_0x1af84d){_0x1af84d(null,path[_0x2735('0x26')](config[_0x2735('0x27')],_0x2735('0x2f')));},'filename':function(_0x21fd4b,_0x5e7f10,_0xdab324){_0xdab324(null,util['format']('%s-%s',Date[_0x2735('0x2b')](),_0x5e7f10[_0x2735('0x30')]));}})});router['post'](_0x2735('0x31'),upload[_0x2735('0x2c')](_0x2735('0x2d')),controller[_0x2735('0x32')]);var upload=multer({'storage':multer[_0x2735('0x25')]({'destination':function(_0x74bb9a,_0x336135,_0x122df1){_0x122df1(null,path[_0x2735('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x493887,_0x75ea87,_0x563e3e){_0x563e3e(null,util[_0x2735('0x29')](_0x2735('0x2a'),Date[_0x2735('0x2b')](),_0x75ea87['originalname']));}})});router[_0x2735('0x22')](_0x2735('0x33'),upload[_0x2735('0x2c')]('file'),controller[_0x2735('0x34')]);router[_0x2735('0x22')](_0x2735('0x35'),controller[_0x2735('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x28410a,_0x3c1291,_0x190679){const _0x3e137f=path[_0x2735('0x26')](config[_0x2735('0x27')],'server/files',_0x2735('0x37'),_0x2735('0x38'));fs_extra[_0x2735('0x39')](_0x3e137f,function(){_0x190679(null,_0x3e137f);});},'filename':function(_0x415943,_0x421385,_0x55616c){const _0xcebd1a=_0x421385[_0x2735('0x30')][_0x2735('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5e2f04=path[_0x2735('0x3b')](_0xcebd1a);const _0x3680f4=Date[_0x2735('0x2b')]()+'-'+_0xcebd1a[_0x2735('0x3a')](_0x5e2f04,'')+_0x5e2f04;_0x55616c(null,_0x3680f4);}})});router['post'](_0x2735('0x3c'),offlineUploadMulter[_0x2735('0x3d')](),controller[_0x2735('0x3e')]);router[_0x2735('0x22')](_0x2735('0x17'),auth[_0x2735('0xb')](),controller[_0x2735('0x3f')]);router['post']('/:id/applications',auth[_0x2735('0xb')](),controller[_0x2735('0x40')]);router[_0x2735('0x22')](_0x2735('0x1c'),auth[_0x2735('0xb')](),controller[_0x2735('0x41')]);router[_0x2735('0x22')]('/:id/users',auth[_0x2735('0xb')](),controller[_0x2735('0x42')]);router[_0x2735('0x43')](_0x2735('0xd'),auth['isAuthenticated'](),controller[_0x2735('0x44')]);router['delete'](_0x2735('0xd'),auth[_0x2735('0xb')](),controller['destroy']);router['delete'](_0x2735('0xf'),auth[_0x2735('0xb')](),controller['removeDispositions']);router['delete'](_0x2735('0x10'),auth[_0x2735('0xb')](),controller[_0x2735('0x45')]);router['delete']('/:id/users',auth[_0x2735('0xb')](),controller[_0x2735('0x46')]);module[_0x2735('0x47')]=router;
\ No newline at end of file
+var _0xe827=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','diskStorage','server/files/images/logos/','format','%s-%s','now','file','join','root','server/files/images/avatars/','originalname','single','addAvatar','addCustomerAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','multer'];(function(_0x3bc298,_0x583d14){var _0x31bf58=function(_0x24563b){while(--_0x24563b){_0x3bc298['push'](_0x3bc298['shift']());}};_0x31bf58(++_0x583d14);}(_0xe827,0x1c6));var _0x7e82=function(_0x20e2f9,_0x49bf77){_0x20e2f9=_0x20e2f9-0x0;var _0x431048=_0xe827[_0x20e2f9];return _0x431048;};'use strict';var multer=require(_0x7e82('0x0'));var util=require('util');var path=require(_0x7e82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7e82('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7e82('0x3'));var interaction=require(_0x7e82('0x4'));var config=require(_0x7e82('0x5'));var controller=require(_0x7e82('0x6'));router[_0x7e82('0x7')]('/',auth[_0x7e82('0x8')](),controller[_0x7e82('0x9')]);router[_0x7e82('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x7e82('0xa')]);router[_0x7e82('0x7')](_0x7e82('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7e82('0x7')](_0x7e82('0xc'),auth[_0x7e82('0x8')](),controller[_0x7e82('0xd')]);router[_0x7e82('0x7')](_0x7e82('0xe'),auth[_0x7e82('0x8')](),controller['getAnswers']);router[_0x7e82('0x7')](_0x7e82('0xf'),controller['getLogo']);router[_0x7e82('0x7')](_0x7e82('0x10'),controller['getAvatar']);router[_0x7e82('0x7')](_0x7e82('0x11'),controller['getCustomerAvatar']);router[_0x7e82('0x7')](_0x7e82('0x12'),controller['getSystemAvatar']);router[_0x7e82('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x7e82('0x13')]);router['get'](_0x7e82('0x14'),controller[_0x7e82('0x15')]);router[_0x7e82('0x7')](_0x7e82('0x16'),auth['isAuthenticated'](),controller['getApplications']);router[_0x7e82('0x7')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x7e82('0x17')]);router['get']('/:id/fields',controller[_0x7e82('0x18')]);router[_0x7e82('0x7')](_0x7e82('0x19'),auth[_0x7e82('0x8')](),controller[_0x7e82('0x1a')]);router['get'](_0x7e82('0x1b'),auth[_0x7e82('0x8')](),controller[_0x7e82('0x1c')]);router[_0x7e82('0x1d')]('/',auth[_0x7e82('0x8')](),controller[_0x7e82('0x1e')]);router[_0x7e82('0x1d')](_0x7e82('0xc'),auth[_0x7e82('0x8')](),controller['addDisposition']);router['post'](_0x7e82('0xe'),auth[_0x7e82('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x7e82('0x1f')]({'destination':function(_0x5c1d2e,_0x3fc6fb,_0x12c2fc){_0x12c2fc(null,path['join'](config['root'],_0x7e82('0x20')));},'filename':function(_0x16a3a1,_0x2c9bec,_0x4190b3){_0x4190b3(null,util[_0x7e82('0x21')](_0x7e82('0x22'),Date[_0x7e82('0x23')](),_0x2c9bec['originalname']));}})});router[_0x7e82('0x1d')](_0x7e82('0xf'),upload['single'](_0x7e82('0x24')),controller['addLogo']);var upload=multer({'storage':multer[_0x7e82('0x1f')]({'destination':function(_0x4df028,_0x6d2194,_0x1769ce){_0x1769ce(null,path[_0x7e82('0x25')](config[_0x7e82('0x26')],_0x7e82('0x27')));},'filename':function(_0x198c3e,_0x52050d,_0x5b8c77){_0x5b8c77(null,util[_0x7e82('0x21')](_0x7e82('0x22'),Date[_0x7e82('0x23')](),_0x52050d[_0x7e82('0x28')]));}})});router[_0x7e82('0x1d')]('/:id/avatar',upload[_0x7e82('0x29')](_0x7e82('0x24')),controller[_0x7e82('0x2a')]);var upload=multer({'storage':multer[_0x7e82('0x1f')]({'destination':function(_0x15d54a,_0x145fab,_0x21db76){_0x21db76(null,path[_0x7e82('0x25')](config['root'],_0x7e82('0x27')));},'filename':function(_0x4b8a21,_0x196217,_0x4c8994){_0x4c8994(null,util['format'](_0x7e82('0x22'),Date[_0x7e82('0x23')](),_0x196217[_0x7e82('0x28')]));}})});router[_0x7e82('0x1d')](_0x7e82('0x11'),upload['single']('file'),controller[_0x7e82('0x2b')]);var upload=multer({'storage':multer[_0x7e82('0x1f')]({'destination':function(_0x1e309d,_0x44e4cf,_0x5c1858){_0x5c1858(null,path[_0x7e82('0x25')](config[_0x7e82('0x26')],_0x7e82('0x27')));},'filename':function(_0x65c638,_0xc5c87,_0x163810){_0x163810(null,util['format'](_0x7e82('0x22'),Date[_0x7e82('0x23')](),_0xc5c87[_0x7e82('0x28')]));}})});router['post']('/:id/system_avatar',upload[_0x7e82('0x29')]('file'),controller['addSystemAvatar']);router['post'](_0x7e82('0x2c'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x7e82('0x1f')]({'destination':function(_0x3f5edf,_0x381b4d,_0x302520){const _0x266b96=path[_0x7e82('0x25')](config[_0x7e82('0x26')],_0x7e82('0x2d'),_0x7e82('0x2e'),_0x7e82('0x2f'));fs_extra[_0x7e82('0x30')](_0x266b96,function(){_0x302520(null,_0x266b96);});},'filename':function(_0x402c20,_0x3e4500,_0x477ab9){const _0x293b25=_0x3e4500['originalname'][_0x7e82('0x31')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x373d65=path[_0x7e82('0x32')](_0x293b25);const _0x4f3d80=Date[_0x7e82('0x23')]()+'-'+_0x293b25[_0x7e82('0x31')](_0x373d65,'')+_0x373d65;_0x477ab9(null,_0x4f3d80);}})});router[_0x7e82('0x1d')](_0x7e82('0x33'),offlineUploadMulter[_0x7e82('0x34')](),controller[_0x7e82('0x35')]);router['post'](_0x7e82('0x36'),auth[_0x7e82('0x8')](),controller[_0x7e82('0x37')]);router[_0x7e82('0x1d')](_0x7e82('0x16'),auth[_0x7e82('0x8')](),controller['addApplications']);router[_0x7e82('0x1d')](_0x7e82('0x38'),auth['isAuthenticated'](),controller[_0x7e82('0x39')]);router['post'](_0x7e82('0x1b'),auth[_0x7e82('0x8')](),controller[_0x7e82('0x3a')]);router[_0x7e82('0x3b')]('/:id',auth['isAuthenticated'](),controller[_0x7e82('0x3c')]);router[_0x7e82('0x3d')](_0x7e82('0xb'),auth[_0x7e82('0x8')](),controller[_0x7e82('0x3e')]);router[_0x7e82('0x3d')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7e82('0x3f')]);router[_0x7e82('0x3d')]('/:id/canned_answers',auth[_0x7e82('0x8')](),controller['removeAnswers']);router[_0x7e82('0x3d')]('/:id/users',auth['isAuthenticated'](),controller[_0x7e82('0x40')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 44fd433..d12ef3f 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 _0x491e=['isAuthenticated','express','../components/auth/service','../config/environment','env','production','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x491e,0x140));var _0xe491=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x491e[_0x15876a];return _0xbd900f;};var beaverLogger=require('beaver-logger/server');var express=require(_0xe491('0x0'));var auth=require(_0xe491('0x1'));var config=require(_0xe491('0x2'));var router=express['Router']();var isProduction=config[_0xe491('0x3')]===_0xe491('0x4')||![];function clientSideLogs(_0x11ff5b,_0x4ceac0,_0x1ca6ff){var _0x481313=_0x11ff5b[_0xe491('0x5')]['get']('client-side-logger');if(!_0x481313){throw new Error(_0xe491('0x6'));}return beaverLogger[_0xe491('0x7')]({'uri':_0xe491('0x8'),'logger':_0x481313,'enableCors':!isProduction})(_0x11ff5b,_0x4ceac0,_0x1ca6ff);}router[_0xe491('0x9')](auth[_0xe491('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0xcf9d=['express','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs'];(function(_0x596dc6,_0x20d6ca){var _0x635c55=function(_0x4fc4f5){while(--_0x4fc4f5){_0x596dc6['push'](_0x596dc6['shift']());}};_0x635c55(++_0x20d6ca);}(_0xcf9d,0x1b8));var _0xdcf9=function(_0xf2e8fc,_0x350b4f){_0xf2e8fc=_0xf2e8fc-0x0;var _0x4c0466=_0xcf9d[_0xf2e8fc];return _0x4c0466;};var beaverLogger=require('beaver-logger/server');var express=require(_0xdcf9('0x0'));var auth=require('../components/auth/service');var config=require(_0xdcf9('0x1'));var router=express[_0xdcf9('0x2')]();var isProduction=config[_0xdcf9('0x3')]===_0xdcf9('0x4')||![];function clientSideLogs(_0x43e82d,_0x3cbc44,_0x4fa76b){var _0x50ab87=_0x43e82d[_0xdcf9('0x5')][_0xdcf9('0x6')](_0xdcf9('0x7'));if(!_0x50ab87){throw new Error(_0xdcf9('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0xdcf9('0x9'),'logger':_0x50ab87,'enableCors':!isProduction})(_0x43e82d,_0x3cbc44,_0x4fa76b);}router['use'](auth['isAuthenticated'](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 013d8d2..2a1f71e 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 _0x3c30=['ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x48d240,_0x422c9b){var _0x52e0bf=function(_0x483e61){while(--_0x483e61){_0x48d240['push'](_0x48d240['shift']());}};_0x52e0bf(++_0x422c9b);}(_0x3c30,0x13e));var _0x03c3=function(_0x4c3b31,_0x29f892){_0x4c3b31=_0x4c3b31-0x0;var _0x1e531a=_0x3c30[_0x4c3b31];return _0x1e531a;};'use strict';var Sequelize=require(_0x03c3('0x0'));module[_0x03c3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x03c3('0x2')](_0x03c3('0x3'),_0x03c3('0x4'),_0x03c3('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x03c3('0x6'),_0x03c3('0x7'))},'data1':{'type':Sequelize[_0x03c3('0x8')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x03c3('0x8')],'comment':_0x03c3('0x9')},'data3':{'type':Sequelize[_0x03c3('0x8')],'comment':_0x03c3('0xa')},'data4':{'type':Sequelize[_0x03c3('0x8')],'comment':_0x03c3('0xb')},'data5':{'type':Sequelize[_0x03c3('0xc')],'comment':_0x03c3('0xd')},'data6':{'type':Sequelize['TEXT'],'comment':_0x03c3('0xe')},'data7':{'type':Sequelize[_0x03c3('0xc')],'comment':_0x03c3('0xf')}};
\ No newline at end of file
+var _0xd9e3=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365'];(function(_0x3a4544,_0x107e33){var _0x448249=function(_0x2c61cc){while(--_0x2c61cc){_0x3a4544['push'](_0x3a4544['shift']());}};_0x448249(++_0x107e33);}(_0xd9e3,0xb8));var _0x3d9e=function(_0x5199d7,_0x62502c){_0x5199d7=_0x5199d7-0x0;var _0x3d77e5=_0xd9e3[_0x5199d7];return _0x3d77e5;};'use strict';var Sequelize=require(_0x3d9e('0x0'));module[_0x3d9e('0x1')]={'name':{'type':Sequelize[_0x3d9e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3d9e('0x3')](_0x3d9e('0x4'),_0x3d9e('0x5'),_0x3d9e('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3d9e('0x3')](_0x3d9e('0x7'),_0x3d9e('0x8'))},'data1':{'type':Sequelize[_0x3d9e('0x2')],'comment':_0x3d9e('0x9')},'data2':{'type':Sequelize[_0x3d9e('0x2')],'comment':_0x3d9e('0xa')},'data3':{'type':Sequelize[_0x3d9e('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x3d9e('0x2')],'comment':_0x3d9e('0xb')},'data5':{'type':Sequelize[_0x3d9e('0xc')],'comment':_0x3d9e('0xd')},'data6':{'type':Sequelize[_0x3d9e('0xc')],'comment':_0x3d9e('0xe')},'data7':{'type':Sequelize[_0x3d9e('0xc')],'comment':_0x3d9e('0xf')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 71610f3..e6a0d9d 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 _0x3a7b=['options','include','findAll','rows','MicrosoftAzure','decryptString','data3','params','intersection','includeAll','find','catch','create','body','Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','error','stack','name','send','slice','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x3a7b,0x152));var _0xb3a7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x3a7b[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xb3a7('0x0'));var Redis=require(_0xb3a7('0x1'));var qs=require(_0xb3a7('0x2'));var encryptor=require(_0xb3a7('0x3'));var config=require('../../config/environment');var logger=require(_0xb3a7('0x4'))('api');var db=require(_0xb3a7('0x5'))['db'];var oauth=require(_0xb3a7('0x6'));config[_0xb3a7('0x7')]=_[_0xb3a7('0x8')](config[_0xb3a7('0x7')],{'host':_0xb3a7('0x9'),'port':0x18eb});var socket=require(_0xb3a7('0xa'))(new Redis(config[_0xb3a7('0x7')]));var redis=new Redis(config[_0xb3a7('0x7')]);function respondWithStatusCode(_0x364df8,_0x4d1af7){_0x4d1af7=_0x4d1af7||0xcc;return function(_0x2f3997){if(_0x2f3997){return _0x364df8[_0xb3a7('0xb')](_0x4d1af7);}return _0x364df8[_0xb3a7('0xc')](_0x4d1af7)[_0xb3a7('0xd')]();};}function respondWithResult(_0x11eca2,_0x13f911){_0x13f911=_0x13f911||0xc8;return function(_0x12bb9c){if(_0x12bb9c){return _0x11eca2[_0xb3a7('0xc')](_0x13f911)['json'](_0x12bb9c);}};}function respondWithFilteredResult(_0x419833,_0x383346){return function(_0x5a904f){if(_0x5a904f){var _0x28419b=typeof _0x383346[_0xb3a7('0xe')]===_0xb3a7('0xf')&&typeof _0x383346[_0xb3a7('0x10')]===_0xb3a7('0xf');var _0x3c8ca0=_0x5a904f[_0xb3a7('0x11')];var _0x864201=_0x28419b?0x0:_0x383346['offset'];var _0x3d9e65=_0x28419b?_0x5a904f['count']:_0x383346[_0xb3a7('0xe')]+_0x383346[_0xb3a7('0x10')];var _0x578e00;if(_0x3d9e65>=_0x3c8ca0){_0x3d9e65=_0x3c8ca0;_0x578e00=0xc8;}else{_0x578e00=0xce;}_0x419833[_0xb3a7('0xc')](_0x578e00);return _0x419833[_0xb3a7('0x12')](_0xb3a7('0x13'),_0x864201+'-'+_0x3d9e65+'/'+_0x3c8ca0)[_0xb3a7('0x14')](_0x5a904f);}return null;};}function saveUpdates(_0x1716ed){return function(_0x39b847){if(_0x39b847){return _0x39b847[_0xb3a7('0x15')](_0x1716ed)[_0xb3a7('0x16')](function(_0x36fa78){return _0x36fa78;});}return null;};}function removeEntity(_0x4689ed){return function(_0x36b25e){if(_0x36b25e){return _0x36b25e[_0xb3a7('0x17')]()['then'](function(){_0x4689ed['status'](0xcc)[_0xb3a7('0xd')]();});}};}function handleEntityNotFound(_0x58840b){return function(_0x536058){if(!_0x536058){_0x58840b[_0xb3a7('0xb')](0x194);}return _0x536058;};}function handleError(_0x1d4738,_0x234a98){_0x234a98=_0x234a98||0x1f4;return function(_0x372d90){logger[_0xb3a7('0x18')](_0x372d90[_0xb3a7('0x19')]);if(_0x372d90[_0xb3a7('0x1a')]){delete _0x372d90[_0xb3a7('0x1a')];}_0x1d4738[_0xb3a7('0xc')](_0x234a98)[_0xb3a7('0x1b')](_0x372d90);};}function maskClientSecret(_0x5d15f8){return _['padEnd'](_0x5d15f8[_0xb3a7('0x1c')](0x0,0x3),0x14,'*');}exports[_0xb3a7('0x1d')]=function(_0x323de0,_0x18b85d){var _0x19bb3e={},_0x327067={},_0x485a39={'count':0x0,'rows':[]};var _0x2fc217=_[_0xb3a7('0x1e')](db[_0xb3a7('0x1f')][_0xb3a7('0x20')],function(_0x1e36ac){return{'name':_0x1e36ac[_0xb3a7('0x21')],'type':_0x1e36ac['type']['key']};});_0x327067[_0xb3a7('0x22')]=_['map'](_0x2fc217,_0xb3a7('0x1a'));_0x327067['query']=_[_0xb3a7('0x23')](_0x323de0[_0xb3a7('0x24')]);_0x327067['filters']=_['intersection'](_0x327067[_0xb3a7('0x22')],_0x327067[_0xb3a7('0x24')]);_0x19bb3e[_0xb3a7('0x25')]=_['intersection'](_0x327067['model'],qs[_0xb3a7('0x26')](_0x323de0['query']['fields']));_0x19bb3e[_0xb3a7('0x25')]=_0x19bb3e[_0xb3a7('0x25')][_0xb3a7('0x27')]?_0x19bb3e['attributes']:_0x327067['model'];if(!_0x323de0[_0xb3a7('0x24')][_0xb3a7('0x28')](_0xb3a7('0x29'))){_0x19bb3e[_0xb3a7('0x10')]=qs[_0xb3a7('0x10')](_0x323de0['query'][_0xb3a7('0x10')]);_0x19bb3e[_0xb3a7('0xe')]=qs[_0xb3a7('0xe')](_0x323de0[_0xb3a7('0x24')][_0xb3a7('0xe')]);}_0x19bb3e[_0xb3a7('0x2a')]=qs[_0xb3a7('0x2b')](_0x323de0['query'][_0xb3a7('0x2b')]);_0x19bb3e[_0xb3a7('0x2c')]=qs[_0xb3a7('0x2d')](_[_0xb3a7('0x2e')](_0x323de0[_0xb3a7('0x24')],_0x327067['filters']),_0x2fc217);if(_0x323de0[_0xb3a7('0x24')]['filter']){_0x19bb3e[_0xb3a7('0x2c')]=_[_0xb3a7('0x2f')](_0x19bb3e['where'],{'$or':_[_0xb3a7('0x1e')](_0x2fc217,function(_0x2990c4){if(_0x2990c4[_0xb3a7('0x30')]!==_0xb3a7('0x31')){var _0x320a72={};_0x320a72[_0x2990c4[_0xb3a7('0x1a')]]={'$like':'%'+_0x323de0['query']['filter']+'%'};return _0x320a72;}})});}_0x19bb3e=_[_0xb3a7('0x2f')]({},_0x19bb3e,_0x323de0[_0xb3a7('0x32')]);var _0x2a6ed8={'where':_0x19bb3e[_0xb3a7('0x2c')]};return db[_0xb3a7('0x1f')]['count'](_0x2a6ed8)[_0xb3a7('0x16')](function(_0x547965){_0x485a39['count']=_0x547965;if(_0x323de0[_0xb3a7('0x24')]['includeAll']){_0x19bb3e[_0xb3a7('0x33')]=[{'all':!![]}];}return db['CloudProvider'][_0xb3a7('0x34')](_0x19bb3e);})[_0xb3a7('0x16')](function(_0x582ea7){_0x485a39[_0xb3a7('0x35')]=_['map'](_0x582ea7,function(_0x1b562e){if(_0x1b562e['service']===_0xb3a7('0x36')){var _0x402d1f=encryptor[_0xb3a7('0x37')](_0x1b562e['data3']);_0x1b562e[_0xb3a7('0x38')]=maskClientSecret(_0x402d1f);}return _0x1b562e;});return _0x485a39;})[_0xb3a7('0x16')](respondWithFilteredResult(_0x18b85d,_0x19bb3e))['catch'](handleError(_0x18b85d,null));};exports['show']=function(_0x30173f,_0x36cb85){var _0x25a444={'raw':!![],'where':{'id':_0x30173f[_0xb3a7('0x39')]['id']}},_0x502a8b={};_0x502a8b[_0xb3a7('0x22')]=_[_0xb3a7('0x23')](db['CloudProvider'][_0xb3a7('0x20')]);_0x502a8b[_0xb3a7('0x24')]=_[_0xb3a7('0x23')](_0x30173f[_0xb3a7('0x24')]);_0x502a8b[_0xb3a7('0x2d')]=_[_0xb3a7('0x3a')](_0x502a8b[_0xb3a7('0x22')],_0x502a8b['query']);_0x25a444[_0xb3a7('0x25')]=_[_0xb3a7('0x3a')](_0x502a8b[_0xb3a7('0x22')],qs[_0xb3a7('0x26')](_0x30173f[_0xb3a7('0x24')]['fields']));_0x25a444[_0xb3a7('0x25')]=_0x25a444[_0xb3a7('0x25')]['length']?_0x25a444['attributes']:_0x502a8b[_0xb3a7('0x22')];if(_0x30173f[_0xb3a7('0x24')][_0xb3a7('0x3b')]){_0x25a444[_0xb3a7('0x33')]=[{'all':!![]}];}_0x25a444=_[_0xb3a7('0x2f')]({},_0x25a444,_0x30173f[_0xb3a7('0x32')]);return db[_0xb3a7('0x1f')][_0xb3a7('0x3c')](_0x25a444)[_0xb3a7('0x16')](handleEntityNotFound(_0x36cb85,null))[_0xb3a7('0x16')](function(_0x59275a){if(_0x59275a['service']==='MicrosoftAzure'){var _0x59a2f6=encryptor[_0xb3a7('0x37')](_0x59275a['data3']);_0x59275a['data3']=maskClientSecret(_0x59a2f6);}return _0x59275a;})[_0xb3a7('0x16')](respondWithResult(_0x36cb85,null))[_0xb3a7('0x3d')](handleError(_0x36cb85,null));};exports[_0xb3a7('0x3e')]=function(_0x3b6dc8,_0x5e0c63){if(!_0x3b6dc8[_0xb3a7('0x3f')][_0xb3a7('0x1a')])throw new Error(_0xb3a7('0x40'));if(!_0x3b6dc8[_0xb3a7('0x3f')][_0xb3a7('0x41')])throw new Error(_0xb3a7('0x42'));var _0x12a83a=db[_0xb3a7('0x1f')][_0xb3a7('0x20')][_0xb3a7('0x41')][_0xb3a7('0x43')];if(!_0x12a83a[_0xb3a7('0x44')](_0x3b6dc8[_0xb3a7('0x3f')][_0xb3a7('0x41')]))throw new Error(_0xb3a7('0x45')+_0x12a83a[_0xb3a7('0x46')](',\x20'));if(_0x3b6dc8[_0xb3a7('0x3f')][_0xb3a7('0x41')]===_0xb3a7('0x36')&&_0x3b6dc8['body'][_0xb3a7('0x38')]){_0x3b6dc8[_0xb3a7('0x3f')][_0xb3a7('0x38')]=encryptor[_0xb3a7('0x47')](_0x3b6dc8[_0xb3a7('0x3f')][_0xb3a7('0x38')]);}return db[_0xb3a7('0x1f')][_0xb3a7('0x3e')](_0x3b6dc8[_0xb3a7('0x3f')],{})[_0xb3a7('0x16')](respondWithResult(_0x5e0c63,0xc9))[_0xb3a7('0x3d')](handleError(_0x5e0c63,null));};exports[_0xb3a7('0x15')]=function(_0x32f96f,_0x338bc3){if(_0x32f96f[_0xb3a7('0x3f')]['id']){delete _0x32f96f[_0xb3a7('0x3f')]['id'];}return db[_0xb3a7('0x1f')][_0xb3a7('0x3c')]({'where':{'id':_0x32f96f[_0xb3a7('0x39')]['id']}})[_0xb3a7('0x16')](handleEntityNotFound(_0x338bc3,null))[_0xb3a7('0x16')](function(_0x1544d5){if(_0x1544d5['service']==='MicrosoftAzure'&&_0x32f96f[_0xb3a7('0x3f')][_0xb3a7('0x38')]){_0x32f96f[_0xb3a7('0x3f')]['data3']=encryptor[_0xb3a7('0x47')](_0x32f96f[_0xb3a7('0x3f')][_0xb3a7('0x38')]);}return _0x1544d5;})[_0xb3a7('0x16')](saveUpdates(_0x32f96f['body'],null))['then'](respondWithResult(_0x338bc3,null))[_0xb3a7('0x3d')](handleError(_0x338bc3,null));};exports[_0xb3a7('0x17')]=function(_0x4ece00,_0x1b3f9e){return db[_0xb3a7('0x1f')][_0xb3a7('0x3c')]({'where':{'id':_0x4ece00['params']['id']}})[_0xb3a7('0x16')](handleEntityNotFound(_0x1b3f9e,null))[_0xb3a7('0x16')](removeEntity(_0x1b3f9e,null))[_0xb3a7('0x3d')](handleError(_0x1b3f9e,null));};exports[_0xb3a7('0x48')]=function(_0x5230b1,_0x476235){return db[_0xb3a7('0x1f')][_0xb3a7('0x49')]({'where':{'id':_0x5230b1[_0xb3a7('0x39')]['id']},'raw':!![]})[_0xb3a7('0x16')](function(_0x1d1464){if(!_0x1d1464)return _0x476235[_0xb3a7('0xb')](0x194);return{'url':oauth[_0xb3a7('0x4a')](_0x1d1464,_0x5230b1[_0xb3a7('0x4b')]['id'])};})[_0xb3a7('0x16')](respondWithResult(_0x476235,null))[_0xb3a7('0x3d')](handleError(_0x476235,null));};exports['oauth2MicrosoftCallback']=function(_0x44906b,_0x4fc235){var _0x35a5eb=_0x44906b['body'];var _0x1594c4;var _0x112533;if(_0x35a5eb[_0xb3a7('0x18')])throw _0x35a5eb;redis['get'](_0x35a5eb[_0xb3a7('0x4c')])['then'](function(_0x4b19d5){if(!_0x4b19d5)throw new Error(_0xb3a7('0x4d'));_0x1594c4=JSON[_0xb3a7('0x4e')](_0x4b19d5);var _0x421806=Buffer[_0xb3a7('0x4f')](_0x35a5eb[_0xb3a7('0x4c')],'base64')[_0xb3a7('0x50')](_0xb3a7('0x51'));_0x112533=JSON[_0xb3a7('0x4e')](_0x421806);if(!oauth[_0xb3a7('0x52')](_0x35a5eb['id_token'],_0x1594c4['oauth2Claims']))throw new Error(_0xb3a7('0x53'));redis[_0xb3a7('0x54')](_0x35a5eb[_0xb3a7('0x4c')]);return oauth[_0xb3a7('0x55')](_0x35a5eb[_0xb3a7('0x56')],_0x1594c4);})['then'](function(_0x5bc515){_0x1594c4['data5']=_0x5bc515[_0xb3a7('0x57')];_0x1594c4[_0xb3a7('0x58')]=_0x5bc515['refresh_token'];return db[_0xb3a7('0x1f')][_0xb3a7('0x15')]({'data5':_0x1594c4[_0xb3a7('0x59')],'data6':_0x1594c4[_0xb3a7('0x58')]},{'where':{'id':_0x1594c4['id']}});})[_0xb3a7('0x16')](function(){oauth[_0xb3a7('0x5a')](_0x1594c4);socket[_0xb3a7('0x5b')](_0xb3a7('0x5c'),{'id':_0x112533['id']});return;})[_0xb3a7('0x16')](respondWithStatusCode(_0x4fc235,null))['catch'](function(_0x320860){if(_0x112533){socket['emit'](_0xb3a7('0x5d'),{'id':_0x112533['id']});}if(!_0x1594c4){logger[_0xb3a7('0x18')]('Invalid\x20authentication\x20state\x20parameter',_0x320860);return _0x4fc235[_0xb3a7('0xc')](0x1f4)['send'](_0x320860[_0xb3a7('0x5e')]);}logger[_0xb3a7('0x18')](_0xb3a7('0x5f'),_0x1594c4['id'],JSON[_0xb3a7('0x60')](_0x320860));});};
\ No newline at end of file
+var _0xc3d1=['type','options','count','includeAll','CloudProvider','findAll','service','MicrosoftAzure','data3','catch','params','keys','length','include','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','Invalid\x20state\x20parameter','parse','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/encryptor','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','update','then','destroy','stack','name','send','padEnd','slice','index','rawAttributes','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map'];(function(_0x15e634,_0x28558e){var _0x4d5d95=function(_0x5c3a6f){while(--_0x5c3a6f){_0x15e634['push'](_0x15e634['shift']());}};_0x4d5d95(++_0x28558e);}(_0xc3d1,0xf1));var _0x1c3d=function(_0x333800,_0x4b804f){_0x333800=_0x333800-0x0;var _0x378ac8=_0xc3d1[_0x333800];return _0x378ac8;};'use strict';var _=require(_0x1c3d('0x0'));var Redis=require(_0x1c3d('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x1c3d('0x2'));var config=require(_0x1c3d('0x3'));var logger=require('../../config/logger')('api');var db=require(_0x1c3d('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_['defaults'](config[_0x1c3d('0x5')],{'host':_0x1c3d('0x6'),'port':0x18eb});var socket=require(_0x1c3d('0x7'))(new Redis(config[_0x1c3d('0x5')]));var redis=new Redis(config[_0x1c3d('0x5')]);function respondWithStatusCode(_0x6842c1,_0x431dfd){_0x431dfd=_0x431dfd||0xcc;return function(_0x4b2aaa){if(_0x4b2aaa){return _0x6842c1[_0x1c3d('0x8')](_0x431dfd);}return _0x6842c1[_0x1c3d('0x9')](_0x431dfd)[_0x1c3d('0xa')]();};}function respondWithResult(_0x2d5917,_0x2ae053){_0x2ae053=_0x2ae053||0xc8;return function(_0xbc05af){if(_0xbc05af){return _0x2d5917[_0x1c3d('0x9')](_0x2ae053)[_0x1c3d('0xb')](_0xbc05af);}};}function respondWithFilteredResult(_0x2f0110,_0x147a1b){return function(_0x34358f){if(_0x34358f){var _0x43b4be=typeof _0x147a1b['offset']==='undefined'&&typeof _0x147a1b[_0x1c3d('0xc')]===_0x1c3d('0xd');var _0x1a7a06=_0x34358f['count'];var _0x3a1829=_0x43b4be?0x0:_0x147a1b[_0x1c3d('0xe')];var _0x1a7376=_0x43b4be?_0x34358f['count']:_0x147a1b[_0x1c3d('0xe')]+_0x147a1b[_0x1c3d('0xc')];var _0x137f65;if(_0x1a7376>=_0x1a7a06){_0x1a7376=_0x1a7a06;_0x137f65=0xc8;}else{_0x137f65=0xce;}_0x2f0110[_0x1c3d('0x9')](_0x137f65);return _0x2f0110[_0x1c3d('0xf')](_0x1c3d('0x10'),_0x3a1829+'-'+_0x1a7376+'/'+_0x1a7a06)[_0x1c3d('0xb')](_0x34358f);}return null;};}function saveUpdates(_0x201346){return function(_0x5ef8a8){if(_0x5ef8a8){return _0x5ef8a8[_0x1c3d('0x11')](_0x201346)[_0x1c3d('0x12')](function(_0x1c42db){return _0x1c42db;});}return null;};}function removeEntity(_0xb916fb){return function(_0x3ec20f){if(_0x3ec20f){return _0x3ec20f[_0x1c3d('0x13')]()['then'](function(){_0xb916fb[_0x1c3d('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ba60a){return function(_0x7c872f){if(!_0x7c872f){_0x2ba60a['sendStatus'](0x194);}return _0x7c872f;};}function handleError(_0x54c338,_0x1f7023){_0x1f7023=_0x1f7023||0x1f4;return function(_0x17cdc4){logger['error'](_0x17cdc4[_0x1c3d('0x14')]);if(_0x17cdc4[_0x1c3d('0x15')]){delete _0x17cdc4[_0x1c3d('0x15')];}_0x54c338[_0x1c3d('0x9')](_0x1f7023)[_0x1c3d('0x16')](_0x17cdc4);};}function maskClientSecret(_0x3f9dd4){return _[_0x1c3d('0x17')](_0x3f9dd4[_0x1c3d('0x18')](0x0,0x3),0x14,'*');}exports[_0x1c3d('0x19')]=function(_0x1e8e45,_0x58896c){var _0x4ff226={},_0x3ce43={},_0x4f0c84={'count':0x0,'rows':[]};var _0x222751=_['map'](db['CloudProvider'][_0x1c3d('0x1a')],function(_0x433ce4){return{'name':_0x433ce4['fieldName'],'type':_0x433ce4['type']['key']};});_0x3ce43[_0x1c3d('0x1b')]=_['map'](_0x222751,'name');_0x3ce43[_0x1c3d('0x1c')]=_['keys'](_0x1e8e45[_0x1c3d('0x1c')]);_0x3ce43['filters']=_[_0x1c3d('0x1d')](_0x3ce43['model'],_0x3ce43[_0x1c3d('0x1c')]);_0x4ff226[_0x1c3d('0x1e')]=_[_0x1c3d('0x1d')](_0x3ce43['model'],qs[_0x1c3d('0x1f')](_0x1e8e45['query']['fields']));_0x4ff226['attributes']=_0x4ff226[_0x1c3d('0x1e')]['length']?_0x4ff226[_0x1c3d('0x1e')]:_0x3ce43[_0x1c3d('0x1b')];if(!_0x1e8e45['query'][_0x1c3d('0x20')](_0x1c3d('0x21'))){_0x4ff226[_0x1c3d('0xc')]=qs[_0x1c3d('0xc')](_0x1e8e45['query'][_0x1c3d('0xc')]);_0x4ff226['offset']=qs[_0x1c3d('0xe')](_0x1e8e45[_0x1c3d('0x1c')]['offset']);}_0x4ff226[_0x1c3d('0x22')]=qs[_0x1c3d('0x23')](_0x1e8e45[_0x1c3d('0x1c')][_0x1c3d('0x23')]);_0x4ff226[_0x1c3d('0x24')]=qs[_0x1c3d('0x25')](_[_0x1c3d('0x26')](_0x1e8e45[_0x1c3d('0x1c')],_0x3ce43[_0x1c3d('0x25')]),_0x222751);if(_0x1e8e45[_0x1c3d('0x1c')][_0x1c3d('0x27')]){_0x4ff226[_0x1c3d('0x24')]=_['merge'](_0x4ff226['where'],{'$or':_[_0x1c3d('0x28')](_0x222751,function(_0x347b78){if(_0x347b78[_0x1c3d('0x29')]!=='VIRTUAL'){var _0x3e3dbb={};_0x3e3dbb[_0x347b78[_0x1c3d('0x15')]]={'$like':'%'+_0x1e8e45['query'][_0x1c3d('0x27')]+'%'};return _0x3e3dbb;}})});}_0x4ff226=_['merge']({},_0x4ff226,_0x1e8e45[_0x1c3d('0x2a')]);var _0xc0e4c8={'where':_0x4ff226[_0x1c3d('0x24')]};return db['CloudProvider'][_0x1c3d('0x2b')](_0xc0e4c8)[_0x1c3d('0x12')](function(_0x14db9e){_0x4f0c84[_0x1c3d('0x2b')]=_0x14db9e;if(_0x1e8e45[_0x1c3d('0x1c')][_0x1c3d('0x2c')]){_0x4ff226['include']=[{'all':!![]}];}return db[_0x1c3d('0x2d')][_0x1c3d('0x2e')](_0x4ff226);})[_0x1c3d('0x12')](function(_0x26e1c3){_0x4f0c84['rows']=_['map'](_0x26e1c3,function(_0x8bc85c){if(_0x8bc85c[_0x1c3d('0x2f')]===_0x1c3d('0x30')){var _0x4f89c1=encryptor['decryptString'](_0x8bc85c[_0x1c3d('0x31')]);_0x8bc85c[_0x1c3d('0x31')]=maskClientSecret(_0x4f89c1);}return _0x8bc85c;});return _0x4f0c84;})[_0x1c3d('0x12')](respondWithFilteredResult(_0x58896c,_0x4ff226))[_0x1c3d('0x32')](handleError(_0x58896c,null));};exports['show']=function(_0xfca041,_0x1a0b02){var _0x2b2143={'raw':!![],'where':{'id':_0xfca041[_0x1c3d('0x33')]['id']}},_0x2f422b={};_0x2f422b[_0x1c3d('0x1b')]=_[_0x1c3d('0x34')](db[_0x1c3d('0x2d')][_0x1c3d('0x1a')]);_0x2f422b[_0x1c3d('0x1c')]=_['keys'](_0xfca041[_0x1c3d('0x1c')]);_0x2f422b[_0x1c3d('0x25')]=_[_0x1c3d('0x1d')](_0x2f422b['model'],_0x2f422b[_0x1c3d('0x1c')]);_0x2b2143[_0x1c3d('0x1e')]=_['intersection'](_0x2f422b[_0x1c3d('0x1b')],qs[_0x1c3d('0x1f')](_0xfca041[_0x1c3d('0x1c')]['fields']));_0x2b2143[_0x1c3d('0x1e')]=_0x2b2143[_0x1c3d('0x1e')][_0x1c3d('0x35')]?_0x2b2143[_0x1c3d('0x1e')]:_0x2f422b[_0x1c3d('0x1b')];if(_0xfca041[_0x1c3d('0x1c')]['includeAll']){_0x2b2143[_0x1c3d('0x36')]=[{'all':!![]}];}_0x2b2143=_['merge']({},_0x2b2143,_0xfca041[_0x1c3d('0x2a')]);return db[_0x1c3d('0x2d')][_0x1c3d('0x37')](_0x2b2143)['then'](handleEntityNotFound(_0x1a0b02,null))[_0x1c3d('0x12')](function(_0xa3608a){if(_0xa3608a[_0x1c3d('0x2f')]===_0x1c3d('0x30')){var _0xe4680f=encryptor[_0x1c3d('0x38')](_0xa3608a['data3']);_0xa3608a[_0x1c3d('0x31')]=maskClientSecret(_0xe4680f);}return _0xa3608a;})[_0x1c3d('0x12')](respondWithResult(_0x1a0b02,null))[_0x1c3d('0x32')](handleError(_0x1a0b02,null));};exports[_0x1c3d('0x39')]=function(_0x50cb3b,_0x535d59){if(!_0x50cb3b[_0x1c3d('0x3a')][_0x1c3d('0x15')])throw new Error(_0x1c3d('0x3b'));if(!_0x50cb3b[_0x1c3d('0x3a')][_0x1c3d('0x2f')])throw new Error(_0x1c3d('0x3c'));var _0x315058=db[_0x1c3d('0x2d')][_0x1c3d('0x1a')][_0x1c3d('0x2f')][_0x1c3d('0x3d')];if(!_0x315058[_0x1c3d('0x3e')](_0x50cb3b[_0x1c3d('0x3a')]['service']))throw new Error(_0x1c3d('0x3f')+_0x315058[_0x1c3d('0x40')](',\x20'));if(_0x50cb3b['body'][_0x1c3d('0x2f')]===_0x1c3d('0x30')&&_0x50cb3b[_0x1c3d('0x3a')][_0x1c3d('0x31')]){_0x50cb3b['body'][_0x1c3d('0x31')]=encryptor[_0x1c3d('0x41')](_0x50cb3b[_0x1c3d('0x3a')][_0x1c3d('0x31')]);}return db['CloudProvider'][_0x1c3d('0x39')](_0x50cb3b[_0x1c3d('0x3a')],{})[_0x1c3d('0x12')](respondWithResult(_0x535d59,0xc9))[_0x1c3d('0x32')](handleError(_0x535d59,null));};exports[_0x1c3d('0x11')]=function(_0x4a3d0b,_0xd74f8e){if(_0x4a3d0b[_0x1c3d('0x3a')]['id']){delete _0x4a3d0b[_0x1c3d('0x3a')]['id'];}return db['CloudProvider'][_0x1c3d('0x37')]({'where':{'id':_0x4a3d0b[_0x1c3d('0x33')]['id']}})[_0x1c3d('0x12')](handleEntityNotFound(_0xd74f8e,null))['then'](function(_0x2a424e){if(_0x2a424e[_0x1c3d('0x2f')]===_0x1c3d('0x30')&&_0x4a3d0b[_0x1c3d('0x3a')][_0x1c3d('0x31')]){_0x4a3d0b[_0x1c3d('0x3a')][_0x1c3d('0x31')]=encryptor[_0x1c3d('0x41')](_0x4a3d0b['body'][_0x1c3d('0x31')]);}return _0x2a424e;})[_0x1c3d('0x12')](saveUpdates(_0x4a3d0b[_0x1c3d('0x3a')],null))[_0x1c3d('0x12')](respondWithResult(_0xd74f8e,null))[_0x1c3d('0x32')](handleError(_0xd74f8e,null));};exports[_0x1c3d('0x13')]=function(_0x56908f,_0x25fc9f){return db[_0x1c3d('0x2d')][_0x1c3d('0x37')]({'where':{'id':_0x56908f[_0x1c3d('0x33')]['id']}})[_0x1c3d('0x12')](handleEntityNotFound(_0x25fc9f,null))['then'](removeEntity(_0x25fc9f,null))[_0x1c3d('0x32')](handleError(_0x25fc9f,null));};exports[_0x1c3d('0x42')]=function(_0xaaf2ae,_0x308df9){return db[_0x1c3d('0x2d')][_0x1c3d('0x43')]({'where':{'id':_0xaaf2ae[_0x1c3d('0x33')]['id']},'raw':!![]})[_0x1c3d('0x12')](function(_0x2fd95b){if(!_0x2fd95b)return _0x308df9[_0x1c3d('0x8')](0x194);return{'url':oauth[_0x1c3d('0x44')](_0x2fd95b,_0xaaf2ae[_0x1c3d('0x45')]['id'])};})[_0x1c3d('0x12')](respondWithResult(_0x308df9,null))[_0x1c3d('0x32')](handleError(_0x308df9,null));};exports[_0x1c3d('0x46')]=function(_0x48aa54,_0x329443){var _0x3c83bd=_0x48aa54[_0x1c3d('0x3a')];var _0x59cd32;var _0x4ccbc6;if(_0x3c83bd[_0x1c3d('0x47')])throw _0x3c83bd;redis[_0x1c3d('0x48')](_0x3c83bd['state'])[_0x1c3d('0x12')](function(_0x4739ba){if(!_0x4739ba)throw new Error(_0x1c3d('0x49'));_0x59cd32=JSON[_0x1c3d('0x4a')](_0x4739ba);var _0xbdafb9=Buffer['from'](_0x3c83bd[_0x1c3d('0x4b')],_0x1c3d('0x4c'))[_0x1c3d('0x4d')](_0x1c3d('0x4e'));_0x4ccbc6=JSON[_0x1c3d('0x4a')](_0xbdafb9);if(!oauth[_0x1c3d('0x4f')](_0x3c83bd[_0x1c3d('0x50')],_0x59cd32[_0x1c3d('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x1c3d('0x52')](_0x3c83bd[_0x1c3d('0x4b')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3c83bd[_0x1c3d('0x53')],_0x59cd32);})['then'](function(_0x42d3d9){_0x59cd32[_0x1c3d('0x54')]=_0x42d3d9[_0x1c3d('0x55')];_0x59cd32['data6']=_0x42d3d9[_0x1c3d('0x56')];return db[_0x1c3d('0x2d')][_0x1c3d('0x11')]({'data5':_0x59cd32[_0x1c3d('0x54')],'data6':_0x59cd32[_0x1c3d('0x57')]},{'where':{'id':_0x59cd32['id']}});})['then'](function(){oauth[_0x1c3d('0x58')](_0x59cd32);socket[_0x1c3d('0x59')](_0x1c3d('0x5a'),{'id':_0x4ccbc6['id']});return;})[_0x1c3d('0x12')](respondWithStatusCode(_0x329443,null))[_0x1c3d('0x32')](function(_0x7df9c){if(_0x4ccbc6){socket['emit']('microsoftAuthorization:error',{'id':_0x4ccbc6['id']});}if(!_0x59cd32){logger[_0x1c3d('0x47')](_0x1c3d('0x5b'),_0x7df9c);return _0x329443[_0x1c3d('0x9')](0x1f4)[_0x1c3d('0x16')](_0x7df9c[_0x1c3d('0x5c')]);}logger['error'](_0x1c3d('0x5d'),_0x59cd32['id'],JSON['stringify'](_0x7df9c));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 8400ecd..3757695 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 _0xdc52=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x5c96eb,_0x5404da){var _0x4ddbad=function(_0x5a1225){while(--_0x5a1225){_0x5c96eb['push'](_0x5c96eb['shift']());}};_0x4ddbad(++_0x5404da);}(_0xdc52,0xc6));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dc5('0x0'));var util=require('util');var logger=require(_0x2dc5('0x1'))('api');var moment=require(_0x2dc5('0x2'));var BPromise=require(_0x2dc5('0x3'));var rp=require(_0x2dc5('0x4'));var fs=require('fs');var path=require(_0x2dc5('0x5'));var rimraf=require(_0x2dc5('0x6'));var config=require('../../config/environment');var attributes=require(_0x2dc5('0x7'));module[_0x2dc5('0x8')]=function(_0x32013d,_0xeaf7c0){return _0x32013d[_0x2dc5('0x9')](_0x2dc5('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa6a=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa6a,0x94));var _0xafa6=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfa6a[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xafa6('0x0'));var util=require('util');var logger=require(_0xafa6('0x1'))('api');var moment=require(_0xafa6('0x2'));var BPromise=require(_0xafa6('0x3'));var rp=require(_0xafa6('0x4'));var fs=require('fs');var path=require(_0xafa6('0x5'));var rimraf=require(_0xafa6('0x6'));var config=require(_0xafa6('0x7'));var attributes=require(_0xafa6('0x8'));module[_0xafa6('0x9')]=function(_0x4d32e5,_0x450309){return _0x4d32e5[_0xafa6('0xa')](_0xafa6('0xb'),attributes,{'tableName':_0xafa6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index a6cf30f..4814925 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 _0x7754=['form_post','state','prompt','login','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','nonce','exp','then','CloudProvider','refresh_token','data6','data1','data3','POST','replace','access_token','data5','authorization_code','decryptString','bind','intervals','findAll','all','catch','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','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','data4','response_mode'];(function(_0x41dfab,_0x4034a2){var _0x9a9b72=function(_0x3e7619){while(--_0x3e7619){_0x41dfab['push'](_0x41dfab['shift']());}};_0x9a9b72(++_0x4034a2);}(_0x7754,0xbf));var _0x4775=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0x7754[_0x1e6db3];return _0x1de886;};'use strict';var _=require('lodash');var crypto=require(_0x4775('0x0'));var jwt=require(_0x4775('0x1'));var moment=require(_0x4775('0x2'));var Redis=require(_0x4775('0x3'));var rp=require(_0x4775('0x4'));var util=require(_0x4775('0x5'));var encryptor=require(_0x4775('0x6'));var config=require(_0x4775('0x7'));var logger=require('../../config/logger')('api');var schedule=require(_0x4775('0x8'));var db=require(_0x4775('0x9'))['db'];config['redis']=_[_0x4775('0xa')](config[_0x4775('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x4775('0xb')]);var MICROSOFT_AUTH_URL=_0x4775('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x4775('0xd'),'profile',_0x4775('0xe'),_0x4775('0xf'),_0x4775('0x10'),_0x4775('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x4775('0xd'),_0x4775('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x4775('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x4775('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5bbf62){var _0x583ece=_[_0x4775('0x14')](AZURE_AUTH_SCOPES[_0x5bbf62[_0x4775('0x15')]]);if(_0x5bbf62[_0x4775('0x15')]===_0x4775('0x16'))_0x583ece[_0x4775('0x17')](_0x5bbf62[_0x4775('0x18')]+_0x4775('0x19'));return _0x583ece[_0x4775('0x1a')]('\x20');}function getAccessTokenScope(_0x5db2db){if(_0x5db2db[_0x4775('0x15')]===_0x4775('0x1b'))return _0x4775('0x10');if(_0x5db2db[_0x4775('0x15')]===_0x4775('0x16'))return _0x5db2db[_0x4775('0x18')]+_0x4775('0x19');}function generateMicrosoftAuthorizationUrl(_0x421dd7,_0xb3daa9){var _0x17ec5f=MICROSOFT_AUTH_URL['replace'](_0x4775('0x1c'),_0x421dd7[_0x4775('0x1d')]);var _0x1de488=[_0x4775('0x1e'),_0x4775('0x1f')];var _0x1e5c07=Buffer[_0x4775('0x20')](JSON[_0x4775('0x21')]({'id':_0xb3daa9}))[_0x4775('0x22')](_0x4775('0x23'));var _0x2b293f=crypto[_0x4775('0x24')](0x10)[_0x4775('0x22')](_0x4775('0x25'));var _0x44745a=getAuthorizationScopes(_0x421dd7);var _0x1537eb=[{'key':'client_id','value':_0x421dd7['data1']},{'key':'response_type','value':encodeURIComponent(_0x1de488['join']('\x20'))},{'key':'redirect_uri','value':_0x421dd7[_0x4775('0x26')]},{'key':_0x4775('0x27'),'value':_0x4775('0x28')},{'key':'scope','value':encodeURIComponent(_0x44745a)},{'key':_0x4775('0x29'),'value':_0x1e5c07},{'key':'nonce','value':_0x2b293f},{'key':_0x4775('0x2a'),'value':_0x4775('0x2b')}];var _0x4fa538=_0x17ec5f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4775('0x14')](_0x1537eb,function(_0x52ab9c){return _0x52ab9c['key']+'='+_0x52ab9c[_0x4775('0x2c')];})[_0x4775('0x1a')]('&');_0x421dd7[_0x4775('0x2d')]={'issuer':_0x17ec5f['replace'](_0x4775('0x2e'),''),'audience':_0x421dd7['data1'],'state':_0x1e5c07,'nonce':_0x2b293f};redis[_0x4775('0x2f')](_0x1e5c07,JSON['stringify'](_0x421dd7));return _0x4fa538;}function isValidIdToken(_0x264e8a,_0x1700af){try{var _0x40fafd=jwt[_0x4775('0x30')](_0x264e8a,{'complete':!![]});var _0x497cf9=_0x40fafd[_0x4775('0x31')];if(_0x497cf9[_0x4775('0x32')]!==_0x1700af[_0x4775('0x33')])return![];if(_0x497cf9[_0x4775('0x34')]!==_0x1700af[_0x4775('0x35')])return![];if(_0x497cf9[_0x4775('0x36')]!==_0x1700af[_0x4775('0x36')])return![];if(moment()['isAfter'](moment['unix'](_0x497cf9[_0x4775('0x37')])))return![];return!![];}catch(_0x1c8c1d){throw _0x1c8c1d;}}function refreshOauth2MicrosoftAccessToken(_0x397293){return Promise['resolve']()[_0x4775('0x38')](function(){if(_0x397293['data3'])return _0x397293;return db[_0x4775('0x39')]['findOne']({'where':{'id':_0x397293['id']},'raw':!![]});})[_0x4775('0x38')](function(_0x536d6c){var _0x451a6e={'grant_type':_0x4775('0x3a'),'refresh_token':_0x536d6c[_0x4775('0x3b')],'scope':getAccessTokenScope(_0x536d6c),'redirect_uri':_0x536d6c['data4'],'client_id':_0x536d6c[_0x4775('0x3c')],'client_secret':encryptor['decryptString'](_0x536d6c[_0x4775('0x3d')])};var _0x517e98={'method':_0x4775('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x4775('0x3f')](_0x4775('0x1c'),_0x536d6c['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x451a6e,'json':!![]};return rp(_0x517e98);})['then'](function(_0x21f23b){_0x397293['data5']=_0x21f23b[_0x4775('0x40')];_0x397293[_0x4775('0x3b')]=_0x21f23b[_0x4775('0x3a')];return db[_0x4775('0x39')]['update']({'data5':_0x397293[_0x4775('0x41')],'data6':_0x397293['data6']},{'where':{'id':_0x397293['id']}});})['then'](function(){return _0x397293;})['catch'](function(_0x512374){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x397293['id'],_0x512374);});}function getOauth2MicrosoftAccessToken(_0x28cc42,_0x404fd3){var _0x2a15f5={'grant_type':_0x4775('0x42'),'code':_0x28cc42,'scope':getAccessTokenScope(_0x404fd3),'redirect_uri':_0x404fd3[_0x4775('0x26')],'client_id':_0x404fd3[_0x4775('0x3c')],'client_secret':encryptor[_0x4775('0x43')](_0x404fd3['data3'])};var _0xe18f94={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x4775('0x3f')](_0x4775('0x1c'),_0x404fd3['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2a15f5,'json':!![]};return rp(_0xe18f94);}function startRefreshInterval(_0x5576dc){var _0xec9fb1=schedule['intervals'];if(_0xec9fb1[_0x5576dc['id']])clearInterval(_0xec9fb1[_0x5576dc['id']]);_0xec9fb1[_0x5576dc['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4775('0x44')](this,{'id':_0x5576dc['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x4775('0x45')]=_0xec9fb1;}function startAllRefreshIntervals(){return db[_0x4775('0x39')][_0x4775('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4775('0x38')](function(_0x92a5d7){var _0x3b46d3=_0x92a5d7[_0x4775('0x14')](function(_0x5dfe29){return refreshOauth2MicrosoftAccessToken(_0x5dfe29)[_0x4775('0x38')](function(_0x1d8de6){startRefreshInterval(_0x1d8de6);});});return Promise[_0x4775('0x47')](_0x3b46d3);})[_0x4775('0x48')](function(_0x5cd088){var _0x145e9f=_0x5cd088?util[_0x4775('0x49')](_0x5cd088,{'showHidden':![],'depth':null}):'';logger[_0x4775('0x4a')](_0x4775('0x4b'),_0x145e9f);});}module[_0x4775('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xde47=['util','../../components/encryptor','../../config/environment','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','push','/.default','Outlook365','Dynamics365','data7','replace','{TENANT_ID}','data2','code','id_token','from','stringify','base64','hex','join','redirect_uri','response_mode','scope','state','nonce','login','key','value','oauth2Claims','data1','set','decode','payload','iss','issuer','audience','exp','then','data3','CloudProvider','findOne','refresh_token','data4','decryptString','POST','data5','access_token','data6','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','catch','error','exports','lodash','crypto','ioredis','request-promise'];(function(_0x365ea9,_0x17ec94){var _0xb7a188=function(_0x5028c2){while(--_0x5028c2){_0x365ea9['push'](_0x365ea9['shift']());}};_0xb7a188(++_0x17ec94);}(_0xde47,0x1f4));var _0x7de4=function(_0x8a917c,_0x19c5f6){_0x8a917c=_0x8a917c-0x0;var _0x2c704e=_0xde47[_0x8a917c];return _0x2c704e;};'use strict';var _=require(_0x7de4('0x0'));var crypto=require(_0x7de4('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x7de4('0x2'));var rp=require(_0x7de4('0x3'));var util=require(_0x7de4('0x4'));var encryptor=require(_0x7de4('0x5'));var config=require(_0x7de4('0x6'));var logger=require('../../config/logger')('api');var schedule=require(_0x7de4('0x7'));var db=require(_0x7de4('0x8'))['db'];config[_0x7de4('0x9')]=_[_0x7de4('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x7de4('0xb'),_0x7de4('0xc'),_0x7de4('0xd'),_0x7de4('0xe'),_0x7de4('0xf'),_0x7de4('0x10'),_0x7de4('0x11')],'Dynamics365':[_0x7de4('0xb'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x7de4('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3142db){var _0x272a19=_[_0x7de4('0x13')](AZURE_AUTH_SCOPES[_0x3142db[_0x7de4('0x14')]]);if(_0x3142db[_0x7de4('0x14')]==='Dynamics365')_0x272a19[_0x7de4('0x15')](_0x3142db['data7']+_0x7de4('0x16'));return _0x272a19['join']('\x20');}function getAccessTokenScope(_0x1f362a){if(_0x1f362a[_0x7de4('0x14')]===_0x7de4('0x17'))return _0x7de4('0xf');if(_0x1f362a['type']===_0x7de4('0x18'))return _0x1f362a[_0x7de4('0x19')]+_0x7de4('0x16');}function generateMicrosoftAuthorizationUrl(_0x5a9fb6,_0x3601a9){var _0x4fe245=MICROSOFT_AUTH_URL[_0x7de4('0x1a')](_0x7de4('0x1b'),_0x5a9fb6[_0x7de4('0x1c')]);var _0x51cbd9=[_0x7de4('0x1d'),_0x7de4('0x1e')];var _0x9c4e2b=Buffer[_0x7de4('0x1f')](JSON[_0x7de4('0x20')]({'id':_0x3601a9}))['toString'](_0x7de4('0x21'));var _0x579b76=crypto['randomBytes'](0x10)['toString'](_0x7de4('0x22'));var _0xc4d2a9=getAuthorizationScopes(_0x5a9fb6);var _0x4bb550=[{'key':'client_id','value':_0x5a9fb6['data1']},{'key':'response_type','value':encodeURIComponent(_0x51cbd9[_0x7de4('0x23')]('\x20'))},{'key':_0x7de4('0x24'),'value':_0x5a9fb6['data4']},{'key':_0x7de4('0x25'),'value':'form_post'},{'key':_0x7de4('0x26'),'value':encodeURIComponent(_0xc4d2a9)},{'key':_0x7de4('0x27'),'value':_0x9c4e2b},{'key':_0x7de4('0x28'),'value':_0x579b76},{'key':'prompt','value':_0x7de4('0x29')}];var _0x36c4ba=_0x4fe245+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7de4('0x13')](_0x4bb550,function(_0xd5c92c){return _0xd5c92c[_0x7de4('0x2a')]+'='+_0xd5c92c[_0x7de4('0x2b')];})[_0x7de4('0x23')]('&');_0x5a9fb6[_0x7de4('0x2c')]={'issuer':_0x4fe245[_0x7de4('0x1a')]('oauth2/',''),'audience':_0x5a9fb6[_0x7de4('0x2d')],'state':_0x9c4e2b,'nonce':_0x579b76};redis[_0x7de4('0x2e')](_0x9c4e2b,JSON[_0x7de4('0x20')](_0x5a9fb6));return _0x36c4ba;}function isValidIdToken(_0x4ab4d9,_0xb83994){try{var _0x1e2069=jwt[_0x7de4('0x2f')](_0x4ab4d9,{'complete':!![]});var _0x2b9ed8=_0x1e2069[_0x7de4('0x30')];if(_0x2b9ed8[_0x7de4('0x31')]!==_0xb83994[_0x7de4('0x32')])return![];if(_0x2b9ed8['aud']!==_0xb83994[_0x7de4('0x33')])return![];if(_0x2b9ed8[_0x7de4('0x28')]!==_0xb83994[_0x7de4('0x28')])return![];if(moment()['isAfter'](moment['unix'](_0x2b9ed8[_0x7de4('0x34')])))return![];return!![];}catch(_0x36ffbc){throw _0x36ffbc;}}function refreshOauth2MicrosoftAccessToken(_0x566e85){return Promise['resolve']()[_0x7de4('0x35')](function(){if(_0x566e85[_0x7de4('0x36')])return _0x566e85;return db[_0x7de4('0x37')][_0x7de4('0x38')]({'where':{'id':_0x566e85['id']},'raw':!![]});})['then'](function(_0x355d16){var _0x153160={'grant_type':_0x7de4('0x39'),'refresh_token':_0x355d16['data6'],'scope':getAccessTokenScope(_0x355d16),'redirect_uri':_0x355d16[_0x7de4('0x3a')],'client_id':_0x355d16[_0x7de4('0x2d')],'client_secret':encryptor[_0x7de4('0x3b')](_0x355d16[_0x7de4('0x36')])};var _0x1c604e={'method':_0x7de4('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x7de4('0x1a')](_0x7de4('0x1b'),_0x355d16[_0x7de4('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x153160,'json':!![]};return rp(_0x1c604e);})[_0x7de4('0x35')](function(_0x1aa77f){_0x566e85[_0x7de4('0x3d')]=_0x1aa77f[_0x7de4('0x3e')];_0x566e85[_0x7de4('0x3f')]=_0x1aa77f[_0x7de4('0x39')];return db[_0x7de4('0x37')][_0x7de4('0x40')]({'data5':_0x566e85[_0x7de4('0x3d')],'data6':_0x566e85['data6']},{'where':{'id':_0x566e85['id']}});})['then'](function(){return _0x566e85;})['catch'](function(_0x258366){logger['error'](_0x7de4('0x41'),_0x566e85['id'],_0x258366);});}function getOauth2MicrosoftAccessToken(_0x452b2f,_0x506707){var _0x4c3618={'grant_type':'authorization_code','code':_0x452b2f,'scope':getAccessTokenScope(_0x506707),'redirect_uri':_0x506707[_0x7de4('0x3a')],'client_id':_0x506707['data1'],'client_secret':encryptor[_0x7de4('0x3b')](_0x506707[_0x7de4('0x36')])};var _0x4cbca8={'method':_0x7de4('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x7de4('0x1a')](_0x7de4('0x1b'),_0x506707[_0x7de4('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4c3618,'json':!![]};return rp(_0x4cbca8);}function startRefreshInterval(_0x1e8257){var _0x4078ef=schedule[_0x7de4('0x42')];if(_0x4078ef[_0x1e8257['id']])clearInterval(_0x4078ef[_0x1e8257['id']]);_0x4078ef[_0x1e8257['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7de4('0x43')](this,{'id':_0x1e8257['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7de4('0x42')]=_0x4078ef;}function startAllRefreshIntervals(){return db[_0x7de4('0x37')][_0x7de4('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x4872bb){var _0x56e8d1=_0x4872bb['map'](function(_0x3d4116){return refreshOauth2MicrosoftAccessToken(_0x3d4116)[_0x7de4('0x35')](function(_0x96c52f){startRefreshInterval(_0x96c52f);});});return Promise['all'](_0x56e8d1);})[_0x7de4('0x45')](function(_0x129214){var _0x2c7579=_0x129214?util['inspect'](_0x129214,{'showHidden':![],'depth':null}):'';logger[_0x7de4('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2c7579);});}module[_0x7de4('0x47')]={'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 c7f5a7a..974ffcd 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 _0x6dc0=['rpc','../../config/environment','client','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x8f1bec,_0x50cc92){var _0x16f764=function(_0x46e4b6){while(--_0x46e4b6){_0x8f1bec['push'](_0x8f1bec['shift']());}};_0x16f764(++_0x50cc92);}(_0x6dc0,0xb6));var _0x06dc=function(_0x3b5450,_0x3b7706){_0x3b5450=_0x3b5450-0x0;var _0xf5b86d=_0x6dc0[_0x3b5450];return _0xf5b86d;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var moment=require(_0x06dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x06dc('0x3'));var fs=require('fs');var Redis=require(_0x06dc('0x4'));var db=require(_0x06dc('0x5'))['db'];var utils=require(_0x06dc('0x6'));var logger=require('../../config/logger')(_0x06dc('0x7'));var config=require(_0x06dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x06dc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x419534,_0x3212ca,_0x14c15b){return new BPromise(function(_0x10e23b,_0x140eef){return client['request'](_0x419534,_0x14c15b)['then'](function(_0x480f30){logger[_0x06dc('0xa')](_0x06dc('0xb'),_0x3212ca,'request\x20sent');logger[_0x06dc('0xc')](_0x06dc('0xd'),_0x3212ca,_0x06dc('0xe'),JSON[_0x06dc('0xf')](_0x480f30));if(_0x480f30['error']){if(_0x480f30[_0x06dc('0x10')][_0x06dc('0x11')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x3212ca,_0x480f30['error']['message']);return _0x140eef(_0x480f30[_0x06dc('0x10')]['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x3212ca,_0x480f30[_0x06dc('0x10')][_0x06dc('0x12')]);return _0x10e23b(_0x480f30[_0x06dc('0x10')]['message']);}else{logger[_0x06dc('0xa')](_0x06dc('0xb'),_0x3212ca,_0x06dc('0xe'));_0x10e23b(_0x480f30[_0x06dc('0x13')]['message']);}})[_0x06dc('0x14')](function(_0x30c1c5){logger[_0x06dc('0x10')](_0x06dc('0xb'),_0x3212ca,_0x30c1c5);_0x140eef(_0x30c1c5);});});}
\ No newline at end of file
+var _0xac35=['request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x37a5a7,_0x55aa32){var _0x2f8744=function(_0x41faac){while(--_0x41faac){_0x37a5a7['push'](_0x37a5a7['shift']());}};_0x2f8744(++_0x55aa32);}(_0xac35,0x141));var _0x5ac3=function(_0x37c2ba,_0x57bd44){_0x37c2ba=_0x37c2ba-0x0;var _0x1d8220=_0xac35[_0x37c2ba];return _0x1d8220;};'use strict';var _=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var moment=require(_0x5ac3('0x2'));var BPromise=require(_0x5ac3('0x3'));var rs=require(_0x5ac3('0x4'));var fs=require('fs');var Redis=require(_0x5ac3('0x5'));var db=require(_0x5ac3('0x6'))['db'];var utils=require(_0x5ac3('0x7'));var logger=require(_0x5ac3('0x8'))(_0x5ac3('0x9'));var config=require(_0x5ac3('0xa'));var jayson=require(_0x5ac3('0xb'));var client=jayson[_0x5ac3('0xc')][_0x5ac3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4c9a16,_0x77dc9f,_0x5e96cb){return new BPromise(function(_0x2a19b9,_0x1754d2){return client[_0x5ac3('0xe')](_0x4c9a16,_0x5e96cb)[_0x5ac3('0xf')](function(_0x378900){logger[_0x5ac3('0x10')]('CloudProvider,\x20%s,\x20%s',_0x77dc9f,_0x5ac3('0x11'));logger['debug'](_0x5ac3('0x12'),_0x77dc9f,_0x5ac3('0x11'),JSON[_0x5ac3('0x13')](_0x378900));if(_0x378900[_0x5ac3('0x14')]){if(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x15')]===0x1f4){logger[_0x5ac3('0x14')]('CloudProvider,\x20%s,\x20%s',_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x1754d2(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);}logger[_0x5ac3('0x14')](_0x5ac3('0x17'),_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x2a19b9(_0x378900['error']['message']);}else{logger[_0x5ac3('0x10')](_0x5ac3('0x17'),_0x77dc9f,'request\x20sent');_0x2a19b9(_0x378900[_0x5ac3('0x18')]['message']);}})[_0x5ac3('0x19')](function(_0x18cad4){logger[_0x5ac3('0x14')]('CloudProvider,\x20%s,\x20%s',_0x77dc9f,_0x18cad4);_0x1754d2(_0x18cad4);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index b30e569..290d01e 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7a54,0x106));var _0x47a5=function(_0x502d51,_0x193c5f){_0x502d51=_0x502d51-0x0;var _0x5bdc68=_0x7a54[_0x502d51];return _0x5bdc68;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x516792,_0x4a6f77){var _0x572f41=function(_0x593c29){while(--_0x593c29){_0x516792['push'](_0x516792['shift']());}};_0x572f41(++_0x4a6f77);}(_0xdb28,0x106));var _0x8db2=function(_0x5677a2,_0x492eaf){_0x5677a2=_0x5677a2-0x0;var _0x483d36=_0xdb28[_0x5677a2];return _0x483d36;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 99e2087..124b2eb 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 _0x5541=['STRING','name','sequelize'];(function(_0x37ca5f,_0x7b93d4){var _0x4b0676=function(_0x5e9dbe){while(--_0x5e9dbe){_0x37ca5f['push'](_0x37ca5f['shift']());}};_0x4b0676(++_0x7b93d4);}(_0x5541,0x1df));var _0x1554=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x5541[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x1554('0x0'));module['exports']={'name':{'type':Sequelize[_0x1554('0x1')],'unique':_0x1554('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x1554('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1554('0x1')]},'type':{'type':Sequelize[_0x1554('0x1')]},'street':{'type':Sequelize[_0x1554('0x1')]},'postalCode':{'type':Sequelize[_0x1554('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1554('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x1554('0x1')]},'sCity':{'type':Sequelize[_0x1554('0x1')]},'sCountry':{'type':Sequelize[_0x1554('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc123=['name','exports','STRING'];(function(_0x59e7e0,_0x3ec148){var _0x26b058=function(_0x212ee2){while(--_0x212ee2){_0x59e7e0['push'](_0x59e7e0['shift']());}};_0x26b058(++_0x3ec148);}(_0xc123,0x193));var _0x3c12=function(_0x35ef6b,_0x4f9e69){_0x35ef6b=_0x35ef6b-0x0;var _0x44127e=_0xc123[_0x35ef6b];return _0x44127e;};'use strict';var Sequelize=require('sequelize');module[_0x3c12('0x0')]={'name':{'type':Sequelize[_0x3c12('0x1')],'unique':_0x3c12('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3c12('0x1')]},'companyId':{'type':Sequelize[_0x3c12('0x1')]},'website':{'type':Sequelize[_0x3c12('0x1')]},'phone':{'type':Sequelize[_0x3c12('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x3c12('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3c12('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3c12('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x3c12('0x1')]},'description':{'type':Sequelize[_0x3c12('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 57b53fc..d7651fb 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 _0x035d=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Companies','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','map','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmCompany','includeAll','include','findAll','rows','catch','show','params','length','find','body','user'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x035d,0x11a));var _0xd035=function(_0x4bc84a,_0xbcba3c){_0x4bc84a=_0x4bc84a-0x0;var _0x3f11dd=_0x035d[_0x4bc84a];return _0x3f11dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd035('0x0'));var zipdir=require(_0xd035('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd035('0x2'));var moment=require('moment');var BPromise=require(_0xd035('0x3'));var Mustache=require('mustache');var util=require(_0xd035('0x4'));var path=require('path');var sox=require(_0xd035('0x5'));var csv=require(_0xd035('0x6'));var ejs=require(_0xd035('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd035('0x8'));var squel=require(_0xd035('0x9'));var crypto=require(_0xd035('0xa'));var jsforce=require(_0xd035('0xb'));var deskjs=require(_0xd035('0xc'));var toCsv=require(_0xd035('0x6'));var querystring=require(_0xd035('0xd'));var Papa=require(_0xd035('0xe'));var Redis=require(_0xd035('0xf'));var authService=require(_0xd035('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd035('0x11'));var hardwareService=require(_0xd035('0x12'));var logger=require(_0xd035('0x13'))(_0xd035('0x14'));var utils=require(_0xd035('0x15'));var config=require(_0xd035('0x16'));var licenseUtil=require(_0xd035('0x17'));var db=require(_0xd035('0x18'))['db'];function respondWithStatusCode(_0x58225d,_0x5512ef){_0x5512ef=_0x5512ef||0xcc;return function(_0x20f930){if(_0x20f930){return _0x58225d['sendStatus'](_0x5512ef);}return _0x58225d[_0xd035('0x19')](_0x5512ef)['end']();};}function respondWithResult(_0x54f307,_0x49b13e){_0x49b13e=_0x49b13e||0xc8;return function(_0x2a3470){if(_0x2a3470){return _0x54f307[_0xd035('0x19')](_0x49b13e)[_0xd035('0x1a')](_0x2a3470);}};}function respondWithFilteredResult(_0xcd19c4,_0x4665f9){return function(_0x436876){if(_0x436876){var _0x413e27=typeof _0x4665f9[_0xd035('0x1b')]===_0xd035('0x1c')&&typeof _0x4665f9['limit']==='undefined';var _0x18fca5=_0x436876[_0xd035('0x1d')];var _0x5b811c=_0x413e27?0x0:_0x4665f9[_0xd035('0x1b')];var _0x486e55=_0x413e27?_0x436876['count']:_0x4665f9[_0xd035('0x1b')]+_0x4665f9[_0xd035('0x1e')];var _0x1f248a;if(_0x486e55>=_0x18fca5){_0x486e55=_0x18fca5;_0x1f248a=0xc8;}else{_0x1f248a=0xce;}_0xcd19c4[_0xd035('0x19')](_0x1f248a);return _0xcd19c4[_0xd035('0x1f')](_0xd035('0x20'),_0x5b811c+'-'+_0x486e55+'/'+_0x18fca5)[_0xd035('0x1a')](_0x436876);}return null;};}function patchUpdates(_0x4295ef){return function(_0x459e40){try{jsonpatch[_0xd035('0x21')](_0x459e40,_0x4295ef,!![]);}catch(_0x232283){return BPromise[_0xd035('0x22')](_0x232283);}return _0x459e40['save']();};}function saveUpdates(_0xab851,_0x55371a){return function(_0x15b42b){if(_0x15b42b){return _0x15b42b[_0xd035('0x23')](_0xab851)[_0xd035('0x24')](function(_0x3a63eb){return _0x3a63eb;});}return null;};}function removeEntity(_0x37dd62,_0x3cb8d0){return function(_0x511092){if(_0x511092){return _0x511092[_0xd035('0x25')]()[_0xd035('0x24')](function(){var _0x49e226=_0x511092['get']({'plain':!![]});var _0x32a429='Companies';return db[_0xd035('0x26')][_0xd035('0x25')]({'where':{'type':_0x32a429,'resourceId':_0x49e226['id']}})['then'](function(){return _0x511092;});})[_0xd035('0x24')](function(){_0x37dd62['status'](0xcc)[_0xd035('0x27')]();});}};}function handleEntityNotFound(_0x2b9fb0,_0x573247){return function(_0x177c2c){if(!_0x177c2c){_0x2b9fb0[_0xd035('0x28')](0x194);}return _0x177c2c;};}function handleError(_0x189cf2,_0x4e8138){_0x4e8138=_0x4e8138||0x1f4;return function(_0x31ff69){logger[_0xd035('0x29')](_0x31ff69[_0xd035('0x2a')]);if(_0x31ff69[_0xd035('0x2b')]){delete _0x31ff69[_0xd035('0x2b')];}_0x189cf2[_0xd035('0x19')](_0x4e8138)[_0xd035('0x2c')](_0x31ff69);};}exports[_0xd035('0x2d')]=function(_0x56d0e1,_0x271ae4){var _0x7aaefb={},_0x18ff94={},_0x1511c7={'count':0x0,'rows':[]};return db['CmCompany']['describe']()['then'](function(_0x33f0d0){_0x18ff94[_0xd035('0x2e')]=_[_0xd035('0x2f')](_0x33f0d0);_0x18ff94[_0xd035('0x30')]=_[_0xd035('0x2f')](_0x56d0e1[_0xd035('0x30')]);_0x18ff94[_0xd035('0x31')]=_[_0xd035('0x32')](_0x18ff94[_0xd035('0x2e')],_0x18ff94['query']);_0x7aaefb[_0xd035('0x33')]=_['intersection'](_0x18ff94[_0xd035('0x2e')],qs[_0xd035('0x34')](_0x56d0e1[_0xd035('0x30')][_0xd035('0x34')]));_0x7aaefb[_0xd035('0x33')]=_0x7aaefb[_0xd035('0x33')]['length']?_0x7aaefb['attributes']:_0x18ff94[_0xd035('0x2e')];if(!_0x56d0e1['query'][_0xd035('0x35')](_0xd035('0x36'))){_0x7aaefb[_0xd035('0x1e')]=qs[_0xd035('0x1e')](_0x56d0e1[_0xd035('0x30')][_0xd035('0x1e')]);_0x7aaefb['offset']=qs[_0xd035('0x1b')](_0x56d0e1['query'][_0xd035('0x1b')]);}_0x7aaefb[_0xd035('0x37')]=qs[_0xd035('0x38')](_0x56d0e1[_0xd035('0x30')][_0xd035('0x38')]);_0x7aaefb[_0xd035('0x39')]=qs[_0xd035('0x31')](_[_0xd035('0x3a')](_0x56d0e1[_0xd035('0x30')],_0x18ff94['filters']),_0x33f0d0);if(_0x56d0e1[_0xd035('0x30')][_0xd035('0x3b')]){_0x7aaefb[_0xd035('0x39')]=_[_0xd035('0x3c')](_0x7aaefb['where'],{'$or':_['map'](_0x7aaefb[_0xd035('0x33')],function(_0x5f2f23){var _0x21c90e={};_0x21c90e[_0x5f2f23]={'$like':'%'+_0x56d0e1[_0xd035('0x30')][_0xd035('0x3b')]+'%'};return _0x21c90e;})});}_0x7aaefb=_[_0xd035('0x3c')]({},_0x7aaefb,_0x56d0e1[_0xd035('0x3d')]);var _0x1686f2={'where':_0x7aaefb['where']};return db[_0xd035('0x3e')][_0xd035('0x1d')](_0x1686f2)[_0xd035('0x24')](function(_0x425cde){_0x1511c7[_0xd035('0x1d')]=_0x425cde;if(_0x56d0e1[_0xd035('0x30')][_0xd035('0x3f')]){_0x7aaefb[_0xd035('0x40')]=[{'all':!![]}];}return db[_0xd035('0x3e')][_0xd035('0x41')](_0x7aaefb);})[_0xd035('0x24')](function(_0x3340a9){_0x1511c7[_0xd035('0x42')]=_0x3340a9;return _0x1511c7;})[_0xd035('0x24')](respondWithFilteredResult(_0x271ae4,_0x7aaefb))[_0xd035('0x43')](handleError(_0x271ae4,null));})[_0xd035('0x43')](handleError(_0x271ae4,null));};exports[_0xd035('0x44')]=function(_0x4512b2,_0x7d732f){var _0x5589a4={'raw':![],'where':{'id':_0x4512b2[_0xd035('0x45')]['id']}},_0x190262={};_0x190262[_0xd035('0x2e')]=_['keys'](db[_0xd035('0x3e')]['rawAttributes']);_0x190262['query']=_[_0xd035('0x2f')](_0x4512b2[_0xd035('0x30')]);_0x190262[_0xd035('0x31')]=_[_0xd035('0x32')](_0x190262[_0xd035('0x2e')],_0x190262[_0xd035('0x30')]);_0x5589a4[_0xd035('0x33')]=_[_0xd035('0x32')](_0x190262['model'],qs[_0xd035('0x34')](_0x4512b2[_0xd035('0x30')]['fields']));_0x5589a4['attributes']=_0x5589a4[_0xd035('0x33')][_0xd035('0x46')]?_0x5589a4['attributes']:_0x190262['model'];if(_0x4512b2[_0xd035('0x30')][_0xd035('0x3f')]){_0x5589a4[_0xd035('0x40')]=[{'all':!![]}];}_0x5589a4=_['merge']({},_0x5589a4,_0x4512b2[_0xd035('0x3d')]);return db[_0xd035('0x3e')][_0xd035('0x47')](_0x5589a4)[_0xd035('0x24')](handleEntityNotFound(_0x7d732f,null))[_0xd035('0x24')](respondWithResult(_0x7d732f,null))[_0xd035('0x43')](handleError(_0x7d732f,null));};exports['create']=function(_0x398490,_0x18310f){return db['CmCompany']['create'](_0x398490[_0xd035('0x48')],{})['then'](function(_0x592482){var _0x29dd20=_0x398490[_0xd035('0x49')]['get']({'plain':!![]});if(!_0x29dd20)throw new Error(_0xd035('0x4a'));if(_0x29dd20[_0xd035('0x4b')]===_0xd035('0x49')){var _0x421cc3=_0x592482[_0xd035('0x4c')]({'plain':!![]});var _0x417c27=_0xd035('0x4d');return db['UserProfileSection'][_0xd035('0x47')]({'where':{'name':_0x417c27,'userProfileId':_0x29dd20[_0xd035('0x4e')]},'raw':!![]})['then'](function(_0x1ce94a){if(_0x1ce94a&&_0x1ce94a['autoAssociation']===0x0){return db[_0xd035('0x26')][_0xd035('0x4f')]({'name':_0x421cc3['name'],'resourceId':_0x421cc3['id'],'type':_0x1ce94a['name'],'sectionId':_0x1ce94a['id']},{})[_0xd035('0x24')](function(){return _0x592482;});}else{return _0x592482;}})['catch'](function(_0x476883){logger[_0xd035('0x29')](_0xd035('0x50'),_0x476883);throw _0x476883;});}return _0x592482;})[_0xd035('0x24')](respondWithResult(_0x18310f,0xc9))['catch'](handleError(_0x18310f,null));};exports[_0xd035('0x23')]=function(_0x5915f0,_0x46b41e){if(_0x5915f0[_0xd035('0x48')]['id']){delete _0x5915f0[_0xd035('0x48')]['id'];}return db[_0xd035('0x3e')][_0xd035('0x47')]({'where':{'id':_0x5915f0[_0xd035('0x45')]['id']}})[_0xd035('0x24')](handleEntityNotFound(_0x46b41e,null))['then'](saveUpdates(_0x5915f0[_0xd035('0x48')],null))['then'](respondWithResult(_0x46b41e,null))[_0xd035('0x43')](handleError(_0x46b41e,null));};exports[_0xd035('0x25')]=function(_0x3a472f,_0x467001){return db['CmCompany'][_0xd035('0x47')]({'where':{'id':_0x3a472f[_0xd035('0x45')]['id']}})['then'](handleEntityNotFound(_0x467001,null))[_0xd035('0x24')](removeEntity(_0x467001,null))[_0xd035('0x43')](handleError(_0x467001,null));};exports[_0xd035('0x51')]=function(_0x44b3ca,_0x45ef19){return db[_0xd035('0x3e')][_0xd035('0x51')]()[_0xd035('0x24')](respondWithResult(_0x45ef19,null))['catch'](handleError(_0x45ef19,null));};exports[_0xd035('0x52')]=function(_0x2e57c3,_0x674ce1,_0x215d57){return db[_0xd035('0x53')][_0xd035('0x47')]({'where':{'id':_0x2e57c3[_0xd035('0x45')]['id']}})[_0xd035('0x24')](handleEntityNotFound(_0x674ce1,null))[_0xd035('0x24')](function(_0x56701d){if(_0x56701d){return _0x56701d[_0xd035('0x52')](_0x2e57c3['body'][_0xd035('0x54')],_['omit'](_0x2e57c3['body'],['ids','id'])||{});}})[_0xd035('0x24')](respondWithResult(_0x674ce1,null))[_0xd035('0x43')](handleError(_0x674ce1,null));};exports[_0xd035('0x55')]=function(_0x388c60,_0xc30da8,_0x10da8e){var _0x374f8c={};var _0x470735={};var _0x51bf89;var _0x21cd1f;return db[_0xd035('0x3e')][_0xd035('0x56')]({'where':{'id':_0x388c60[_0xd035('0x45')]['id']}})[_0xd035('0x24')](handleEntityNotFound(_0xc30da8,null))['then'](function(_0x5f5d10){if(_0x5f5d10){_0x51bf89=_0x5f5d10;_0x470735[_0xd035('0x2e')]=_[_0xd035('0x2f')](db[_0xd035('0x53')][_0xd035('0x57')]);_0x470735[_0xd035('0x30')]=_[_0xd035('0x2f')](_0x388c60[_0xd035('0x30')]);_0x470735[_0xd035('0x31')]=_[_0xd035('0x32')](_0x470735[_0xd035('0x2e')],_0x470735[_0xd035('0x30')]);_0x374f8c[_0xd035('0x33')]=_[_0xd035('0x32')](_0x470735[_0xd035('0x2e')],qs['fields'](_0x388c60['query']['fields']));_0x374f8c['attributes']=_0x374f8c[_0xd035('0x33')]['length']?_0x374f8c['attributes']:_0x470735['model'];_0x374f8c['order']=qs[_0xd035('0x38')](_0x388c60[_0xd035('0x30')][_0xd035('0x38')]);_0x374f8c[_0xd035('0x39')]=qs[_0xd035('0x31')](_[_0xd035('0x3a')](_0x388c60['query'],_0x470735['filters']));if(_0x388c60[_0xd035('0x30')]['filter']){_0x374f8c[_0xd035('0x39')]=_[_0xd035('0x3c')](_0x374f8c[_0xd035('0x39')],{'$or':_[_0xd035('0x58')](_0x374f8c['attributes'],function(_0x1a2321){var _0x47bfa4={};_0x47bfa4[_0x1a2321]={'$like':'%'+_0x388c60[_0xd035('0x30')]['filter']+'%'};return _0x47bfa4;})});}_0x374f8c=_['merge']({},_0x374f8c,_0x388c60[_0xd035('0x3d')]);return _0x51bf89['getContacts'](_0x374f8c);}})[_0xd035('0x24')](function(_0x6b6aad){if(_0x6b6aad){_0x21cd1f=_0x6b6aad[_0xd035('0x46')];if(!_0x388c60[_0xd035('0x30')][_0xd035('0x35')](_0xd035('0x36'))){_0x374f8c[_0xd035('0x1e')]=qs[_0xd035('0x1e')](_0x388c60[_0xd035('0x30')][_0xd035('0x1e')]);_0x374f8c[_0xd035('0x1b')]=qs[_0xd035('0x1b')](_0x388c60['query'][_0xd035('0x1b')]);}return _0x51bf89[_0xd035('0x55')](_0x374f8c);}})['then'](function(_0x283395){if(_0x283395){return _0x283395?{'count':_0x21cd1f,'rows':_0x283395}:null;}})[_0xd035('0x24')](respondWithResult(_0xc30da8,null))[_0xd035('0x43')](handleError(_0xc30da8,null));};
\ No newline at end of file
+var _0xa405=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','update','addContacts','ids','getContacts','findOne','CmContact','pick','map','options','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','count','offset','status','set','apply','reject','then','get','Companies','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','CmCompany','describe','query','keys','filters','intersection','model','attributes','fields'];(function(_0x2b24d0,_0x49b3d7){var _0x1a2482=function(_0x4c22ad){while(--_0x4c22ad){_0x2b24d0['push'](_0x2b24d0['shift']());}};_0x1a2482(++_0x49b3d7);}(_0xa405,0x17a));var _0x5a40=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa405[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5a40('0x0'));var jsonpatch=require(_0x5a40('0x1'));var rp=require(_0x5a40('0x2'));var moment=require(_0x5a40('0x3'));var BPromise=require(_0x5a40('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5a40('0x5'));var sox=require('sox');var csv=require(_0x5a40('0x6'));var ejs=require(_0x5a40('0x7'));var fs=require('fs');var fs_extra=require(_0x5a40('0x8'));var _=require(_0x5a40('0x9'));var squel=require('squel');var crypto=require(_0x5a40('0xa'));var jsforce=require(_0x5a40('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5a40('0x6'));var querystring=require(_0x5a40('0xc'));var Papa=require(_0x5a40('0xd'));var Redis=require('ioredis');var authService=require(_0x5a40('0xe'));var qs=require(_0x5a40('0xf'));var as=require(_0x5a40('0x10'));var hardwareService=require(_0x5a40('0x11'));var logger=require('../../config/logger')(_0x5a40('0x12'));var utils=require(_0x5a40('0x13'));var config=require(_0x5a40('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a40('0x15'))['db'];function respondWithStatusCode(_0x45e1d4,_0x210d6f){_0x210d6f=_0x210d6f||0xcc;return function(_0x3d3667){if(_0x3d3667){return _0x45e1d4['sendStatus'](_0x210d6f);}return _0x45e1d4['status'](_0x210d6f)[_0x5a40('0x16')]();};}function respondWithResult(_0x30ed53,_0x8e46ed){_0x8e46ed=_0x8e46ed||0xc8;return function(_0x1fb40d){if(_0x1fb40d){return _0x30ed53['status'](_0x8e46ed)[_0x5a40('0x17')](_0x1fb40d);}};}function respondWithFilteredResult(_0x34b51d,_0x26af94){return function(_0x427057){if(_0x427057){var _0xb5fa95=typeof _0x26af94['offset']===_0x5a40('0x18')&&typeof _0x26af94[_0x5a40('0x19')]===_0x5a40('0x18');var _0x2c4162=_0x427057[_0x5a40('0x1a')];var _0x55cf33=_0xb5fa95?0x0:_0x26af94[_0x5a40('0x1b')];var _0x5c0dc1=_0xb5fa95?_0x427057['count']:_0x26af94[_0x5a40('0x1b')]+_0x26af94[_0x5a40('0x19')];var _0x53de0b;if(_0x5c0dc1>=_0x2c4162){_0x5c0dc1=_0x2c4162;_0x53de0b=0xc8;}else{_0x53de0b=0xce;}_0x34b51d[_0x5a40('0x1c')](_0x53de0b);return _0x34b51d[_0x5a40('0x1d')]('Content-Range',_0x55cf33+'-'+_0x5c0dc1+'/'+_0x2c4162)['json'](_0x427057);}return null;};}function patchUpdates(_0x14fa97){return function(_0xc3253d){try{jsonpatch[_0x5a40('0x1e')](_0xc3253d,_0x14fa97,!![]);}catch(_0x548166){return BPromise[_0x5a40('0x1f')](_0x548166);}return _0xc3253d['save']();};}function saveUpdates(_0x42bc67,_0x22a35f){return function(_0x185005){if(_0x185005){return _0x185005['update'](_0x42bc67)[_0x5a40('0x20')](function(_0x131947){return _0x131947;});}return null;};}function removeEntity(_0x3334d1,_0x3121cd){return function(_0x57d253){if(_0x57d253){return _0x57d253['destroy']()[_0x5a40('0x20')](function(){var _0x1d1921=_0x57d253[_0x5a40('0x21')]({'plain':!![]});var _0x9eab1c=_0x5a40('0x22');return db[_0x5a40('0x23')][_0x5a40('0x24')]({'where':{'type':_0x9eab1c,'resourceId':_0x1d1921['id']}})[_0x5a40('0x20')](function(){return _0x57d253;});})[_0x5a40('0x20')](function(){_0x3334d1[_0x5a40('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18cd35,_0x1e80bc){return function(_0x3d9bb9){if(!_0x3d9bb9){_0x18cd35[_0x5a40('0x25')](0x194);}return _0x3d9bb9;};}function handleError(_0x1902e0,_0x2f40c7){_0x2f40c7=_0x2f40c7||0x1f4;return function(_0x2d1f29){logger[_0x5a40('0x26')](_0x2d1f29[_0x5a40('0x27')]);if(_0x2d1f29[_0x5a40('0x28')]){delete _0x2d1f29['name'];}_0x1902e0[_0x5a40('0x1c')](_0x2f40c7)[_0x5a40('0x29')](_0x2d1f29);};}exports[_0x5a40('0x2a')]=function(_0x17046b,_0x162a7c){var _0x5cd22a={},_0x19b0a2={},_0x1ae9ee={'count':0x0,'rows':[]};return db[_0x5a40('0x2b')][_0x5a40('0x2c')]()[_0x5a40('0x20')](function(_0x4f44f2){_0x19b0a2['model']=_['keys'](_0x4f44f2);_0x19b0a2[_0x5a40('0x2d')]=_[_0x5a40('0x2e')](_0x17046b[_0x5a40('0x2d')]);_0x19b0a2[_0x5a40('0x2f')]=_[_0x5a40('0x30')](_0x19b0a2[_0x5a40('0x31')],_0x19b0a2['query']);_0x5cd22a[_0x5a40('0x32')]=_[_0x5a40('0x30')](_0x19b0a2['model'],qs['fields'](_0x17046b[_0x5a40('0x2d')][_0x5a40('0x33')]));_0x5cd22a['attributes']=_0x5cd22a[_0x5a40('0x32')][_0x5a40('0x34')]?_0x5cd22a['attributes']:_0x19b0a2[_0x5a40('0x31')];if(!_0x17046b['query'][_0x5a40('0x35')](_0x5a40('0x36'))){_0x5cd22a[_0x5a40('0x19')]=qs[_0x5a40('0x19')](_0x17046b['query'][_0x5a40('0x19')]);_0x5cd22a[_0x5a40('0x1b')]=qs[_0x5a40('0x1b')](_0x17046b[_0x5a40('0x2d')]['offset']);}_0x5cd22a[_0x5a40('0x37')]=qs[_0x5a40('0x38')](_0x17046b[_0x5a40('0x2d')]['sort']);_0x5cd22a[_0x5a40('0x39')]=qs[_0x5a40('0x2f')](_['pick'](_0x17046b[_0x5a40('0x2d')],_0x19b0a2['filters']),_0x4f44f2);if(_0x17046b['query'][_0x5a40('0x3a')]){_0x5cd22a['where']=_[_0x5a40('0x3b')](_0x5cd22a[_0x5a40('0x39')],{'$or':_['map'](_0x5cd22a[_0x5a40('0x32')],function(_0x20a1a6){var _0x491281={};_0x491281[_0x20a1a6]={'$like':'%'+_0x17046b[_0x5a40('0x2d')][_0x5a40('0x3a')]+'%'};return _0x491281;})});}_0x5cd22a=_[_0x5a40('0x3b')]({},_0x5cd22a,_0x17046b['options']);var _0x16e05c={'where':_0x5cd22a[_0x5a40('0x39')]};return db[_0x5a40('0x2b')][_0x5a40('0x1a')](_0x16e05c)[_0x5a40('0x20')](function(_0x8762fa){_0x1ae9ee[_0x5a40('0x1a')]=_0x8762fa;if(_0x17046b[_0x5a40('0x2d')][_0x5a40('0x3c')]){_0x5cd22a[_0x5a40('0x3d')]=[{'all':!![]}];}return db[_0x5a40('0x2b')][_0x5a40('0x3e')](_0x5cd22a);})['then'](function(_0x183a9e){_0x1ae9ee[_0x5a40('0x3f')]=_0x183a9e;return _0x1ae9ee;})[_0x5a40('0x20')](respondWithFilteredResult(_0x162a7c,_0x5cd22a))[_0x5a40('0x40')](handleError(_0x162a7c,null));})[_0x5a40('0x40')](handleError(_0x162a7c,null));};exports[_0x5a40('0x41')]=function(_0x15fa3a,_0x2ad417){var _0x2f369e={'raw':![],'where':{'id':_0x15fa3a[_0x5a40('0x42')]['id']}},_0x1e7541={};_0x1e7541[_0x5a40('0x31')]=_[_0x5a40('0x2e')](db[_0x5a40('0x2b')][_0x5a40('0x43')]);_0x1e7541[_0x5a40('0x2d')]=_['keys'](_0x15fa3a['query']);_0x1e7541[_0x5a40('0x2f')]=_['intersection'](_0x1e7541['model'],_0x1e7541['query']);_0x2f369e[_0x5a40('0x32')]=_['intersection'](_0x1e7541[_0x5a40('0x31')],qs[_0x5a40('0x33')](_0x15fa3a[_0x5a40('0x2d')][_0x5a40('0x33')]));_0x2f369e[_0x5a40('0x32')]=_0x2f369e[_0x5a40('0x32')]['length']?_0x2f369e['attributes']:_0x1e7541[_0x5a40('0x31')];if(_0x15fa3a[_0x5a40('0x2d')][_0x5a40('0x3c')]){_0x2f369e[_0x5a40('0x3d')]=[{'all':!![]}];}_0x2f369e=_['merge']({},_0x2f369e,_0x15fa3a['options']);return db['CmCompany']['find'](_0x2f369e)[_0x5a40('0x20')](handleEntityNotFound(_0x2ad417,null))[_0x5a40('0x20')](respondWithResult(_0x2ad417,null))[_0x5a40('0x40')](handleError(_0x2ad417,null));};exports[_0x5a40('0x44')]=function(_0x16debb,_0xa6c571){return db[_0x5a40('0x2b')][_0x5a40('0x44')](_0x16debb[_0x5a40('0x45')],{})['then'](function(_0x4ea44f){var _0x21317f=_0x16debb[_0x5a40('0x46')][_0x5a40('0x21')]({'plain':!![]});if(!_0x21317f)throw new Error(_0x5a40('0x47'));if(_0x21317f[_0x5a40('0x48')]==='user'){var _0x308f95=_0x4ea44f['get']({'plain':!![]});var _0x4e7e70=_0x5a40('0x22');return db[_0x5a40('0x49')][_0x5a40('0x4a')]({'where':{'name':_0x4e7e70,'userProfileId':_0x21317f[_0x5a40('0x4b')]},'raw':!![]})[_0x5a40('0x20')](function(_0x40ee41){if(_0x40ee41&&_0x40ee41[_0x5a40('0x4c')]===0x0){return db[_0x5a40('0x23')][_0x5a40('0x44')]({'name':_0x308f95[_0x5a40('0x28')],'resourceId':_0x308f95['id'],'type':_0x40ee41[_0x5a40('0x28')],'sectionId':_0x40ee41['id']},{})[_0x5a40('0x20')](function(){return _0x4ea44f;});}else{return _0x4ea44f;}})[_0x5a40('0x40')](function(_0x5e2364){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e2364);throw _0x5e2364;});}return _0x4ea44f;})[_0x5a40('0x20')](respondWithResult(_0xa6c571,0xc9))[_0x5a40('0x40')](handleError(_0xa6c571,null));};exports[_0x5a40('0x4d')]=function(_0x24cadb,_0x28f277){if(_0x24cadb[_0x5a40('0x45')]['id']){delete _0x24cadb[_0x5a40('0x45')]['id'];}return db[_0x5a40('0x2b')][_0x5a40('0x4a')]({'where':{'id':_0x24cadb[_0x5a40('0x42')]['id']}})['then'](handleEntityNotFound(_0x28f277,null))['then'](saveUpdates(_0x24cadb[_0x5a40('0x45')],null))[_0x5a40('0x20')](respondWithResult(_0x28f277,null))[_0x5a40('0x40')](handleError(_0x28f277,null));};exports['destroy']=function(_0x375e22,_0x50bb3a){return db[_0x5a40('0x2b')][_0x5a40('0x4a')]({'where':{'id':_0x375e22['params']['id']}})[_0x5a40('0x20')](handleEntityNotFound(_0x50bb3a,null))[_0x5a40('0x20')](removeEntity(_0x50bb3a,null))['catch'](handleError(_0x50bb3a,null));};exports[_0x5a40('0x2c')]=function(_0x2d8359,_0x3ad27c){return db[_0x5a40('0x2b')][_0x5a40('0x2c')]()['then'](respondWithResult(_0x3ad27c,null))[_0x5a40('0x40')](handleError(_0x3ad27c,null));};exports[_0x5a40('0x4e')]=function(_0x587e00,_0x4b08f6,_0x35cd92){return db['CmContact'][_0x5a40('0x4a')]({'where':{'id':_0x587e00['params']['id']}})[_0x5a40('0x20')](handleEntityNotFound(_0x4b08f6,null))[_0x5a40('0x20')](function(_0x302d9a){if(_0x302d9a){return _0x302d9a['addContacts'](_0x587e00[_0x5a40('0x45')][_0x5a40('0x4f')],_['omit'](_0x587e00['body'],[_0x5a40('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x4b08f6,null))[_0x5a40('0x40')](handleError(_0x4b08f6,null));};exports[_0x5a40('0x50')]=function(_0x4eab13,_0x1d16da,_0x5d7ba7){var _0x152344={};var _0x3692c8={};var _0x294495;var _0x40652f;return db[_0x5a40('0x2b')][_0x5a40('0x51')]({'where':{'id':_0x4eab13[_0x5a40('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d16da,null))[_0x5a40('0x20')](function(_0x3af824){if(_0x3af824){_0x294495=_0x3af824;_0x3692c8[_0x5a40('0x31')]=_['keys'](db[_0x5a40('0x52')][_0x5a40('0x43')]);_0x3692c8[_0x5a40('0x2d')]=_[_0x5a40('0x2e')](_0x4eab13['query']);_0x3692c8['filters']=_[_0x5a40('0x30')](_0x3692c8['model'],_0x3692c8[_0x5a40('0x2d')]);_0x152344[_0x5a40('0x32')]=_[_0x5a40('0x30')](_0x3692c8[_0x5a40('0x31')],qs[_0x5a40('0x33')](_0x4eab13[_0x5a40('0x2d')]['fields']));_0x152344[_0x5a40('0x32')]=_0x152344[_0x5a40('0x32')][_0x5a40('0x34')]?_0x152344[_0x5a40('0x32')]:_0x3692c8[_0x5a40('0x31')];_0x152344['order']=qs[_0x5a40('0x38')](_0x4eab13['query'][_0x5a40('0x38')]);_0x152344[_0x5a40('0x39')]=qs[_0x5a40('0x2f')](_[_0x5a40('0x53')](_0x4eab13[_0x5a40('0x2d')],_0x3692c8[_0x5a40('0x2f')]));if(_0x4eab13['query']['filter']){_0x152344['where']=_[_0x5a40('0x3b')](_0x152344[_0x5a40('0x39')],{'$or':_[_0x5a40('0x54')](_0x152344[_0x5a40('0x32')],function(_0x3acc50){var _0xbf46e2={};_0xbf46e2[_0x3acc50]={'$like':'%'+_0x4eab13[_0x5a40('0x2d')]['filter']+'%'};return _0xbf46e2;})});}_0x152344=_['merge']({},_0x152344,_0x4eab13[_0x5a40('0x55')]);return _0x294495['getContacts'](_0x152344);}})['then'](function(_0x55a7cf){if(_0x55a7cf){_0x40652f=_0x55a7cf['length'];if(!_0x4eab13['query'][_0x5a40('0x35')](_0x5a40('0x36'))){_0x152344[_0x5a40('0x19')]=qs[_0x5a40('0x19')](_0x4eab13[_0x5a40('0x2d')][_0x5a40('0x19')]);_0x152344[_0x5a40('0x1b')]=qs[_0x5a40('0x1b')](_0x4eab13[_0x5a40('0x2d')]['offset']);}return _0x294495['getContacts'](_0x152344);}})['then'](function(_0x3a1692){if(_0x3a1692){return _0x3a1692?{'count':_0x40652f,'rows':_0x3a1692}:null;}})[_0x5a40('0x20')](respondWithResult(_0x1d16da,null))['catch'](handleError(_0x1d16da,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 2952051..c6c5609 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 _0xd8ac=['api','moment','bluebird','request-promise','path','exports','define','CmCompany','cm_companies','../../config/logger'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd8ac,0x10d));var _0xcd8a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcd8a('0x0'))(_0xcd8a('0x1'));var moment=require(_0xcd8a('0x2'));var BPromise=require(_0xcd8a('0x3'));var rp=require(_0xcd8a('0x4'));var fs=require('fs');var path=require(_0xcd8a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0xcd8a('0x6')]=function(_0x13c5d2,_0x4519d0){return _0x13c5d2[_0xcd8a('0x7')](_0xcd8a('0x8'),attributes,{'tableName':_0xcd8a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6069=['../../config/logger','moment','request-promise','path','rimraf','./cmCompany.attributes','CmCompany','cm_companies','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6069,0x116));var _0x9606=function(_0x33b10b,_0x4e2125){_0x33b10b=_0x33b10b-0x0;var _0x1c360f=_0x6069[_0x33b10b];return _0x1c360f;};'use strict';var _=require(_0x9606('0x0'));var util=require(_0x9606('0x1'));var logger=require(_0x9606('0x2'))('api');var moment=require(_0x9606('0x3'));var BPromise=require('bluebird');var rp=require(_0x9606('0x4'));var fs=require('fs');var path=require(_0x9606('0x5'));var rimraf=require(_0x9606('0x6'));var config=require('../../config/environment');var attributes=require(_0x9606('0x7'));module['exports']=function(_0x578d5b,_0x4c7d1d){return _0x578d5b['define'](_0x9606('0x8'),attributes,{'tableName':_0x9606('0x9'),'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 e3e57c2..4ed91d8 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 _0xbc4b=['CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','debug'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbc4b,0x98));var _0xbbc4=function(_0x37a02f,_0x570d8e){_0x37a02f=_0x37a02f-0x0;var _0x2a9b39=_0xbc4b[_0x37a02f];return _0x2a9b39;};'use strict';var _=require(_0xbbc4('0x0'));var util=require(_0xbbc4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbbc4('0x2'));var fs=require('fs');var Redis=require(_0xbbc4('0x3'));var db=require(_0xbbc4('0x4'))['db'];var utils=require(_0xbbc4('0x5'));var logger=require(_0xbbc4('0x6'))(_0xbbc4('0x7'));var config=require(_0xbbc4('0x8'));var jayson=require(_0xbbc4('0x9'));var client=jayson[_0xbbc4('0xa')][_0xbbc4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x510ea6,_0x59c8e0,_0x523001){return new BPromise(function(_0x215464,_0x2cd34a){return client[_0xbbc4('0xc')](_0x510ea6,_0x523001)[_0xbbc4('0xd')](function(_0x44a866){logger['info'](_0xbbc4('0xe'),_0x59c8e0,'request\x20sent');logger[_0xbbc4('0xf')](_0xbbc4('0x10'),_0x59c8e0,_0xbbc4('0x11'),JSON['stringify'](_0x44a866));if(_0x44a866[_0xbbc4('0x12')]){if(_0x44a866[_0xbbc4('0x12')][_0xbbc4('0x13')]===0x1f4){logger['error'](_0xbbc4('0xe'),_0x59c8e0,_0x44a866[_0xbbc4('0x12')][_0xbbc4('0x14')]);return _0x2cd34a(_0x44a866[_0xbbc4('0x12')]['message']);}logger[_0xbbc4('0x12')](_0xbbc4('0xe'),_0x59c8e0,_0x44a866[_0xbbc4('0x12')]['message']);return _0x215464(_0x44a866[_0xbbc4('0x12')][_0xbbc4('0x14')]);}else{logger[_0xbbc4('0x15')](_0xbbc4('0xe'),_0x59c8e0,_0xbbc4('0x11'));_0x215464(_0x44a866[_0xbbc4('0x16')][_0xbbc4('0x14')]);}})[_0xbbc4('0x17')](function(_0x50853e){logger[_0xbbc4('0x12')](_0xbbc4('0xe'),_0x59c8e0,_0x50853e);_0x2cd34a(_0x50853e);});});}
\ No newline at end of file
+var _0xb1c4=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x28ea2f,_0x4dd834){var _0x5f3a70=function(_0x4a0b8f){while(--_0x4a0b8f){_0x28ea2f['push'](_0x28ea2f['shift']());}};_0x5f3a70(++_0x4dd834);}(_0xb1c4,0x13d));var _0x4b1c=function(_0x3b2899,_0x39ea95){_0x3b2899=_0x3b2899-0x0;var _0x3baf72=_0xb1c4[_0x3b2899];return _0x3baf72;};'use strict';var _=require(_0x4b1c('0x0'));var util=require(_0x4b1c('0x1'));var moment=require(_0x4b1c('0x2'));var BPromise=require(_0x4b1c('0x3'));var rs=require(_0x4b1c('0x4'));var fs=require('fs');var Redis=require(_0x4b1c('0x5'));var db=require(_0x4b1c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b1c('0x7'))(_0x4b1c('0x8'));var config=require(_0x4b1c('0x9'));var jayson=require(_0x4b1c('0xa'));var client=jayson['client'][_0x4b1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x154c2f,_0x3d9084,_0x24a4af){return new BPromise(function(_0x52112a,_0x51c5ad){return client['request'](_0x154c2f,_0x24a4af)[_0x4b1c('0xc')](function(_0x22b25b){logger[_0x4b1c('0xd')](_0x4b1c('0xe'),_0x3d9084,_0x4b1c('0xf'));logger[_0x4b1c('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3d9084,_0x4b1c('0xf'),JSON[_0x4b1c('0x11')](_0x22b25b));if(_0x22b25b[_0x4b1c('0x12')]){if(_0x22b25b[_0x4b1c('0x12')][_0x4b1c('0x13')]===0x1f4){logger[_0x4b1c('0x12')](_0x4b1c('0xe'),_0x3d9084,_0x22b25b['error'][_0x4b1c('0x14')]);return _0x51c5ad(_0x22b25b[_0x4b1c('0x12')][_0x4b1c('0x14')]);}logger[_0x4b1c('0x12')](_0x4b1c('0xe'),_0x3d9084,_0x22b25b[_0x4b1c('0x12')][_0x4b1c('0x14')]);return _0x52112a(_0x22b25b[_0x4b1c('0x12')][_0x4b1c('0x14')]);}else{logger[_0x4b1c('0xd')]('CmCompany,\x20%s,\x20%s',_0x3d9084,'request\x20sent');_0x52112a(_0x22b25b[_0x4b1c('0x15')][_0x4b1c('0x14')]);}})['catch'](function(_0x45b44e){logger[_0x4b1c('0x12')]('CmCompany,\x20%s,\x20%s',_0x3d9084,_0x45b44e);_0x51c5ad(_0x45b44e);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index ca2b9b7..477fb67 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 _0x0767=['delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update'];(function(_0x1d3a1c,_0x4fb972){var _0x27a392=function(_0x2d5908){while(--_0x2d5908){_0x1d3a1c['push'](_0x1d3a1c['shift']());}};_0x27a392(++_0x4fb972);}(_0x0767,0x75));var _0x7076=function(_0x61eb10,_0x316ffa){_0x61eb10=_0x61eb10-0x0;var _0x369464=_0x0767[_0x61eb10];return _0x369464;};'use strict';var multer=require(_0x7076('0x0'));var util=require(_0x7076('0x1'));var path=require('path');var timeout=require(_0x7076('0x2'));var express=require('express');var router=express[_0x7076('0x3')]();var fs_extra=require(_0x7076('0x4'));var auth=require(_0x7076('0x5'));var interaction=require(_0x7076('0x6'));var config=require(_0x7076('0x7'));var controller=require('./cmCompany.controller');router[_0x7076('0x8')]('/',auth['isAuthenticated'](),controller[_0x7076('0x9')]);router[_0x7076('0x8')](_0x7076('0xa'),auth[_0x7076('0xb')](),controller[_0x7076('0xc')]);router[_0x7076('0x8')](_0x7076('0xd'),auth['isAuthenticated'](),controller[_0x7076('0xe')]);router[_0x7076('0x8')](_0x7076('0xf'),auth[_0x7076('0xb')](),controller[_0x7076('0x10')]);router[_0x7076('0x11')]('/',auth[_0x7076('0xb')](),controller['create']);router[_0x7076('0x11')]('/:id/contacts',auth[_0x7076('0xb')](),controller[_0x7076('0x12')]);router[_0x7076('0x13')]('/:id',auth[_0x7076('0xb')](),controller[_0x7076('0x14')]);router[_0x7076('0x15')](_0x7076('0xd'),auth[_0x7076('0xb')](),controller['destroy']);module[_0x7076('0x16')]=router;
\ No newline at end of file
+var _0x0517=['update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','post','create','addContacts'];(function(_0x5402e5,_0x1a70bf){var _0x5b216f=function(_0x3afff8){while(--_0x3afff8){_0x5402e5['push'](_0x5402e5['shift']());}};_0x5b216f(++_0x1a70bf);}(_0x0517,0x168));var _0x7051=function(_0x533326,_0xe6c046){_0x533326=_0x533326-0x0;var _0x206839=_0x0517[_0x533326];return _0x206839;};'use strict';var multer=require(_0x7051('0x0'));var util=require(_0x7051('0x1'));var path=require(_0x7051('0x2'));var timeout=require(_0x7051('0x3'));var express=require(_0x7051('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7051('0x5'));var interaction=require(_0x7051('0x6'));var config=require('../../config/environment');var controller=require(_0x7051('0x7'));router[_0x7051('0x8')]('/',auth[_0x7051('0x9')](),controller[_0x7051('0xa')]);router[_0x7051('0x8')]('/describe',auth[_0x7051('0x9')](),controller[_0x7051('0xb')]);router['get'](_0x7051('0xc'),auth[_0x7051('0x9')](),controller[_0x7051('0xd')]);router[_0x7051('0x8')](_0x7051('0xe'),auth[_0x7051('0x9')](),controller['getContacts']);router[_0x7051('0xf')]('/',auth[_0x7051('0x9')](),controller[_0x7051('0x10')]);router['post'](_0x7051('0xe'),auth['isAuthenticated'](),controller[_0x7051('0x11')]);router['put']('/:id',auth[_0x7051('0x9')](),controller[_0x7051('0x12')]);router[_0x7051('0x13')](_0x7051('0xc'),auth['isAuthenticated'](),controller[_0x7051('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 16ecf00..6785cd2 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 _0x71f4=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x2b8278,_0x3c8e43){var _0x13a7e3=function(_0x98c1cc){while(--_0x98c1cc){_0x2b8278['push'](_0x2b8278['shift']());}};_0x13a7e3(++_0x3c8e43);}(_0x71f4,0x1ce));var _0x471f=function(_0x48e1ae,_0x2aa4b2){_0x48e1ae=_0x48e1ae-0x0;var _0x4a8776=_0x71f4[_0x48e1ae];return _0x4a8776;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x471f('0x0')]={'firstName':{'type':Sequelize[_0x471f('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x471f('0x1')]},'postalCode':{'type':Sequelize[_0x471f('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x471f('0x1')]},'dateOfBirth':{'type':Sequelize[_0x471f('0x1')]},'description':{'type':Sequelize[_0x471f('0x2')]},'phone':{'type':Sequelize[_0x471f('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x471f('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x471f('0x1')]},'fb_data':{'type':Sequelize[_0x471f('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x471f('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x471f('0x1')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x471f('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x471f('0x1')]},'priority':{'type':Sequelize[_0x471f('0x3')](0x2)[_0x471f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x471f('0x5')],'defaultValue':Sequelize[_0x471f('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x471f('0x3')]}};
\ No newline at end of file
+var _0x2170=['STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x44f7a9,_0xbbd4a6){var _0x203e5f=function(_0x149df7){while(--_0x149df7){_0x44f7a9['push'](_0x44f7a9['shift']());}};_0x203e5f(++_0xbbd4a6);}(_0x2170,0xcd));var _0x0217=function(_0x4712ef,_0x3622c8){_0x4712ef=_0x4712ef-0x0;var _0x18d2a8=_0x2170[_0x4712ef];return _0x18d2a8;};'use strict';var _=require(_0x0217('0x0'));var Sequelize=require(_0x0217('0x1'));module[_0x0217('0x2')]={'firstName':{'type':Sequelize[_0x0217('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0217('0x3')]},'street':{'type':Sequelize[_0x0217('0x3')]},'postalCode':{'type':Sequelize[_0x0217('0x3')]},'city':{'type':Sequelize[_0x0217('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x0217('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x0217('0x3')]},'mobile':{'type':Sequelize[_0x0217('0x3')]},'fax':{'type':Sequelize[_0x0217('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x0217('0x3')]},'facebook':{'type':Sequelize[_0x0217('0x3')]},'fb_data':{'type':Sequelize[_0x0217('0x3')]},'twitter':{'type':Sequelize[_0x0217('0x3')]},'skype':{'type':Sequelize[_0x0217('0x3')]},'teams':{'type':Sequelize[_0x0217('0x3')]},'viber':{'type':Sequelize[_0x0217('0x3')]},'line':{'type':Sequelize[_0x0217('0x3')]},'wechat':{'type':Sequelize[_0x0217('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x0217('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x0217('0x3')]},'priority':{'type':Sequelize[_0x0217('0x4')](0x2)[_0x0217('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0217('0x6')],'defaultValue':Sequelize[_0x0217('0x7')]},'dialTimezone':{'type':Sequelize[_0x0217('0x3')]},'utcOffset':{'type':Sequelize[_0x0217('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index cbcb5c5..e41e048 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','@xcally.com','head','name','substring','indexOf','split','length','Anonymous','pop','isEmpty','html','test','includes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfe28,0xfc));var _0x8fe2=function(_0x3c0a03,_0xbcecb1){_0x3c0a03=_0x3c0a03-0x0;var _0x5c4469=_0xfe28[_0x3c0a03];return _0x5c4469;};'use strict';var _=require(_0x8fe2('0x0'));var moment=require(_0x8fe2('0x1'));var random=require(_0x8fe2('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x8fe2('0x3'));var tnef=require(_0x8fe2('0x4'));var logger=require(_0x8fe2('0x5'))(_0x8fe2('0x6'));var config=require(_0x8fe2('0x7'));function getAddress(_0x173fca){var _0x5de7fd=_['head'](_0x173fca[_0x8fe2('0x8')]);return _0x5de7fd&&_0x5de7fd[_0x8fe2('0x9')]?_0x5de7fd[_0x8fe2('0x9')]:_0x8fe2('0xa')+random['generate'](0x6)+_0x8fe2('0xb');}function getFirstName(_0x3945fa){var _0x411741=_[_0x8fe2('0xc')](_0x3945fa[_0x8fe2('0x8')]);if(_0x411741&&_0x411741[_0x8fe2('0xd')]){if(_0x411741['name']==_0x411741[_0x8fe2('0x9')]){return _0x411741[_0x8fe2('0xd')][_0x8fe2('0xe')](0x0,_0x411741['name'][_0x8fe2('0xf')]('@'));}var _0x5bbca1=_0x411741[_0x8fe2('0xd')][_0x8fe2('0x10')](/\s+/);return _0x5bbca1[_0x8fe2('0x11')]>0x1?_0x5bbca1['slice'](0x0,-0x1)['join']('\x20'):_0x411741[_0x8fe2('0xd')];}return _0x8fe2('0x12');}function getLastName(_0x4a5958){var _0x1255db=_[_0x8fe2('0xc')](_0x4a5958[_0x8fe2('0x8')]);if(_0x1255db&&_0x1255db[_0x8fe2('0xd')]){var _0x45b4f7=_0x1255db[_0x8fe2('0xd')][_0x8fe2('0x10')](/\s+/);return _0x45b4f7['length']>0x1?_0x45b4f7[_0x8fe2('0x13')]():'';}return'';}function getMails(_0x788988,_0x4edb4d){var _0x2edc7a='';for(var _0x49cb9c=0x0;_0x49cb9c<_0x4edb4d[_0x8fe2('0x8')][_0x8fe2('0x11')];_0x49cb9c+=0x1){if(_0x4edb4d['value'][_0x49cb9c][_0x8fe2('0x9')]!==_0x788988){if(!_[_0x8fe2('0x14')](_0x2edc7a)){_0x2edc7a+=',';}_0x2edc7a+=_0x4edb4d[_0x8fe2('0x8')][_0x49cb9c]['name']||_0x4edb4d['value'][_0x49cb9c]['address']||'';_0x2edc7a+='\x20<';_0x2edc7a+=_0x4edb4d['value'][_0x49cb9c]['address']?_0x4edb4d[_0x8fe2('0x8')][_0x49cb9c][_0x8fe2('0x9')]:_0x8fe2('0xa')+random['generate'](0x6)+'@xcally.com';_0x2edc7a+='>';}}return _0x2edc7a;}function parseEmail(_0x12ef40,_0x798d98,_0x32224c){if(_0x798d98[_0x8fe2('0x15')]){var _0x2beb27=/