(self.webpackChunk_mattermost_webapp=self.webpackChunk_mattermost_webapp||[]).push([[557],{96512:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var s=r(45697),a=r.n(s),i=(r(39714),r(67294)),n=r(44012),c=r(73727);function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class o extends i.PureComponent{render(){return i.createElement("div",{id:"back_button",className:"signup-header"},i.createElement(c.Link,{onClick:this.props.onClick,to:this.props.url},i.createElement(n.Z,{id:"generic_icons.back",defaultMessage:"Back Icon"},(e=>i.createElement("span",{id:"back_button_icon",className:"fa fa-1x fa-angle-left",title:e.toString()}))),i.createElement(n.Z,{id:"web.header.back",defaultMessage:"Back"})))}}l(o,"propTypes",{url:a().string,onClick:a().func}),l(o,"defaultProps",{url:"/"})},90557:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var s=r(90879),a=r(14494),i=r(33383),n=r(22742),c=r(12707),l=r(10386),o=r(45697),u=r.n(o),d=(r(88674),r(33948),r(60285),r(74916),r(64765),r(67294)),m=r(44012),p=r(59925),h=r(89262),E=r(68336),g=r(16406),f=r(96512),_=r(19476),b=r(34288);function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class S extends d.PureComponent{constructor(e){super(e),v(this,"verifyEmail",(async()=>{const{actions:{verifyUserEmail:e}}=this.props,t=await e(new URLSearchParams(this.props.location.search).get("token")||"");"data"in t?this.handleSuccess():"error"in t&&this.handleError(E.cS.FAILED_EMAIL_VERIFICATION)})),this.state={verifyStatus:"pending",serverError:null}}componentDidMount(){this.verifyEmail()}handleRedirect(){if(this.props.isLoggedIn)b.mc();else{let e="/login?extra=verified";const t=new URLSearchParams(this.props.location.search).get("email");t&&(e+="&email="+encodeURIComponent(t));const r=new URLSearchParams(this.props.location.search).get("redirect_to");r&&(e+="&redirect_to="+r),h.m.push(e)}}async handleSuccess(){if(this.setState({verifyStatus:"success"}),this.props.actions.clearErrors(),this.props.isLoggedIn){this.props.actions.logError({message:E.MN.EMAIL_VERIFIED,type:E.Mw.SUCCESS},!0),(0,p.L9)("settings","verify_email");const e=await this.props.actions.getMe();"data"in e?this.handleRedirect():"error"in e&&this.handleError(E.cS.FAILED_USER_STATE_GET)}else this.handleRedirect()}handleError(e){let t=null;e===E.cS.FAILED_EMAIL_VERIFICATION?t=d.createElement(m.Z,{id:"signup_user_completed.invalid_invite",defaultMessage:"The invite link was invalid. Please speak with your Administrator to receive an invitation."}):e===E.cS.FAILED_USER_STATE_GET&&(t=d.createElement(m.Z,{id:"signup_user_completed.failed_update_user_state",defaultMessage:"Please clear your cache and try to log in."})),this.setState({verifyStatus:"failure",serverError:t})}render(){if("failure"!==this.state.verifyStatus)return d.createElement(_.Z,null);let e=null;return this.state.serverError&&(e=d.createElement("div",{className:"form-group has-error"},d.createElement("label",{className:"control-label"},this.state.serverError))),d.createElement("div",null,d.createElement(f.Z,null),d.createElement("div",{className:"col-sm-12"},d.createElement("div",{className:"signup-team__container"},d.createElement("img",{alt:"signup team logo",className:"signup-team-logo",src:g.Z}),d.createElement("div",{className:"signup__content"},d.createElement("h1",null,this.props.siteName),d.createElement("h4",{className:"color--light"},d.createElement(m.Z,{id:"web.root.signup_info",defaultMessage:"All team communication in one place, searchable and accessible anywhere"})),e))))}}v(S,"propTypes",{location:u().shape({search:u().string.isRequired}).isRequired,siteName:u().string,actions:u().shape({verifyUserEmail:u().func.isRequired,getMe:u().func.isRequired,logError:u().func.isRequired,clearErrors:u().func.isRequired}).isRequired,isLoggedIn:u().bool.isRequired});const y=(0,a.connect)((function(e){const t=(0,n.iE)(e).SiteName;return{isLoggedIn:Boolean((0,c.rc)(e)),siteName:t}}),(function(e){return{actions:(0,s.bindActionCreators)({verifyUserEmail:i.NH,getMe:i.jo,logError:l.H,clearErrors:l.b9},e)}}))(S)},16406:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});const s=r.p+"files/ab8aa80cba445eb0fb75e6611c292567.png"}}]);
//# sourceMappingURL=557.51a6e1ac34b811e4c186.js.map