1import{r as d,c as m,au as w,t as v,G as f,s as G,av as h,v as c,aw as y,ax as T,Y as O,ay as C}from"#entry";const N=(l={})=>{const t=()=>window.location.href,a=()=>document.title,{languageCode:i="en",source:n}=l,s=h(),p=()=>new Promise((e,o)=>{if(window.google?.accounts?.id)return e();const u=document.querySelector('script[src="https://accounts.google.com/gsi/client"]');if(u){u.addEventListener("load",()=>e()),u.addEventListener("error",()=>o(new Error("Failed to load Google script")));return}const r=document.createElement("script");r.src="https://accounts.google.com/gsi/client",r.async=!0,r.defer=!0,r.onload=()=>e(),r.onerror=()=>o(new Error("Failed to load Google script")),document.head.appendChild(r)}),g=async e=>{c({eventName:"auto_sign_in_popup_tapped",eventGroup:"google_one_tap",properties:{source:n,page_title:a(),page_location:t()}});try{const o=y.credential(e.credential);await T(O(),o),C(),c({eventName:"auto_sign_in_popup_login_success",eventGroup:"google_one_tap",properties:{source:n,page_title:a(),page_location:t()}}),c({eventName:"sign_in_one_tap",eventGroup:"google_one_tap",properties:{source:n,method:"google_one_tap",page_title:a(),page_location:t()}}),l.onSuccess?.()}catch(o){c({eventName:"auto_sign_in_popup_login_failed",eventGroup:"google_one_tap",properties:{source:n,error:o,page_title:a(),page_location:t()}})}},_=e=>{if(e.isNotDisplayed())return;const o=document.querySelector("#credential_picker_container iframe");o&&i!=="en"&&(o.src=o.src+`&hl=${i}`),e.isDisplayMoment?.()&&c({eventName:"auto_sign_in_popup_shown",eventGroup:"google_one_tap",properties:{source:n,page_title:a(),page_location:t()}}),e.isSkippedMoment?.()&&c({eventName:"auto_sign_in_popup_skipped",eventGroup:"google_one_tap",properties:{source:n,page_title:a(),page_location:t()}})};return{initializeGoogleOneTap:async()=>{try{await p(),window.google?.accounts?.id&&(window.google.accounts.id.initialize({client_id:s.public.googleWebClientId,callback:g,cancel_on_tap_outside:!1,use_fedcm_for_prompt:!1}),window.google.accounts.id.prompt(_))}catch(e){console.warn("Failed to init Google One-Tap",e)}},cancelGoogleOneTap:()=>{try{window.google?.accounts?.id&&window.google.accounts.id.cancel()}catch(e){console.warn("Failed to cancel Google One-Tap",e)}}}},F=l=>{const{active:t,validate:a}=l,{cancelGoogleOneTap:i,initializeGoogleOneTap:n}=N(l),s=d(!0),p=m(()=>t===void 0?!0:w(t));return v(async()=>{s.value=await a?.()??!0,s.value&&p.value&&await n()}),f(()=>{i()}),G(p,async g=>{s.value&&g?n():i()}),{cancelGoogleOneTap:i}};export{F as u};
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.