"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["721"],{3109:function(e,n,t){t.r(n),t.d(n,{OneTap:()=>k});var r=t(4518),a=t(5074),i=t(5577),c=t(4607),l=t(2265),o=t(212),s=t(8628),u=t(3269),h=t(7697),p=t(7032),g=t(7896),d=t(4964),f=t(8726);let _=(0,u.dm)(function(){let e=(0,s.ho)(),{user:n}=(0,s.Jd)(),t=(0,h.O)(),r=(0,a.useRef)(!1),{navigate:i}=(0,d.r)(),c=(0,p.H)();async function l(n){r.current=!1;try{let t=await e.authenticateWithGoogleOneTap({token:n.credential});await e.handleGoogleOneTapCallback(t,c.generateCallbackUrls(window.location.href),i)}catch(e){console.error(e)}}let o=t.displayConfig.googleOneTapClientId,u=!n?.id&&!!o;async function _(){let e=await (0,f.u)();return e.accounts.id.initialize({client_id:o,callback:l,itp_support:c.itpSupport,cancel_on_tap_outside:c.cancelOnTapOutside,auto_select:!1,use_fedcm_for_prompt:c.fedCmSupport}),e}let{data:U}=(0,g.s)(u?_:void 0,"google-identity-services-script");return(0,a.useEffect)(()=>{!U||n?.id||r.current||(U.accounts.id.prompt(n=>{"skipped"===n.getMomentType()&&e.closeGoogleOneTap()}),r.current=!0)},[e,U,n?.id]),(0,a.useEffect)(()=>()=>{U&&r.current&&(r.current=!1,U.accounts.id.cancel())},[U]),null});function U(){return(0,r.Y)(l.q,{path:"one-tap",children:(0,r.Y)(c.n.Root,{flow:"oneTap",children:(0,r.Y)(o.d,{children:(0,r.Y)(l.q,{index:!0,children:(0,r.Y)(_,{})})})})})}U.displayName="OneTap";let k=(0,i.Z)(U)},7032:function(e,n,t){t.d(n,{H:()=>u,Q:()=>s});var r=t(8560),a=t(4173),i=t(5074),c=t(2366),l=t(7697),o=t(4964);let s=(0,i.createContext)(null),u=()=>{let e=(0,i.useContext)(s),n=(0,c.II)(),{displayConfig:t}=(0,l.O)(),{queryParams:u}=(0,o.r)();if(!e||"GoogleOneTap"!==e.componentName)throw Error("Clerk: useGoogleOneTapContext called outside GoogleOneTap.");let{componentName:h,...p}=e,g=(0,i.useCallback)(e=>{let i=new r.n(n,{...p,signInFallbackRedirectUrl:e,signUpFallbackRedirectUrl:e},u),c=n.signUpUrl||t.signUpUrl,l=n.signInUrl||t.signInUrl,o=i.getPreservedSearchParams();l=(0,a.kZ)({base:l,hashSearchParams:[u,o]},{stringify:!0}),c=(0,a.kZ)({base:c,hashSearchParams:[u,o]},{stringify:!0});let s=i.getAfterSignInUrl(),h=i.getAfterSignUpUrl(),g=(0,a.kZ)({base:c,hashPath:"/continue",hashSearch:new URLSearchParams({sign_up_force_redirect_url:h}).toString()},{stringify:!0}),d=(0,a.kZ)({base:l,hashPath:"/factor-one",hashSearch:new URLSearchParams({sign_in_force_redirect_url:s}).toString()},{stringify:!0}),f=(0,a.kZ)({base:l,hashPath:"/factor-two",hashSearch:new URLSearchParams({sign_in_force_redirect_url:s}).toString()},{stringify:!0});return{signInUrl:l,signUpUrl:c,firstFactorUrl:d,secondFactorUrl:f,continueSignUpUrl:g,signInForceRedirectUrl:s,signUpForceRedirectUrl:h}},[p,t.signInUrl,t.signUpUrl,n,u]);return{...p,componentName:h,generateCallbackUrls:g}}}}]);