1"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([[526],{68869(e,i,n){n.r(i),n.d(i,{AuthComponent:()=>l});var r=n(92086),o=(n(17632),n(50016)),t=n(77224),a=n(40068),u=n(90076);const l=e=>{const[i,n]=(0,o.useState)(!1),{authProvider:l,onSignInComplete:s}=e,c=(0,o.useCallback)((()=>{i||(n(!0),s())}),[i,s]);return(0,o.useEffect)((()=>{a.log.info("authProvider",l,"userSignedInExecuted",i),l!==r.A.auth.EmailAuthProvider.PROVIDER_ID&&l!==r.A.auth.PhoneAuthProvider.PROVIDER_ID||i||(a.log.info("UserAuthed in effect"),c())}),[l,i,c]),(0,u.jsx)(o.Fragment,{children:(0,u.jsx)(t.y,{className:"auth__firebase-ui "+(e.darkMode?"auth__firebase-ui-dark":""),uiCallback:i=>{a.log.info("UI created"),a.log.info("isPending",i.isPendingRedirect()),e.onIsPendingRedirectChange(i.isPendingRedirect())},uiConfig:{callbacks:{signInSuccessWithAuthResult:(e,i)=>(a.log.info("Sign in success called",e,i),c(),!1),signInFailure:async i=>{if("firebaseui/anonymous-upgrade-merge-conflict"===i.code){if(null===i.credential)return a.log.info("No credential in merge conflict, trigger alert"),void e.onAccountMergeConflict();try{return a.log.info("Sign in merge conflict",i),await r.A.auth().signInWithCredential(i.credential),void c()}catch(n){a.log.error("Error upgrading anonymous user",n)}}return a.log.info("Sign in error",i),new Promise(((e,n)=>{a.log.info("Sign in error",i),e()}))},uiShown:()=>{a.log.info("UI shown")}},credentialHelper:"none",autoUpgradeAnonymousUsers:!0,signInOptions:[{provider:r.A.auth.PhoneAuthProvider.PROVIDER_ID,recaptchaParameters:{type:"image",size:"invisible",badge:"bottomleft"},defaultCountry:"NZ"},{provider:r.A.auth.EmailAuthProvider.PROVIDER_ID,requireDisplayName:!0,signInMethod:r.A.auth.EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD,emailLinkSignIn:()=>({url:e.emailAuthUrl})},r.A.auth.GoogleAuthProvider.PROVIDER_ID,r.A.auth.FacebookAuthProvider.PROVIDER_ID]},firebaseAuth:r.A.auth()})})}}}]);
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.