1import{i as e}from"./dataRegion-B9_XVSv3.js";import{s as t}from"./adminQueryRegions-6INa_5GC.js";import{t as n}from"./client-Dmzl-gDj.js";import{a as r,i,n as a,r as o,t as s}from"./authEmailRegion-BSsG68K3.js";function c(){if(typeof window>`u`)return!1;let e=new URLSearchParams(window.location.hash.replace(/^#/,``));if(e.get(`type`)===`magiclink`&&e.get(`access_token`))return!0;let t=new URLSearchParams(window.location.search);return t.get(`type`)===`magiclink`&&!!(t.get(`token_hash`)||t.get(`token`)||t.get(`code`))}function l(){if(typeof window>`u`)return!1;let e=new URLSearchParams(window.location.search);return!!(e.get(`oobCode`)&&e.get(`apiKey`))}function u(){return c()||l()}function d(){if(typeof window>`u`)return;let e=new URL(window.location.href),t=new URLSearchParams(e.hash.replace(/^#/,``));for(let e of[`access_token`,`refresh_token`,`expires_in`,`token_type`,`type`])t.delete(e);e.hash=t.toString()?`#${t.toString()}`:``,e.searchParams.delete(`code`),e.searchParams.delete(`token_hash`),e.searchParams.delete(`token`),e.searchParams.delete(`type`),e.searchParams.delete(`dataRegion`),window.history.replaceState(null,``,`${e.pathname}${e.search}${e.hash}`)}var f=null,p=null;function m(){if(typeof window>`u`)return`no-window`;let e=new URLSearchParams(window.location.hash.replace(/^#/,``)),t=new URLSearchParams(window.location.search);return t.get(`token_hash`)??t.get(`token`)??t.get(`code`)??e.get(`access_token`)??`magiclink`}async function h(){let e=m();return f&&p===e?f:(p=e,f=g().catch(e=>{throw f=null,p=null,e}),f)}async function g(){let t=new URLSearchParams(window.location.hash.replace(/^#/,``)),c=t.get(`access_token`),l=t.get(`refresh_token`);if(t.get(`type`)===`magiclink`&&c&&l)return await i({accessToken:c,refreshToken:l}),d(),!0;let u=new URLSearchParams(window.location.search),f=u.get(`code`);if(u.get(`type`)===`magiclink`&&f)return await a(f),d(),!0;let p=u.get(`token_hash`)??u.get(`token`);if(u.get(`type`)===`magiclink`&&p)return await r({tokenHash:p,types:[`magiclink`,`email`]}),d(),!0;for(let t of s(o())){let{data:{session:r}}=await n(t).auth.getSession();if(r)return e(t),!0}return!1}async function _(){let t=new URLSearchParams(window.location.search).get(`email`)?.trim().toLowerCase();if(t)return t;for(let t of s(o())){let{data:{user:r}}=await n(t).auth.getUser(),i=r?.email?.trim().toLowerCase()??null;if(i)return e(t),i}return null}async function v(){await h();let e=await t();if(!e)throw Error(`auth/invalid-credential`);return{legacyUserId:e,email:await _()}}export{u as n,c as r,v as t};
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.