1import{c as N,j as e,v as p,n as v,s as C}from"./index-BHKyTGiK.js";import{r as a,b as k}from"./vendor-react-BK3hO__s.js";import{H as S}from"./vendor-helmet-CV_Aq258.js";import{b as L}from"./dashboardAuth-jwQYVHUc.js";import{I as d}from"./input-LSJ5CHP8.js";import{C as I,b as E,L as D,c as F,a as P}from"./card-CfoQ3H8_.js";import{C as g}from"./circle-alert-B7MhwYca.js";import"./vendor-supabase-TbPYTrVH.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const b=N("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);function W(){const[r,m]=a.useState(""),[h,f]=a.useState(""),[l,t]=a.useState(""),[x,c]=a.useState(""),[i,o]=a.useState(!1),[n,u]=a.useState(!1),j=k(),y=async s=>{s.preventDefault(),o(!0),t("");try{await L(r,h)?j("/dashboard"):t("Invalid email or password.")}catch{t("Connection error. Try again.")}finally{o(!1)}},w=async s=>{if(s.preventDefault(),!r){t("Please enter your email address.");return}o(!0),t(""),c("");try{await C.functions.invoke("dashboard-auth",{body:{action:"request_reset",email:r}}),c("If this email is registered, you'll receive an email with a reset link (valid 1 hour).")}catch{t("Connection error. Try again.")}finally{o(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(S,{children:[e.jsx("meta",{name:"robots",content:"noindex, nofollow"}),e.jsx("title",{children:"Dashboard Login | David J. Woods"})]}),e.jsx("div",{className:"min-h-screen bg-[hsl(220,15%,10%)] flex items-center justify-center p-4",children:e.jsxs(I,{className:"w-full max-w-md bg-[hsl(220,15%,13%)] border-[hsl(220,15%,20%)] text-white",children:[e.jsxs(E,{className:"text-center space-y-2",children:[e.jsx("div",{className:"mx-auto w-12 h-12 bg-primary/20 rounded-full flex items-center justify-center",children:n?e.jsx(b,{className:"w-6 h-6 text-primary"}):e.jsx(D,{className:"w-6 h-6 text-primary"})}),e.jsx(F,{className:"text-xl text-white",children:n?"Reset Password":"Dashboard Login"}),e.jsx("p",{className:"text-sm text-[hsl(220,10%,55%)]",children:n?"Enter your email to receive reset instructions":"Internal area â Authorized users only"})]}),e.jsx(P,{children:n?e.jsxs("form",{onSubmit:w,className:"space-y-4",children:[l&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-red-400 bg-red-400/10 p-3 rounded",children:[e.jsx(g,{className:"w-4 h-4 shrink-0"})," ",l]}),x&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-emerald-400 bg-emerald-400/10 p-3 rounded",children:[e.jsx(b,{className:"w-4 h-4 shrink-0"})," ",x]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-[hsl(220,10%,65%)]",children:"Email"}),e.jsx(d,{type:"email",value:r,onChange:s=>m(s.target.value),placeholder:"[email protected]",required:!0,className:"bg-[hsl(220,15%,16%)] border-[hsl(220,15%,22%)] text-white placeholder:text-[hsl(220,10%,40%)]"})]}),e.jsx(p,{type:"submit",disabled:i,className:"w-full bg-primary hover:bg-primary/90",children:i?"Sending...":"Send Reset Instructions"}),e.jsxs("button",{type:"button",onClick:()=>{u(!1),t(""),c("")},className:"flex items-center gap-1 text-sm text-[hsl(220,10%,55%)] hover:text-white transition-colors mx-auto",children:[e.jsx(v,{className:"w-3 h-3"})," Back to Login"]})]}):e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[l&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-red-400 bg-red-400/10 p-3 rounded",children:[e.jsx(g,{className:"w-4 h-4 shrink-0"}),l]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-[hsl(220,10%,65%)]",children:"Email"}),e.jsx(d,{type:"email",value:r,onChange:s=>m(s.target.value),placeholder:"[email protected]",required:!0,className:"bg-[hsl(220,15%,16%)] border-[hsl(220,15%,22%)] text-white placeholder:text-[hsl(220,10%,40%)]"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-[hsl(220,10%,65%)]",children:"Password"}),e.jsx(d,{type:"password",value:h,onChange:s=>
6f(s.target.value),placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",required:!0,className:"bg-[hsl(220,15%,16%)] border-[hsl(220,15%,22%)] text-white placeholder:text-[hsl(220,10%,40%)]"})]}),e.jsx(p,{type:"submit",disabled:i,className:"w-full bg-primary hover:bg-primary/90",children:i?"Loading...":"Sign In"}),e.jsx("button",{type:"button",onClick:()=>{u(!0),t("")},className:"text-sm text-[hsl(220,10%,55%)] hover:text-white transition-colors mx-auto block",children:"Forgot password?"})]})})]})})]})}export{W 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.