import{r as o,h as e}from"./p-a89095f5.js";import{t as s}from"./p-3e7f0e42.js";import{s as a}from"./p-9e8ba117.js";import"./p-29ec504c.js";import"./p-8cd54418.js";import"./p-d7f93824.js";import"./p-2a0c7fc9.js";import"./p-86bd3473.js";import"./p-65879f9e.js";import"./p-60cf0cc2.js";const i=class{constructor(e){o(this,e),this.users=[]}onReset(o){var e;if("bulkUpdateUsers"===(null===(e=o.detail)||void 0===e?void 0:e.endpoint)){const o=document.querySelector("ion-modal.modal-edit-users");(null==o?void 0:o.dismiss)&&o.dismiss()}}async onSuccess(o){var e;if("bulkUpdateUsers"===(null===(e=o.detail)||void 0===e?void 0:e.endpoint)){const o=document.querySelector("ion-modal.modal-edit-users");(null==o?void 0:o.dismiss)&&(await o.dismiss(),this.presentToast())}}async presentToast(){var o;(await s.create({message:`Updated ${null===(o=this.users)||void 0===o?void 0:o.length} users.`,duration:2e3})).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:!0,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:((null==a?void 0:a.locations)||[]).map((o=>({label:(null==o?void 0:o.name)||"No Location Name",value:null==o?void 0:o.id})))}),e("fireenjin-select-tags",{name:"tags",label:"Tags",labelPosition:"stacked",allowAdding:!0,options:[{label:"Important",value:"important"}]})))}};i.style="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}}";export{i as modal_edit_users}