PageSourceSearch

https://promakod.uz/assets/ResetPassword-Cv-WHaWX.js

js promakod.uz collected 2026-09-24 15:14:34 UTC 4,080 bytes, 1 lines download raw bytes

1import{f as S,r as t,j as e}from"./vendor-react-CdSkYK6A.js";import{u as P,s as d,B as h,I as f,k as n}from"./index-Bkpzml6u.js";import{L as p}from"./label-BTRMdqOW.js";import{ad as j,a6 as w,A as k}from"./vendor-icons-B6Pw7kvU.js";import"./vendor-radix-DZ5WJj_n.js";import"./vendor-supabase-C0gOjPry.js";import"./vendor-query-Cv6EpE7x.js";const V=()=>{const l=S(),{t:s}=P(),[o,g]=t.useState(""),[i,b]=t.useState(""),[c,m]=t.useState(!1),[N,u]=t.useState(!1),[v,x]=t.useState(!0);t.useEffect(()=>{const{data:{subscription:a}}=d.auth.onAuthStateChange(r=>{r==="PASSWORD_RECOVERY"&&(u(!0),x(!1))});return d.auth.getSession().then(({data:{session:r}})=>{r&&u(!0),x(!1)}),()=>a.unsubscribe()},[]);const y=async a=>{if(a.preventDefault(),o.length<6){n.error(s("passwordMin6"));return}if(o!==i){n.error(s("passwordsMismatch"));return}m(!0);try{const{error:r}=await d.auth.updateUser({password:o});r?n.error(r.message):(n.success(s("passwordUpdatedSuccess")),l("/auth"))}catch{n.error(s("error"))}finally{m(!1)}};return v?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-4 border-primary border-t-transparent rounded-full"})}):N?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("a",{href:"/",className:"flex items-center justify-center gap-2.5 mb-8",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl gradient-hero flex items-center justify-center shadow-glow",children:e.jsx(j,{className:"w-6 h-6 text-primary-foreground"})}),e.jsxs("span",{className:"text-2xl font-bold text-foreground",children:["Promo",e.jsx("span",{className:"text-gradient",children:"Kod"})]})]}),e.jsxs("div",{className:"bg-card rounded-2xl p-8 shadow-card",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground text-center mb-2",children:s("setNewPassword")}),e.jsx("p",{className:"text-muted-foreground text-center mb-6",children:s("enterNewPassword")}),e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"password",children:s("newPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx(w,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),e.jsx(f,{id:"password",type:"password",placeholder:"••••••••",value:o,onChange:a=>g(a.target.value),className:"pl-10"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"confirmPassword",children:s("confirmPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx(w,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),e.jsx(f,{id:"confirmPassword",type:"password",placeholder:"••••••••",value:i,onChange:a=>b(a.target.value),className:"pl-10"})]})]}),e.jsx(h,{type:"submit",className:"w-full",disabled:c,children:c?e.jsx("span",{className:"animate-spin w-5 h-5 border-2 border-white border-t-transparent rounded-full"}):e.jsxs(e.Fragment,{children:[s("updatePassword"),e.jsx(k,{className:"w-4 h-4 ml-2"})]})})]})]})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsxs("a",{href:"/",className:"flex items-center justify-center gap-2.5 mb-8",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl gradient-hero flex items-center justify-center shadow-glow",children:e.jsx(j,{className:"w-6 h-6 text-primary-foreground"})}),e.jsxs("span",{className:"text-2xl font-bold text-foreground",children:["Promo",e.jsx("span",{className:"text-gradient",children:"Kod"})]})]}),e.jsxs("div",{className:"bg-card rounded-2xl p-8 shadow-card",children:[e.jsx("h1",{className:"text-xl font-bold text-foreground mb-4",children:"Havola yaroqsiz"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:s("resetLinkExpired")}),e.jsx(h,{onClick:()=>l("/auth"),className:"w-full",children:s("backToLogin")})]})]})})};export{V 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.