1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2534],{67671:function(e,n,t){"use strict";var r=t(85893),i=t(67294),o=t(91434),s=t(41664),l=t.n(s),a=t(94884),u=t.n(a),c=t(72300),d=t(50259),p=t(93967),m=t.n(p),h=t(16332),g=t(97576);n.Z=e=>{let{autoFocus:n}=e,t=(0,i.useContext)(o.Ec),[s,a]=(0,i.useState)(""),[p,f]=(0,i.useState)(""),[x,v]=(0,i.useState)(!1),[_,y]=(0,i.useState)(null),{executeRecaptcha:j}=(0,d.xX)();if(null===t||t.__typename!==o.bZ.Anonymous)return null;async function N(){if(x||!t||t.__typename!==o.bZ.Anonymous||!j)return;if(!s){y("Username required.");return}if(!p){y("Password required.");return}v(!0),y(null);let e=await j("login").catch(e=>e);if(e instanceof Error){y("An error occurred, please try again later."),v(!1);return}v(!1),await t.login(s,p,e).catch(e=>{y(e.message)}),v(!1)}return(0,r.jsxs)("div",{className:u().container,children:[(0,r.jsx)("h2",{className:u().header,children:"Login"}),(0,r.jsx)("div",{style:{height:"1em"}}),(0,r.jsx)(h.GoogleLoginButton,{}),(0,r.jsx)("div",{style:{height:"1em"}}),(0,r.jsx)(g.i,{}),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),N()},children:[(0,r.jsxs)("div",{className:u().formField,children:[(0,r.jsx)("label",{className:u().formFieldLabel,htmlFor:"username",children:"Username/Email"}),(0,r.jsx)("input",{type:"text",name:"username",value:s,autoFocus:n,className:u().formFieldInput,onChange:e=>a(e.target.value)})]}),(0,r.jsxs)("div",{className:u().formField,children:[(0,r.jsx)("label",{className:u().formFieldLabel,htmlFor:"password",children:"Password"}),(0,r.jsx)("input",{type:"password",value:p,name:"password",autoComplete:"currentPassword",className:u().formFieldInput,onChange:e=>f(e.target.value)})]}),(0,r.jsx)("div",{className:m()("login-errors",u().errorText),children:_}),(0,r.jsx)("button",{className:u().formSubmit,type:"submit",children:x?(0,r.jsx)(c.Z,{}):"Login"})]}),(0,r.jsx)(l(),{href:"/premium",className:u().link,children:"Create new account"}),(0,r.jsx)(l(),{href:"/user/password",className:u().link,children:"Reset your password"}),(0,r.jsxs)("div",{className:u().disclaimer,children:["This site is protected by reCAPTCHA and the Google"," ",(0,r.jsx)("a",{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and"," ",(0,r.jsx)("a",{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]})}},16332:function(e,n,t){"use strict";t.r(n),t.d(n,{GoogleLoginButton:function(){return g},SignUpWithGoogle:function(){return f},postGoogleSignUpLoadingAtom:function(){return h}});var r=t(85893),i=t(15103),o=t(48583),s=t(5292),l=t(48718),a=t(11163),u=t(75338),c=t(72300),d=t(83208),p=t(91058),m=t.n(p);let h=(0,i.cn)(!1);function g(){let e=function(e,n){let[t,r]=(0,o.KO)(h),i=(0,o.Dv)(d.Yb),a=(0,o.Dv)(d.ev),u=l.S.user.registerWithGoogle.useMutation(),c=l.S.user.newsletterOptIn.useMutation();return async function(){try{var e,n,t;let o=new s.Z.auth.GoogleAuthProvider,l=s.Z.auth().currentUser,d=null==l?void 0:l.displayName,p=null==l?void 0:l.photoURL,m=await s.Z.auth().signInWithPopup(o).catch(e=>e);if(r(!0),m instanceof Error)return console.error("[GOOGLE SIGNUP ERR]:",m),r(!1),!1;if(!(null===(e=m.additionalUserInfo)||void 0===e?void 0:e.isNewUser)){m.user&&(d||p)&&await m.user.updateProfile({displayName:null!=d?d:m.user.displayName,photoURL:null!=p?p:m.user.photoURL}),console.log("User already exists. Redirecting to home page"),r(!1);return}if(!(null==m?void 0:null===(n=m.user)||void 0===n?void 0:n.email)||!(null==m?void 0:null===(t=m.user)||void 0===t?void 0:t.uid))return console.error("[GOOGLE SIGNUP ERR] || null email || null uid :",m),r(!1),!1;let h=await u.mutateAsync({email:m.user.email,firebaseUID:m.user.uid});if(!h)return console.error("[GOOGLE SIGNUP ERR]:",h),r(!1),!1;return c.mutate({email:m.user.email,isOptedIntoMarketEar:a,isOptedIntoNewsletter:i}),r(!1),!0}catch(e){return console.error("[GOOGLE SIGNUP ERR]:",e),r(!1),!1}}}();return(0,r.jsxs)("button",{type:"button",className:m().btn,onClick:n=>{n.preventDefault(),e()},children:[(0,r.jsx)(u.JM8,{}),(0,r.jsx)("span",{children:"Log in with Google"})]})}
1function f(e){let[n,t]=(0,o.KO)(h),i=(0,o.Dv)(d.Yb),p=(0,o.Dv)(d.ev),m=l.S.user.registerWithGoogle.useMutation(),g=l.S.user.newsletterOptIn.useMutation(),f=(0,a.useRouter)();async function x(){try{var n,r,o;let l=new s.Z.auth.GoogleAuthProvider,a=s.Z.auth().currentUser,u=null==a?void 0:a.displayName,c=null==a?void 0:a.photoURL,d=await s.Z.auth().signInWithPopup(l).catch(e=>e);if(t(!0),d instanceof Error)return console.error("[GOOGLE SIGNUP ERR]:",d),t(!1),!1;if(!(null===(n=d.additionalUserInfo)||void 0===n?void 0:n.isNewUser)){d.user&&(u||c)&&await d.user.updateProfile({displayName:null!=u?u:d.user.displayName,photoURL:null!=c?c:d.user.photoURL}),console.log("User already exists. Redirecting to home page"),t(!1),f.push("/signup/success");return}if(!(null==d?void 0:null===(r=d.user)||void 0===r?void 0:r.email)||!(null==d?void 0:null===(o=d.user)||void 0===o?void 0:o.uid))return console.error("[GOOGLE SIGNUP ERR] || null email || null uid :",d),t(!1),!1;let h=await m.mutateAsync({email:d.user.email,firebaseUID:d.user.uid});if(!h)return console.error("[GOOGLE SIGNUP ERR]:",h),t(!1),!1;if(g.mutate({email:d.user.email,isOptedIntoMarketEar:p,isOptedIntoNewsletter:i}),e.onCompleteGoToCheckout){t(!1),window.location.assign("/signup/".concat(e.machineName||"default"));return}return t(!1),window.location.assign("/signup/success"),!0}catch(e){return console.error("[GOOGLE SIGNUP ERR]:",e),t(!1),!1}}return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("button",{suppressHydrationWarning:!0,type:"button",className:"btn-primary flex items-center justify-center gap-2",onClick:async e=>{e.preventDefault(),await x()},children:[(0,r.jsx)(u.JM8,{suppressHydrationWarning:!0}),n?(0,r.jsx)(c.Z,{}):(0,r.jsx)("span",{children:"Sign up with Google"})]})})}},97576:function(e,n,t){"use strict";t.d(n,{i:function(){return i}});var r=t(85893);let i=()=>(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(o,{}),(0,r.jsx)("span",{className:"text-sm text-center uppercase",style:{fontWeight:500},children:"or"}),(0,r.jsx)(o,{})]}),o=()=>(0,r.jsx)("hr",{className:"opacity-50",style:{height:"1px"}})},72300:function(e,n,t){"use strict";var r=t(85893);t(67294);var i=t(2645),o=t.n(i);n.Z=e=>{let{className:n,size:t}=e,i={};return t&&(i.style={fontSize:"".concat(t,"px")}),(0,r.jsx)("i",{suppressHydrationWarning:!0,className:"fas fa-circle-notch ".concat(o().spinner," ").concat(n||""),...i})}},82534:function(e,n,t){"use strict";var r=t(85893);t(67294);var i=t(20672),o=t.n(i),s=t(67671);n.Z=e=>{let{setShowSignIn:n}=e;return(0,r.jsx)("div",{className:o().loginBlockOverlay,id:"loginOverlay",onClick:function(e){e.target&&"signInOverlay"===e.target.id&&n&&n(!1)},children:(0,r.jsxs)("div",{id:"loginModal",className:o().loginBlockContainer,children:[(0,r.jsx)("button",{className:o().btn,onClick:()=>n?n(!1):null,children:"X"}),(0,r.jsx)(s.Z,{autoFocus:!0})]})})}},83208:function(e,n,t){"use strict";t.d(n,{GE:function(){return d},Yb:function(){return u},ev:function(){return c},vW:function(){return p}});var r=t(85893),i=t(15103),o=t(48583),s=t(31439),l=t(10297),a=t.n(l);let u=(0,i.cn)("on"),c=(0,i.cn)("on"),d=()=>{let[e,n]=(0,o.KO)(u);return(0,r.jsx)(s.gN,{name:"isOptedIntoNewsletter",children:e=>(0,r.jsxs)(m,{children:[(0,r.jsx)("input",{type:"checkbox",id:"isOptedIntoNewsletter",name:"isOptedIntoNewsletter",defaultChecked:!0,onChange:t=>{let r=t.target.checked?"on":"off";e.setValue(r),n(r)}}),(0,r.jsx)("label",{htmlFor:"isOptedIntoNewsletter",children:"Yes, I want to sign up for the curated newsletter, The Durden Dispatch, delivered to my inbox daily."})]})})},p=()=>{let[e,n]=(0,o.KO)(c);return(0,r.jsx)(s.gN,{name:"isOptedIntoMarketEar",children:e=>(0,r.jsxs)(m,{children:[(0,r.jsx)("input",{type:"checkbox",id:"isOptedIntoMarketEar",name:"isOptedIntoMarketEar",defaultChecked:!0,onChange:t=>{let r=t.target.checked?"on":"off";e.setValue(r),n(r)}}),(0,r.jsx)("label",{htmlFor:"isOptedIntoMarketEar",children:"Yes, I want to sign up for The Market Ear's Top Focus daily newsletter."})]})})},m=e=>(0,r.jsx)("div",{className:a().checkboxContainer,children:e.children})},94884:function(e){e.exports={container:"BlockLogin_container__ZIjvS",header:"BlockLogin_header__6hliu",formField:"BlockLogin_formField__k0EJP",formFieldLabel:"BlockLogin_formFieldLabel__Sf1Wg",formFieldInput:"BlockLogin_formFieldInput__PdKyr",formSubmit:"BlockLogin_formSubmit__WAm4C",link:"BlockLogin_link__NF4iw",errorText:"BlockLogin_errorText__qrYko",disclaimer:"BlockLogin_disclaimer__VsQj1",FilledLoading:"BlockLogin_FilledLoading__M9P4G"}},91058:function(e){e.exports={btn:"GoogleLoginButton_btn__VW_qw"}},2645:function(e){e.exports={spinner:"LoadingSpinner_spinner__7QsGc",rotation:"LoadingSpinner_rotation__039ue"}},20672:function(e){e.exports={loginBlockOverlay:"ModalLogin_loginBlockOverlay__XSb0k",loginBlockContainer:"ModalLogin_loginBlockContainer__IJvja",btn:"ModalLogin_btn__kiXJp",FilledLoading:"ModalLogin_FilledLoading__n6lVm"}},10297:function(e){e.exports={checkboxContainer:"NewsLetterOptIns_checkboxContainer__tr6fc"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.