1import{j as e}from"./ui-CDa3migz.js";import{r as a,u as g}from"./vendor-lfZNxkbU.js";import{d as w,u as v,s as n,H as b,a as N,I as m,B as y,F as k}from"./index-Ca5Bl_uW.js";import{L as h}from"./label-DM5OMYaH.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 z=w("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),C=()=>{const[r,x]=a.useState(""),[i,f]=a.useState(""),[d,c]=a.useState(!1),[l,u]=a.useState(!1),p=g(),{toast:o}=v();a.useEffect(()=>{const{data:{subscription:s}}=n.auth.onAuthStateChange(t=>{(t==="PASSWORD_RECOVERY"||t==="SIGNED_IN")&&u(!0)});return n.auth.getSession().then(({data:{session:t}})=>{t&&u(!0)}),()=>s.unsubscribe()},[]);const j=async s=>{if(s.preventDefault(),r.length<6){o({title:"BÅÄ d",description:"HasÅo musi mieÄ minimum 6 znaków",variant:"destructive"});return}if(r!==i){o({title:"BÅÄ d",description:"HasÅa nie sÄ takie same",variant:"destructive"});return}c(!0);const{error:t}=await n.auth.updateUser({password:r});c(!1),t?o({title:"BÅÄ d",description:t.message,variant:"destructive"}):(o({title:"HasÅo zmienione",description:"Możesz teraz korzystaÄ z nowego hasÅa."}),p("/moje-konto",{replace:!0}))};return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsxs(b,{children:[e.jsx("title",{children:"Resetuj hasÅo | VWP"}),e.jsx("meta",{name:"robots",content:"noindex, follow"})]}),e.jsx(N,{}),e.jsx("main",{className:"flex-1 py-12 bg-muted",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsx("div",{className:"max-w-md mx-auto",children:e.jsxs("div",{className:"bg-background p-8 border border-border shadow-sm",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx("div",{className:"w-16 h-16 bg-vwp-dark rounded-full flex items-center justify-center",children:e.jsx(z,{className:"w-8 h-8 text-white"})})}),e.jsx("h1",{className:"font-heading text-2xl font-bold text-center mb-2 text-foreground",children:"Ustaw nowe hasÅo"}),e.jsx("p",{className:"text-center text-muted-foreground text-sm mb-8",children:l?"Wpisz nowe hasÅo do swojego konta":"Weryfikacja linku resetujÄ cego..."}),l&&e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(h,{htmlFor:"password",children:"Nowe hasÅo *"}),e.jsx(m,{id:"password",type:"password",value:r,onChange:s=>x(s.target.value),className:"mt-1",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"})]}),e.jsxs("div",{children:[e.jsx(h,{htmlFor:"confirm",children:"Powtórz hasÅo *"}),e.jsx(m,{id:"confirm",type:"password",value:i,onChange:s=>f(s.target.value),className:"mt-1",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"})]}),e.jsx(y,{type:"submit",className:"w-full font-heading bg-vwp-dark hover:bg-vwp-dark/90",size:"lg",disabled:d,children:d?"ProszÄ czekaÄ...":"ZMIEÅ HASÅO"})]})]})})})}),e.jsx(k,{})]})};export{C 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.