c1908217b91b9026a7094f71a78dcea21ff5a2a28d34a3534b6f433e22c2baa1

Source Code:

(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{698:function(e,a,t){"use strict";t.r(a);var n=t(42),o=t.n(n),r=t(27),i=t.n(r),l=t(8),s=t.n(l),c=t(3),u=t.n(c),d=t(2),m=t.n(d),h=t(5),p=t.n(h),f=t(4),v=t.n(f),g=t(6),b=t.n(g),w=t(0),E=t.n(w),y=t(19),k=t(16),N=t(23),_=t.n(N),S=t(25),P=Object(S.a)({loader:function(){return Promise.all([t.e(2),t.e(6),t.e(22)]).then(t.bind(null,1017))}}),x=t(15),T=t.n(x),C=t(13),I=t.n(C),O=t(330),L=t(332),j=t(1),q=t.n(j),B=t(47),F=t.n(B),M=t(823),D=t.n(M),R=t(88),A=t.n(R),V=t(825),W=t.n(V),z=t(894),J=t.n(z),K=t(896),U=t.n(K),H=t(283),Y=t.n(H),Q=t(758),G=t.n(Q),Z=t(57),$=t(20),X=t.n($),ee=t(303),ae=t.n(ee),te=t(24),ne=t.n(te),oe=t(7),re=t.n(oe),ie=t(135),le=t.n(ie),se=t(348),ce=t.n(se),ue=t(26),de=t(29),me=G.a.initialize,he=G.a.submit,pe=function(e){function a(e){return u()(this,a),p()(this,v()(a).call(this,e))}return b()(a,e),m()(a,[{key:"componentDidMount",value:function(){this.props.uiState;if(!this.gaObj){var e=q()(this.props,"options.globalBlogOptions.tsm_ga_properties.auth",null);null!==e&&(this.gaObj=new de.a,this.gaObj.setAccounts([e]))}q()(this.props,"options.postLoadCredentials",!1)||!q()(this.props,"options.loyalty_restricted",!1)||document.body.classList.contains("no-scroll")||document.body.classList.add("no-scroll"),window.document.body.addEventListener("click",function(e){var a=void 0!==e.target?e.target:e.srcElement;if("a"==(a.nodeName||a.tagName).toLowerCase()){var t=void 0!==a.dataset.source?a.dataset.source:null;if(-1!==a.href.indexOf("#auth-")){var n=a.href.match(/\#auth\-([a-zA-Z\-]+)/);if(n.length>1)return e.preventDefault(),void this.toggle(n[1],t)}var o=["^"+("http://"+this.props.options.activeDomain)+"#fb-auth-registration-link(/)?$","^#fb-auth-registration-link(/)?$"];return null!==a.href.match(new RegExp("/"+o.join("|")+"/"))?(e.preventDefault(),void this.toggle("start",t)):"auth-modal-backdrop"==a.id?(e.preventDefault(),void this.toggle("close",t)):void 0}}.bind(this)),this.maybeLogout(),this.maybeFetchProfile(),this.maybeValidateKey(),this.maybeNoScroll()}},{key:"shouldComponentUpdate",value:function(e,a){return re()(this,e,a)}},{key:"maybeFetchProfile",value:function(){var e=this.props,a=e.uiState,t=e.receivedProfile,n=q()(a,"auth-modal.mode","start");!t||-1===["profile","profile-edit","change-password"].indexOf(n)||!1!==q()(a,"auth-modal.profileLoaded",!1)||q()(a,"auth-modal.processing",!1)||this.fetchProfile()}},{key:"componentDidUpdate",value:function(){this.maybeLogout(),this.maybeFetchProfile(),this.maybeValidateKey(),this.maybeNoScroll()}},{key:"render",value:function(){var e=this,a=this.props,t=a.options,n=a.uiState,o=a.formIsInvalid,r=a.formIsPristine,i=a.formIsValid,l=a.submitForm,c=a.internalads,u=a.socialOverlayInfo,d=a.blogInfo,m=a.logos,h=a.Logo,p=a.authStep,f={};try{f=A()(window,"location.search")?ae.a.parse(window.location.search.substring(1)):{}}catch(e){}var v=q()(n,"auth-modal.useModal",!0),g=q()(this.props,"isModal",!0),b=!!parseInt(q()(t,"blogOptions.facebook_app.plugins.facebook-authentication",0)),w=q()(t,"postLoadCredentials",null),y=q()(t,"postLoadCredentials.serviceStatus",void 0),k=!!q()(t,"postLoadCredentials.offline",void 0),N=q()(f,"static-override",!1),_=!q()(w,"id",null)&&q()(t,"loyalty_restricted",!1);if(!(_||q()(n,"auth-modal.show",!1))||!v&&g)return null;var S,x,C,I,j=k&&!N||void 0!==y&&!y?"servicefailure":q()(n,"auth-modal.mode","start"),B=q()(n,"auth-modal.step",1),F=q()(n,"auth-modal.processing",!1),M=q()(n,"auth-modal.error",null),D=q()(n,"auth-modal.message",null),R=q()(n,"auth-modal.profileLoaded",!1),V="auth-form-"+j.replace("-fb",""),W=le.a.stripslashes(q()(t,"globalBlogOptions.loyalty_title_"+t.blogId,null)),z=W||t.blogOptions._station_info.legalname,J=function(){}.bind(this);switch(j){case"start":S=null,x=E.a.createElement("div",{className:"input-container"},E.a.createElement("a",{className:"start-button",href:"#auth-register"},E.a.createElement("span",{className:"icon-close"})," Join Now"),E.a.createElement("a",{className:"start-button login",title:"Sign In",href:"#auth-login"},E.a.createElement("span",{className:"icon-user"})," Sign In"));break;case"login-fb":case"login":S="Sign In",C=g&&E.a.createElement("a",{className:"auth-nav-back",href:"#auth-start"},"Back"),I=r||o||F?E.a.createElement("span",{className:"auth-nav-next"},"Next"):E.a.createElement("a",{className:"auth-nav-next",href:"#_",onClick:function(e){e.preventDefault(),l(V)}},"Next"),x=E.a.createElement("div",{className:"input-container"},!g&&E.a.createElement("p",null,E.a.createElement("span",null,"If you are a member, please sign in below.",E.a.createElement("br",null)," Not a member? ",E.a.createElement("a",{href:"/registration/"},"Sign up!"))),b&&E.a.createElement("div",{className:"facebook-connect-button",title:"Sign in with Facebook",onClick:this.fbLogin.bind(this)},E.a.createElement("span",{className:"icon-facebook"}),"Sign in with Facebook","login-fb"==j&&F&&E.a.createElement(Z.a,{width:"18px",color:"#c0c0c0",strokeWidth:"4",id:"auth-loading"})),b&&E.a.createElement("div",{className:"or"}),E.a.createElement(P,{id:"auth-form",mode:j,step:B,onSubmit:this.authRequest.bind(this),goToStep:p,isModal:g}),!b&&E.a.createElement("p",{className:"fb-reset-message"},"Normally sign in with Facebook? ",E.a.createElement("a",{href:g?"#auth-fb-lost-password":"/login/?action=lost-password"},"Click here"),"."),!q()(t,"gdpr",!1)&&E.a.createElement("p",{className:"terms"},"You will receive the ",t.blogOptions._station_info.legalname," email newsletter, but you may unsubscribe at any time without losing your VIP status. ",E.a.createElement("a",{href:"/privacy",target:"_blank"},"Privacy Policy")," & ",E.a.createElement("a",{href:"/vip-terms",target:"_blank"},"Terms and Conditions"),"."),q()(t,"gdpr",!1)&&E.a.createElement("p",{className:"terms gdpr-terms"},E.a.createElement("a",{href:"/privacy",target:"_blank"},"Privacy Policy")," & ",E.a.createElement("a",{href:"/vip-terms",target:"_blank"},"Terms and Conditions")));break;case"register":S="Join Now",C=1==B?g&&E.a.createElement("a",{className:"auth-nav-back",href:"#auth-start"},"Back"):E.a.createElement("a",{className:"auth-nav-back",href:"#_",onClick:this.prev.bind(this)},"Back"),I=r||o||F?E.a.createElement("span",{className:"auth-nav-next"},"Next"):E.a.createElement("a",{className:"auth-nav-next",href:"#_",onClick:function(e){e.preventDefault(),l(V)}},"Next"),J=1==B?this.next.bind(this):this.authRequest.bind(this);var K=b&&1==B&&E.a.createElement("div",null,E.a.createElement("div",{className:"facebook-connect-button",title:"Sign in with Facebook",onClick:this.fbLogin.bind(this)},E.a.createElement("span",{className:"icon-facebook"}),"Sign up with Facebook"),E.a.createElement("div",{className:"or"}));x=E.a.createElement("div",{className:"input-container"},!g&&E.a.createElement("p",null,E.a.createElement("span",null,"Please register below.",E.a.createElement("br",null)," Already a member? ",E.a.createElement("a",{href:"/login/"},"Sign in!"))),K,E.a.createElement(P,{id:"auth-form",mode:j,step:B,onSubmit:J,goToStep:p,isModal:g}),!q()(t,"gdpr",!1)&&E.a.createElement("p",{className:"terms"},"You will receive the ",t.blogOptions._station_info.legalname," email newsletter, but you may unsubscribe at any time without losing your VIP status. ",E.a.createElement("a",{href:"/privacy",target:"_blank"},"Privacy Policy")," & ",E.a.createElement("a",{href:"/vip-terms",target:"_blank"},"Terms and Conditions"),"."),q()(t,"gdpr",!1)&&E.a.createElement("p",{className:"terms gdpr-terms"},E.a.createElement("a",{href:"/privacy",target:"_blank"},"Privacy Policy")," & ",E.a.createElement("a",{href:"/vip-terms",target:"_blank"},"Terms and Conditions")));break;case"account-activation":S="Welcome Back!",C=E.a.createElement("a",{className:"auth-nav-back",href:"#auth-start"},"Back"),I=r||o||F?E.a.createElement("span",{className:"auth-nav-next"},"Next"):E.a.createElement("a",{className:"auth-nav-next",href:"#_",onClick:function(e){e.preventDefault(),l(V)}},"Next"),J=this.authRequest.bind(this);var U=q()(n,"auth-modal.values.blog");x=E.a.createElement("div",{className:"input-container"},E.a.createElement("p",null,"It appears that you already have an account created within our VIP network of sites on ",E.a.createElement("a",{href:U},U),". To keep your personal information safe, we need to verify that it's really you. To activate your account, please confirm your ",E.a.createElement("a",{href:U},U)," password. When you have confirmed your password, you will be able to sign in through Facebook on both sites."),E.a.createElement(P,{id:"auth-form",mode:j,step:B,onSubmit:J,goToStep:p,isModal:g}),E.a.createElement("p",{className:"meta"},"Please note that your prizes and activities will not be shared between programs within our VIP network."));break;case"site-activation":S="Welcome Back!",C=E.a.createElement("a",{className:"auth-nav-back",href:"#auth-start"},"Back"),I=o||F?E.a.createElement("span",{className:"auth-nav-next"},"Next"):E.a.createElement("a",{className:"auth-nav-next",href:"#_",onClick:function(e){e.preventDefault(),l(V)}},"Next"),J=this.authRequest.bind(this),x=E.a.createElement("div",{className:"input-container"},E.a.createElement("p",null,"It appears that you already have an account on this site associated with ",E.a.createElement("strong",{className:"user-email"},q()(n,"auth-modal.values.email")),". To connect your existing account just click next. You will maintain your existing VIP profile. After you do this, you will be able to always sign in to ",E.a.createElement("a",{href:"http://"+t.activeDomain,target:"_blank"},t.activeDomain)," using your original account information."),E.a.createElement(P,{id:"auth-form",mode:j,step:B,onSubmit:J,goToStep:p,isModal:g}),E.a.createElement("p",{className:"meta"},"*Please note that your prizes and activities will not be shared between programs within our VIP network."));break;case"required-fields":S="We're Almost There!",C=E.a.createElement("span",{className:"auth-nav-back"},"Back"),I=r||o||F?E.a.createElement("span",{className:"auth-nav-next"},"Next"):E.a.createElement("a",{className:"auth-nav-next",href:"#_",onClick:function(e){e.preventDefault(),l(V)}},"Next"),J=this.authRequest.bind(this),x=E.a.createElement("div",{className:"input-container"},E.a.createElement("p",null,"Please fill out the information below to help us provide you a better experience."),E.a.createElement(P,{id:"auth-form",mode:j,step:B,onSubmit:J,goToStep:p,isModal:g}));break;case"message":S=q()(n,"auth-modal.values.title",""),C=E.a.createElement("span",{className:"auth-nav-back"},"Back"),I=E.a.createElement("span",{className:"auth-nav-next"},"Next"),x=E.a.createElement("div",{className:"message-container",dangerouslySetInnerHTML:{__html:q()(n,"auth-modal.values.message","")}});break;case"servicefailure":S=q()(n,"auth-modal.values.title",""),x=E.a.createElement("div",{className:"message-container"},"Sorry, this service is temporarily unavailable.");break;case"logout":S="Signing Out",C=E.a.createElement("span",{className:"auth-nav-back"},"Back"),I=E.a.createElement("span",{className:"auth-nav-next"},"Next"),x=i&&E.a.createElement("div",{className:"message-container"},E.a.createElement("div",{className:"logout-loading"},M&&E.a.createElement("div",{className:"auth-error"},M),!M&&E.a.createElement("span",null,E.a.createElement(Z.a,{width:"30px",color:"#c0c0c0",strokeWidth:"4"})," Signing out...")));break;case"fb-lost-password":S="Signing in via Facebook",C=g?E.a.createElement("a",{href:"#auth-login"},"Back"):E.a.createElement("a",{href:"/login/"},"Back"),I=r||o||F?E.a.createElement("span",{className:"auth-nav-next"},"Next"):E.a.createElement("a",{className:"auth-nav-next",href:"#_",onClick:function(e){e.preventDefault(),l(V)}},"Next"),J=this.authRequest.bind(this),x=E.a.createElement("div",{className:"input-container"},E.a.createElement("p",null,'As of September 28th, 2018, sign in via Facebook is no longer available. In order to access your account, please enter the email you use to login to Facebook and click "Next". You will receive an email with a custom link to pick your new password, which you will use moving forward. You will only have to do this once.'),E.a.createElement(P,{id:"auth-form",mode:j,step:B,onSubmit:this.authRequest.bind(this),goToStep:p,isModal:g}));break;case"lost-password":S="Lost Password",C=g?E.a.createElement("a",{className:"auth-nav-back",href:"#auth-login"},"Back"):E.a.createElement("a",{href:"/login/"},"Back"),I=r||o||F?E.a.createElement("span",{className:"auth-nav-next"},"Next"):E.a.createElement("a",{className:"auth-nav-next",href:"#_",onClick:function(e){e.preventDefault(),l(V)}},"Next"),J=this.authRequest.bind(this),x=E.a.createElement("div",{className:"input-container"},E.a.createElement("p",null,"Please enter your email address."),E.a.createElement(P,{id:"auth-form",mode:j,step:B,onSubmit:this.authRequest.bind(this),goToStep:p,isModal:g}));break;case"reset-password":S="Reset Password",C=null,I=null,J=function(){}.bind(this),x=E.a.createElement("div",{className:"input-container"},!M&&!D&&E.a.createElement("div",{className:"profile-loading"},E.a.createElement(Z.a,{width:"30px",color:"#c0c0c0",strokeWidth:"4"})," Validating key..."));break;case"change-password":S="Change Account Settings",R?!0!==R?(C=null,I=null,x=E.a.createElement("div",{className:"user-profile"},E.a.createElement("p",null,"Profile could not be loaded."))):(C=null,I=r||o||F?E.a.createElement("span",{className:"auth-nav-next"},"Save"):E.a.createElement("a",{className:"auth-nav-next",href:"#_",onClick:function(e){e.preventDefault(),l(V)}},"Save"),J=this.authRequest.bind(this),x=E.a.createElement("div",{className:"user-profile"},!g&&E.a.createElement("p",null,"Change your email or password."),E.a.createElement(P,{id:"auth-form",mode:j,step:B,onSubmit:J,goToStep:p,isModal:g}))):(C=null,I=null,x=E.a.createElement("div",{className:"user-profile"},E.a.createElement("div",{className:"profile-loading"},E.a.createElement(Z.a,{width:"30px",color:"#c0c0c0",strokeWidth:"4"})," Loading Profile...")));break;case"profile":if(S="Profile",J=function(){},R)if(!0!==R)C=null,I=null,x=E.a.createElement("div",{className:"user-profile"},E.a.createElement("p",null,"Profile could not be loaded."));else{var H=q()(n,"auth-modal.profile",{});C=null,I=E.a.createElement("a",{className:"auth-nav-next",href:"/profile/edit/"},"Edit"),x=E.a.createElement("div",{className:"user-profile"},!g&&E.a.createElement("p",null,"Review your profile below:"),E.a.createElement("div",null,E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"Name"),H.display_name?H.display_name:H.first_name+" "+H.last_name),q()(H,"dob.year")&&q()(H,"dob.month")&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"Birthday"),H.dob.month+(H.dob.day?"/"+H.dob.day:"")+"/"+H.dob.year),H.gender&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"Gender"),H.gender),H.phone&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"Phone"),H.phone),H.mobile_phone&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"Mobile Phone"),H.mobile_phone),H.home_phone&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"Home Phone"),H.home_phone),H.work_phone&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"Work Phone"),H.work_phone),q()(H,"address.street")&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"Address"),H.address.street+(H.address.street2?" "+H.address.street2:"")),q()(H,"address.city")&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"City"),H.address.city),q()(H,"address.state")&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"State"),H.address.state),q()(H,"address.zip")&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"Zipcode"),H.address.zip),q()(H,"address.country")&&E.a.createElement("div",{className:"profile-value"},E.a.createElement("span",null,"Country"),H.address.country)))}else C=null,I=null,x=E.a.createElement("div",{className:"user-profile"},E.a.createElement("div",{className:"profile-loading"},E.a.createElement(Z.a,{width:"30px",color:"#c0c0c0",strokeWidth:"4"})," Loading Profile..."));break;case"profile-edit":S="Edit Profile",R?!0!==R?(C=null,I=null,x=E.a.createElement("div",{className:"user-profile"},E.a.createElement("div",{className:"auth-error"},R),E.a.createElement("p",null,"Profile could not be loaded."))):(S="Edit Profile",C=E.a.createElement("a",{className:"auth-nav-back",href:"/profile/"},"Back"),I=r||o||F?E.a.createElement("span",{className:"auth-nav-next"},"Save"):E.a.createElement("a",{className:"auth-nav-next",href:"#_",onClick:function(e){e.preventDefault(),l(V)}},"Save"),J=this.authRequest.bind(this),x=E.a.createElement("div",{className:"user-profile"},!g&&E.a.createElement("p",null,"Review your profile information below:"),E.a.createElement(P,{id:"auth-form",mode:j,step:B,onSubmit:J,goToStep:p,isModal:g}))):(C=null,I=null,x=E.a.createElement("div",{className:"input-container loading"},E.a.createElement("div",{className:"profile-loading"},E.a.createElement(Z.a,{width:"30px",color:"#c0c0c0",strokeWidth:"4"})," Loading Profile...")))}var Y="logout"!=j&&"message"!=j&&(C||I)&&E.a.createElement("div",{className:"modal-nav"},C,I),Q=_?z+" Members Only":z,G=_?"<div><span>This is an exclusive benefit for ".concat(z," members.</span><span>If you are a member, please sign in below.<br/> Not a member? Sign up!</span></div>"):"<div><span>If you are a member, please sign in below.<br/> Not a member? Sign up!</span></div>",$=T()(null,{"is-modal":g});return E.a.createElement("div",{id:"auth-modal",className:$},E.a.createElement("div",{id:"auth-modal-backdrop",className:_?"restricted":null,onClick:function(){_?window.location.href="/":e.toggle("close")}}),E.a.createElement("div",{id:"auth-modal-container",className:j},g&&E.a.createElement("a",{className:"icon-close",href:"#auth-close",onClick:function(){_&&(window.location.href="/")}}),g&&E.a.createElement("div",{className:"auth-modal-header"},g&&E.a.createElement(L.a,s()({title:Q,subTitle:G},{blogInfo:d,socialOverlayInfo:u,logos:m,Logo:h,modeTitle:S}))),E.a.createElement("div",{className:"auth-modal-content"},E.a.createElement("div",null,D&&E.a.createElement("div",{className:"auth-message",dangerouslySetInnerHTML:{__html:D}}),M&&E.a.createElement("div",{className:"auth-error"},M),x,!x&&E.a.createElement(P,{id:"auth-form",mode:j,step:B,onSubmit:J,goToStep:p,isModal:g}))),E.a.createElement("div",{className:"auth-modal-footer"},Y,g&&E.a.createElement(O.a,{options:t,internalads:c}),E.a.createElement("div",{className:"clear"}))))}},{key:"toggle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;"close"==e&&(e=null),null===e&&(a=null),this.props.toggleAuth(e,a)}},{key:"prev",value:function(e){var a=this.props,t=a.uiState,n=a.authStep;void 0!==e.preventDefault&&e.preventDefault();var o=q()(t,"auth-modal.step",1)-1;o<1&&(o=1),n(o)}},{key:"next",value:function(e){var a=this.props,t=a.authStep,n=a.formIsPristine,o=a.formIsInvalid,r=a.uiState;(void 0!==e.preventDefault&&e.preventDefault(),n||o)||t(q()(r,"auth-modal.step",1)+1)}},{key:"objToQueryString",value:function(e){var a=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return D()(e,function(e,n,o){return"object"==i()(e)?a.objToQueryString(e,n):null!==t?t+"["+n+"]="+e:n+"="+e}).join("&")}},{key:"maybeNoScroll",value:function(){var e=this.props.options;q()(e,"loyalty_restricted",!1)&&q()(e,"postLoadCredentials.id",null)&&document.body.classList.contains("no-scroll")&&document.body.classList.remove("no-scroll")}},{key:"scrollToTop",value:function(){window&&(void 0!==window.scroll?window.scroll({top:0,behavior:"smooth"}):void 0!==window.scrollTo?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTop=0)}},{key:"fbLogin",value:function(){var e=this.props,a=e.authError,t=(e.options,e.toggleAuth),n=e.uiState,o=q()(n,"auth-modal.processing",!1);void 0===window.FB||o||window.FB.login(function(e){e.authResponse&&window.FB.api("/me",{fields:["id","name","email"]},function(e){"login-fb"!=q()(n,"auth-modal.mode",null)&&t("login-fb"),this.authRequest({params:e}).catch(function(e){a(q()(e,"errors._error","There was an error"))})}.bind(this))}.bind(this),{scope:"email,user_birthday,user_status,publish_actions,user_about_me,user_location,user_likes,user_hometown"})}},{key:"authEvent",value:function(e){var a=this,t=this.props,n=t.options,o=t.uiState;if("function"==typeof window.Event)window.dispatchEvent(new Event(e));else{var r=document.createEvent("Event");r.initEvent(e,!1,!0),window.dispatchEvent(r)}var i,l=q()(o,"auth-modal.source",!1);switch(e){case"auth.login":i="login";break;case"auth.register":i="registration";break;case"auth.logout":i="logout",l=""}null===l&&(l=q()(n,"loyalty_restricted",!1)?"vip exclusive":"site login");var s={eventCategory:"auth",eventAction:i,eventLabel:l};Object(ue.a)({data:s,ga:{fn:function(){void 0!==a.gaObj&&a.gaObj.sendTrackingEvent(s),de.b.sendTrackingEventByName(s,["primary"])}},ca:{},pa:{}})}},{key:"authRequest",value:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.options,r=t.authEditProfileNonce,l=t.authProcessing,s=t.authSuccess,c=t.uiState,u=t.toggleAuth;if(!q()(c,"auth-modal.processing",!1)){l();var d=q()(c,"auth-modal.mode","login"),m=q()(c,"auth-modal.payload",{});"string"==typeof m&&(m=ae.a.parse(m));var h=window.location.search?ae.a.parse(window.location.search.replace(/^\?/,"")):{},p=Object.keys(m).length?X()(I()(a),m):I()(a);switch(A()(p,"user_email")&&(p.user_email=encodeURIComponent(p.user_email)),d){case"login-fb":p.action="facebook_user_auth",p.params=q()(p,"params",{});break;case"login":p.action="facebook_wp_user_auth",void 0!==h.redirect_to&&(p.referer=encodeURIComponent(h.redirect_to));break;case"register":p.action="tsm_register_user",q()(n,"gdpr",!1)&&(p.receive_newsletters=p.receive_newsletters?1:0);break;case"account-activation":break;case"site-activation":p.required_meta=_()({},q()(p,"required_meta",{}),{activate:!0});break;case"required-fields":!1!==q()(p,"params",!1)&&!1!==q()(p,"required_meta",!1)&&(p.params=_()({},q()(p,"params",{}),p.required_meta)),p.required_meta=_()({},q()(p,"required_meta",{}),p.params);break;case"fb-lost-password":case"lost-password":p.action="lost_password";break;case"change-password":case"profile-edit":p.action="user_update_profile",p.profile_edit_form_submit="profile_edit_form_submit",p.profile_edit_nonce=r,p.receive_texts?p.receive_texts=1:p.receive_texts=0}var f=this.objToQueryString(p),v=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Pragma:"no-cache","Cache-Control":"no-cache"});return fetch("/rest/carbon/api/auth/auth",{method:"POST",credentials:"include",headers:v,body:f}).then(function(e){return e.json()}).then(function(a){var t={};if(t="string"==typeof a.data?JSON.parse(a.data):void 0!==q()(a,"data",void 0)?a.data:a,"object"!=i()(t)||0==Object.keys(t).length)throw l(!1),new Y.a({_error:"There was a problem. Please try again."});switch(d){case"register":if(t.success)return e.authEvent("auth.register"),t.redirect?void(-1===t.redirect.indexOf("welcome=1")?window.location.href=t.redirect:window.location.reload()):(l(!1),void u("message",null,{title:t.title,message:t.message},null));if(void 0!==q()(t,"body"))return e.authEvent("auth.login"),void window.location.reload();void 0!==q()(t.errors,"captcha",void 0)&&void 0!==window.grecaptcha&&window.grecaptcha.reset();var n=I()(t.errors);q()(n,"captcha",null)&&(ne()(n,"g-recaptcha-response",n.captcha),ce()(n,"captcha"));var r=q()(e.props.uiState,"auth-modal.step",1),c=0,m=0;throw F()(n,function(e,a){null===window.document.querySelector("[name="+a+"]")?m++:c++}),!c&&m&&e.props.authStep(1==r?2:1),l(!1),new Y.a(n);case"fb-lost-password":case"lost-password":if(l(!1),!t.success)throw new Y.a({user_email:t.message});return void u("message",null,{title:"Success",message:t.message},null);case"change-password":case"profile-edit":if(e.scrollToTop(),!t.success)throw l(!1),new Y.a(o()({_error:t.message?t.message:"Please review the errors below."},t.errors));return s("change-password"==d?"Password successfully changed":"Profile successfully updated."),void window.location.reload()}if(void 0!==t.error_messages&&t.error_messages)throw l(!1),new Y.a({_error:t.error_messages});if(void 0!==t.redirect&&t.redirect)return e.authEvent("auth.login"),void(window.location.href==t.redirect.trim()?window.location.reload():window.location.href=t.redirect.trim());if(void 0!==t.form&&t.form)switch(l(!1),t.form){case"site-activation":u(t.form,null,{email:t.email},p);break;case"account-activation":u(t.form,null,{blog:t.blog},p);break;default:u(t.form,null,null,p)}else h.redirect_to&&(window.location.href=redirectTo)}).catch(function(e){throw l(!1),e instanceof Y.a?e:new Y.a({_error:"Sorry, this service is temporarily unavailable."})})}}},{key:"maybeLogout",value:function(){var e=this.props.uiState;"logout"!=q()(e,"auth-modal.mode","start")||q()(e,"auth-modal.processing",!1)||q()(e,"auth-modal.error",!1)||this.logout()}},{key:"logout",value:function(){var e=this,a=this.props,t=a.authProcessing,n=a.isModal,o=a.uiState,r=q()(o,"auth-modal.processing",!1),l=q()(o,"auth-modal.error",!1);if(!r&&!l){t();var s=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Pragma:"no-cache","Cache-Control":"no-cache"}),c=this.props.authError;fetch("/rest/carbon/api/auth/auth",{method:"POST",credentials:"include",headers:s,body:"action=facebook_auth_logout"}).then(function(e){return e.json()}).then(function(a){var t={};t="string"==typeof a.data?JSON.parse(a.data):a,"object"==i()(t)&&0!=Object.keys(t).length||c("There was a problem. Please try again.",null),t.success?(e.authEvent("auth.logout"),n?window.location.reload():window.location.href="/"):window.location.reload()})}}},{key:"fetchProfile",value:function(){var e=this.props,a=e.authEditProfileNonce,t=e.authError,n=e.authProcessing,o=e.initializeForm,r=e.receivedProfile,l=e.uiState;if(!q()(l,"auth-modal.processing",!1)){var s=q()(l,"auth-modal.mode");n();var c=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Pragma:"no-cache","Cache-Control":"no-cache"});fetch("/rest/carbon/api/auth/auth",{method:"POST",credentials:"include",headers:c,body:"action=user_get_profile&profile_edit_nonce="+a}).then(function(e){return e.json()}).then(function(e){var a={};if(a="string"==typeof e.data?JSON.parse(e.data):e,"object"!=i()(a)||0==Object.keys(a).length)return r(a.profile,"There was a problem. Please try again."),void t("There was a problem. Please try again.",null);if(!a.success)return r(a.profile,a.message),void t(a.message);var l=I()(a.profile);l.receive_texts=l.receive_texts&&Boolean(l.receive_texts),r(I()(l)),o("auth-form-"+s,I()(l),!1),n(!1)}).catch(function(e){r({},"There was a problem. The request could not be completed. Please try again."),t("There was a problem. The request could not be completed. Please try again.")})}}},{key:"maybeValidateKey",value:function(){var e=this.props.uiState;if("reset-password"==q()(e,"auth-modal.mode","start")&&!q()(e,"auth-modal.processing",!1)&&!q()(e,"auth-modal.error",!1)&&!q()(e,"auth-modal.message",!1))return console.log("CALLING VALIDATE KEY",q()(e,"auth-modal.processing"),q()(e,"auth-modal.error"),q()(e,"auth-modal.message")),void this.validateKey()}},{key:"validateKey",value:function(){var e=this.props,a=(e.options,e.uiState),t=e.authError,n=e.authSuccess,o=e.authProcessing;if(!q()(a,"auth-modal.processing",!1)){o();var r=q()(a,"auth-modal.resetKey",null);if(r){var i=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Pragma:"no-cache","Cache-Control":"no-cache"});fetch("/rest/carbon/api/auth/auth",{method:"POST",credentials:"include",headers:i,body:"action=user_regenerate_password&key="+r}).then(function(e){return e.json()}).then(function(e){var a={};(a="string"==typeof e.data?JSON.parse(e.data):e).success?(n("Key validated, redirecting..."),window.location.href="/profile/edit/?action=change-password"):t(a.message?a.message:"There was an error. Please contact support.")}).catch(function(e){t("There was a problem. The request could not be completed. Please try again.")})}else window.location.href="/"}}}]),a}(w.Component);pe=Object(k.connect)(function(e,a){var t="auth-form-"+q()(e,"ui.auth-modal.mode","start").replace("-fb","");return{authEditProfileNonce:q()(e,"json.response.options.authEditProfileNonce",""),options:e.json.response.options,uiState:e.ui,internalads:e.internalads,formState:q()(e,"form."+t),formIsInvalid:W()(t)(e),formIsPristine:J()(t)(e),formIsValid:U()(t)(e)}},function(e){return Object(y.bindActionCreators)({initializeForm:me,submitForm:he},e)})(pe);a.default=pe},772:function(e,a,t){var n=t(428),o=t(318),r=t(824),i=t(41);e.exports=function(e,a){return(i(e)?n:r)(e,o(a,3))}},823:function(e,a,t){var n=t(431),o=t(772);e.exports=function(e,a){return n(o(e,a),1)}},824:function(e,a,t){var n=t(424),o=t(82);e.exports=function(e,a){var t=-1,r=o(e)?Array(e.length):[];return n(e,function(e,n,o){r[++t]=a(e,n,o)}),r}},825:function(e,a,t){"use strict";var n=t(312);a.__esModule=!0,a.default=void 0;var o=n(t(826)),r=n(t(700)),i=(0,o.default)(r.default);a.default=i},826:function(e,a,t){"use strict";var n=t(312);a.__esModule=!0,a.default=void 0;var o=n(t(746)),r=function(e){return function(a,t){var n=(0,o.default)(e)(a,t);return function(e){return!n(e)}}};a.default=r},894:function(e,a,t){"use strict";var n=t(312);a.__esModule=!0,a.default=void 0;var o=n(t(895)),r=n(t(700)),i=(0,o.default)(r.default);a.default=i},895:function(e,a,t){"use strict";a.__esModule=!0,a.default=void 0;var n=function(e){var a=e.deepEqual,t=e.empty,n=e.getIn;return function(e,o){return function(r){for(var i=(o||function(e){return n(e,"form")})(r),l=arguments.length,s=new Array(l>1?l-1:0),c=1;c<l;c++)s[c-1]=arguments[c];if(s&&s.length)return s.every(function(t){var o=n(i,e+".initial."+t),r=n(i,e+".values."+t);return a(o,r)});var u=n(i,e+".initial")||t,d=n(i,e+".values")||u;return a(u,d)}}};a.default=n},896:function(e,a,t){"use strict";var n=t(312);a.__esModule=!0,a.default=void 0;var o=n(t(746)),r=n(t(700)),i=(0,o.default)(r.default);a.default=i}}]);