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-checkbox/emby-checkbox.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,_embyCheckbox,_embySelect,_embyScroller,_textencoding,_layoutmanager,_scheduledtasktriggereditor,_scheduledtasktriggercontroller){function ScheduledTaskPage(view,params){this.enableAlphaNumericShortcuts=!1,this.enableTotalRecordCountDisplay=!1,this.hasOtherViewButtons=!0,this.supportsViewSettings=!1,params.serverId=ApiClient.serverId(),_list.default.apply(this,arguments),function(instance,view){var container=view.querySelector(".itemsViewSettingsContainer");container.classList.add("justify-content-flex-start","readOnlyContent"),container.classList.remove("justify-content-center"),container.style.justifyContent="flex-start",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="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>'+_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.getItem=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.getSettingsKey=function(){return"scheduledtask"},ScheduledTaskPage.prototype.getBaseListRendererOptions=function(){var options=_list.default.prototype.getBaseListRendererOptions.apply(this,arguments);return options.draggable=!1,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.fields.push("Name"),options.fields.push("TaskTriggerTimeLimit"),options},ScheduledTaskPage.prototype.getSortMenuOptions=function(){return[]},ScheduledTaskPage.prototype.getViewSettingDefaults=function(){var viewSettings=_list.default.prototype.getViewSettingDefaults.apply(this,arguments);return viewSettings.imageType="list",viewSettings},_exports.default=ScheduledTaskPage});