import{r as l,B as i,h as o}from"./p-9b6cc562.js";import{m as n}from"./p-a4d32aeb.js";import"./p-24c4a299.js";import"./p-8cd54418.js";const e=class{constructor(i){l(this,i),this.locationId=void 0,this.alerts=[],this.paginationEl=void 0,this.filters={}}async componentDidLoad(){(null==i?void 0:i.isBrowser)&&(await n.create({component:"modal-flow",componentProps:{headerTitle:"Add an Alert",steps:[{fields:[{beforeHTML:"<h1>What is the subject of the email?</h1>",name:"subject"}]},{fields:[{beforeHTML:"<h1>What is the type of alert?</h1>",name:"type",type:"radios",value:"email",options:[{label:"Email",value:"email"},{label:"Feed Card",value:"feed"}]}]}]}})).present()}render(){return[o("ion-content",{class:"ion-padding"},o("floodteam-title-bar",null,o("ion-router-link",{href:"/alerts"},"Alerts"),o("ion-buttons",{slot:"end"},o("ion-button",{fill:"solid",color:"primary",href:"/alerts/new"},"Add"))),o("div",{class:"ion-padding"},o("fireenjin-search-bar",{ref:l=>this.filterBarEl=l,paginationEl:this.paginationEl,filters:[{name:"locationId",label:"Location",endpoint:"listLocations",value:this.locationId,icon:"business",resultsKey:"locations"}]})),o("ion-card",{class:"list-card"},o("ion-card-content",null,o("ion-list",null,this.alerts.map((l=>{var i,n,e,t,a;return o("ion-item",null,o("div",{slot:"start"},(null===(i=null==l?void 0:l.types)||void 0===i?void 0:i.includes("email"))?o("ion-icon",{name:"mail"}):null),o("ion-label",null,o("h2",null,null===(n=null==l?void 0:l.template)||void 0===n?void 0:n.subject),o("p",null,"Sent to"," ",(null===(e=null==l?void 0:l.emails)||void 0===e?void 0:e.length)?`${l.emails.length} Emails`:""," ",(null===(t=null==l?void 0:l.userIds)||void 0===t?void 0:t.length)?`${(null===(a=null==l?void 0:l.emails)||void 0===a?void 0:a.length)?"and ":""}${l.userIds.length} Users`:"")))})))))),o("floodteam-navigation-footer",null)]}};e.style="";export{e as app_alert_list}