PageSourceSearch

https://www.hintword.com/assets/GoogleLoginComponent-BIWofiS_.js

js hintword.com collected 2026-10-02 01:31:41 UTC 2,841 bytes, 2 lines download raw bytes

1import{r as e,i as M,j as O}from"./index-jogDH_HH.js";function $(o={}){const{nonce:t,locale:i,onScriptLoadSuccess:r,onScriptLoadError:v}=o,[a,u]=e.useState(!1),c=e.useRef(r);c.current=r;const f=e.useRef(v);return f.current=v,e.useEffect(()=>{const n=document.createElement("script");return n.src="https://accounts.google.com/gsi/client",i&&(n.src+=`?hl=${i}`),n.async=!0,n.defer=!0,n.nonce=t,n.onload=()=>{var l;u(!0),(l=c.current)===null||l===void 0||l.call(c)},n.onerror=()=>{var l;u(!1),(l=f.current)===null||l===void 0||l.call(f)},document.body.appendChild(n),()=>{document.body.removeChild(n)}},[t]),a}const k=e.createContext(null);function q({clientId:o,nonce:t,locale:i,onScriptLoadSuccess:r,onScriptLoadError:v,children:a}){const u=$({nonce:t,onScriptLoadSuccess:r,onScriptLoadError:v,locale:i}),c=e.useMemo(()=>({locale:i,clientId:o,scriptLoadedSuccessfully:u}),[o,u]);return M.createElement(k.Provider,{value:c},a)}function D(){const o=e.useContext(k);if(!o)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return o}function J(o){var t;return(t=o?.clientId)!==null&&t!==void 0?t:o?.client_id}const K={large:40,medium:32,small:20};function N({onSuccess:o,onError:t,useOneTap:i,promptMomentNotification:r,type:v="standard",theme:a="outline",size:u="large",text:c,shape:f,logo_alignment:n,width:l,click_listener:B,state:F,containerProps:g,...H}){const C=e.useRef(null),{clientId:G,locale:j,scriptLoadedSuccessfully:A}=D(),I=e.useRef(o);I.current=o;const _=e.useRef(t);_.current=t;const R=e.useRef(r);return R.current=r,e.useEffect(()=>{var m,h,S,x,L,E,p,b,y;if(A)return(S=(h=(m=window?.google)===null||m===void 0?void 0:m.accounts)===null||h===void 0?void 0:h.id)===null||S===void 0||S.initialize({client_id:G,callback:d=>{var s;if(!d?.credential)return(s=_.current)===null||s===void 0?void 0:s.call(_);const{credential:w,select_by:V}=d;I.current({credential:w,clientId:J(d),select_by:V})},...H}),(E=(L=(x=window?.google)===null||x===void 0?void 0:x.accounts)===null||L===void 0?void 0:L.id)===null||E===void 0||E.renderButton(C.current,{type:v,theme:a,size:u,text:c,shape:f,logo_alignment:n,width:l,locale:j,click_listener:B,state:F}),i&&((y=(b=(p=window?.google)===null||p===void 0?void 0:p.accounts)===null||b===void 0?void 0:b.id)===null||y===void 0||y.prompt(R.current)),()=>{var d,s,w;i&&((w=(s=(d=window?.google)===null||d===void 0?void 0:d.accounts)===null||s===void 0?void 0:s.id)===null||w===void 0||w.cancel())}},[G,A,i,v,a,u,c,f,n,l,j]),M.createElement("div",{...g,ref:C,style:{height:K[u],...g?.style}})}const Q=({onSuccess:o,clientId:t})=>O.jsx(q,{clientId:t,children:O.jsx(N,{onSuccess:o,onError:()=>alert("Login Failed"),useOneTap:!0,width:"300",text:"continue_with",shape:"pill",theme:"filled_blue"})});export{Q as default};
2//# sourceMappingURL=GoogleLoginComponent-BIWofiS_.js.map

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.