import{B as _,X as c,C as m,j as p,t as a,m as t,k as n,H as v,E as f,F as U,q as L,y as b,x as C}from"./vendor-CoimUlS3.js";import{L as k}from"./Layout-DhxLvS0V.js";import{F as B}from"./FileInput-BAEpJ7ii.js";import{T as F}from"./TextInput-UGcC5hIa.js";import{S}from"./SelectInput-BeV75IPk.js";import{L as h}from"./LoadingButton-BqD68voa.js";import{_ as x}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./utils-CXPYudwi.js";import"./LogoutButton-BZlSuKxY.js";import"./app-W9XHfen4.js";/* empty css                                                                 */import"./ui-CI37mw-K.js";import"./Logo-DiOikIGZ.js";import"./FlashMessages-D1juQjH6.js";const E={components:{FileInput:B,Head:c,Link:_,LoadingButton:h,SelectInput:S,TextInput:F},layout:k,props:{countries:Array,cities:Array,title:String},remember:"form",data(){return{form:this.$inertia.form({first_name:"",last_name:"",phone:"",email:"",city:null,address:"",country_id:null,password:"",role_id:null,photo:null})}},created(){},methods:{setDefaultValue(l,r,i){const u=l.find(e=>e.name.match(new RegExp(i+".*")));u&&(this.form[r]=u.id)},store(){this.form.post(this.route("customers.store"))}}},H={class:"max-w-full bg-white rounded-md shadow overflow-hidden"},A={class:"flex flex-wrap -mb-8 -mr-6 p-8"},I=["value"],N={class:"flex items-center justify-end px-8 py-4 bg-gray-50 border-t border-gray-100"};function P(l,r,i,u,e,d){const w=m("Head"),s=m("text-input"),V=m("select-input"),g=m("file-input"),y=m("loading-button");return a(),p("div",null,[t(w,{title:l.$t(i.title)},null,8,["title"]),n("div",H,[n("form",{onSubmit:r[9]||(r[9]=v((...o)=>d.store&&d.store(...o),["prevent"]))},[n("div",A,[t(s,{modelValue:e.form.first_name,"onUpdate:modelValue":r[0]||(r[0]=o=>e.form.first_name=o),error:e.form.errors.first_name,class:"pb-8 pr-6 w-full lg:w-1/3",label:l.$t("First name")},null,8,["modelValue","error","label"]),t(s,{modelValue:e.form.last_name,"onUpdate:modelValue":r[1]||(r[1]=o=>e.form.last_name=o),error:e.form.errors.last_name,class:"pb-8 pr-6 w-full lg:w-1/3",label:l.$t("Last name")},null,8,["modelValue","error","label"]),t(s,{modelValue:e.form.email,"onUpdate:modelValue":r[2]||(r[2]=o=>e.form.email=o),error:e.form.errors.email,class:"pb-8 pr-6 w-full lg:w-1/3",label:l.$t("Email")},null,8,["modelValue","error","label"]),t(s,{modelValue:e.form.phone,"onUpdate:modelValue":r[3]||(r[3]=o=>e.form.phone=o),error:e.form.errors.phone,class:"pb-8 pr-6 w-full lg:w-1/2",label:l.$t("Phone")},null,8,["modelValue","error","label"]),t(s,{modelValue:e.form.city,"onUpdate:modelValue":r[4]||(r[4]=o=>e.form.city=o),error:e.form.errors.city,class:"pb-8 pr-6 w-full lg:w-1/2",label:l.$t("City")},null,8,["modelValue","error","label"]),t(s,{modelValue:e.form.address,"onUpdate:modelValue":r[5]||(r[5]=o=>e.form.address=o),error:e.form.errors.address,class:"pb-8 pr-6 w-full lg:w-1/3",label:l.$t("Address")},null,8,["modelValue","error","label"]),t(V,{modelValue:e.form.country_id,"onUpdate:modelValue":r[6]||(r[6]=o=>e.form.country_id=o),error:e.form.errors.country_id,class:"pr-6 pb-8 w-full lg:w-1/3",label:l.$t("Country")},{default:f(()=>[r[10]||(r[10]=n("option",{value:null},null,-1)),(a(!0),p(U,null,L(i.countries,o=>(a(),p("option",{key:o.id,value:o.id},b(o.name),9,I))),128))]),_:1},8,["modelValue","error","label"]),t(s,{modelValue:e.form.password,"onUpdate:modelValue":r[7]||(r[7]=o=>e.form.password=o),error:e.form.errors.password,class:"pb-8 pr-6 w-full lg:w-1/3",type:"password",autocomplete:"new-password",label:l.$t("Password")},null,8,["modelValue","error","label"]),t(g,{modelValue:e.form.photo,"onUpdate:modelValue":r[8]||(r[8]=o=>e.form.photo=o),error:e.form.errors.photo,class:"pb-8 pr-6 w-full lg:w-1/2",type:"file",accept:"image/*",label:l.$t("Photo")},null,8,["modelValue","error","label"])]),n("div",N,[t(y,{loading:e.form.processing,class:"btn-indigo",type:"submit"},{default:f(()=>[C(b(l.$t("create")),1)]),_:1},8,["loading"])])],32)])])}const Y=x(E,[["render",P]]);export{Y as default};
