import globalize from"./../modules/common/globalize.js";import"./../modules/emby-elements/emby-input/emby-input.js";import"./../modules/emby-elements/emby-button/emby-button.js";import"./../modules/emby-elements/emby-checkbox/emby-checkbox.js";import"./../modules/emby-elements/emby-select/emby-select.js";import"./../modules/emby-elements/emby-scroller/emby-scroller.js";import"./../modules/emby-elements/emby-dialogclosebutton/emby-dialogclosebutton.js";import layoutManager from"./../modules/layoutmanager.js";import loading from"./../modules/loading/loading.js";import dialogHelper from"./../modules/dialoghelper/dialoghelper.js";import pluginManager from"./../modules/common/pluginmanager.js";import responseHelper from"./../modules/common/responsehelper.js";function onSubmit(e){return loading.show(),this.options.apiClient.saveUserNotification(getEntry(this)).then(onSubmitted.bind(this)),e.preventDefault(),!1}function showToast(options){return Emby.importModule("./modules/toast/toast.js").then(function(toast){return toast(options)})}function onTestSuccess(){loading.hide(),showToast(globalize.translate("NotificationSent"))}function onTestFail(response){loading.hide(),response.errorMessagePreamble=globalize.translate("ErrorSendingNotification"),responseHelper.handleErrorResponse(response)}function sendEntryTest(){var apiClient=this.options.apiClient;loading.show(),apiClient.sendTestUserNotification(getEntry(this)).then(onTestSuccess,onTestFail)}function getEntry(instance){var entry=Object.assign({},instance.options.entry),dlg=instance.dlg;return instance.options.entryFormEditor.setObjectValues(dlg,entry),entry.GroupItems=dlg.querySelector(".chkGroupItems").checked,entry.UserIds=dlg.querySelector(".selectUser").getValues(),entry.LibraryIds=dlg.querySelector(".selectLibrary").getValues(),entry.DeviceIds=dlg.querySelector(".selectDevices").getValues(),entry.EventIds=Array.prototype.map.call(dlg.querySelectorAll(".chkSubEvent:checked"),function(c){return c.getAttribute("data-id")}),entry}function onSubmitted(){loading.hide(),this.submitted=!0,dialogHelper.close(this.dlg)}function getEventHtml(info,entry){let html="";html=(html+='