1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="d2c68ee5-edb5-4cd6-ae8a-30e4318da166",e._sentryDebugIdIdentifier="sentry-dbid-d2c68ee5-edb5-4cd6-ae8a-30e4318da166")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[209],{286:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>A});var a=t(94513),r=t(1471),i=t(27988),l=t.n(i),o=t(65288),n=t(42262),d=t(54143),c=t(84437),u=t(65663),m=t(94285),h=t(9910),p=t(41498),g=t(49959),x=t(66246),f=t(73033),v=t(4237),w=t(67764),b=t(9936),j=t(88214);let y=()=>{let{t:e}=(0,r.Bd)(["staffAuth","common"]),{parseError:s}=(0,w.Z)(),t=(0,u.useRouter)(),{handleSubmit:i,register:l,formState:{errors:y}}=(0,h.mN)({resolver:(0,m.useMemo)(()=>{let s;return(0,o.u)((s=s=>e(`staffAuth:${s}`),(0,p.Ik)({email:(0,p.Yj)().min(1,s("validation.emailRequired")).email(s("validation.emailInvalid"))})))},[e])}),[A,M]=(0,m.useState)(null);(0,m.useEffect)(()=>{t.query?.linkExpired&&M(e("staffAuth:linkExpired"))},[t.query?.linkExpired,e]);let[N,E]=(0,m.useState)(!1),[R,I]=(0,m.useState)(""),L=(0,b.u)(),_=async e=>{let{email:t}=e;I(t),L.mutate({email:t},{onSuccess:()=>{E(!0)},onError:e=>{M(s(e))}})};return(0,a.jsxs)(n.A,{sx:{display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100vh - 5rem)"},children:[A&&(0,a.jsx)(d.A,{onClose:()=>M(null),icon:!1,severity:"error",sx:{width:"100%"},children:A}),(0,a.jsxs)(n.A,{component:"form",noValidate:!0,onSubmit:i(_),sx:{display:"flex",flexDirection:"column",alignItems:"stretch",width:"27rem",maxWidth:"-webkit-fill-available"},children:[(0,a.jsx)("div",{className:"p-12 pt-16 text-center w-full",children:(0,a.jsx)(g.A,{src:j.o.logo,alt:e("staffAuth:logoAlt"),maxWidth:v.U8,fullWidth:!0})}),(0,a.jsx)("div",{className:"mt-2 w-full",children:(0,a.jsx)(c.HM,{isTagline:!0,colour:c.Io.PRIMARY,level:c.rM.ONE,children:e("staffAuth:resetPassword")})}),(0,a.jsx)("div",{className:"mb-3 w-full",children:(0,a.jsx)(x.A,{id:"email",type:"email",label:e("staffAuth:emailLabel"),errorMessage:y.email?.message,...l("email")})}),(0,a.jsx)(f.$n,{variant:f.Ak.PRIMARY,size:f.Mp.LARGE,className:"w-full",name:"reset-password","data-test-id":"reset-password",type:"submit",loading:L.isLoading,children:e("staffAuth:resetPassword")}),N&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(c.a3,{textAlign:c.G$.CENTRE,children:e("common:validationMessages.resetPasswordConfirmation",{email:R})})})]})]})},A=()=>{let{t:e}=(0,r.Bd)("staffAuth");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l(),{children:(0,a.jsx)("title",{children:`${e("pageTitle.resetPassword")} | ${j.o.site_name??""}`})}),(0,a.jsx)(y,{})]})}},4237:(e,s,t)=>{"use strict";t.d(s,{U8:()=>i,YB:()=>a,fQ:()=>r,pt:()=>l});let a=1129,r=345,i=328,l=40},4705:(e,s,t)=>{"use strict";t.d(s,{kJ:()=>i,xW:()=>o,xe:()=>n});var a=t(65663),r=t.n(a);let i="/wellbeing/login",l=[i,"/wellbeing/reset-password","/wellbeing/new-password"],o=e=>{let s=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return l.some(e=>s===e||s.startsWith(`${e}/`))},n=e=>{let s=t=>{t.startsWith(i)&&(e.clear(),r().events.off("routeChangeComplete",s))};r().events.on("routeChangeComplete",s)}},9936:(e,s,t)=>{"use strict";t.d(s,{u:()=>i});var a=t(52111),r=t(80013);let i=()=>(0,a.useMutation)(e=>r.n.post("/auth/reset-password",e))},49959:(e,s,t)=>{"use strict";t.d(s,{A:()=>o});var a=t(94513),r=t(74671),i=t.n(r),l=t(4237);let o=({src:e,alt:s,maxHeight:t,maxWidth:r,fullWidth:o=!1,priority:n,loading:d,unoptimized:c})=>{let u={width:o?"100%":"auto",height:"auto",...void 0!==t?{maxHeight:t}:{},...void 0!==r?{maxWidth:r}:{}},m=void 0!==r?`${r}px`:void 0!==t?`${4*t}px`:"200px";return e.endsWith(".svg")&&(e.includes("/assets/brands/")||e.includes("/assets/logos/"))?(0,a.jsx)(i(),{src:e,alt:s,width:l.YB,height:l.fQ,className:"h-auto w-auto",style:u,priority:n,loading:d,unoptimized:c}):(0,a.jsx)(i(),{src:e,alt:s,width:0,height:0,sizes:m,className:"h-auto w-auto",style:u,priority:n,loading:d,unoptimized:c??!0})}},56421:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/wellbeing/reset-password",function(){return t(286)}])},66246:(e,s,t)=>{"use strict";t.d(s,{A:()=>d});var a=t(94513),r=t(1471),i=t(84437),l=t(51304),o=t.n(l);let n=(0,t(94285).forwardRef)(({id:e,label:s,helperText:t,type:l="text",disabled:n=!1,errorMessage:d,className:c="","data-cy":u,name:m,value:h,onChange:p,onBlur:g,disableFutureDates:x=!1,rows:f,required:v=!0,maxLength:w,...b},j)=>{let{t:y}=(0,r.Bd)(),A=d?"border-error-500":"border-neutral-300",M=n?"bg-neutral-100 cursor-not-allowed":"bg-surface/60",N=`w-full px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500 ${A} ${M} ${c}`.trim(),E={date:"YYYY-MM-DD","datetime-local":"YYYY-MM-DDTHH:mm"}[l],R=x&&E?o()().format(E):void 0,I=f&&f>1,L=t?`${e}-helper`:void 0,_=d?`${e}-error`:void 0,$=void 0!==w?`${e}
1-counter`:void 0,k=[L,_,$].filter(Boolean).join(" ");return(0,a.jsxs)("div",{children:[s&&(0,a.jsx)("div",{className:"mb-1",children:(0,a.jsxs)(i.lR,{htmlFor:e,children:[s,!v&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)(i.a3,{as:i.Y4.SPAN,colour:i.Io.MUTED,size:i.Zx.SMALL,children:y("formLabels.optional")})]})]})}),t&&(0,a.jsx)("div",{className:"mb-2",id:L,children:(0,a.jsx)(i.a3,{colour:i.Io.MUTED,size:i.Zx.SMALL,children:t})}),I?(0,a.jsx)("textarea",{ref:j,id:e,name:m,disabled:n,value:h,maxLength:w,onChange:p,onBlur:g,"aria-describedby":k||void 0,"data-cy":u,className:`${N} resize-vertical min-h-[80px]`,rows:f,...b}):(0,a.jsx)("input",{ref:j,type:l,id:e,name:m,disabled:n,value:h,maxLength:w,onChange:p,onBlur:g,"aria-describedby":k||void 0,"data-cy":u,className:N,max:R,...b}),d&&(0,a.jsx)("div",{className:"mt-1",id:_,children:(0,a.jsx)(i.a3,{variant:i.J3.ERROR,size:i.Zx.SMALL,children:d})}),void 0!==w&&void 0!==h&&(0,a.jsx)("div",{className:"mt-1",id:$,"aria-live":"polite",children:(0,a.jsx)(i.a3,{colour:i.Io.MUTED,size:i.Zx.SMALL,textAlign:i.G$.RIGHT,children:y("form.charactersRemaining",{count:w-h.length})})})]})});n.displayName="FormInput";let d=n},67764:(e,s,t)=>{"use strict";t.d(s,{Z:()=>r});var a=t(1471);let r=()=>{let{t:e}=(0,a.Bd)();return{parseError:s=>s?.response?.status===429?e("validationMessages.tooManyRequests"):s?.response?.data?.code===23505?e("validationMessages.emailAlreadyRegisteredLogin"):s?.response?.data?.message==="Incorrect username or password"?e("validationMessages.incorrectCredentials"):s?.response?.data?.message?s.response.data.message:s?.message?s.message:e("validationMessages.somethingWentWrong")}}},80013:(e,s,t)=>{"use strict";t.d(s,{n:()=>i});var a=t(23090),r=t(4705);let i=a.A.create({baseURL:"https://api.motion.org.uk",headers:{Accept:"application/json","Content-Type":"application/json"},withCredentials:!0});i.interceptors.request.use(e=>(e.baseURL="https://api.motion.org.uk",e.data instanceof FormData&&delete e.headers["Content-Type"],e)),i.interceptors.response.use(e=>e,e=>{let s=e?.response?.status===401,t=e?.response?.message==="token expired"||e?.response?.data==="Unauthorized"||e?.response?.data?.message==="Authentication required";return s&&t&&((0,r.xW)(window.location.pathname)||(window.location.href="/wellbeing/login")),Promise.reject(e)})}},e=>{e.O(0,[1018,3090,5306,5288,9715,4143,636,6593,8792],()=>e(e.s=56421)),_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.