1import{u as E,r as n,a as o,b as _,c as I,d as h,g as p,i as C,R as r,e as k,f as L,h as w,j as y}from"./main-BVeaUmEJ.js";const b="gis-one-tap-dismissed";function v({callbackUrl:i}){const t=E(),c=n.useRef(!1),{data:s}=o.useSession(),R=s!==void 0&&!s?.user,{ready:l}=_(R),u=I(),d=n.useCallback(async()=>{window.google?.accounts?.id?.cancel(),await u()},[u]),a=n.useRef(h(i,p(t)));return a.current=h(i,p(t)),n.useEffect(()=>{if(!l||!C()||typeof window>"u"||!window.google?.accounts?.id||s?.user||t.pathname.startsWith(r.Auth))return;try{if(sessionStorage.getItem(b))return}catch{}if(c.current)return;c.current=!0;const g=k(),S=async e=>{try{const{error:f}=await o.signIn.social({provider:"google",idToken:{token:e,nonce:g},disableRedirect:!0,callbackURL:a.current,errorCallbackURL:w(r.AuthError)});if(f){y(),await o.signIn.social({provider:"google",callbackURL:a.current,errorCallbackURL:w(r.AuthError)});return}await d()}finally{y()}};window.google.accounts.id.initialize({client_id:L.VITE_GOOGLE_CLIENT_ID??"",nonce:g,callback:e=>{e.credential&&S(e.credential).catch(console.error)},auto_select:!1,cancel_on_tap_outside:!0,context:"signin"}),window.google.accounts.id.prompt(e=>{if(e.isNotDisplayed()&&e.getNotDisplayedReason()==="suppressed_by_user")try{sessionStorage.setItem(b,"1")}catch{}})},[l,s,t.pathname,d]),null}export{v as GoogleOneTapPrompt};
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.