1import{Y as P,z as A,D as l,x as T,cS as k,G as e,T as I,H as h,aa as B,ab as C,ej as _,fp as q,J as f,em as D,fr as y,as as F,i0 as H}from"./index-BuKyKLFj.js";import{R as N}from"./recaptcha-7GW7223w.js";import{u as L,E as M}from"./useEmailTypoSuggestion-B0vs1U4Y.js";import{u as z}from"./useComponentLog-D6gfCGk9.js";import{A as U}from"./index-BBcuTcSd.js";import"./email-typo-validator-DKcwSn5E.js";import"./arrow-backward-Dh-4CpSy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"[email protected]"};var r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="cdf32352-9c96-45bc-9888-595f71c5a294",t._sentryDebugIdIdentifier="sentry-dbid-cdf32352-9c96-45bc-9888-595f71c5a294")}catch{}})();const W=()=>{z("ForgotPassword");const t=P(),r=A(a=>a.ui.urlParams.username)||void 0,[s,o]=l.useState(r??""),[c,i]=l.useState(!1),[S,u]=l.useState(!1),[w,x]=l.useState(!1),m=T(),p=new N("password_reset"),[g]=k("rdng-2486-email-typo-validator-show"),{suggestion:n,handleBlur:E,clearSuggestion:b,applySuggestion:v}=L({enableHardBlock:!1}),j=async a=>{if(a.preventDefault(),!y(s)){i(!0);return}if(!p){x(!0);return}try{u(!1),m(F("Password Reset Requested",{email:s}));const d=await p.getToken();await H(s,d),u(!0),o(""),i(!1)}catch(d){console.error(d),i(!1),u(!0),o("")}},R=()=>{i(s.length>0&&!y(s)),g&&E(s)};return e.jsxs(U,{children:[e.jsx(I,{as:"h1",size:"xxlarge",children:"Request Password Reset"}),w&&e.jsx(h,{title:"Unable to Request Password Reset",description:"An error occurred. Please try again.",variant:"error",extraClassName:"mt-4"}),S?e.jsx(h,{extraClassName:"mt-4",title:"Password reset request sent",variant:"success",description:"Check your email for instructions on completing your password reset. If you donât see an email, please check your spam folder, or make sure youâre using the same email address that you used to create your account and try again."}):e.jsx("div",{}),e.jsxs("form",{className:"auth-form",onSubmit:a=>{j(a)},children:[e.jsxs(B,{children:[e.jsx(C,{htmlFor:"email",children:"Email Address"}),e.jsx(_,{required:!0,onBlur:R,id:"email",name:"email","data-test":"email",onChange:a=>{o(a.target.value),n.shouldShow&&b()},value:s,autoComplete:"email","aria-invalid":!!c}),c&&e.jsx(q,{children:"This doesn't appear to be a valid email address."}),g&&e.jsx(M,{suggestion:n.suggestion,shouldShow:n.shouldShow,isHardBlock:n.isHardBlock,onApply:a=>{o(v(a))}})]}),e.jsx("div",{className:"buttons-wrapper",children:e.jsx(f,{"data-test":"toResetPasswordPage",disabled:!s,stretch:!0,type:"submit",children:"Request Reset"})})]}),e.jsxs("form",{onSubmit:()=>{m({type:D,payload:{params:{username:s}}}),t("/user/signin")},children:[e.jsx("input",{type:"hidden",name:"username",value:s}),e.jsx(f,{type:"submit",stretch:!0,variant:"text",children:"Back to Sign In"})]})]})};export{W as default}; 2//# sourceMappingURL=index-BeHiftDl.js.map
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.