PageSourceSearch

https://parkcityutah.ai/assets/ResetPassword-D8I1EVsj.js

js parkcityutah.ai collected 2026-10-05 13:31:15 UTC 5,597 bytes, 1 lines download raw bytes

1import{r,f as A,u as I,g as B,j as s,L as p,M as f,I as h,B as F,s as M}from"./index-PtGACUVf.js";import{L as w}from"./label-BGYTmHnu.js";import{C as R}from"./circle-check-big-sSf7dLsd.js";import{L as g}from"./lock-BKQbbgdB.js";import{E as T}from"./eye-off-CXoqCu0T.js";import{E as O}from"./eye-B9hDvAFW.js";import{o as U,s as j,Z as z}from"./types-iW-1e-aB.js";const Y=U({password:j().min(6,"Password must be at least 6 characters"),confirmPassword:j()}).refine(a=>a.password===a.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),K=()=>{const[a,N]=r.useState(""),[c,b]=r.useState(""),[d,y]=r.useState(!1),[i,m]=r.useState(!1),[v,P]=r.useState(!1),[n,x]=r.useState({}),{updatePassword:E,user:t}=A(),C=I(),{toast:u}=B(),S=()=>{try{return Y.parse({password:a,confirmPassword:c}),x({}),!0}catch(e){if(e instanceof z){const o={};e.errors.forEach(l=>{const k=l.path[0];o[k]=l.message}),x(o)}return!1}},L=async e=>{if(e.preventDefault(),!!S()){m(!0);try{const{error:o}=await E(a);if(o)u({title:"Error",description:o.message,variant:"destructive"});else{if(t!=null&&t.id){const{error:l}=await M.from("profiles").update({password_set:!0}).eq("id",t.id);l&&console.error("Error updating password_set:",l)}P(!0),u({title:"Password updated!",description:"Your password has been successfully set."}),setTimeout(()=>{C("/dashboard")},2e3)}}finally{m(!1)}}};return v?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-6",children:s.jsxs("div",{className:"w-full max-w-md text-center",children:[s.jsx("div",{className:"p-4 rounded-full bg-green-100 dark:bg-green-900/20 w-fit mx-auto mb-6",children:s.jsx(R,{className:"h-12 w-12 text-green-600 dark:text-green-400"})}),s.jsx("h2",{className:"font-display text-2xl font-bold text-foreground mb-2",children:"Password Updated!"}),s.jsx("p",{className:"text-muted-foreground mb-6",children:"Redirecting you to the dashboard..."}),s.jsx(p,{className:"h-6 w-6 animate-spin mx-auto text-primary"})]})}):s.jsxs("div",{className:"min-h-screen bg-background flex",children:[s.jsxs("div",{className:"hidden lg:flex lg:w-1/2 gradient-hero relative overflow-hidden",children:[s.jsxs("div",{className:"absolute inset-0",children:[s.jsx("div",{className:"absolute -top-40 -right-40 w-80 h-80 bg-accent/10 rounded-full blur-3xl"}),s.jsx("div",{className:"absolute -bottom-40 -left-40 w-80 h-80 bg-primary/10 rounded-full blur-3xl"})]}),s.jsxs("div",{className:"relative z-10 flex flex-col justify-center px-12 xl:px-20",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[s.jsx("div",{className:"p-3 rounded-2xl bg-primary-foreground/10 backdrop-blur-sm",children:s.jsx(f,{className:"h-8 w-8 text-primary-foreground"})}),s.jsx("span",{className:"font-display font-bold text-3xl text-primary-foreground",children:"I AM LOCAL AI"})]}),s.jsxs("h1",{className:"font-display text-4xl xl:text-5xl font-bold text-primary-foreground leading-tight mb-6",children:["Reset Your",s.jsx("br",{}),s.jsx("span",{className:"text-accent",children:"Password"})]}),s.jsx("p",{className:"text-lg text-primary-foreground/80 max-w-md",children:"Choose a strong password to keep your account secure."})]})]}),s.jsx("div",{className:"flex-1 flex items-center justify-center p-6 sm:p-12",children:s.jsxs("div",{className:"w-full max-w-md",children:[s.jsxs("div",{className:"lg:hidden flex items-center gap-2 mb-8 justify-center",children:[s.jsx("div",{className:"p-2 rounded-xl bg-primary",children:s.jsx(f,{className:"h-5 w-5 text-primary-foreground"})}),s.jsx("span",{className:"font-display font-bold text-xl",children:"I AM LOCAL AI"})]}),s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("h2",{className:"font-display text-2xl font-bold text-foreground",children:"Set your password"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:t?"Please set a password to secure your account":"Enter your new password below"})]}),s.jsxs("form",{onSubmit:L,className:"space-y-5",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(w,{htmlFor:"password",children:"New Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(g,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(h,{id:"password",type:d?"text":"password",placeholder:"••••••••",value:a,onChange:e=>N(e.target.value),className:"pl-10 pr-10"}),s.jsx("button",{type:"button",onClick:()=>y(!d),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:d?s.jsx(T,{className:"h-4 w-4"}):s.jsx(O,{className:"h-4 w-4"})})]}),n.password&&s.jsx("p",{className:"text-sm text-destructive",children:n.password})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(w,{htmlFor:"confirmPassword",children:"Confirm Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(g,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(h,{id:"confirmPassword",type:d?"text":"password",placeholder:"••••••••",value:c,onChange:e=>b(e.target.value),className:"pl-10"})]}),n.confirmPassword&&s.jsx("p",{className:"text-sm text-destructive",children:n.confirmPassword})]}),s.jsx(F,{type:"submit",variant:"accent",className:"w-full",size:"lg",disabled:i,children:i?s.jsxs(s.Fragment,{children:[s.jsx(p,{className:"h-4 w-4 animate-spin mr-2"}
1),"Updating..."]}):"Update Password"})]}),s.jsx("div",{className:"mt-6 text-center",children:s.jsx("a",{href:"/auth",className:"text-sm text-muted-foreground hover:text-foreground",children:"← Back to sign in"})})]})})]})};export{K 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.