import{r as o,e as i,h as n}from"./p-a89095f5.js";const t=class{constructor(n){o(this,n),this.floodteamCloseModal=i(this,"floodteamCloseModal",7),this.tests=void 0,this.test=void 0,this.flowId=void 0}closeModal(){this.floodteamCloseModal.emit()}run(o,i){console.log(i),o.preventDefault()}edit(o,i){console.log(i),this.test=i}render(){var o,i,t,l,e,s;return[n("ion-header",null,n("ion-toolbar",null,n("ion-title",null,"Add / Edit Tests"),n("ion-buttons",{slot:"end"},n("ion-button",{onClick:()=>this.closeModal()},n("ion-icon",{slot:"icon-only",name:"close-circle-outline"}))))),n("ion-content",null,n("ion-list",null,null===(i=null===(o=this.tests)||void 0===o?void 0:o.map)||void 0===i?void 0:i.call(o,(o=>n("ion-item",null,n("ion-buttons",{slot:"start"},n("ion-button",{onClick:i=>this.edit(i,o)},n("ion-icon",{name:"create",slot:"icon-only"}))),n("ion-label",null,(null==o?void 0:o.name)||"No Name"),n("ion-buttons",{slot:"end"},n("ion-button",{onClick:i=>this.run(i,o)},n("ion-icon",{name:"play",slot:"icon-only"}))))))),n("ion-card",null,n("fireenjin-form",{beforeSubmit:async o=>({...o,flowId:this.flowId}),endpoint:(null===(t=this.test)||void 0===t?void 0:t.id)?"editTest":"addTest",documentId:null===(l=this.test)||void 0===l?void 0:l.id},n("fireenjin-input",{name:"name",label:"Name",labelPosition:"stacked",required:!0,value:null===(e=this.test)||void 0===e?void 0:e.name}),n("fireenjin-code-editor",{name:"formData",label:"Form Data",labelPosition:"stacked",required:!0,value:null===(s=this.test)||void 0===s?void 0:s.formData,outputObject:!0}))))]}};t.style="";export{t as floodteam_modal_flow_test}