"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[5679],{96512:(e,t,s)=>{s.d(t,{Z:()=>u});var a=s(48431),r=s.n(a),n=s(54156),l=s.n(n),o=s(21005),i=s(24897),d=s(94184),c=s.n(d);const m=e=>{let{url:t,className:s,onClick:a}=e;const{formatMessage:r}=(0,o.useIntl)();return l().createElement("div",{id:"back_button",className:c()("signup-header",s)},l().createElement(i.Link,{onClick:a,to:t},l().createElement("span",{id:"back_button_icon",className:"fa fa-1x fa-angle-left",title:r({id:"generic_icons.back",defaultMessage:"Back Icon"})}),l().createElement(o.FormattedMessage,{id:"web.header.back",defaultMessage:"Back"})))};m.propTypes={url:r().string,className:r().string,onClick:r().func},m.defaultProps={url:"/"};const u=m},95679:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g});var a=s(97779),r=s(64323),n=s(73396),l=s(48431),o=s.n(l),i=(s(33948),s(88674),s(73210),s(54156)),d=s.n(i),c=s(21005),m=s(16794),u=s(96512),p=s(927),h=s(87993);function f(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class E extends d().PureComponent{constructor(){super(...arguments),f(this,"state",{error:null,updateText:null}),f(this,"resetForm",d().createRef()),f(this,"emailInput",d().createRef()),f(this,"handleSendLink",(async e=>{e.preventDefault();const t=this.emailInput.current.value.trim().toLowerCase();if(!t||!(0,m.Jh)(t))return void this.setState({error:d().createElement(c.FormattedMessage,{id:"password_send.error",defaultMessage:"Please enter a valid email address."})});this.setState({error:null});const{data:s,error:a}=await this.props.actions.sendPasswordResetEmail(t);s?(this.setState({error:null,updateText:d().createElement("div",{id:"passwordResetEmailSent",className:"reset-form alert alert-success"},d().createElement(c.FormattedMessage,{id:"password_send.link",defaultMessage:"If the account exists, a password reset email will be sent to:"}),d().createElement("div",null,d().createElement("b",null,t)),d().createElement("br",null),d().createElement(c.FormattedMessage,{id:"password_send.checkInbox",defaultMessage:"Please check your inbox."}))}),this.resetForm.current&&(this.resetForm.current.hidden=!0)):a&&this.setState({error:a.message,updateText:null})}))}render(){let e=null;this.state.error&&(e=d().createElement("div",{className:"form-group has-error"},d().createElement("label",{className:"control-label"},this.state.error)));let t="form-group";return e&&(t+=" has-error"),d().createElement("div",null,d().createElement(u.Z,null),d().createElement("div",{className:"col-sm-12"},d().createElement("div",{className:"signup-team__container"},d().createElement(c.FormattedMessage,{id:"password_send.title",tagName:"h1",defaultMessage:"Password Reset"}),this.state.updateText,d().createElement("form",{onSubmit:this.handleSendLink,ref:this.resetForm},d().createElement("p",null,d().createElement(c.FormattedMessage,{id:"password_send.description",defaultMessage:"To reset your password, enter the email address you used to sign up"})),d().createElement("div",{className:t},d().createElement(p.Z,{id:"passwordResetEmailInput",type:"email",className:"form-control",name:"email",placeholder:{id:(0,h.t)("password_send.email"),defaultMessage:"Email"},ref:this.emailInput,spellCheck:"false",autoFocus:!0})),e,d().createElement("button",{id:"passwordResetButton",type:"submit",className:"btn btn-primary"},d().createElement(c.FormattedMessage,{id:"password_send.reset",defaultMessage:"Reset my password"}))))))}}f(E,"propTypes",{actions:o().shape({sendPasswordResetEmail:o().func.isRequired}).isRequired});const g=(0,r.connect)(null,(e=>({actions:(0,a.bindActionCreators)({sendPasswordResetEmail:n.LS},e)})))(E)}}]);
//# sourceMappingURL=5679.e80f9a33980bd89534a1.js.map