(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[679],{96512:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c}),s(39714);var a=s(45697),r=s.n(a),n=s(67294),l=s(44012),i=s(73727);function o(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class c extends n.PureComponent{render(){return n.createElement("div",{id:"back_button",className:"signup-header"},n.createElement(i.Link,{onClick:this.props.onClick,to:this.props.url},n.createElement(l.Z,{id:"generic_icons.back",defaultMessage:"Back Icon"},(e=>n.createElement("span",{id:"back_button_icon",className:"fa fa-1x fa-angle-left",title:e.toString()}))),n.createElement(l.Z,{id:"web.header.back",defaultMessage:"Back"})))}}o(c,"propTypes",{url:r().string,onClick:r().func}),o(c,"defaultProps",{url:"/"})},95679:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>E});var a=s(14890),r=s(37703),n=s(12543),l=(s(88674),s(73210),s(33948),s(45697)),i=s.n(l),o=s(67294),c=s(44012),d=s(61625),u=s(96512),m=s(927),p=s(82251);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 h extends o.PureComponent{constructor(...e){super(...e),f(this,"state",{error:null,updateText:null}),f(this,"resetForm",o.createRef()),f(this,"emailInput",o.createRef()),f(this,"handleSendLink",(async e=>{e.preventDefault();const t=this.emailInput.current.value.trim().toLowerCase();if(!t||!(0,d.isEmail)(t))return void this.setState({error:o.createElement(c.Z,{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:o.createElement("div",{id:"passwordResetEmailSent",className:"reset-form alert alert-success"},o.createElement(c.Z,{id:"password_send.link",defaultMessage:"If the account exists, a password reset email will be sent to:"}),o.createElement("div",null,o.createElement("b",null,t)),o.createElement("br",null),o.createElement(c.Z,{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=o.createElement("div",{className:"form-group has-error"},o.createElement("label",{className:"control-label"},this.state.error)));let t="form-group";return e&&(t+=" has-error"),o.createElement("div",null,o.createElement(u.Z,null),o.createElement("div",{className:"col-sm-12"},o.createElement("div",{className:"signup-team__container"},o.createElement("h3",null,o.createElement(c.Z,{id:"password_send.title",defaultMessage:"Password Reset"})),this.state.updateText,o.createElement("form",{onSubmit:this.handleSendLink,ref:this.resetForm},o.createElement("p",null,o.createElement(c.Z,{id:"password_send.description",defaultMessage:"To reset your password, enter the email address you used to sign up"})),o.createElement("div",{className:t},o.createElement(m.Z,{id:"passwordResetEmailInput",type:"email",className:"form-control",name:"email",placeholder:{id:(0,p.t)("password_send.email"),defaultMessage:"Email"},ref:this.emailInput,spellCheck:"false",autoFocus:!0})),e,o.createElement("button",{id:"passwordResetButton",type:"submit",className:"btn btn-primary"},o.createElement(c.Z,{id:"password_send.reset",defaultMessage:"Reset my password"}))))))}}f(h,"propTypes",{actions:i().shape({sendPasswordResetEmail:i().func.isRequired}).isRequired});const E=(0,r.connect)(null,(e=>({actions:(0,a.bindActionCreators)({sendPasswordResetEmail:n.sendPasswordResetEmail},e)})))(h)}}]);
//# sourceMappingURL=679.052824b000c78d747639.js.map