1import{b as N,a as y,m as w,n as S,r as m,j as e,L as u,i as x}from"./index-CaWDYMXN.js";import{B as L}from"./button-CS4yFmc0.js";import{L as A}from"./Logo-LVpYjk60.js";import{T as k}from"./ThemeLanguageToggles-C85f8ynw.js";import{A as T,m as C}from"./authErrors-Cyfhtmf8.js";import{S as E}from"./shield-check-BT_Jtamg.js";import{L as F}from"./lock-BzYjADlH.js";import{A as _}from"./arrow-right-mjsIhtjk.js";function P(){var d,f;const{t}=N(),{signIn:r}=y(),i=w(),n=((f=(d=S().state)==null?void 0:d.from)==null?void 0:f.pathname)??"/app",[s,l]=m.useState(""),[a,o]=m.useState(""),[c,p]=m.useState(!1);async function b(v){if(v.preventDefault(),!s||!a){x.error(t("auth.error.emptyFields"));return}p(!0);try{const{error:g}=await r({email:s,password:a});if(g){x.error(C(g,t));return}x.success(t("auth.welcomeBack").replace("{email}",s)),i(n,{replace:!0})}finally{p(!1)}}return e.jsxs("div",{className:"min-h-screen bg-surface text-on-surface flex flex-col",children:[e.jsxs("header",{className:"px-6 py-4 flex items-center justify-between",children:[e.jsx(u,{to:"/","aria-label":"WealthOS",children:e.jsx(A,{})}),e.jsx(k,{})]}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-8",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"inline-flex items-center gap-1.5 text-[11px] label-caps text-tertiary mb-2",children:[e.jsx(E,{className:"h-3 w-3"}),"Secure sign-in"]}),e.jsx("h1",{className:"font-display text-3xl sm:text-4xl font-bold tracking-tight",children:t("auth.login.title")}),e.jsx("p",{className:"mt-2 text-sm text-on-surface-variant",children:t("auth.login.subtitle")}),e.jsxs("form",{onSubmit:b,className:"mt-8 space-y-5",children:[e.jsx(j,{icon:T,type:"email",value:s,onChange:l,placeholder:"[email protected]",label:t("common.email"),required:!0}),e.jsx(j,{icon:F,type:"password",value:a,onChange:o,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢",label:t("common.password"),required:!0,rightSlot:e.jsx(u,{to:"#",className:"text-[11px] text-primary hover:underline",children:t("auth.login.forgot")})}),e.jsxs(L,{type:"submit",size:"lg",className:"w-full gap-2",disabled:c,children:[c?"â¦":t("auth.login.submit"),!c&&e.jsx(_,{className:"h-4 w-4"})]})]}),e.jsxs("p",{className:"mt-6 text-center text-sm text-on-surface-variant",children:[t("auth.login.switch")," ",e.jsx(u,{to:"/register",className:"text-primary font-semibold hover:underline",children:t("common.signUp")})]})]})}),e.jsxs("footer",{className:"py-6 text-center text-[11px] text-on-surface-variant",children:["© ",new Date().getFullYear()," WealthOS Financial Technologies."]})]})}function j({icon:t,type:r,value:i,onChange:h,placeholder:n,label:s,required:l,rightSlot:a}){return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"label-caps text-on-surface-variant",children:s}),a]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:r,value:i,onChange:o=>h(o.target.value),placeholder:n,required:l,className:"w-full h-11 bg-surface-container-high rounded-md pl-3 pr-10 text-sm text-on-surface placeholder:text-on-surface-variant ghost-border focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:shadow-[0_0_0_3px_hsl(var(--primary-container)/0.4)]"}),e.jsx(t,{className:"h-4 w-4 absolute right-3 top-1/2 -translate-y-1/2 text-on-surface-variant pointer-events-none"})]})]})}export{P 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.