PageSourceSearch

https://collabsmap.com/assets/ResetPasswordPage-CuniUe2_.js

js collabsmap.com collected 2026-10-04 23:23:24 UTC 3,036 bytes, 1 lines download raw bytes

1import{r,w as j,a as x}from"./chunk-KS7C4IRE-CDheynbW.js";import{j as t}from"./jsx-runtime-u17CrQMm.js";import{u as E,t as P}from"./AuthProvider-Dxr9XcHq.js";import{f as y}from"./errors-D9W2EQYe.js";import{W as v}from"./WebLogo-Cv_yu_2p.js";import{A as C}from"./AuthPage-BnlLoICO.js";import{C as b}from"./Callout-D_BS-Ux9.js";import{E as k}from"./EmptyState-CbU-HAYa.js";import{B as S}from"./logo-full-CFQLcoNi.js";import{F as A}from"./FormSection-BrpQE_l5.js";import{S as R}from"./Stack-D6G4TFFy.js";import{P as w}from"./PasswordInput-CixHp-j7.js";import"./browser-Dk4ssQwl.js";import"./VidereoLogo-DG_8ELzv.js";import"./Loader-Jt6ro-gi.js";import"./LoadingState-Bjpk0Jit.js";import"./Skeleton-DiYwo0lM.js";import"./MapBackdrop-D093Ga4w.js";import"./SecuredByVidereo-hZeer-3j.js";import"./Group-DBKRyCtm.js";import"./collabsmap-mark-ueLeU-Rz.js";import"./InfoIcon-Bo0Oftuf.js";import"./RemoveButton-Bd0XwAL8.js";import"./IconButton-BuJqVz1Q.js";import"./enums-B2OCwrQG.js";import"./index-BY2L8H1W.js";import"./InputBase-Dk4kpKG_.js";const g=8;function T({onSubmit:f,loading:n=!1,error:l,testIdPrefix:s="reset"}){const[a,p]=r.useState(""),[i,u]=r.useState(""),[m,o]=r.useState(""),c=e=>{if(e.preventDefault(),o(""),a.length<g){o(`Password must be at least ${g} characters.`);return}if(a!==i){o("Passwords don’t match.");return}f(a)},d=m||l;return t.jsx("div",{"data-testid":`${s}-form`,children:t.jsx(A,{title:"Set a new password",description:"Pick something memorable.",children:t.jsx("form",{onSubmit:c,children:t.jsxs(R,{gap:"lg",children:[t.jsx(w,{label:"New password",placeholder:"At least 8 characters",value:a,onChange:e=>p(e.currentTarget.value),required:!0,withAsterisk:!1,"data-testid":`${s}-password-input`}),t.jsx(w,{label:"Confirm password",placeholder:"Type it again",value:i,onChange:e=>u(e.currentTarget.value),required:!0,withAsterisk:!1,"data-testid":`${s}-confirm-input`}),d&&t.jsx(b,{tone:"error","data-testid":`${s}-error`,children:d}),t.jsx(S,{type:"submit",fullWidth:!0,loading:n,"data-testid":`${s}-submit-button`,children:"Update password"})]})})})})}const at=j(function(){const n=x(),{user:l,loading:s,updatePassword:a}=E(),[p,i]=r.useState(!1),[u,m]=r.useState(""),[o,c]=r.useState(!1);r.useEffect(()=>{if(!o)return;P("auth_password_reset_completed",{app:"web"});const e=setTimeout(()=>n("/map",{replace:!0}),1500);return()=>clearTimeout(e)},[o,n]);const d=r.useCallback(async e=>{m(""),i(!0);try{await a(e),c(!0)}catch(h){m(y(h instanceof Error?h.message:"Could not update password").message)}finally{i(!1)}},[a]);return t.jsx(C,{brand:"collabsmap",logo:t.jsx(v,{variant:"full",size:"md"}),loading:s,loadingLabel:"Loading",children:o?t.jsx(b,{tone:"success",title:"Password updated",children:"Redirecting you to the map…"}):l?t.jsx(T,{onSubmit:d,loading:p,error:u}):t.jsx(k,{title:"Reset link expired",description:"This link has expired or was already used.",action:t.jsx(S,{variant:"secondary",size:"sm",component:"a",href:"/forgot-password",children:"Request a new link"})})})});export{at 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.