1import{j as e}from"./vendor-react-B-kF5cAy.js";import{a7 as u,X as p,B as c,z as h,J as g}from"./index-CzHRsatk.js";import{M as b}from"./main-page-header-CU3G6WfT.js";import{u as j,S as x,i as f}from"./switch-Dxg9Lpwp.js";import{P as v}from"./page-shell-FL8muQ5p.js";import{F as P,a as S,b as t,c as F,d as o,e as y,f as E,g as C}from"./field-BEP_Vwyp.js";import{I as N}from"./input-DvOaFAIG.js";import{u as R}from"./use-hydration-stable-query-mUMcYLPT.js";import{a as B}from"./app-i18n-DUL5iWur.js";import"./vendor-motion-Cc1CmEAp.js";import"./vendor-utils-Ct12j0u0.js";import"./vendor-zod-BdcIrOrR.js";import"./workspace-core-DG8pee_8.js";import"./page-title-CxVafghH.js";import"./vendor-form-DG6077WV.js";import"./toast-DHpsQ-qT.js";import"./label-CJDyZc1B.js";function L(s){return{displayName:s.displayName??null,username:s.username??"user",avatarUrl:s.avatarUrl??null,avatarKey:s.avatarKey??null,bio:s.bio??null,isPublic:s.isPublic??!0,submissionRejectionEmailsEnabled:s.submissionRejectionEmailsEnabled??!0}}function T(){const s=h();return R(g(s.profile.me.queryOptions(void 0,{staleTime:3e4})))}function W(){const s=B(),i=T(),l=i.data?.profile?L(i.data.profile):null,{form:r,isSaving:n,validateUsername:d}=j({open:!0,onOpenChange:()=>{},user:l});return e.jsxs(v,{verticalPreset:"relaxed",children:[e.jsx(b,{title:s.app.profile.settingsTitle,hideTitleOnMobile:!1}),e.jsx(u,{children:e.jsx(p,{className:"rounded-3xl",padding:"flush",children:e.jsxs("form",{className:"flex flex-col",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),r.handleSubmit()},children:[e.jsx(P,{children:e.jsxs(S,{className:"gap-5 p-5 sm:p-6",children:[e.jsx(r.Field,{name:"username",validators:{onChange:({value:a})=>d(a)},children:a=>e.jsxs(t,{"data-invalid":!!a.state.meta.errors.length||void 0,children:[e.jsx(F,{htmlFor:"settings-username",children:s.onboarding.username}),e.jsxs(o,{children:[e.jsx(N,{id:"settings-username",value:a.state.value,placeholder:s.onboarding.username.toLowerCase(),className:"h-12 rounded-2xl bg-surface-soft","aria-invalid":!!a.state.meta.errors.length||void 0,disabled:i.isLoading,onBlur:a.handleBlur,onChange:m=>a.handleChange(m.target.value)}),e.jsx(y,{errors:a.state.meta.errors})]})]})}),e.jsx(r.Field,{name:"submissionRejectionEmailsEnabled",children:a=>e.jsxs(t,{orientation:"horizontal",className:"items-center justify-between gap-4",children:[e.jsxs(o,{children:[e.jsx(E,{children:s.app.profile.submissionRejectionEmails}),e.jsx(C,{children:s.app.profile.submissionRejectionEmailsDescription})]}),e.jsx(x,{checked:a.state.value,"aria-label":s.app.profile.submissionRejectionEmails,disabled:i.isLoading,onCheckedChange:a.handleChange})]})})]})}),e.jsx("div",{className:"flex justify-end border-border/60 border-t bg-surface-soft p-5 sm:p-6",children:e.jsx(r.Subscribe,{children:a=>e.jsx(c,{type:"submit",className:"rounded-full",disabled:i.isLoading||i.isError||n||!f(a.values,s.app.profile),children:n?s.app.profile.saving:s.app.profile.saveChanges})})})]})})})]})}export{W as component};
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.