1import{j as g,d as h,O as U,u as D,q as F,c as Z,w as q,k as f,o as i,a as e,h as o,e as n,f as v,i as x,n as H,t as d,F as b,l as p,C as c,N as P,I as R}from"./app.1c75f29f.js";import{_ as S}from"./AppLayout.78e80e3b.js";import"./Banner.7925d127.js";import"./ApplicationMark.85c52153.js";const j={class:"grid grid-cols-12 py-10 gap-5"},L={class:"col-span-6 col-start-4"},A={class:"bg-white p-14 rounded-xl"},E={class:"flex justify-center"},I={class:"h-24 w-24 rounded-full bg-gray-10 relative"},N={class:"h-7 w-7 rounded-full bg-indigo-60 z-10 absolute -right-2 bottom-4 flex items-center justify-center cursor-pointer"},O=e("label",{for:"profile"},[e("svg",{width:"15",height:"14",viewBox:"0 0 15 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.764 3.0099C11.792 3.05873 11.8409 3.0936 11.9037 3.0936C13.5796 3.0936 14.9482 4.4607 14.9482 6.13471V10.2779C14.9482 11.9519 13.5796 13.319 11.9037 13.319H4.02715C2.3443 13.319 0.982666 11.9519 0.982666 10.2779V6.13471C0.982666 4.4607 2.3443 3.0936 4.02715 3.0936C4.08301 3.0936 4.13887 3.0657 4.15982 3.0099L4.20172 2.9262C4.2258 2.87552 4.25051 2.82347 4.27559 2.77063C4.45423 2.39437 4.65185 1.97812 4.7743 1.73348C5.09551 1.10573 5.64017 0.756975 6.31749 0.75H9.60637C10.2837 0.756975 10.8353 1.10573 11.1565 1.73348C11.2665 1.95317 11.4341 2.30705 11.5955 2.64814C11.6289 2.71856 11.662 2.78842 11.6942 2.85645L11.764 3.0099ZM11.2543 5.68831C11.2543 6.03706 11.5336 6.31606 11.8828 6.31606C12.2319 6.31606 12.5182 6.03706 12.5182 5.68831C12.5182 5.33956 12.2319 5.05358 11.8828 5.05358C11.5336 5.05358 11.2543 5.33956 11.2543 5.68831ZM6.75741 6.76943C7.0856 6.44161 7.51155 6.26723 7.96543 6.26723C8.4193 6.26723 8.84525 6.44161 9.16646 6.76246C9.48767 7.08331 9.66224 7.50878 9.66224 7.96216C9.65525 8.89681 8.90111 9.65709 7.96543 9.65709C7.51155 9.65709 7.0856 9.48271 6.76439 9.16186C6.44318 8.84101 6.26861 8.41553 6.26861 7.96216V7.95518C6.26163 7.51576 6.4362 7.09028 6.75741 6.76943ZM9.89965 9.90121C9.40387 10.3964 8.71956 10.7033 7.96543 10.7033C7.23224 10.7033 6.54792 10.4174 6.02422 9.90121C5.50749 9.37809 5.2212 8.69453 5.2212 7.96216C5.21422 7.23676 5.50051 6.55321 6.01724 6.03008C6.54094 5.50696 7.23224 5.22098 7.96543 5.22098C8.69861 5.22098 9.38991 5.50696 9.90663 6.02311C10.4234 6.54623 10.7097 7.23676 10.7097 7.96216C10.7027 8.72243 10.3954 9.40599 9.89965 9.90121Z",fill:"white"})])],-1),T=["src"],G=e("div",{class:"text-14-medium mt-6 pb-3 border-b border-gray-30"},"Choose user type",-1),J={class:"grid grid-cols-3 gap-1.5 mt-5"},K=["onClick"],Q={key:0,class:"text-14-regular text-error-40 mt-1"},W=e("div",{class:"text-14-medium mt-8 pb-3 border-b border-gray-30 mb-4"},"Basic Details",-1),X={class:"flex items-center relative"},Y=e("i",{class:"text-gray-80 icon-profile-1 absolute left-3 text-lg"},null,-1),ee={class:"text-14-regular text-error-40 mt-1 mb-4"},te={class:"flex items-center relative mt-3"},se=e("i",{class:"text-gray-80 icon-location-1 absolute left-3 text-lg"},null,-1),le={class:"text-14-regular text-error-40 mt-1 mb-4"},oe={class:"mt-4 flex items-center relative"},re=e("i",{class:"text-gray-80 icon-work-1 absolute left-3 text-lg"},null,-1),ae={class:"text-14-regular text-error-40 mt-2"},ie={class:"flex items-center relative mt-3"},ne=e("i",{class:"text-gray-80 icon-message-1 absolute left-3 text-lg"},null,-1),de={class:"text-14-regular text-error-40 mt-1 mb-4"},ue={class:"flex items-center relative mt-3"},pe=e("svg",{class:"absolute left-4",width:"18",height:"18",viewBox:"0 0 18 18",fill:"off",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.142 5.547V6.69701C14.4338 7.10022 15.375 8.2696 15.375 9.6663V13.369C15.375 15.0981 13.9415 16.5 12.1742 16.5H5.8266C4.05852 16.5 2.625 15.0981 2.625 13.369V9.6663C2.625 8.2696 3.56696 7.10022 4.85796 6.69701V5.547C4.86559 3.31109 6.7175 1.5 8.98857 1.5C11.2901 1.5 13.142 3.31109 13.142 5.547ZM9.00381 2.80428C10.5509 2.80428 11.8084 4.03404 11.8084 5.547V6.53528H6.19165V5.5321C6.19927 4.02658 7.45674 2.80428 9.00381 2.80428ZM9.66684 12.3412C9.66684 12.7064 9.36962 12.9971 8.99619 12.9971C8.63038 12.9971 8.33316 12.7064 8.33316 12.3412V10.6866C8.33316 10.3289 8.63038 10.0382 8.99619 10.0382C9.36962 10.0382 9.66684 10.3289 9.66684 10.6866V12.3412Z",fill:"#130F26"})],-1),ce={class:"text-14-regular text-error-40 mt-1 mb-4"},me={class:"flex items-center relative mt-3 bg-gray-10 rounded-md h-input"},ge=e("i",{class:"text-gray-80 icon-profile-1 absolute left-3 text-lg"},null,-1),fe=["value"],ve={key:0,class:"absolute pl-12 text-sm text-gray-60"},_e={class:"text-14-regular text-error-40 mt-1 mb-4"},Ce={class:"grid grid-cols-2 gap-4 px-6 mt-8"},ke={__name:"Create",setup(be){g(()=>f().props.value.user);const w=g(()=>f().props.value.roles.data),y=g(()=>f().props.value.genders);let a;route().current()=="users.edit"&&(a=g(()=>f().props.value.userDetails.data));let _=h(!1),u=U({id:null,name:null}),s=D({full_name:"",address:"",email:"",password:"",gender:"",role:u.id,photo:null,organization:""});F(()=>{route().current()=="users.edit"&&(s.full_name=a.value.full_name,s.email=a.value.email,s.address=a.value.address,s.password=a.value.password,s.gender=a.value.gender,s.role=a.value.role,s.organization=a.value.organization,m.value=a.value.photo,u.name=a.value.role_label,u.id=a.value.role,_.value=!0)});const k=r=>{u.id=r.id,u.name=r.name,s.role=r.id},m=h(null),V=r=>{s.photo=r,$(r)},$=r=>{const l=new FileReader;l.onload=t=>{m.value=t.target.result}
1,l.readAsDataURL(r)},M=()=>{s.post(route("users.store"),{onFinish:()=>{}})},z=()=>{R.Inertia.post(`/admin/users/${a.value.slug}/update`,{_method:"put",...s})},B=()=>{window.history.back()};return(r,l)=>(i(),Z(S,{title:"AHRCM Dashboard"},{default:q(()=>[e("div",null,[e("div",j,[e("div",L,[e("div",A,[e("div",E,[e("div",I,[e("div",N,[O,e("input",{accept:"image/*",type:"file",name:"profile",id:"profile",class:"hidden",onChange:l[0]||(l[0]=t=>V(t.target.files[0]))},null,32)]),o(m)?(i(),n("img",{key:0,src:o(m),alt:"",class:"absolute w-full h-full top-0 right-0 rounded-full object-cover"},null,8,T)):v("",!0)])]),G,e("div",J,[(i(!0),n(b,null,x(o(w),t=>(i(),n("div",{onClick:C=>k(t),key:t.id,class:H([o(u).id==t.id?"bg-indigo-60 text-white":"border-gray-30 hover:border-indigo-20","text-center border rounded-lg py-3 cursor-pointer text-14-regular transition-all duration-200"])},d(t.display_name),11,K))),128)),r.$page.props.errors.role?(i(),n("p",Q,d(r.$page.props.errors.role),1)):v("",!0)]),W,e("div",X,[Y,p(e("input",{id:"full name",type:"email",class:"block w-full input pl-12",required:"",placeholder:"Full name","onUpdate:modelValue":l[1]||(l[1]=t=>o(s).full_name=t)},null,512),[[c,o(s).full_name]])]),e("p",ee,d(r.$page.props.errors.full_name),1),e("div",te,[se,p(e("input",{id:"adderss",type:"text",class:"block w-full input pl-12",required:"",placeholder:"Address","onUpdate:modelValue":l[2]||(l[2]=t=>o(s).address=t)},null,512),[[c,o(s).address]])]),e("p",le,d(r.$page.props.errors.address),1),e("div",oe,[re,p(e("input",{"onUpdate:modelValue":l[3]||(l[3]=t=>o(s).organization=t),type:"text",class:"input block w-full pl-12",placeholder:"Organization"},null,512),[[c,o(s).organization]])]),e("p",ae,d(r.$page.props.errors.organization),1),e("div",ie,[ne,p(e("input",{autocomplete:"off",id:"email",type:"email",class:"block w-full input pl-12",required:"",placeholder:"Email","onUpdate:modelValue":l[4]||(l[4]=t=>o(s).email=t)},null,512),[[c,o(s).email]])]),e("p",de,d(r.$page.props.errors.email),1),o(_)?v("",!0):(i(),n(b,{key:0},[e("div",ue,[pe,p(e("input",{autocomplete:"off",id:"password",type:"password",class:"block w-full input pl-12",required:"",placeholder:"Password","onUpdate:modelValue":l[5]||(l[5]=t=>o(s).password=t)},null,512),[[c,o(s).password]])]),e("p",ce,d(r.$page.props.errors.password),1)],64)),e("div",me,[ge,p(e("select",{placeholder:"Select gender","onUpdate:modelValue":l[6]||(l[6]=t=>o(s).gender=t),class:"text-sm pl-12 w-full block appearance-none border-none outline-none py-2 border-0 focus:outline-none focus:ring-0 focus:ring-white bg-transparent"},[(i(!0),n(b,null,x(o(y),(t,C)=>(i(),n("option",{value:C,key:C},d(t),9,fe))),128))],512),[[P,o(s).gender]]),o(s).gender?v("",!0):(i(),n("div",ve,"Select gender"))]),e("p",_e,d(r.$page.props.errors.gender),1),e("div",Ce,[e("button",{class:"btn btn-secondary",onClick:l[7]||(l[7]=t=>B())},"Cancel"),o(_)?(i(),n("button",{key:1,class:"btn btn-primary",onClick:l[9]||(l[9]=t=>z())},"Update user")):(i(),n("button",{key:0,class:"btn btn-primary",onClick:l[8]||(l[8]=t=>M())},"Create account"))])])])])])]),_:1}))}};export{ke as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.