1 |
- (()=>{function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(){var e,n,r=function(t){return t in window};if(r("URLSearchParams")&&r("fetch")&&r("Promise")){var o=document.querySelector("script[src*=google-one-tap-assets]").getAttribute("src"),i=new URLSearchParams(o.slice(o.indexOf("?"))),a=(e=atob(i.get("jsKey")).split("@"),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=a[0],d=a[1];if(c){var s=document.createElement("div");s.id="g_id_onload",s.setAttribute("data-prompt_parent_id","g_id_onload"),s.setAttribute("style","position: absolute; right: 0; z-index: 1000000001;"),s.setAttribute("data-client_id",c),s.setAttribute("data-callback","handleCredentialResponse"),s.setAttribute("data-moment_callback","continueWithNextIdp"),s.setAttribute("data-next-idp-src",d),document.body.insertAdjacentElement("afterbegin",s);var l=document.createElement("script");l.src="https://accounts.google.com/gsi/client",document.body.appendChild(l)}}}(),window.continueWithNextIdp=function(t){if(t.isNotDisplayed()&&"suppressed_by_user"!==t.getNotDisplayedReason()){var e=window.g_id_onload;if(e){var n=e.getAttribute("data-next-idp-src"),r=document.createElement("script");r.src=n,document.body.appendChild(r)}}},window.handleCredentialResponse=function(t){window.dispatchEvent(new Event("signinStarted")),window.fetch("/auth/api/v1/authentication/google/tap",{method:"POST",credentials:"same-origin",body:JSON.stringify({provider:"google",idToken:t.credential}),headers:{"Content-Type":"application/json"}}).then((function(t){if(t.ok)return t.json();throw new Error("Failed with HTTP code ".concat(t.status))})).then((function(t){var e=new URL(document.location).searchParams;e.has("ret")||e.has("return")||e.append("ret",document.location.href);var n=Array.from(e.keys()).reduce((function(t,n){return t.push("".concat(n,"=").concat(encodeURIComponent(e.get(n)))),t}),[]);window.location.replace("".concat(t.ssoPath,"&").concat(n.join("&"))),window.dispatchEvent(new Event("signinEnded"))})).catch((function(t){window.dispatchEvent(new Event("signinFailed"))}))}})();
|