define(["exports","./../list/list.js","./../modules/common/globalize.js","./../modules/emby-elements/emby-input/emby-input.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/emby-elements/emby-button/paper-icon-button-light.js","./../modules/emby-elements/emby-select/emby-select.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/common/textencoding.js","./../modules/layoutmanager.js","./scheduledtasktriggereditor.js","./scheduledtasktriggercontroller.js"],function(_exports,_list,_globalize,_embyInput,_embyButton,_paperIconButtonLight,_embySelect,_embyScroller,_textencoding,_layoutmanager,_scheduledtasktriggereditor,_scheduledtasktriggercontroller){function ScheduledTaskPage(view,params){this.enableAlphaNumericShortcuts=!1,this.enableTotalRecordCountDisplay=!1,this.hasOtherViewButtons=!0,this.supportsViewSettings=!1,_list.default.apply(this,arguments),function(instance,view){view.querySelector(".itemsViewSettingsContainer").classList.add("itemsViewSettingsContainer-align-start","readOnlyContent"),view.querySelector(".listTotalRecordCount").insertAdjacentHTML("afterend",'<div><h2 class="taskName" style="margin-top:0;"></h2><p style="margin-top:0;" class="taskDescription"></p><button is="emby-button" type="button" class="itemsViewSettingsContainer-button raised raised-mini btnAddTrigger submit" title="'+_globalize.default.translate("ButtonAddScheduledTaskTrigger")+'" aria-label="'+_globalize.default.translate("ButtonAddScheduledTaskTrigger")+'"><i class="md-icon button-icon button-icon-left">&#xe145;</i><span class="emby-button-text">'+_globalize.default.translate("ButtonAddScheduledTaskTrigger")+"</span></button></div>"),instance.itemsContainer.classList.add("readOnlyContent")}(this,view),view.querySelector(".btnAddTrigger").addEventListener("click",function(e){_scheduledtasktriggereditor.default.show({trigger:{ScheduledTaskId:this.params.id},apiClient:this.getApiClient()})}.bind(this)),this.itemsContainer.setAttribute("data-monitor","ScheduledTaskTriggers")}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["flexStyles"]),Object.assign(ScheduledTaskPage.prototype,_list.default.prototype),ScheduledTaskPage.prototype.supportsAlphaPicker=function(){return!1},ScheduledTaskPage.prototype.getItemTypes=function(){return["ScheduledTaskTrigger"]},ScheduledTaskPage.prototype.onItemRefreshed=function(item){_list.default.prototype.onItemRefreshed.apply(this,arguments),this.view.querySelector(".taskName").innerHTML=_textencoding.default.htmlEncode(item.Name||""),this.view.querySelector(".taskDescription").innerHTML=_textencoding.default.htmlEncode(item.Description||"")},ScheduledTaskPage.prototype.getEmptyListMessage=function(){return Promise.resolve("")},ScheduledTaskPage.prototype.setTitle=function(){},ScheduledTaskPage.prototype.fetchItem=function(){return this.getApiClient().getScheduledTask(this.params.id)},ScheduledTaskPage.prototype.getItems=function(query){return this.getApiClient().getScheduledTask(this.params.id).then(function(item){var item=item.Triggers||[],totalRecordCount=item.length;return Promise.resolve({Items:item,TotalRecordCount:totalRecordCount})})},ScheduledTaskPage.prototype.getNameSortOption=function(itemType){return null},ScheduledTaskPage.prototype.getSettingsKey=function(){return"scheduledtask"},ScheduledTaskPage.prototype.getBaseListRendererOptions=function(){var options=_list.default.prototype.getBaseListRendererOptions.apply(this,arguments);return options.draggable=!1,options.draggableXActions=!0,options.multiSelect=!1,options.action=_layoutmanager.default.tv?"menu":"none",options},ScheduledTaskPage.prototype.getCardOptions=function(items,settings){var options=_list.default.prototype.getCardOptions.apply(this,arguments);return options.fields.push("Name"),options.fields.push("TaskTriggerTimeLimit"),options},ScheduledTaskPage.prototype.getListViewOptions=function(items,settings){var options=_list.default.prototype.getListViewOptions.apply(this,arguments);return options.enableDefaultIcon=!0,options.defaultBackground=!1,options.deleteButton=!0,options.moreButton=!1,options.buttonCommands=["delete"],options.fields.push("Name"),options.fields.push("TaskTriggerDescription"),options.fields.push("TaskTriggerDescription2"),options.fields.push("TaskTriggerTimeLimit"),options},ScheduledTaskPage.prototype.getViewSettingDefaults=function(){var viewSettings=_list.default.prototype.getViewSettingDefaults.apply(this,arguments);return viewSettings.imageType="list",viewSettings};_exports.default=ScheduledTaskPage});