import{r as o,h as e}from"./p-03169580.js";import{t as i}from"./p-c5cf028c.js";import{s}from"./p-81b30421.js";import"./p-4cb16df5.js";import"./p-7cbdb4ea.js";import"./p-59c95c5f.js";import"./p-c9699503.js";import"./p-bd8b186e.js";import"./p-795b799a.js";import"./p-3a8e6af1.js";const a="modal-edit-users .banner{background-color:var(--ion-color-secondary)}modal-edit-users h1{color:#fff}modal-edit-users p{margin:0 0 15px 0;color:rgba(255, 255, 255, 0.8);font-weight:normal}.modal-edit-users{--width:700px;--max-width:700px}@media only screen and (max-width: 800px){.modal-edit-users{--width:100%;--max-width:auto}}";let t=class{constructor(e){o(this,e);this.users=[]}onReset(o){var e;if(((e=o.detail)===null||e===void 0?void 0:e.endpoint)==="bulkUpdateUsers"){const o=document.querySelector("ion-modal.modal-edit-users");if(o===null||o===void 0?void 0:o.dismiss){o.dismiss()}}}async onSuccess(o){var e;if(((e=o.detail)===null||e===void 0?void 0:e.endpoint)==="bulkUpdateUsers"){const o=document.querySelector("ion-modal.modal-edit-users");if(o===null||o===void 0?void 0:o.dismiss){await o.dismiss();this.presentToast()}}}async presentToast(){var o;const e=await i.create({message:`Updated ${(o=this.users)===null||o===void 0?void 0:o.length} users.`,duration:2e3});e.present()}render(){return e("ion-content",null,e("fireenjin-form",{class:"ion-padding",endpoint:"bulkUpdateUsers",beforeSubmit:async o=>({data:o,userIds:this.users.map((o=>o.id))}),disableLoader:true,resetButtonColor:"medium"},e("fireenjin-select",{name:"companyId",label:"Company",labelPosition:"stacked",endpoint:"listCompanies",limit:100,dataPropsMap:{companies:"results"}}),e("fireenjin-select",{label:"Location",name:"locationId",options:((s===null||s===void 0?void 0:s.locations)||[]).map((o=>({label:(o===null||o===void 0?void 0:o.name)||"No Location Name",value:o===null||o===void 0?void 0:o.id})))}),e("fireenjin-select-tags",{name:"tags",label:"Tags",labelPosition:"stacked",allowAdding:true,options:[{label:"Important",value:"important"}]})))}};t.style=a;export{t as modal_edit_users};
//# sourceMappingURL=p-233937ce.entry.js.map