Your IP : 216.73.217.77


Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/
Upload File :
Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ProfileModal-09ae28bb.js

import{r as N,T as y,o as g,i as O,g as l,f as r,u as e,a as s,t as p,n as u,h as C,c as b}from"./app-f1493ab2.js";import{_ as f}from"./FormInput-b3450213.js";import{x as Z,I as F,y as S,S as T,g as z}from"./tabs-80627b62.js";import{h as A,G as D,U as E,S as G}from"./transition-f32a8133.js";const I={class:"fixed inset-0 overflow-y-auto"},L={class:"flex min-h-full items-center justify-center p-4 text-center"},P={class:"text-base text-xl leading-7 text-gray-900"},J={class:"mb-4 text-sm leading-6 text-gray-600"},q={class:"mt-5 grid grid-cols-1 gap-x-6 gap-y-4"},H={class:"mt-4 flex"},K=["disabled"],Q={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},R={key:1},W={class:"mt-5 grid grid-cols-1 gap-x-6 gap-y-4"},X={class:"mt-4 flex"},Y=["disabled"],ee={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},te={key:1},le={__name:"ProfileModal",props:{user:Object,organization:Object,role:String,isOpen:Boolean},emits:["close"],setup(w,{emit:U}){var x,h,_,V,$,k;const m=w,n=N(!1),c=(a,t)=>{if(a){const o=JSON.parse(a);return(o==null?void 0:o[t])??null}else return null},i=y({first_name:m.user.first_name,last_name:m.user.last_name,email:m.user.email});y({organization_name:(x=m.organization)==null?void 0:x.name,address:c((h=m.organization)==null?void 0:h.address,"street"),city:c((_=m.organization)==null?void 0:_.address,"city"),state:c((V=m.organization)==null?void 0:V.address,"state"),zip:c(($=m.organization)==null?void 0:$.address,"zip"),country:c((k=m.organization)==null?void 0:k.address,"country")});const d=y({old_password:null,password:null,password_confirmation:null}),M=async a=>{n.value=!0,i.put("./profile/",{preserveScroll:!0,onFinish:()=>{n.value=!1}})},j=async a=>{n.value=!0,d.put("./profile/password",{preserveScroll:!0,onFinish:()=>{n.value=!1}})},B=U;function v(){B("close",!0)}return(a,t)=>(g(),O(e(G),{appear:"",show:w.isOpen,as:"template"},{default:l(()=>[r(e(E),{as:"div",onClose:v,class:"relative z-10"},{default:l(()=>[r(e(A),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0","enter-to":"opacity-100",leave:"duration-200 ease-in","leave-from":"opacity-100","leave-to":"opacity-0"},{default:l(()=>t[8]||(t[8]=[s("div",{class:"fixed inset-0 bg-black bg-opacity-25"},null,-1)])),_:1}),s("div",I,[s("div",L,[r(e(A),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0 scale-95","enter-to":"opacity-100 scale-100",leave:"duration-200 ease-in","leave-from":"opacity-100 scale-100","leave-to":"opacity-0 scale-95"},{default:l(()=>[r(e(D),{class:"w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all min-w-[20em]"},{default:l(()=>[s("div",null,[s("h2",P,p(a.$t("Personal information")),1),s("p",J,p(a.$t("Update your account details and credentials")),1),r(e(Z),null,{default:l(()=>[r(e(F),{class:"flex space-x-1 rounded-xl bg-primary p-1"},{default:l(()=>[r(e(S),{as:"template"},{default:l(({selected:o})=>[s("button",{class:u(["w-full rounded-lg py-2.5 text-sm leading-5 text-[#ffffffcc]","ring-white focus:outline-none",o?"bg-white text-black shadow":"hover:bg-white hover:text-black"])},p(a.$t("My profile")),3)]),_:1}),r(e(S),{as:"template"},{default:l(({selected:o})=>[s("button",{class:u(["w-full rounded-lg py-2.5 text-sm leading-5 text-[#ffffffcc]","ring-white focus:outline-none",o?"bg-white text-black shadow":"hover:bg-white hover:text-black"])},p(a.$t("Security")),3)]),_:1})]),_:1}),r(e(T),{class:"mt-2"},{default:l(()=>[r(e(z),null,{default:l(()=>[s("div",q,[s("form",{onSubmit:t[3]||(t[3]=C(o=>M(),["prevent"])),class:"grid gap-x-6 gap-y-4 sm:grid-cols-6"},[r(f,{modelValue:e(i).first_name,"onUpdate:modelValue":t[0]||(t[0]=o=>e(i).first_name=o),name:a.$t("First name"),error:e(i).errors.first_name,type:"text",class:u("sm:col-span-3")},null,8,["modelValue","name","error"]),r(f,{modelValue:e(i).last_name,"onUpdate:modelValue":t[1]||(t[1]=o=>e(i).last_name=o),name:a.$t("Last name"),error:e(i).errors.last_name,type:"text",class:u("sm:col-span-3")},null,8,["modelValue","name","error"]),r(f,{modelValue:e(i).email,"onUpdate:modelValue":t[2]||(t[2]=o=>e(i).email=o),name:a.$t("Email"),error:e(i).errors.email,type:"text",class:u("sm:col-span-6")},null,8,["modelValue","name","error"]),s("div",H,[s("button",{type:"button",onClick:v,class:"inline-flex justify-center rounded-md border border-transparent bg-slate-50 px-4 py-2 text-sm text-slate-500 hover:bg-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 mr-4"},p(a.$t("Cancel")),1),s("button",{class:u(["inline-flex justify-center rounded-md border border-transparent bg-primary px-4 py-2 text-sm text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",{"opacity-50":n.value}]),disabled:n.value},[n.value?(g(),b("svg",Q,t[9]||(t[9]=[s("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"},null,-1),s("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[s("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1)]))):(g(),b("span",R,p(a.$t("Save")),1))],10,K)])],32)])]),_:1}),r(e(z),null,{default:l(()=>[s("div",W,[s("form",{onSubmit:t[7]||(t[7]=C(o=>j(),["prevent"])),class:"grid gap-x-6 gap-y-4 sm:grid-cols-6"},[r(f,{modelValue:e(d).old_password,"onUpdate:modelValue":t[4]||(t[4]=o=>e(d).old_password=o),name:a.$t("Old password"),error:e(d).errors.old_password,type:"password",class:u("sm:col-span-6")},null,8,["modelValue","name","error"]),r(f,{modelValue:e(d).password,"onUpdate:modelValue":t[5]||(t[5]=o=>e(d).password=o),name:a.$t("New password"),error:e(d).errors.password,type:"password",class:u("sm:col-span-6")},null,8,["modelValue","name","error"]),r(f,{modelValue:e(d).password_confirmation,"onUpdate:modelValue":t[6]||(t[6]=o=>e(d).password_confirmation=o),name:a.$t("Confirm password"),error:e(d).errors.password_confirmation,type:"password",class:u("sm:col-span-6")},null,8,["modelValue","name","error"]),s("div",X,[s("button",{type:"button",onClick:v,class:"inline-flex justify-center rounded-md border border-transparent bg-slate-50 px-4 py-2 text-sm text-slate-500 hover:bg-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 mr-4"},p(a.$t("Cancel")),1),s("button",{class:u(["inline-flex justify-center rounded-md border border-transparent bg-primary px-4 py-2 text-sm text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",{"opacity-50":n.value}]),disabled:n.value},[n.value?(g(),b("svg",ee,t[10]||(t[10]=[s("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"},null,-1),s("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[s("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1)]))):(g(),b("span",te,p(a.$t("Save")),1))],10,Y)])],32)])]),_:1})]),_:1})]),_:1})])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]))}};export{le as _};