import{r as s,d as i,h as t}from"./p-03169580.js";const e="";let n=class{constructor(t){s(this,t);this.ionInput=i(this,"ionInput",7);this.fireenjinSelectUser=i(this,"fireenjinSelectUser",7);this.placeholder="Search Users";this.disableSearch=false;this.mode="inline";this.limit=5;this.results=[]}async selectUser(s,i){this.value=i.email;this.fireenjinSelectUser.emit({event:s,user:i});setTimeout((async()=>{await this.inputSearchEl.checkValidity({setValidationClass:true})}),200);if(this.mode==="popover"){await this.inputSearchEl.closePopover()}else if(this.mode==="inline"){await this.inputSearchEl.clearResults()}}render(){return t("fireenjin-input-search",{labelPosition:this.labelPosition,lines:this.lines,iconEnd:this.iconEnd,iconStart:this.iconStart,mode:this.mode,label:this.label,ref:s=>this.inputSearchEl=s,endpoint:"searchUsers",resultsKey:"searchUsers.results",name:this.name,searchParams:{limit:this.limit?this.limit:null},results:this.results,placeholder:this.placeholder,value:this.value,template:s=>t("ion-item",{onClick:i=>this.selectUser(i,s),style:{cursor:"pointer"}},t("ion-label",null,t("h2",null,s.firstName?s.firstName:""," ",s.lastName?s.lastName:""),t("p",null,s.email?s.email:"No email on file")),t("ion-icon",{name:"checkmark-circle"}))},t("slot",{name:"start"}),t("slot",{name:"end"}))}};n.style=e;export{n as fireenjin_input_search_user};
//# sourceMappingURL=p-96d78fda.entry.js.map