1import{r as h,j as e,an as ee,aZ as se,b as j,T as P,B as T,I as a,q as ne,U as F,G as c,e as w,ah as R,a2 as G,z as N,ai as W,aj as H,ak as S,w as k,ac as $,aa as oe,L as re,ad as ie,dc as te,p as O,dE as ae,dF as le,dG as ce,dH as de,dv as me,H as xe,i as pe}from"./index-Dl9ZQv6B.js";import{u as ue}from"./use-tabs-Beb7uLdL.js";import{C as he}from"./custom-breadcrumbs-Ba_tMC9J.js";import{z as g,t as V,F as D}from"./form-provider-rWts3SmY.js";import{S as M,i as je,u as L,F as b,C as be}from"./fields-Di9-yUlB.js";import{c as ge,a as ye}from"./format-number-B9tUpbDI.js";import"./image-BLBFyWDA.js";import"./editor-CglOUxCT.js";import{s as B}from"./schema-helper-BRyqIIKE.js";import{C as v}from"./Card-Caz_0aqK.js";import{L as E}from"./LoadingButton-i5kkWm-Z.js";import{P as fe,a as we,b as Ce,F as ve,I as Pe,L as Se,T as Ae}from"./new-password-icon-A_6M1PaA.js";import{L as z}from"./label-Dr2dCdGT.js";import{A as Te,a as ke}from"./address-new-form-BIBsyo8t.js";import{D as U,a as Ie,b as Ne}from"./Dialog-Cfv3BYnl.js";import{T as Z}from"./TextField-CvzbL4Ow.js";import{I as A}from"./InputAdornment-CUh-BnDl.js";import{C as q}from"./CardHeader-B6ZKbGXq.js";import{P as Fe}from"./payment-new-card-form-BdVyxpq4.js";import{D as De}from"./DialogTitle-BAp1-__I.js";import{L as J}from"./ListItemText-DpxVB6bo.js";import{F as Le}from"./FormControlLabel-OYIvxmQw.js";import{T as Ee,a as qe}from"./Tabs-CwFzIEJe.js";import"./FormHelperText-BfUteBBa.js";import"./formControlState-Dq1zat_P.js";import"./Rating-TH9gEEqI.js";import"./visuallyHidden-Dan1xhjv.js";import"./Slider-BgbHarr4.js";import"./FormControl-Dg7b2c30.js";import"./utils-DoM3o7-Q.js";import"./FormLabel-Bmax70CE.js";import"./RadioGroup-CDoTuWUb.js";import"./FormGroup-Cbj3d5Dc.js";import"./index-OKA_SEiY.js";import"./countries-DSLisFCy.js";import"./Autocomplete-D1ABA98f.js";import"./Select-DCBu16wo.js";import"./Menu-Dft15SZH.js";import"./InputBase-Cdgc33BK.js";import"./Chip-P-44lzz7.js";import"./country-select-GichdVd0.js";import"./InputLabel-RwVw-k3n.js";import"./Checkbox-C1N37BUe.js";import"./upload-avatar-BP3Wx3yE.js";import"./DatePicker-BnInH-G2.js";import"./ListItem-BCchh-lL.js";import"./listItemButtonClasses-C9c-rUr6.js";import"./MobileDateTimePicker-S8KeHvoU.js";import"./index-DIQx7_jo.js";import"./CircularProgress-FjyU9b18.js";import"./KeyboardArrowRight-C0aw2OZ5.js";function Be({list:s,open:n,action:o,onClose:r,selected:m,onSelect:p,title:x="Address book"}){const[d,t]=h.useState(""),i=ze({inputData:s,query:d}),y=!i.length&&!!d,C=h.useCallback(u=>{t(u.target.value)},[]),f=h.useCallback(u=>{p(u),t(""),r()},[r,p]),I=e.jsx(ee,{sx:{p:.5,maxHeight:480},children:i.map(u=>e.jsxs(se,{onClick:()=>f(u),sx:{py:1,my:.5,px:1.5,gap:.5,width:1,borderRadius:1,display:"flex",flexDirection:"column",alignItems:"flex-start",...m(`${u.id}`)&&{bgcolor:"action.selected"}},children:[e.jsxs(j,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(P,{variant:"subtitle2",children:u.name}),u.primary&&e.jsx(z,{color:"info",children:"Default"})]}),u.company&&e.jsx(T,{sx:{color:"primary.main",typography:"caption"},children:u.company}),e.jsx(P,{variant:"body2",sx:{color:"text.secondary"},children:u.fullAddress}),u.phoneNumber&&e.jsx(P,{variant:"body2",sx:{color:"text.secondary"},children:u.phoneNumber})]},u.id))});return e.jsxs(U,{fullWidth:!0,maxWidth:"xs",open:n,onClose:r,children:[e.jsxs(j,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:3,pr:1.5},children:[e.jsxs(P,{variant:"h6",children:[" ",x," "]}),o&&o]}),e.jsx(j,{sx:{p:2,pt:0},children:e.jsx(Z,{value:d,onChange:C,placeholder:"Search...",InputProps:{startAdornment:e.jsx(A,{position:"start",children:e.jsx(a,{icon:"eva:search-fill",sx:{color:"text.disabled"}})})}})}),y?e.jsx(M,{query:d,sx:{px:3,pt:5,pb:10}}):I]})}function ze({inputData:s,query:n}){return n?s.filter(o=>o.name.toLowerCase().indexOf(n.toLowerCase())!==-1||o.fullAddress.toLowerCase().indexOf(n.toLowerCase())!==-1||`${o.company}`.toLowerCase().indexOf(n.toLowerCase())!==-1):s}const Ue=g.object({displayName:g.string().min(1,{message:"Name is required!"}),email:g.string().min(1,{message:"Email is required!"}).email({message:"Email must be a valid email address!"}),photoURL:B.file({message:{required_error:"Avatar is required!"}}),phoneNumber:B.phoneNumber({isValidPhoneNumber:je}),country:B.objectOrNull({message:{required_error:"Country is required!"}}),address:g.string().min(1,{message:"Address is required!"}),state:g.string().min(1,{message:"State is required!"}),city:g.string().min(1,{message:"City is required!"}),zipCode:g.string().min(1,{message:"Zip code is required!"}),about:g.string().min(1,{message:"About is required!"}),isPublic:g.boolean()});function _e(){const{user:s}=ne(),n={displayName:(s==null?void 0:s.displayName)||"",email:(s==null?void 0:s.email)||"",photoURL:(s==null?void 0:s.photoURL)||null,phoneNumber:(s==null?void 0:s.phoneNumber)||"",country:(s==null?void 0:s.country)||"",address:(s==null?void 0:s.address)||"",state:(s==null?void 0:s.state)||"",city:(s==null?void 0:s.city)||"",zipCode:(s==null?void 0:s.zipCode)||"",about:(s==null?void 0:s.about)||"",isPublic:(s==null?void 0:s.isPublic)||!1},o=L({mode:"all",resolver:V(Ue),defaultValues:n}),{handleSubmit:r,formState:{isSubmitting:m}}=o,p=r(async x=>{try{await new Promise(d=>setTimeout(d,500)),F.success("Update success!"),console.info("DATA",x)}catch(d){console.error(d)}});return e.jsx(D,{methods:o,onSubmit:p,children:e.jsxs(c,{container:!0,spacing:3,children:[e.jsx(c,{xs:12,md:4,children:e.jsxs(v,{sx:{pt:10,pb:5,px:3,textAlign:"center"},children:[e.jsx(b.UploadAvatar,{name:"photoURL",maxSize:3145728,helperText:e.jsxs(P,{variant:"caption",sx:{mt:3,mx:"auto",display:"block",textAlign:"center",color:"text.disabled"},children:["Allowed *.jpeg, *.jpg, *.png, *.gif",e.jsx("br",{})," max size of ",ge(3145728)]})}),e.jsx(b.Switch,{name:"isPublic",labelPlacement:"start",label:"Public profile",sx:{mt:5}}),e.jsx(w,{variant:"soft",color:"error",sx:{mt:3},children:"Delete user"})]})}),e.jsx(c,{xs:12,md:8,children:e.jsxs(v,{sx:{p:3},children:[e.jsxs(T,{rowGap:3,columnGap:2,display:"grid",gridTemplateColumns:{xs:"repeat(1, 1fr)",sm:"repeat(2, 1fr)"},children:[e.jsx(b.Text,{name:"displayName",label:"Name"}),e.jsx(b.Text,{name:"email",label:"Email address"}),e.jsx(b.Phone,{name:"phoneNumber",label:"Phone number"}),e.jsx(b.Text,{name:"address",label:"Address"}),e.jsx(b.CountrySelect,{name:"country",label:"Country",placeholder:"Choose a country"}),e.jsx(b.Text,{name:"state",label:"State/region"}),e.jsx(b.Text,{name:"city",label:"City"}),e.jsx(b.Text,{name:"zipCode",label:"Zip/code"})]}),e.jsxs(j,{spacing:3,alignItems:"flex-end",sx:{mt:3},children:[e.jsx(b.Text,{name:"about",multiline:!0,rows:4,label:"About"}),e.jsx(E,{type:"submit",variant:"contained",loading:m,children:"Save changes"})]})]})})]})})}function Y({card:s,sx:n,...o}){const r=R();return e.jsxs(e.Fragment,{children:[e.jsxs(G,{variant:"outlined",sx:{p:2.5,width:1,position:"relative",...n},...o,children:[e.jsxs(T,{gap:1,display:"flex",alignItems:"center",sx:{mb:1},children:[e.jsx(a,{width:36,icon:s.cardType==="visa"&&"logos:visa"||"logos:mastercard"}),s.primary&&e.jsx(z,{color:"info",children:"Default"})]}),e.jsx(P,{variant:"subtitle2",children:s.cardNumber}),e.jsx(N,{onClick:r.onOpen,sx:{top:8,right:8,position:"absolute"},children:e.jsx(a,{icon:"eva:more-vertical-fill"})})]}),e.jsx(W,{open:r.open,anchorEl:r.anchorEl,onClose:r.onClose,children:e.jsxs(H,{
1children:[e.jsxs(S,{onClick:r.onClose,children:[e.jsx(a,{icon:"eva:star-fill"}),"Set as primary"]}),e.jsxs(S,{onClick:r.onClose,children:[e.jsx(a,{icon:"solar:pen-bold"}),"Edit"]}),e.jsxs(S,{onClick:r.onClose,sx:{color:"error.main"},children:[e.jsx(a,{icon:"solar:trash-bin-trash-bold"}),"Delete"]})]})})]})}function Oe({open:s,list:n,onClose:o,selected:r,onSelect:m}){const[p,x]=h.useState(""),t=!Re({inputData:n,query:p}).length&&!!p,i=h.useCallback(f=>{x(f.target.value)},[]),y=h.useCallback(f=>{m(f),x(""),o()},[o,m]),C=e.jsx(j,{spacing:2.5,sx:{p:3},children:n.map(f=>e.jsx(Y,{card:f,onClick:()=>y(f),sx:{cursor:"pointer",...r(f.id)&&{boxShadow:I=>`0 0 0 2px ${I.vars.palette.text.primary}`}}},f.id))});return e.jsxs(U,{fullWidth:!0,maxWidth:"xs",open:s,onClose:o,children:[e.jsxs(j,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:3,pr:1.5},children:[e.jsx(P,{variant:"h6",children:" Cards "}),e.jsx(w,{size:"small",startIcon:e.jsx(a,{icon:"mingcute:add-line"}),sx:{alignSelf:"flex-end"},children:"New"})]}),e.jsx(j,{sx:{px:3},children:e.jsx(Z,{value:p,onChange:i,placeholder:"Search...",InputProps:{startAdornment:e.jsx(A,{position:"start",children:e.jsx(a,{icon:"eva:search-fill",sx:{color:"text.disabled"}})})}})}),t?e.jsx(M,{query:p,sx:{px:3,pt:5,pb:10}}):C]})}function Re({inputData:s,query:n}){return n?s.filter(o=>o.cardNumber.toLowerCase().indexOf(n.toLowerCase())!==-1):s}function Ge({cardList:s,addressBook:n,plans:o}){const r=k(),m=k(),p=n.filter(l=>l.primary)[0],x=s.filter(l=>l.primary)[0],[d,t]=h.useState(""),[i,y]=h.useState(p),[C,f]=h.useState(x),I=h.useCallback(l=>{o.filter(X=>X.primary)[0].subscription!==l&&t(l)},[o]),u=h.useCallback(l=>{y(l)},[]),K=h.useCallback(l=>{f(l)},[]),Q=o.map(l=>e.jsx(c,{xs:12,md:4,children:e.jsxs(G,{variant:"outlined",onClick:()=>I(l.subscription),sx:{p:2.5,cursor:"pointer",position:"relative",...l.primary&&{opacity:.48,cursor:"default"},...l.subscription===d&&{boxShadow:_=>`0 0 0 2px ${_.vars.palette.text.primary}`}},children:[l.primary&&e.jsx(z,{color:"info",startIcon:e.jsx(a,{icon:"eva:star-fill"}),sx:{position:"absolute",top:8,right:8},children:"Current"}),l.subscription==="basic"&&e.jsx(fe,{}),l.subscription==="starter"&&e.jsx(we,{}),l.subscription==="premium"&&e.jsx(Ce,{}),e.jsx(T,{sx:{typography:"subtitle2",mt:2,mb:.5,textTransform:"capitalize"},children:l.subscription}),e.jsxs(j,{direction:"row",alignItems:"center",sx:{typography:"h4"},children:[l.price||"Free",!!l.price&&e.jsx(T,{component:"span",sx:{typography:"body2",color:"text.disabled",ml:.5},children:"/mo"})]})]})},l.subscription));return e.jsxs(e.Fragment,{children:[e.jsxs(v,{children:[e.jsx(q,{title:"Plan"}),e.jsx(c,{container:!0,spacing:2,sx:{p:3},children:Q}),e.jsxs(j,{spacing:2,sx:{p:3,pt:0,typography:"body2"},children:[e.jsxs(c,{container:!0,spacing:{xs:.5,md:2},children:[e.jsx(c,{xs:12,md:4,sx:{color:"text.secondary"},children:"Plan"}),e.jsx(c,{xs:12,md:8,sx:{typography:"subtitle2",textTransform:"capitalize"},children:d||"-"})]}),e.jsxs(c,{container:!0,spacing:{xs:.5,md:2},children:[e.jsx(c,{xs:12,md:4,sx:{color:"text.secondary"},children:"Billing name"}),e.jsx(c,{xs:12,md:8,children:e.jsx(w,{onClick:r.onTrue,endIcon:e.jsx(a,{width:16,icon:"eva:arrow-ios-downward-fill"}),sx:{typography:"subtitle2",p:0,borderRadius:0},children:i==null?void 0:i.name})})]}),e.jsxs(c,{container:!0,spacing:{xs:.5,md:2},children:[e.jsx(c,{xs:12,md:4,sx:{color:"text.secondary"},children:"Billing address"}),e.jsx(c,{xs:12,md:8,sx:{color:"text.secondary"},children:i==null?void 0:i.fullAddress})]}),e.jsxs(c,{container:!0,spacing:{xs:.5,md:2},children:[e.jsx(c,{xs:12,md:4,sx:{color:"text.secondary"},children:"Billing phone number"}),e.jsx(c,{xs:12,md:8,sx:{color:"text.secondary"},children:i==null?void 0:i.phoneNumber})]}),e.jsxs(c,{container:!0,spacing:{xs:.5,md:2},children:[e.jsx(c,{xs:12,md:4,sx:{color:"text.secondary"},children:"Payment method"}),e.jsx(c,{xs:12,md:8,children:e.jsx(w,{onClick:m.onTrue,endIcon:e.jsx(a,{width:16,icon:"eva:arrow-ios-downward-fill"}),sx:{typography:"subtitle2",p:0,borderRadius:0},children:C==null?void 0:C.cardNumber})})]})]}),e.jsx($,{sx:{borderStyle:"dashed"}}),e.jsxs(j,{spacing:1.5,direction:"row",justifyContent:"flex-end",sx:{p:3},children:[e.jsx(w,{variant:"outlined",children:"Cancel plan"}),e.jsx(w,{variant:"contained",children:"Upgrade plan"})]})]}),e.jsx(Oe,{list:s,open:m.value,onClose:m.onFalse,selected:l=>(C==null?void 0:C.id)===l,onSelect:K}),e.jsx(Be,{list:n,open:r.value,onClose:r.onFalse,selected:l=>(i==null?void 0:i.id)===l,onSelect:u,action:e.jsx(w,{size:"small",startIcon:e.jsx(a,{icon:"mingcute:add-line"}
1),sx:{alignSelf:"flex-end"},children:"New"})})]})}function We({cards:s,sx:n,...o}){const r=k();return e.jsxs(e.Fragment,{children:[e.jsxs(v,{sx:{my:3,...n},...o,children:[e.jsx(q,{title:"Payment method",action:e.jsx(w,{size:"small",color:"primary",startIcon:e.jsx(a,{icon:"mingcute:add-line"}),onClick:r.onTrue,children:"New card"})}),e.jsx(T,{rowGap:2.5,columnGap:2,display:"grid",gridTemplateColumns:{xs:"repeat(1, 1fr)",md:"repeat(2, 1fr)"},sx:{p:3},children:s.map(m=>e.jsx(Y,{card:m},m.id))})]}),e.jsxs(U,{fullWidth:!0,maxWidth:"xs",open:r.value,onClose:r.onFalse,children:[e.jsx(De,{children:" Add new card "}),e.jsx(Ie,{sx:{overflow:"unset"},children:e.jsx(Fe,{})}),e.jsxs(Ne,{children:[e.jsx(w,{color:"inherit",variant:"outlined",onClick:r.onFalse,children:"Cancel"}),e.jsx(w,{color:"inherit",variant:"contained",onClick:r.onFalse,children:"Add"})]})]})]})}function He({invoices:s}){const n=k();return e.jsxs(v,{children:[e.jsx(q,{title:"Invoice history"}),e.jsxs(j,{spacing:1.5,sx:{px:3,pt:3},children:[(n.value?s:s.slice(0,8)).map(o=>e.jsxs(j,{direction:"row",alignItems:"center",children:[e.jsx(J,{primary:o.invoiceNumber,secondary:oe(o.createdAt),primaryTypographyProps:{typography:"body2"},secondaryTypographyProps:{mt:.5,component:"span",typography:"caption",color:"text.disabled"}}),e.jsx(P,{variant:"body2",sx:{textAlign:"right",mr:5},children:ye(o.price)}),e.jsx(re,{color:"inherit",underline:"always",variant:"body2",href:"#",children:"PDF"})]},o.id)),e.jsx($,{sx:{borderStyle:"dashed"}})]}),e.jsx(j,{alignItems:"flex-start",sx:{p:2},children:e.jsxs(w,{size:"small",color:"inherit",startIcon:e.jsx(a,{width:16,icon:n.value?"eva:arrow-ios-upward-fill":"eva:arrow-ios-downward-fill",sx:{mr:-.5}}),onClick:n.onToggle,children:["Show ",n.value?"less":"more"]})})]})}function $e({addressBook:s}){const[n,o]=h.useState(""),r=R(),m=k(),p=h.useCallback(t=>{console.info("ADDRESS",t)},[]),x=h.useCallback((t,i)=>{r.onOpen(t),o(i)},[r]),d=h.useCallback(()=>{r.onClose(),o("")},[r]);return e.jsxs(e.Fragment,{children:[e.jsxs(v,{children:[e.jsx(q,{title:"Address book",action:e.jsx(w,{size:"small",color:"primary",startIcon:e.jsx(a,{icon:"mingcute:add-line"}),onClick:m.onTrue,children:"Address"})}),e.jsx(j,{spacing:2.5,sx:{p:3},children:s.map(t=>e.jsx(Te,{variant:"outlined",address:t,action:e.jsx(N,{onClick:i=>{x(i,`${t.id}`)},sx:{position:"absolute",top:8,right:8},children:e.jsx(a,{icon:"eva:more-vertical-fill"})}),sx:{p:2.5,borderRadius:1}},t.id))})]}),e.jsx(W,{open:r.open,anchorEl:r.anchorEl,onClose:d,children:e.jsxs(H,{children:[e.jsxs(S,{onClick:()=>{d(),console.info("SET AS PRIMARY",n)},children:[e.jsx(a,{icon:"eva:star-fill"}),"Set as primary"]}),e.jsxs(S,{onClick:()=>{d(),console.info("EDIT",n)},children:[e.jsx(a,{icon:"solar:pen-bold"}),"Edit"]}),e.jsxs(S,{onClick:()=>{d(),console.info("DELETE",n)},sx:{color:"error.main"},children:[e.jsx(a,{icon:"solar:trash-bin-trash-bold"}),"Delete"]})]})}),e.jsx(ke,{open:m.value,onClose:m.onFalse,onCreate:p})]})}function Ve({cards:s,plans:n,invoices:o,addressBook:r}){return e.jsxs(c,{container:!0,spacing:5,disableEqualOverflow:!0,children:[e.jsxs(c,{xs:12,md:8,children:[e.jsx(Ge,{plans:n,cardList:s,addressBook:r}),e.jsx(We,{cards:s}),e.jsx($e,{addressBook:r})]}),e.jsx(c,{xs:12,md:4,children:e.jsx(He,{invoices:o})})]})}function Me({socialLinks:s}){const n={facebook:s.facebook||"",instagram:s.instagram||"",linkedin:s.linkedin||"",twitter:s.twitter||""},o=L({defaultValues:n}),{handleSubmit:r,formState:{isSubmitting:m}}=o,p=r(async x=>{try{await new Promise(d=>setTimeout(d,500)),F.success("Update success!"),console.info("DATA",x)}catch(d){console.error(d)}});return e.jsx(D,{methods:o,onSubmit:p,children:e.jsxs(v,{sx:{p:3,gap:3,display:"flex",flexDirection:"column"},children:[Object.keys(s).map(x=>e.jsx(b.Text,{name:x,InputProps:{startAdornment:e.jsxs(A,{position:"start",children:[x==="facebook"&&e.jsx(ve,{width:24}),x==="instagram"&&e.jsx(Pe,{width:24}),x==="linkedin"&&e.jsx(Se,{width:24}),x==="twitter"&&e.jsx(Ae,{width:24,sx:{color:"text.primary"}})]})}},x)),e.jsx(E,{type:"submit",variant:"contained",loading:m,sx:{ml:"auto"},children:"Save changes"})]})})}const Ze=[{subheader:"Activity",caption:"Donec mi odio, faucibus at, scelerisque quis",items:[{id:"activity_comments",label:"Email me when someone comments onmy article"},{id:"activity_answers",label:"Email me when someone answers on my form"},{id:"activityFollows",label:"Email me hen someone follows me"}]},{subheader:"Application",caption:"Donec mi odio, faucibus at, scelerisque quis",items:[{id:"application_news",label:"News and announcements"},{id:"application_product",label:"Weekly product updates"},{id:"application_blog",label:"Weekly blog digest"}]}];function Je(){const s=L({defaultValues:{selected:["activity_comments","application_product"]}}),{watch:n,control:o,handleSubmit:r,formState:{isSubmitting:m}}=s,p=n(),x=r(async t=>{try{await new Promise(i=>setTimeout(i,500)),F.success("Update success!"),console.info("DATA",t)}catch(i){console.error(i)}}),d=(t,i)=>t.includes(i)?t.filter(y=>y!==i):[...t,i];return e.jsx(D,{methods:s,onSubmit:x,children:e.jsxs(v,{sx:{p:3,gap:3,dis
1play:"flex",flexDirection:"column"},children:[Ze.map(t=>e.jsxs(c,{container:!0,spacing:3,children:[e.jsx(c,{xs:12,md:4,children:e.jsx(J,{primary:t.subheader,secondary:t.caption,primaryTypographyProps:{typography:"h6",mb:.5},secondaryTypographyProps:{component:"span"}})}),e.jsx(c,{xs:12,md:8,children:e.jsx(j,{spacing:1,sx:{p:3,borderRadius:2,bgcolor:"background.neutral"},children:e.jsx(be,{name:"selected",control:o,render:({field:i})=>e.jsx(e.Fragment,{children:t.items.map(y=>e.jsx(Le,{label:y.label,labelPlacement:"start",control:e.jsx(ie,{checked:i.value.includes(y.id),onChange:()=>i.onChange(d(p.selected,y.id))}),sx:{m:0,width:1,justifyContent:"space-between"}},y.id))})})})})]},t.subheader)),e.jsx(E,{type:"submit",variant:"contained",loading:m,sx:{ml:"auto"},children:"Save changes"})]})})}const Ye=g.object({oldPassword:g.string().min(1,{message:"Password is required!"}).min(6,{message:"Password must be at least 6 characters!"}),newPassword:g.string().min(1,{message:"New password is required!"}),confirmNewPassword:g.string().min(1,{message:"Confirm password is required!"})}).refine(s=>s.oldPassword!==s.newPassword,{message:"New password must be different than old password",path:["newPassword"]}).refine(s=>s.newPassword===s.confirmNewPassword,{message:"Passwords do not match!",path:["confirmNewPassword"]});function Ke(){const s=k(),n={oldPassword:"",newPassword:"",confirmNewPassword:""},o=L({mode:"all",resolver:V(Ye),defaultValues:n}),{reset:r,handleSubmit:m,formState:{isSubmitting:p}}=o,x=m(async d=>{try{await new Promise(t=>setTimeout(t,500)),r(),F.success("Update success!"),console.info("DATA",d)}catch(t){console.error(t)}});return e.jsx(D,{methods:o,onSubmit:x,children:e.jsxs(v,{sx:{p:3,gap:3,display:"flex",flexDirection:"column"},children:[e.jsx(b.Text,{name:"oldPassword",type:s.value?"text":"password",label:"Old password",InputProps:{endAdornment:e.jsx(A,{position:"end",children:e.jsx(N,{onClick:s.onToggle,edge:"end",children:e.jsx(a,{icon:s.value?"solar:eye-bold":"solar:eye-closed-bold"})})})}}),e.jsx(b.Text,{name:"newPassword",label:"New password",type:s.value?"text":"password",InputProps:{endAdornment:e.jsx(A,{position:"end",children:e.jsx(N,{onClick:s.onToggle,edge:"end",children:e.jsx(a,{icon:s.value?"solar:eye-bold":"solar:eye-closed-bold"})})})},helperText:e.jsxs(j,{component:"span",direction:"row",alignItems:"center",children:[e.jsx(a,{icon:"eva:info-fill",width:16,sx:{mr:.5}})," Password must be minimum 6+"]})}),e.jsx(b.Text,{name:"confirmNewPassword",type:s.value?"text":"password",label:"Confirm new password",InputProps:{endAdornment:e.jsx(A,{position:"end",children:e.jsx(N,{onClick:s.onToggle,edge:"end",children:e.jsx(a,{icon:s.value?"solar:eye-bold":"solar:eye-closed-bold"})})})}}),e.jsx(E,{type:"submit",variant:"contained",loading:p,sx:{ml:"auto"},children:"Save changes"})]})})}const Qe=[{value:"general",label:"General",icon:e.jsx(a,{icon:"solar:user-id-bold",width:24})},{value:"billing",label:"Billing",icon:e.jsx(a,{icon:"solar:bill-list-bold",width:24})},{value:"notifications",label:"Notifications",icon:e.jsx(a,{icon:"solar:bell-bing-bold",width:24})},{value:"social",label:"Social links",icon:e.jsx(a,{icon:"solar:share-bold",width:24})},{value:"security",label:"Security",icon:e.jsx(a,{icon:"ic:round-vpn-key",width:24})}];function Xe(){const s=ue("general");return e.jsxs(te,{children:[e.jsx(he,{heading:"Account",links:[{name:"Dashboard",href:O.dashboard.root},{name:"User",href:O.dashboard.user.root},{name:"Account"}],sx:{mb:{xs:3,md:5}}}),e.jsx(Ee,{value:s.value,onChange:s.onChange,sx:{mb:{xs:3,md:5}},children:Qe.map(n=>e.jsx(qe,{label:n.label,icon:n.icon,value:n.value},n.value))}),s.value==="general"&&e.jsx(_e,{}),s.value==="billing"&&e.jsx(Ve,{plans:ae,cards:le,invoices:ce,addressBook:de}),s.value==="notifications"&&e.jsx(Je,{}),s.value==="social"&&e.jsx(Me,{socialLinks:me.socialLinks}),s.value==="security"&&e.jsx(Ke,{})]})}const es={title:`Account settings | Dashboard - ${pe.appName}`};function Qs(){return e.jsxs(e.Fragment,{children:[e.jsx(xe,{children:e.jsxs("title",{children:[" ",es.title]})}),e.jsx(Xe,{})]})}
1export{Qs 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.