import{r as l,B as o,h as i}from"./p-f8363b1b.js";import{m as n}from"./p-510e3bc9.js";import"./p-d2ac57a0.js";import"./p-f44f0a67.js";const e=class{constructor(o){l(this,o),this.alerts=[],this.filters={}}async componentDidLoad(){(null==o?void 0:o.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[i("ion-content",{class:"ion-padding"},i("floodteam-title-bar",null,i("ion-router-link",{href:"/alerts"},"Alerts"),i("ion-buttons",{slot:"end"},i("ion-button",{fill:"solid",color:"primary",href:"/alerts/new"},"Add"))),i("div",{class:"ion-padding"},i("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"}]})),i("ion-card",{class:"list-card"},i("ion-card-content",null,i("ion-list",null,this.alerts.map((l=>{var o,n,e,t,a;return i("ion-item",null,i("div",{slot:"start"},(null===(o=null==l?void 0:l.types)||void 0===o?void 0:o.includes("email"))?i("ion-icon",{name:"mail"}):null),i("ion-label",null,i("h2",null,null===(n=null==l?void 0:l.template)||void 0===n?void 0:n.subject),i("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`:"")))})))))),i("floodteam-navigation-footer",null)]}};e.style="";export{e as app_alert_list}