"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[4231],{26452:(e,t,s)=>{s.d(t,{Z:()=>u});var a=s(86332),r=s.n(a),n=s(84390),l=s.n(n),i=s(72060),o=s(9448),c=s(60042),d=s.n(c);const m=e=>{let{url:t,className:s,onClick:a}=e;const{formatMessage:r}=(0,i.useIntl)();return l().createElement("div",{className:d()("signup-header",s)},l().createElement(o.Link,{"data-testid":"back_button",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(i.FormattedMessage,{id:"web.header.back",defaultMessage:"Back"})))};m.propTypes={url:r().string,className:r().string,onClick:r().func},m.defaultProps={url:"/"};const u=m},48480:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g});var a=s(36891),r=s(70314),n=s(43704),l=s(86332),i=s.n(l),o=(s(14078),s(61418),s(20266),s(92189),s(84390)),c=s.n(o),d=s(72060),m=s(65370),u=s(26452),p=s(29925),f=s(96811);function h(e,t,s){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var a=s.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class b extends c().PureComponent{constructor(){super(...arguments),h(this,"state",{error:null,updateText:null}),h(this,"resetForm",c().createRef()),h(this,"emailInput",c().createRef()),h(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:c().createElement(d.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:c().createElement("div",{id:"passwordResetEmailSent",className:"reset-form alert alert-success"},c().createElement(d.FormattedMessage,{id:"password_send.link",defaultMessage:"If the account exists, a password reset email will be sent to:"}),c().createElement("div",null,c().createElement("b",null,t)),c().createElement("br",null),c().createElement(d.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=c().createElement("div",{className:"form-group has-error"},c().createElement("label",{className:"control-label"},this.state.error)));let t="form-group";return e&&(t+=" has-error"),c().createElement("div",null,c().createElement(u.Z,null),c().createElement("div",{className:"col-sm-12"},c().createElement("div",{className:"signup-team__container"},c().createElement(d.FormattedMessage,{id:"password_send.title",tagName:"h1",defaultMessage:"Password Reset"}),this.state.updateText,c().createElement("form",{onSubmit:this.handleSendLink,ref:this.resetForm},c().createElement("p",null,c().createElement(d.FormattedMessage,{id:"password_send.description",defaultMessage:"To reset your password, enter the email address you used to sign up"})),c().createElement("div",{className:t},c().createElement(p.Z,{id:"passwordResetEmailInput",type:"email",className:"form-control",name:"email",placeholder:{id:(0,f.t)("password_send.email"),defaultMessage:"Email"},ref:this.emailInput,spellCheck:"false",autoFocus:!0})),e,c().createElement("button",{id:"passwordResetButton",type:"submit",className:"btn btn-primary"},c().createElement(d.FormattedMessage,{id:"password_send.reset",defaultMessage:"Reset my password"}))))))}}h(b,"propTypes",{actions:i().shape({sendPasswordResetEmail:i().func.isRequired}).isRequired});const g=(0,r.connect)(null,(e=>({actions:(0,a.bindActionCreators)({sendPasswordResetEmail:n.LS},e)})))(b)}}]);
//# sourceMappingURL=4231.f9372ddf5363e41aa9a0.js.map