1import{l as W,u as $,r as y,d as A,j as e,L as _,C as E,I as w,f as N,e as B,v as P,W as F,M as O,a as H,J as L}from"./index-DJSCT-dY.js";const U=[{id:"overview",label:"Overview",icon:"user"},{id:"photos",label:"Photos",icon:"image"},{id:"account",label:"Account",icon:"sliders"},{id:"security",label:"Security",icon:"shield"},{id:"data",label:"Personal data",icon:"file"}];function te(){const{user:n,updateAccount:t}=W(),s=$(),[l,a]=y.useState("overview"),{data:i}=A("/api/profile"),{data:r}=A("/api/applications/stats/summary"),{data:d}=A("/api/resumes"),u=(i==null?void 0:i.profile)||null,b=(r==null?void 0:r.pipelineStats)||{},v=(r==null?void 0:r.recentApplications)||[],c=(d==null?void 0:d.resumes)||[];if(!n)return null;const h=!!n.google_id,g=(n.name||n.email||"?").split(/[\s@]/).filter(Boolean).slice(0,2).map(x=>{var f;return(f=x[0])==null?void 0:f.toUpperCase()}).join("")||"?",m=n.created_at?new Date(n.created_at):null,o=m?Math.max(1,Math.floor((Date.now()-m.getTime())/(30*24*3600*1e3))):0,p=n.subscription_plan==="pro"?"Pro":n.subscription_plan==="max"||(n==null?void 0:n.subscription_plan)==="unlimited"?"Max":n.subscription_plan==="job_hunt_pass"?"Job Hunt Pass":null;return e.jsxs("div",{className:"editorial fade-up page-shell",children:[e.jsx("div",{className:"page-header",children:e.jsxs("div",{className:"page-header-text",children:[e.jsxs("div",{className:"eyebrow",style:{marginBottom:12},children:["Account · ",n.name||n.email]}),e.jsxs("h1",{className:"h-editorial",style:{fontSize:"clamp(36px, 4.8vw, 52px)",lineHeight:1.05},children:["Your ",e.jsx("em",{children:"profile"}),"."]}),e.jsxs("p",{style:{fontSize:14,color:"rgb(var(--ink-2))",marginTop:12,maxWidth:560},children:["Identity, security, and the connections that make CareerVamp yours. Application-form data lives in",e.jsx(_,{to:"/autofill",style:{color:"rgb(var(--ink-2))",textDecoration:"underline",marginLeft:4},children:"Autofill"}),"."]})]})}),e.jsxs("div",{className:"cv-card",style:{padding:28,marginBottom:24,display:"grid",gridTemplateColumns:"auto 1fr auto",gap:28,alignItems:"center"},children:[e.jsx("div",{style:{width:96,height:96,borderRadius:20,background:"linear-gradient(135deg, rgb(var(--blue)), rgb(var(--violet)))",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:36,fontWeight:600,boxShadow:"0 14px 40px -16px rgb(109 40 217 / 0.4)"},children:g}),e.jsxs("div",{style:{minWidth:0},children:[e.jsx("div",{className:"serif",style:{fontSize:28,lineHeight:1.1,marginBottom:4},children:n.name||"Unnamed user"}),e.jsxs("div",{style:{fontSize:14,color:"rgb(var(--ink-2))",marginBottom:10},children:[(u==null?void 0:u.headline)||n.email,(u==null?void 0:u.location)&&` · ${u.location}`]}),e.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[p&&e.jsx("span",{className:"cv-pill cv-pill-blue",children:p}),n.email_verified&&e.jsxs("span",{className:"cv-pill",children:[e.jsx(E,{className:"h-2.5 w-2.5","aria-label":"Email verified"})," Verified email"]}),n.role==="admin"&&e.jsx("span",{className:"cv-pill cv-pill-amber",children:"Admin"}),h&&e.jsxs("span",{className:"cv-pill",children:[e.jsx(w,{name:"link",size:9})," Google"]})]})]}),m&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-end",textAlign:"right"},children:[e.jsx("span",{className:"mono",style:{fontSize:10,color:"rgb(var(--ink-3))",letterSpacing:"0.06em"},children:"MEMBER SINCE"}),e.jsx("span",{className:"serif",style:{fontSize:22,lineHeight:1},children:m.getFullYear()}),e.jsxs("span",{style:{fontSize:11,color:"rgb(var(--ink-3))"},children:[m.toLocaleDateString("en-US",{month:"long"})," · ",o," mo"]})]})]}),e.jsx("div",{style:{display:"flex",gap:0,borderBottom:"1px solid rgb(var(--line))",marginBottom:24,overflowX:"auto"},children:U.map(x=>{const f=l===x.id;return e.jsxs("button",{type:"button",onClick:()=>a(x.id),style:{padding:"12px 18px",background:"transparent",border:"none",borderBottom:"2px solid "+(f?"rgb(var(--ink))":"transparent"),color:f?"rgb(var(--ink))":"rgb(var(--ink-2))",fontSize:13,fontWeight:f?600:500,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:7,marginBottom:-1,whiteSpace:"nowrap",fontFamily:"inherit"},children:[e.jsx(w,{name:x.icon,size:13})," ",x.label]},x.id)})}),l==="overview"&&e.jsx(V,{navigate:s,setTab:a,pipelineStats:b,recentApps:v,resumes:c,user:n}),l==="photos"&&e.jsx(G,{}),l==="account"&&e.jsx(J,{user:n,profile:u,isGoogle:h,updateAccount:t}),l==="security"&&e.jsx(Z,{isGoogle:h,user:n}),l==="data"&&e.jsx(K,{profile:u,resumesCount:c.length})]})}function Y(n,t=1e3,s=.85){return new Promise((l,a)=>{const i=new FileReader;i.onload=()=>{const r=new Image;r.onload=()=>
1{let d=r.naturalWidth,u=r.naturalHeight;if(d>t||u>t){const v=t/Math.max(d,u);d=Math.round(d*v),u=Math.round(u*v)}const b=document.createElement("canvas");b.width=d,b.height=u,b.getContext("2d").drawImage(r,0,0,d,u),b.toBlob(v=>v?l(v):a(new Error("encode failed")),"image/jpeg",s)},r.onerror=a,r.src=i.result},i.onerror=a,i.readAsDataURL(n)})}function G(){const[n,t]=y.useState(null),[s,l]=y.useState(!1),[a,i]=y.useState(""),r=y.useRef(null),d=y.useCallback(async()=>{try{const{data:c}=await N.get("/api/documents",{params:{category:"photo"}}),h=c.documents||[],g=await Promise.all(h.map(async m=>{try{const o=await N.get(`/api/documents/${m.id}/file-base64`);return{id:m.id,name:m.original_filename||"Photo",uri:`data:${o.data.mimeType||"image/jpeg"};base64,${o.data.base64}`,isDefault:!!m.is_default}}catch{return null}}));t(g.filter(Boolean).sort((m,o)=>(o.isDefault?1:0)-(m.isDefault?1:0)))}catch{i("Could not load photos"),t([])}},[]);y.useEffect(()=>{d()},[d]);const u=async c=>{var g,m,o;const h=(g=c.target.files)==null?void 0:g[0];if(c.target.value="",!!h){if(!/^image\//.test(h.type)){i("Please choose an image file.");return}l(!0),i("");try{const p=await Y(h),x=(h.name.replace(/\.[^.]+$/,"")||"photo")+".jpg",f=new FormData;f.append("file",new File([p],x,{type:"image/jpeg"}),x),f.append("category","photo"),await N.post("/api/documents/upload",f),await d()}catch(p){i(((o=(m=p.response)==null?void 0:m.data)==null?void 0:o.error)||"Upload failed.")}finally{l(!1)}}},b=async c=>{try{await N.delete(`/api/documents/${c}`),t(h=>(h||[]).filter(g=>g.id!==c))}catch{}},v=async c=>{try{await N.post(`/api/documents/${c}/default`),t(h=>(h||[]).map(g=>({...g,isDefault:g.id===c})).sort((g,m)=>(m.isDefault?1:0)-(g.isDefault?1:0)))}catch{}};return e.jsxs("div",{className:"cv-card",style:{padding:24},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,marginBottom:6},children:[e.jsx("h3",{style:{fontSize:16,fontWeight:600,color:"rgb(var(--ink))",margin:0},children:"Profile photos"}),e.jsx("button",{type:"button",className:"cv-btn cv-btn-primary cv-btn-sm",disabled:s,onClick:()=>{var c;return(c=r.current)==null?void 0:c.click()},children:s?"Uploadingâ¦":"Upload photo"}),e.jsx("input",{ref:r,type:"file",accept:"image/*",style:{display:"none"},onChange:u})]}),e.jsxs("p",{style:{fontSize:13,color:"rgb(var(--ink-2))",marginBottom:16},children:["Headshots for the photo résumé templates. In the résumé editor, open ",e.jsx("b",{children:"Contact â From uploads"})," to pick one."]}),a&&e.jsx("div",{style:{color:"#ef4444",fontSize:13,marginBottom:12},children:a}),n===null&&e.jsx("div",{style:{color:"rgb(var(--ink-3))",fontSize:13},children:"Loadingâ¦"}),n&&n.length===0&&e.jsx("div",{style:{color:"rgb(var(--ink-3))",fontSize:13},children:"No photos yet. Upload a headshot to get started."}),n&&n.length>0&&e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(120px,1fr))",gap:14},children:n.map(c=>e.jsxs("div",{style:{position:"relative",borderRadius:12,overflow:"hidden",border:c.isDefault?"2px solid rgb(var(--violet))":"1px solid rgb(var(--line))",aspectRatio:"1",background:"rgb(var(--bg-2))"},children:[e.jsx("img",{src:c.uri,alt:c.name,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}),c.isDefault?e.jsx("span",{style:{position:"absolute",bottom:6,left:6,fontSize:9,fontWeight:600,padding:"2px 7px",borderRadius:6,background:"rgb(var(--violet))",color:"#fff"},children:"Default"}):e.jsx("button",{type:"button",onClick:()=>v(c.id),title:"Set as default",style:{position:"absolute",bottom:6,left:6,fontSize:9,fontWeight:500,padding:"2px 7px",borderRadius:6,background:"rgba(0,0,0,.55)",color:"#fff",border:"none",cursor:"pointer"},children:"Set default"}),e.jsx("button",{type:"button",onClick:()=>b(c.id),title:"Delete photo","aria-label":"Delete photo",style:{position:"absolute",top:6,right:6,width:24,height:24,borderRadius:"50%",border:"none",background:"rgba(0,0,0,.55)",color:"#fff",cursor:"pointer",fontSize:14,lineHeight:1},children:"Ã"})]},c.id))})]})}function V({navigate:n,setTab:t,pipelineStats:s,recentApps:l,resumes:a,user:i}){const r=(i==null?void 0:i.subscription_plan)==="pro"?"Pro":(i==null?void 0:i.subscription_plan)==="max"||(i==null?void 0:i.subscription_plan)==="unlimited"?"Max":(i==null?void 0:i.subscription_plan)==="job_hunt_pass"?"Job Hunt Pass":null,d=Date.now()-30*24*3600*1e3;a.filter(o=>o.type==="tailored"&&new Date(o.updated_at||o.created_at)>=new Date(d)).length;const u=typeof(i==null?void 0:i.tailoredCount)=="number"?i.tailoredCount:a.filter(o=>o.type==="tailored").length,b=s.total||0,v=(s.interview||0)+(s.offer||0),c=s.avg_match_score!=null?Math.round(s.avg_match_score):null,h=[{n:u,l:"Résumés tailored",d:"rgb(var(--violet))"},{n:c??"â",l:"Avg ATS score",d:"rgb(var(--green))"},{n:b,l:"Applications",d:"rgb(var(--blue))"},{n:v,l:"Interviews",d:"rgb(var(--amber))"}],g=Array.from({length:7},(o,p)=>{const x=new Date;return x.setHours(0,0,0,0),x.setDate(x.getDate()-(6-p)),{ts:x,label:"MTWTFSS"[x.getDay()===0?6:x.getDay()-1],count:0}});for(const o of l){const p=new Date(o.updated_at||o.created_at),x=g.findIndex(f=>f.ts.toDateString()===p.toDateString());x>=0&&g[x].count++}const m=Math.max(1,...g.map(o=>o.count));return e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1.4fr 1fr",gap:16},className:"profile-overview-row",children:[e.jsxs("div",{className:"cv-card",style:{padding:24},children:[e.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:"Activity · 30 days"}),e.jsx("h3",{className:"serif",style:{fontSize:22,marginBottom:18},children:"Where your time went."}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:12,marginBottom:22},children:h.map(o=>e.jsxs("div",{style:{padding:14,border:"1px solid rgb(var(--line))",borderRadius:10},children:[e.jsx("div",{className:"serif",style:{fontSize:28,lineHeight:1,marginBottom:4,color:o.d},children:o.n}),e.jsx("div",{style:{fontSize:11,color:"rgb(var(--ink-3))"},children:o.l})]},o.l))}),e.jsx("div",{className:"div-label",style:{marginBottom:10},children:"last 7 days"}),e.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:5,height:70},children:g.map((o,p)=>e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:"100%",height:`${o.count/m*100}%`,background:"rgb(var(--ink))",borderRadius:3,opacity:o.count===0?.15:.65+p/12,minHeight:2},title:`${o.count} application${o.count===1?"":"s"}`}),e.jsx("span",{className:"mono",style:{fontSize:9,color:"rgb(var(--ink-3))"},children:o.label})]},p))})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{className:"cv-card",style:{padding:22,background:"rgb(var(--bg-2))"},children:[e.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:16},children:e.jsxs("div",{children:[e.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:"Plan"}),e.jsx("div",{className:"serif",style:{fontSize:24,lineHeight:1.1},children:r||"No plan"}),e.jsx("div",{style:{fontSize:12,color:"rgb(var(--ink-3))",marginTop:2},children:r?"Manage billing & invoices in Subscription":"Start a 7-day free trial for AI tailoring + cover letters"})]})}),e.jsx("div",{style:{display:"flex",gap:8},children:e.jsxs("button",{type:"button",onClick:()=>n("/subscription"),className:"cv-btn cv-btn-secondary cv-btn-sm",style:{flex:1},children:["Manage plan ",e.jsx(w,{name:"arrow-right",size:11})]})})]}),e.jsxs("div",{className:"cv-card",style:{padding:22},children:[e.jsx("div",{className:"eyebrow",style:{marginBottom:10}
1,children:"Quick links"}),[{l:"Edit account info",t:"account"},{l:"Change password",t:"security"},{l:"Personal data",t:"data"}].map((o,p)=>e.jsxs("button",{type:"button",onClick:()=>t(o.t),style:{width:"100%",textAlign:"left",padding:"10px 0",background:"none",border:"none",cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:p?"1px solid rgb(var(--line-2))":"none",fontSize:13,color:"rgb(var(--ink))",fontFamily:"inherit"},children:[e.jsx("span",{children:o.l}),e.jsx(w,{name:"arrow-right",size:12})]},o.t))]})]}),e.jsx("style",{children:` 2 @media (max-width: 900px) { 3 .profile-overview-row { grid-template-columns: 1fr !important; } 4 } 5 `})]})}function J({user:n,profile:t,isGoogle:s,updateAccount:l}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs(S,{eyebrow:"01 · IDENTITY",title:"The basics on your profile.",children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},className:"profile-account-grid",children:[e.jsx(R,{label:"Display name",value:n.name,onSave:a=>l({name:a}),validate:a=>a?a.length>100?"Max 100 characters":null:"Name cannot be empty"}),e.jsx(R,{label:"Primary email",value:n.email,type:"email",verified:!0,disabled:s,disabledHint:s?"Managed by Google sign-in":null,onSave:a=>l({email:a}),validate:a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)?null:"Enter a valid email"}),(t==null?void 0:t.headline)&&e.jsx(D,{full:!0,label:"Headline",value:t.headline}),(t==null?void 0:t.location)&&e.jsx(D,{label:"Location",value:t.location}),(t==null?void 0:t.phone)&&e.jsx(D,{label:"Phone",value:`${t.phone_country_code||""} ${t.phone}`.trim()})]}),e.jsxs("p",{style:{fontSize:12,color:"rgb(var(--ink-3))",marginTop:14},children:["Headline, location, phone, and other application-form fields are managed in"," ",e.jsx(_,{to:"/autofill",style:{color:"rgb(var(--ink-2))",textDecoration:"underline"},children:"Autofill"}),"."]})]}),((t==null?void 0:t.linkedin_url)||(t==null?void 0:t.github_url)||(t==null?void 0:t.portfolio_url)||(t==null?void 0:t.other_url))&&e.jsx(S,{eyebrow:"02 · LINKS",title:"What you put on every résumé.",children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},className:"profile-account-grid",children:[(t==null?void 0:t.linkedin_url)&&e.jsx(D,{label:"LinkedIn",value:t.linkedin_url}),(t==null?void 0:t.github_url)&&e.jsx(D,{label:"GitHub",value:t.github_url}),(t==null?void 0:t.portfolio_url)&&e.jsx(D,{label:"Portfolio",value:t.portfolio_url}),(t==null?void 0:t.other_url)&&e.jsx(D,{label:"Other",value:t.other_url})]})}),e.jsx("style",{children:` 6 @media (max-width: 720px) { 7 .profile-account-grid { grid-template-columns: 1fr !important; } 8 } 9 `})]})}function X(n){if(!n)return"never";const t=new Date(n).getTime();if(!Number.isFinite(t))return"never";const s=Math.floor((Date.now()-t)/1e3);if(s<0||s<60)return"just now";if(s<3600){const a=Math.floor(s/60);return`${a} minute${a===1?"":"s"} ago`}if(s<86400){const a=Math.floor(s/3600);return`${a} hour${a===1?"":"s"} ago`}if(s<604800){const a=Math.floor(s/86400);return`${a} day${a===1?"":"s"} ago`}if(s<2592e3){const a=Math.floor(s/604800);return`${a} week${a===1?"":"s"} ago`}if(s<31536e3){const a=Math.floor(s/2592e3);return`${a} month${a===1?"":"s"} ago`}const l=Math.floor(s/31536e3);return`${l} year${l===1?"":"s"} ago`}function Z({isGoogle:n,user:t}){const[s,l]=y.useState(""),[a,i]=y.useState(""),[r,d]=y.useState(""),[u,b]=y.useState(!1),[v,c]=y.useState(!1),[h,g]=y.useState(!1),[m,o]=y.useState(null),[p,x]=y.useState((t==null?void 0:t.password_changed_at)||null),f=async C=>{var k,z;if(C.preventDefault(),o(null),a.length<8)return o({kind:"err",text:"New password must be at least 8 characters"});if(a!==r)return o({kind:"err",text:"New password and confirmation don't match"});g(!0);try{const{data:j}=await N.post("/api/auth/change-password",{currentPassword:s,newPassword:a});j!=null&&j.password_changed_at?x(j.password_changed_at):x(new Date().toISOString()),o({kind:"ok",text:"Password updated."}),l(""),i(""),d("")}catch(j){o({kind:"err",text:((z=(k=j==null?void 0:j.response)==null?void 0:k.data)==null?void 0:z.error)||"Failed to update password"})}finally{g(!1)}};return n?e.jsxs(S,{eyebrow:"01 · PASSWORD",title:"Managed by Google.",children:[e.jsx("p",{style:{fontSize:13,color:"rgb(var(--ink-2))",maxWidth:540},children:"Your account is signed in with Google, so password changes happen in your Google Account settings, not here."}),e.jsxs("a",{href:"https://myaccount.google.com/security",target:"_blank",rel:"noopener noreferrer",className:"cv-btn cv-btn-secondary",style:{marginTop:14,textDecoration:"none"},children:["Open Google Security ",e.jsx(w,{name:"arrow-right",size:12})]})]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs(S,{eyebrow:"01 · PASSWORD",title:"Change your password.",children:[e.jsxs("div",{title:p?new Date(p).toLocaleStr
9ing():"Never changed",style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12,color:"rgb(var(--ink-3))",marginBottom:14,fontFamily:"ui-monospace, Menlo, monospace"},children:[e.jsx(w,{name:"shield",size:11}),"Last changed ",X(p)]}),e.jsxs("form",{onSubmit:f,style:{display:"flex",flexDirection:"column",gap:12,maxWidth:460},children:[e.jsx(I,{label:"Current password",value:s,onChange:l,visible:u,toggleVisible:()=>b(C=>!C),placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",required:!0}),e.jsx(I,{label:"New password",value:a,onChange:i,visible:v,toggleVisible:()=>c(C=>!C),placeholder:"At least 8 characters",required:!0}),e.jsx(I,{label:"Confirm new password",value:r,onChange:d,visible:v,placeholder:"Repeat the new password",required:!0}),e.jsxs("button",{type:"submit",disabled:h||!s||!a||!r,className:"cv-btn cv-btn-secondary",style:{alignSelf:"flex-start",marginTop:4},children:[h?e.jsx(B,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(E,{className:"h-3.5 w-3.5"}),"Update password"]}),m&&e.jsxs("div",{style:{fontSize:12,color:m.kind==="ok"?"rgb(var(--green))":"rgb(var(--red))",display:"inline-flex",alignItems:"center",gap:6,marginTop:4},children:[m.kind==="ok"?e.jsx(E,{className:"h-3 w-3"}):e.jsx(P,{className:"h-3 w-3"}),m.text]})]})]}),e.jsx(q,{})]})}function q(){const n=H(),[t,s]=y.useState(!1),[l,a]=y.useState(null),i=async()=>{var r,d;if(await n({title:"Sign out everywhere?",body:"Every active session (including this one) will need to log in again.",confirmLabel:"Sign out everywhere",tone:"danger"})){s(!0),a(null);try{await N.post("/api/auth/signout-all"),L.removeItem("token"),L.removeItem("user"),window.location.href="/login"}catch(u){a({kind:"err",text:((d=(r=u==null?void 0:u.response)==null?void 0:r.data)==null?void 0:d.error)||"Could not sign out of all devices."}),s(!1)}}};return e.jsxs(S,{eyebrow:"02 · SESSIONS",title:"Sign out of every device.",children:[e.jsx("p",{style:{fontSize:13,color:"rgb(var(--ink-2))",maxWidth:540,marginBottom:14},children:"Lost a laptop or forgot to log out on a shared machine? This revokes every active CareerVamp session for your account â you'll need to log in again here too."}),e.jsx("button",{type:"button",onClick:i,disabled:t,className:"cv-btn cv-btn-secondary",style:{alignSelf:"flex-start"},children:t?"Signing outâ¦":"Sign out everywhere"}),l&&e.jsx("div",{style:{fontSize:12,color:"rgb(var(--red))",marginTop:10},children:l.text})]})}function K({profile:n,resumesCount:t}){var s,l,a,i,r,d;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs(S,{eyebrow:"01 · APPLICATION DATA",title:"Your auto-fill profile.",children:[e.jsx("p",{style:{fontSize:13,color:"rgb(var(--ink-2))",marginBottom:14,maxWidth:540},children:"The fields the extension fills into job applications â phone, address, work authorization, education, experience, skills, links â are managed in Autofill."}),e.jsxs(_,{to:"/autofill",className:"cv-btn cv-btn-secondary",style:{textDecoration:"none"},children:["Open Autofill ",e.jsx(w,{name:"arrow-right",size:12})]}),e.jsxs("div",{style:{marginTop:18,fontSize:11,color:"rgb(var(--ink-3))"},children:[((s=n==null?void 0:n.skills)==null?void 0:s.length)||0," skill",((l=n==null?void 0:n.skills)==null?void 0:l.length)===1?"":"s"," ·"," ",((a=n==null?void 0:n.experience)==null?void 0:a.length)||0," role",((i=n==null?void 0:n.experience)==null?void 0:i.length)===1?"":"s"," ·"," ",((r=n==null?void 0:n.education)==null?void 0:r.length)||0," school",((d=n==null?void 0:n.education)==null?void 0:d.length)===1?"":"s"]})]}),e.jsxs(S,{eyebrow:"02 · RÃSUMÃS",title:"Your library.",children:[e.jsxs("p",{style:{fontSize:13,color:"rgb(var(--ink-2))",maxWidth:540},children:["You currently have ",e.jsxs("strong",{children:[t," résumé",t===1?"":"s"]}),". Open the library to download any as PDF or DOCX."]}),e.jsxs(_,{to:"/resumes",className:"cv-btn cv-btn-secondary",style:{marginTop:14,textDecoration:"none"},children:["Open résumés ",e.jsx(w,{name:"arrow-right",size:12})]})]}),e.jsxs(S,{eyebrow:"03 · COVER LETTERS",title:"Your letters.",children:[e.jsx("p",{style:{fontSize:13,color:"rgb(var(--ink-2))",maxWidth:540},children:"Every cover letter you generated or saved, including the ones the extension wrote while autofilling."}),e.jsxs(_,{to:"/cover-letter",className:"cv-btn cv-btn-secondary",style:{marginTop:14,textDecoration:"none"},children:["Open cover letters ",e.jsx(w,{name:"arrow-right",size:12})]})]}),e.jsxs(S,{eyebrow:"04 · APPLICATIONS",title:"Your job tracker.",children:[e.jsx("p",{style:{fontSize:13,color:"rgb(var(--ink-2))",maxWidth:540},children:"Every application CareerVamp filled for you â the résumé used, the values submitted, and where each one stands."}),e.jsxs(_,{to:"/job-tracker",className:"cv-btn cv-btn-secondary",style:{marginTop:14,textDecoration:"none"},children:["Open job tracker ",e.jsx(w,{name:"arrow-right",size:12})]})]}),e.jsx(Q,{})]})}function Q(){const{logout:n}=W(),t=$(),[s,l]=y.useState(!1),[a,i]=y.useState(""),[r,d]=y.useState(!1),[u,b]=y.useState(""),v=async()=>{var c,h;if(!(a!=="DELETE"||r)){d(!0),b("");try{await N.delete("/api/auth/me",{data:{confirm:"DELETE"}}),n({silent:!0}),t("/login?reason=account_deleted",{replace:!0})}catch(g){b(((h=(c=g.response)==null?void 0:c.data)==null?void 0:h.error)||g.message||"Could not delete account."),d(!1)}}};return e.jsxs("div",{className:"cv-card",style:{padding:24,borderColor:"rgb(var(--red) / 0.4)"},children:[e.jsx("div",{className:"eyebrow",style:{marginBottom:6,color:"rgb(var(--red))"},children:"03 · DANGER ZONE"}),e.jsx("h3",{className:"serif",style:{fontSize:22,marginBottom:8},children:"Delete account"}),e.jsxs("p",{style:{fontSize:13,color:"rgb(var(--ink-2))",maxWidth:560,marginBottom:14},children:["Permanently deletes your account, every résumé, every job-tracker entry, your autofill profile, and all activity logs. ",e.jsx("strong",{children:"This cannot be undone."})]}),e.jsx("p",{style:{fontSize:12,color:"rgb(var(--ink-3))",maxWidth:560,marginBottom:14},children:`If you have an active paid subscription, cancel billing in the Subscription tab â "Manage payment" first â deleting here only removes local data, it doesn't end your Str
9ipe billing.`}),s?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,maxWidth:560},children:[e.jsxs("label",{style:{fontSize:11,color:"rgb(var(--ink-3))"},children:["Type ",e.jsx("code",{style:{background:"rgb(var(--bg-2))",padding:"1px 5px",borderRadius:3},children:"DELETE"})," to confirm:"]}),e.jsx("input",{type:"text",className:"cv-input",value:a,onChange:c=>i(c.target.value),placeholder:"DELETE",autoFocus:!0,disabled:r,style:{fontFamily:"var(--font-mono, ui-monospace), monospace"}}),u&&e.jsxs("div",{style:{fontSize:12,color:"rgb(var(--red))",display:"flex",alignItems:"center",gap:6},children:[e.jsx(P,{className:"h-3.5 w-3.5"})," ",u]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{type:"button",className:"cv-btn",onClick:v,disabled:a!=="DELETE"||r,style:{background:"rgb(var(--red))",borderColor:"rgb(var(--red))",color:"white",opacity:a!=="DELETE"||r?.55:1},children:r?e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"h-3.5 w-3.5 animate-spin"})," Deletingâ¦"]}):"Delete forever"}),e.jsx("button",{type:"button",className:"cv-btn cv-btn-ghost",onClick:()=>{l(!1),i(""),b("")},disabled:r,children:"Cancel"})]})]}):e.jsx("button",{type:"button",className:"cv-btn",onClick:()=>{l(!0),i(""),b("")},style:{borderColor:"rgb(var(--red) / 0.6)",color:"rgb(var(--red))"},children:"Delete accountâ¦"})]})}function S({eyebrow:n,title:t,children:s}){return e.jsxs("div",{className:"cv-card",style:{padding:24},children:[e.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:n}),e.jsx("h3",{className:"serif",style:{fontSize:22,marginBottom:18},children:t}),s]})}function D({label:n,value:t,full:s}){return e.jsxs("div",{style:{gridColumn:s?"1 / -1":"auto"},children:[e.jsx("label",{style:{fontSize:11,color:"rgb(var(--ink-3))",display:"block",marginBottom:5},children:n}),e.jsx("div",{className:"cv-input",style:{padding:"10px 12px",display:"flex",alignItems:"center",color:"rgb(var(--ink-2))",background:"rgb(var(--bg-2))"},children:t||e.jsx("span",{style:{color:"rgb(var(--ink-3))"},children:"â"})})]})}function R({label:n,value:t,onSave:s,validate:l,type:a="text",verified:i,full:r,disabled:d,disabledHint:u}){const[b,v]=y.useState(!1),[c,h]=y.useState(t||""),[g,m]=y.useState(!1),[o,p]=y.useState(null),x=()=>{h(t||""),p(null),v(!0)},f=()=>{v(!1),p(null)},C=async k=>{var j,M;if(k==null||k.preventDefault(),g)return;const z=c.trim();if(z===(t||"")){f();return}if(l){const T=l(z);if(T){p(T);return}}m(!0),p(null);try{await s(z),v(!1)}catch(T){p(((M=(j=T==null?void 0:T.response)==null?void 0:j.data)==null?void 0:M.error)||"Could not save")}finally{m(!1)}};return e.jsxs("div",{style:{gridColumn:r?"1 / -1":"auto"},children:[e.jsxs("label",{style:{fontSize:11,color:"rgb(var(--ink-3))",display:"flex",justifyContent:"space-between",marginBottom:5},children:[e.jsx("span",{children:n}),e.jsxs("span",{style:{display:"inline-flex",gap:8},children:[i&&e.jsxs("span",{style:{color:"rgb(var(--green))",fontSize:10,display:"inline-flex",alignItems:"center",gap:3},children:[e.jsx(E,{className:"h-2.5 w-2.5"})," verified"]}),!b&&!d&&e.jsx("button",{type:"button",onClick:x,style:{background:"none",border:"none",padding:0,color:"rgb(var(--ink-2))",fontSize:10,cursor:"pointer",textDecoration:"underline",fontFamily:"inherit"},children:"Edit"})]})]}),b?e.jsxs("form",{onSubmit:C,style:{display:"flex",gap:6},children:[e.jsx("input",{type:a,value:c,autoFocus:!0,onChange:k=>h(k.target.value),disabled:g,className:"cv-input",style:{flex:1}}),e.jsx("button",{type:"submit",disabled:g,className:"cv-btn cv-btn-primary cv-btn-sm",children:g?e.jsx(B,{className:"h-3 w-3 animate-spin"}):e.jsx(E,{className:"h-3 w-3"})}),e.jsx("button",{type:"button",onClick:f,disabled:g,className:"cv-btn cv-btn-ghost cv-btn-sm",children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"cv-input",style:{padding:"10px 12px",display:"flex",alignItems:"center",color:"rgb(var(--ink))"},children:t||e.jsx("span",{style:{color:"rgb(var(--ink-3))"},children:"â"})}),d&&u&&e.jsx("p",{style:{fontSize:11,color:"rgb(var(--ink-3))",marginTop:4},children:u})]}),o&&e.jsxs("p",{style:{fontSize:11,color:"rgb(var(--red))",marginTop:4,display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx(P,{className:"h-3 w-3"})," ",o]})]})}function I({label:n,value:t,onChange:s,visible:l,toggleVisible:a,placeholder:i,required:r}){return e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:11,color:"rgb(var(--ink-3))",display:"block",marginBottom:5},children:n}),e.jsxs("div",{style:{position:"relative"},children:[e.jsx("input",{type:l?"text":"password",value:t,onChange:d=>s(d.target.value),placeholder:i,required:r,className:"cv-input",style:{paddingRight:a?38:void 0}}),a&&e.jsx("button",{type:"button",onClick:a,tabIndex:-1,style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",padding:4,color:"rgb(var(--ink-3))",cursor:"pointer",display:"inline-flex",alignItems:"center"},"aria-label":l?"Hide password":"Show password",children:l?e.jsx(F,{className:"h-4 w-4"}):e.jsx(O,{className:"h-4 w-4"})})]})]})}export{te 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.