import{T as _,c as g,o as f,d as t,b as s,u as o}from"./app-fEKA3BkQ.js";import{_ as v}from"./SpinnerBtn-BezRkGQj.js";import{_ as V}from"./UserLayout-D_lxcpvH.js";import{_ as p}from"./InputField-C_K5Mgww.js";import{_ as b}from"./AssetInput-EWE_Aw8o.js";import{_ as u}from"./MultiSelect-D4amtqCA.js";import"./assetStore-BSVLrDIW.js";import"./PageHeader-DmRLoM5E.js";import"./ValidationErrors-B24rcOPH.js";const h={class:"card card-body mx-auto max-w-2xl"},x={class:"space-y-2"},M={class:"mb-2 grid grid-cols-3 place-items-end gap-3"},y={class:"flex flex-col gap-2"},C={class:"mt-2 flex justify-end"},A=Object.assign({layout:V},{__name:"Create",props:["groups","dialCodes"],setup(r){const e=_({name:"",picture:"",group_ids:[],dial_code:"+880",phone:""}),c=()=>{e.post(route("user.whatsapp.customers.store"))};return(U,a)=>{var d,i,n,m;return f(),g("div",h,[t("div",x,[s(p,{label:"Name",modelValue:o(e).name,"onUpdate:modelValue":a[0]||(a[0]=l=>o(e).name=l),placeholder:"Enter customer full name",validationMessage:(d=o(e).errors)==null?void 0:d.name},null,8,["modelValue","validationMessage"]),t("div",M,[s(u,{mode:"single","close-on-select":!1,searchable:!0,label:"Whatsapp Number","input-label":"name",modelValue:o(e).dial_code,"onUpdate:modelValue":a[1]||(a[1]=l=>o(e).dial_code=l),valueProp:"id",placeholder:"Dial Code",validationMessage:(i=o(e).errors)==null?void 0:i.dial_code,options:r.dialCodes},null,8,["modelValue","validationMessage","options"]),s(p,{classes:"col-span-2 ",type:"tel",modelValue:o(e).phone,"onUpdate:modelValue":a[2]||(a[2]=l=>o(e).phone=l),placeholder:"enter customer number (without country code)",validationMessage:(n=o(e).errors)==null?void 0:n.phone},null,8,["modelValue","validationMessage"])]),s(u,{label:"Groups",modelValue:o(e).group_ids,"onUpdate:modelValue":a[3]||(a[3]=l=>o(e).group_ids=l),placeholder:"Select groups",validationMessage:(m=o(e).errors)==null?void 0:m.group_ids,options:r.groups,valueProp:"value"},null,8,["modelValue","validationMessage","options"]),t("div",y,[s(b,{label:"Profile Image (Avatar)",modelValue:o(e).picture,"onUpdate:modelValue":a[4]||(a[4]=l=>o(e).picture=l)},null,8,["modelValue"])])]),t("div",C,[s(v,{onClick:c,processing:o(e).processing,"btn-text":"Create"},null,8,["processing"])])])}}});export{A as default};
