1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[711],{92662:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/reset",function(){return a(40215)}])},40215:function(e,s,a){"use strict";a.r(s);var t,r,o=a(74512),n=a(46809),l=a(56719),i=a(65471),u=a(9491),d=a(1961),c=a(67747),p=a(19020),h=a(62450),m=a(33795),w=a.n(m),g=a(32735);(t=r||(r={})).PENDING="PENDING",t.SUBMITTING="SUBMITTING",t.SUCCESS="SUCCESS";let y=e=>{let{userId:s,token:a}=e,[t,m]=(0,g.useState)(null),[y,S]=(0,g.useState)(0),[I,C]=(0,g.useState)([]),[f,b]=(0,g.useState)(r.PENDING),x=(0,l.useSharedQuery)(),[N]=(0,h.cI)(),[[E,j],k]=(0,g.useState)([s||"",a||""]),[P]=(0,l.useResetPasswordMutation)(),T=(0,g.useCallback)(()=>{m(null)},[m]),[Z,_]=(0,g.useState)(!1),v=(0,g.useCallback)(()=>{_(!0)},[_]),F=(0,g.useCallback)(()=>{_(!1)},[_]),[G,U]=(0,g.useState)(!1),D=(0,g.useCallback)(async(e,s)=>{if(s&&s!==N.getFieldValue("password"))throw"Make sure your passphrase is the same in both passphrase boxes."},[N]),R=(0,g.useCallback)(e=>{let s=e.target.value;U(G||!!s)},[G]),B=(0,g.useCallback)(e=>{b(r.SUBMITTING),m(null),(async()=>{try{let s=await P({variables:{userId:E,token:j,password:e.password}});w()(s,"data.resetPassword.success")?b(r.SUCCESS):(b(r.PENDING),m(Error("Incorrect token, please check and try again")))}catch(e){e.message?m(e):(m(Error("Please check the errors above and try again")),console.dir(e)),b(r.PENDING)}})()},[P,j,E]),[M,q]=(0,g.useState)(!1),L=(0,g.useCallback)(e=>{(0,i.setPasswordInfo)({setPasswordStrength:S,setPasswordSuggestions:C},e),q(N.isFieldTouched("password")),e.confirm?N.isFieldTouched("password")&&N.validateFields(["password"]):e.password&&N.isFieldTouched("confirm")&&N.validateFields(["confirm"])},[N]);return(0,o.jsx)(n.SharedLayout,{title:"Reset Password",query:x,forbidWhen:n.AuthRestrict.NEVER,children:(0,o.jsx)(n.Row,{children:(0,o.jsx)(n.Col,{flex:1,children:(0,o.jsxs)("div",{children:["SUBMITTING"===f?(0,o.jsx)(u.Z,{type:"info",message:"Submitting...",description:"This might take a few moments..."}):"SUCCESS"===f?(0,o.jsx)(u.Z,{type:"success",message:"Password Reset",description:"Your password was reset; you can go and log in now"}):null,(0,o.jsxs)(d.Z,{...i.formItemLayout,form:N,onFinish:B,onValuesChange:L,style:{display:f===r.PENDING?"":"none"},children:[(0,o.jsx)(d.Z.Item,{label:"Enter your reset token:",children:(0,o.jsx)(c.Z,{type:"text",value:j,onChange:e=>k([E,e.target.value])})}),(0,o.jsxs)(d.Z.Item,{label:"Choose a new passphrase:",required:!0,children:[(0,o.jsx)(d.Z.Item,{noStyle:!0,name:"password",rules:[{required:!0,message:"Please input your passphrase."}],children:(0,o.jsx)(c.Z,{type:"password",autoComplete:"new-password","data-cy":"registerpage-input-password",onFocus:v,onBlur:F})}),(0,o.jsx)(n.PasswordStrength,{passwordStrength:y,suggestions:I,isDirty:M,isFocussed:Z})]}),(0,o.jsx)(d.Z.Item,{label:"Confirm passphrase",name:"confirm",rules:[{required:!0,message:"Please confirm your passphrase."},{validator:D}],children:(0,o.jsx)(c.Z,{type:"password",autoComplete:"new-password",onBlur:R,"data-cy":"registerpage-input-password2"})}),t?(0,o.jsx)(d.Z.Item,{children:(0,o.jsx)(u.Z,{type:"error",closable:!0,onClose:T,message:t.message?String(t.message):String(t)})}):null,(0,o.jsx)(d.Z.Item,{...i.tailFormItemLayout,children:(0,o.jsx)(p.ZP,{htmlType:"submit","data-cy":"resetpage-submit-button",children:"Reset passphrase"})})]})]})})})})};y.getInitialProps=async e=>{let{query:{user_id:s,token:a}={}}=e;return{userId:"string"==typeof s?s:null,token:"string"==typeof a?a:null}},s.default=y}},function(e){e.O(0,[679,450,795,427,774,888,179],function(){return e(e.s=92662)}),_N_E=e.O()}]);
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.