webpackJsonp([56],{2120:function(e,t,a){"use strict";(function(e){function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=a(6),r=l(s),o=a(4),u=l(o),i=a(5),n=l(i),d=a(7),f=l(d),c=a(8),m=l(c),p=a(2),h=l(p),w=a(1),y=l(w),_=a(46),v=l(_),b=a(17),E=a(742),M=a(69),g=a(9),S=l(g),T=a(16),k=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t.default=e,t}(T),N=a(2101),O=l(N),P=function(t){function a(e){(0,u.default)(this,a);var t=(0,f.default)(this,(a.__proto__||(0,r.default)(a)).call(this,e));return t.submit=t.submit.bind(t),t.preSubmit=t.preSubmit.bind(t),t.state={showMfa:!1,password:""},t}return(0,m.default)(a,t),(0,n.default)(a,[{key:"preSubmit",value:function(e){var t=this;e.preventDefault();var a={},l=v.default.findDOMNode(this.refs.password).value;if(!l)return a.error=k.localizeMessage("claim.email_to_oauth.pwdError","Please enter your password."),void this.setState(a);this.setState({password:l}),a.error=null,this.setState(a),(0,M.checkMfa)(this.props.email,function(e){e?t.setState({showMfa:!0}):t.submit(t.props.email,l,"")},function(e){t.setState({error:e.message})})}},{key:"submit",value:function(e,t,a){var l=this;(0,E.emailToOAuth)(e,t,a,this.props.newType,function(e){e.follow_link&&(window.location.href=e.follow_link)},function(e){l.setState({error:e.message,showMfa:!1})})}},{key:"render",value:function(){var t=null;this.state.error&&(t=y.default.createElement("div",{className:"form-group has-error"},y.default.createElement("label",{className:"control-label"},this.state.error)));var a="form-group";t&&(a+=" has-error");var l=this.props.newType===S.default.SAML_SERVICE?S.default.SAML_SERVICE.toUpperCase():k.toTitleCase(this.props.newType),s=l+" SSO",r=void 0;return r=this.state.showMfa?y.default.createElement(O.default,{loginId:this.props.email,password:this.state.password,submit:this.submit}):y.default.createElement("form",{onSubmit:this.preSubmit},y.default.createElement("p",null,y.default.createElement(b.FormattedMessage,{id:"claim.email_to_oauth.ssoType",defaultMessage:"Upon claiming your account, you will only be able to login with {type} SSO",values:{type:l}})),y.default.createElement("p",null,y.default.createElement(b.FormattedMessage,{id:"claim.email_to_oauth.ssoNote",defaultMessage:"You must already have a valid {type} account",values:{type:l}})),y.default.createElement("p",null,y.default.createElement(b.FormattedMessage,{id:"claim.email_to_oauth.enterPwd",defaultMessage:"Enter the password for your {site} account",values:{site:e.window.mm_config.SiteName}})),y.default.createElement("div",{className:a},y.default.createElement("input",{type:"password",className:"form-control",name:"password",ref:"password",placeholder:k.localizeMessage("claim.email_to_oauth.pwd","Password"),spellCheck:"false"})),t,y.default.createElement("button",{type:"submit",className:"btn btn-primary"},y.default.createElement(b.FormattedMessage,{id:"claim.email_to_oauth.switchTo",defaultMessage:"Switch account to {uiType}",values:{uiType:s}}))),y.default.createElement("div",null,y.default.createElement("h3",null,y.default.createElement(b.FormattedMessage,{id:"claim.email_to_oauth.title",defaultMessage:"Switch Email/Password Account to {uiType}",values:{uiType:s}})),r)}}]),a}(y.default.Component);t.default=P,P.defaultProps={},P.propTypes={newType:h.default.string,email:h.default.string}}).call(t,a(22))}});
//# sourceMappingURL=56.c07a72b2eee4d5e15926.js.map