"use strict";(self.webpackChunk_mattermost_webapp=self.webpackChunk_mattermost_webapp||[]).push([[112],{39112:(e,s,a)=>{a.r(s),a.d(s,{default:()=>N});var t=a(97779),r=a(14494),n=a(22742),o=a(33383),l=a(45697),c=a.n(l),m=(a(33948),a(88674),a(41637),a(74916),a(64765),a(67294)),i=a(44012),u=a(94184),d=a.n(u),p=a(89262),f=a(66788),w=a(927),h=a(87993);const g=e=>{let{location:s,siteName:a,actions:t}=e;const[r,n]=(0,m.useState)(null),o=(0,m.useRef)(null),l=r?m.createElement("div",{className:"form-group has-error"},m.createElement("label",{className:"control-label"},r)):null;return m.createElement("div",{className:"col-sm-12"},m.createElement("div",{className:"signup-team__container"},m.createElement(i.Z,{id:"password_form.title",tagName:"h1",defaultMessage:"Password Reset"}),m.createElement("form",{onSubmit:async e=>{e.preventDefault();const a=o.current.value;if(!a||a.length<f.ZP.MIN_PASSWORD_LENGTH)return void n(m.createElement(i.Z,{id:"password_form.error",defaultMessage:"Please enter at least {chars} characters.",values:{chars:f.ZP.MIN_PASSWORD_LENGTH}}));const r=new URLSearchParams(s.search).get("token");if("string"!=typeof r)throw new Error("token must be a string");const{data:l,error:c}=await t.resetUserPassword(r,a);l?(p.m.push("/login?extra="+f.ZP.PASSWORD_CHANGE),n(null)):c&&n(c.message)}},m.createElement("p",null,m.createElement(i.Z,{id:"password_form.enter",defaultMessage:"Enter a new password for your {siteName} account.",values:{siteName:a}})),m.createElement("div",{className:d()("form-group",{"has-error":r})},m.createElement(w.Z,{id:"resetPasswordInput",type:"password",className:"form-control",name:"password",ref:o,placeholder:{id:(0,h.t)("password_form.pwd"),defaultMessage:"Password"},spellCheck:"false",autoFocus:!0})),l,m.createElement("button",{id:"resetPasswordButton",type:"submit",className:"btn btn-primary"},m.createElement(i.Z,{id:"password_form.change",defaultMessage:"Change my password"})))))};g.propTypes={location:c().shape({search:c().string.isRequired}).isRequired,actions:c().shape({resetUserPassword:c().func.isRequired}).isRequired,siteName:c().string};const E=(0,m.memo)(g),N=(0,r.connect)((function(e){return{siteName:(0,n.iE)(e).SiteName}}),(e=>({actions:(0,t.bindActionCreators)({resetUserPassword:o.$P},e)})))(E)}}]);
//# sourceMappingURL=112.84e5b97deeb53a8a0a1f.js.map