"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["721"],{13109:function(e,n,t){t.r(n),t.d(n,{OneTap:()=>k});var r=t(14518),a=t(35074),i=t(85577),l=t(44607),c=t(42265),o=t(80212);t(50036),t(31475);var s=t(91806),u=t(63269),h=t(97697),p=t(17032),d=t(67896),g=t(4964),f=t(24296);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,g.r)(),l=(0,p.H)();async function c(n){r.current=!1;try{let t=await e.authenticateWithGoogleOneTap({token:n.credential});await e.handleGoogleOneTapCallback(t,l.generateCallbackUrls(window.location.href),i)}catch(e){console.error(e)}}let o=t.displayConfig.googleOneTapClientId,u=!(null==n?void 0:n.id)&&!!o;async function _(){let e=await (0,f.u)();return e.accounts.id.initialize({client_id:o,callback:c,itp_support:l.itpSupport,cancel_on_tap_outside:l.cancelOnTapOutside,auto_select:!1,use_fedcm_for_prompt:l.fedCmSupport}),e}let{data:U}=(0,d.s)(u?_:void 0,"google-identity-services-script");return(0,a.useEffect)(()=>{!U||(null==n?void 0:n.id)||r.current||(U.accounts.id.prompt(n=>{"skipped"===n.getMomentType()&&e.closeGoogleOneTap()}),r.current=!0)},[e,U,null==n?void 0:n.id]),(0,a.useEffect)(()=>()=>{U&&r.current&&(r.current=!1,U.accounts.id.cancel())},[U]),null});function U(){return(0,r.Y)(c.q,{path:"one-tap",children:(0,r.Y)(l.n.Root,{flow:"oneTap",children:(0,r.Y)(o.d,{children:(0,r.Y)(c.q,{index:!0,children:(0,r.Y)(_,{})})})})})}U.displayName="OneTap";let k=(0,i.Z)(U)},17032:function(e,n,t){t.d(n,{H:()=>u,Q:()=>s}),t(98114),t(88711),t(60486),t(25089),t(61244),t(77895);var r=t(28560),a=t(14173),i=t(35074),l=t(62366),c=t(97697),o=t(4964);let s=(0,i.createContext)(null),u=()=>{let e=(0,i.useContext)(s),n=(0,l.II)(),{displayConfig:t}=(0,c.O)(),{queryParams:u}=(0,o.r)();if(!e||"GoogleOneTap"!==e.componentName)throw Error("Clerk: useGoogleOneTapContext called outside GoogleOneTap.");let{componentName:h,...p}=e,d=(0,i.useCallback)(e=>{let i=new r.n(n,{...p,signInFallbackRedirectUrl:e,signUpFallbackRedirectUrl:e},u),l=n.signUpUrl||t.signUpUrl,c=n.signInUrl||t.signInUrl,o=i.getPreservedSearchParams();c=(0,a.kZ)({base:c,hashSearchParams:[u,o]},{stringify:!0}),l=(0,a.kZ)({base:l,hashSearchParams:[u,o]},{stringify:!0});let s=i.getAfterSignInUrl(),h=i.getAfterSignUpUrl(),d=(0,a.kZ)({base:l,hashPath:"/continue",hashSearch:new URLSearchParams({sign_up_force_redirect_url:h}).toString()},{stringify:!0}),g=(0,a.kZ)({base:c,hashPath:"/factor-one",hashSearch:new URLSearchParams({sign_in_force_redirect_url:s}).toString()},{stringify:!0}),f=(0,a.kZ)({base:c,hashPath:"/factor-two",hashSearch:new URLSearchParams({sign_in_force_redirect_url:s}).toString()},{stringify:!0});return{signInUrl:c,signUpUrl:l,firstFactorUrl:g,secondFactorUrl:f,continueSignUpUrl:d,signInForceRedirectUrl:s,signUpForceRedirectUrl:h}},[p,t.signInUrl,t.signUpUrl,n,u]);return{...p,componentName:h,generateCallbackUrls:d}}}}]);