import{A as g,T as w,h as y,c as d,a as l,b as e,t as i,w as V,u as a,d as u,v as p,F as k,k as c,j as U,e as C,g as N,o as _}from"./app-13978987.js";import{_ as m}from"./InputFieldError-52549d23.js";import{_ as x}from"./UserLayout-6a50516d.js";import{_ as L}from"./PageHeader-8c638686.js";import{_ as P}from"./SpinnerBtn-899a94c2.js";import"./dropdown-45d66330.js";const $={class:"container flex-grow p-4 sm:p-6"},j={class:"space-y-6"},A={class:"card mx-auto max-w-3xl p-5"},B={class:"mb-4"},E={class:"flex items-center gap-3"},S=["src"],T={class:"label mb-1"},D={class:"label mb-1"},F={class:"label mb-1"},I={class:"label mb-1"},M={class:"label mb-1"},O={class:"mt-3 text-sm"},R=N({layout:x}),J=Object.assign(R,{__name:"AccountSettings",props:["user"],setup(b){const o=b,f=g(()=>s.avatar?URL.createObjectURL(s.avatar):o.user.avatar?o.user.avatar:"https://ui-avatars.com/api/?name="+o.user.name),s=w({avatar:null,name:o.user.name,email:o.user.email,phone:o.user.phone,current_password:"",_method:"put"}),h=()=>{s.post(route("user.account-settings.update"))};return(t,r)=>{const v=y("Link");return _(),d("main",$,[l(L),e("div",j,[e("div",A,[e("h4",B,i(t.trans("Edit Profile")),1),e("form",{onSubmit:V(h,["prevent"]),class:"space-y-1"},[e("div",E,[e("img",{src:f.value,class:"h-20 w-20 rounded-full border border-gray-300"},null,8,S),e("div",null,[e("label",T,i(t.trans("Avatar")),1),e("input",{class:"input",type:"file",onInput:r[0]||(r[0]=n=>a(s).avatar=n.target.files[0])},null,32),l(m,{message:a(s).errors.avatar},null,8,["message"])])]),e("div",null,[e("label",D,i(t.trans("Name")),1),u(e("input",{class:"input",type:"text","onUpdate:modelValue":r[1]||(r[1]=n=>a(s).name=n),placeholder:"Zubayer"},null,512),[[p,a(s).name]]),l(m,{message:a(s).errors.name},null,8,["message"])]),e("div",null,[e("label",F,i(t.trans("Phone Number")),1),u(e("input",{class:"input",type:"tel","onUpdate:modelValue":r[2]||(r[2]=n=>a(s).phone=n),placeholder:"+810 989 989 989"},null,512),[[p,a(s).phone]]),l(m,{message:a(s).errors.phone},null,8,["message"])]),!o.user.provider&&!o.user.provider_id?(_(),d(k,{key:0},[e("div",null,[e("label",I,i(t.trans("Email")),1),u(e("input",{class:"input",type:"email","onUpdate:modelValue":r[3]||(r[3]=n=>a(s).email=n),placeholder:"zubayerhasan@gmal.com"},null,512),[[p,a(s).email]]),l(m,{message:a(s).errors.email},null,8,["message"])]),e("div",null,[e("label",M,i(t.trans("Current Password")),1),u(e("input",{class:"input",type:"password","onUpdate:modelValue":r[4]||(r[4]=n=>a(s).current_password=n),placeholder:"enter your current password"},null,512),[[p,a(s).current_password]]),l(m,{message:a(s).errors.current_password},null,8,["message"]),e("div",O,[c(i(t.trans("Want to change the password?"))+" ",1),l(v,{href:t.route("user.change-password"),class:"font-medium text-primary-800"},{default:U(()=>[c(i(t.trans("Click here")),1)]),_:1},8,["href"])])])],64)):C("",!0),l(P,{type:"submit",processing:a(s).processing,class:"btn btn-primary mb-4 mt-6","btn-text":t.trans("Update Information")},null,8,["processing","btn-text"])],32)])])])}}});export{J as default};
