import { a as e } from "./alasql-f59e855e.js";
var t = function() {
  if ("undefined" != typeof self)
    return self;
  if ("undefined" != typeof window)
    return window;
  if ("undefined" != typeof global)
    return global;
  throw new Error("unable to locate global object");
}();
const r = t.fetch, n = t.fetch.bind(t), s = t.Headers, o = t.Request, a = t.Response, i = Object.freeze(Object.defineProperty({ __proto__: null, Headers: s, Request: o, Response: a, default: n, fetch: r }, Symbol.toStringTag, { value: "Module" })), u = e(i);
class c extends Error {
  constructor(e2) {
    super(e2), this.__isStorageError = true, this.name = "StorageError";
  }
}
function l(e2) {
  return "object" == typeof e2 && null !== e2 && "__isStorageError" in e2;
}
class d extends c {
  constructor(e2, t2, r2) {
    super(e2), this.name = "StorageApiError", this.status = t2, this.statusCode = r2;
  }
  toJSON() {
    return { name: this.name, message: this.message, status: this.status, statusCode: this.statusCode };
  }
}
class f extends c {
  constructor(e2, t2) {
    super(e2), this.name = "StorageUnknownError", this.originalError = t2;
  }
}
var h = globalThis && globalThis.__awaiter || function(e2, t2, r2, n2) {
  return new (r2 || (r2 = Promise))(function(s2, o2) {
    function a2(e3) {
      try {
        u2(n2.next(e3));
      } catch (e4) {
        o2(e4);
      }
    }
    function i2(e3) {
      try {
        u2(n2.throw(e3));
      } catch (e4) {
        o2(e4);
      }
    }
    function u2(e3) {
      var t3;
      e3.done ? s2(e3.value) : (t3 = e3.value, t3 instanceof r2 ? t3 : new r2(function(e4) {
        e4(t3);
      })).then(a2, i2);
    }
    u2((n2 = n2.apply(e2, t2 || [])).next());
  });
};
const p = (e2) => {
  let t2;
  return t2 = e2 || ("undefined" == typeof fetch ? (...e3) => Promise.resolve().then(() => i).then(({ default: t3 }) => t3(...e3)) : fetch), (...e3) => t2(...e3);
}, w = (e2) => {
  if (Array.isArray(e2))
    return e2.map((e3) => w(e3));
  if ("function" == typeof e2 || e2 !== Object(e2))
    return e2;
  const t2 = {};
  return Object.entries(e2).forEach(([e3, r2]) => {
    const n2 = e3.replace(/([-_][a-z])/gi, (e4) => e4.toUpperCase().replace(/[-_]/g, ""));
    t2[n2] = w(r2);
  }), t2;
};
var y = globalThis && globalThis.__awaiter || function(e2, t2, r2, n2) {
  return new (r2 || (r2 = Promise))(function(s2, o2) {
    function a2(e3) {
      try {
        u2(n2.next(e3));
      } catch (e4) {
        o2(e4);
      }
    }
    function i2(e3) {
      try {
        u2(n2.throw(e3));
      } catch (e4) {
        o2(e4);
      }
    }
    function u2(e3) {
      var t3;
      e3.done ? s2(e3.value) : (t3 = e3.value, t3 instanceof r2 ? t3 : new r2(function(e4) {
        e4(t3);
      })).then(a2, i2);
    }
    u2((n2 = n2.apply(e2, t2 || [])).next());
  });
};
const g = (e2) => e2.msg || e2.message || e2.error_description || e2.error || JSON.stringify(e2), m = (e2, t2, r2) => y(void 0, void 0, void 0, function* () {
  const n2 = yield h(void 0, void 0, void 0, function* () {
    return "undefined" == typeof Response ? (yield Promise.resolve().then(() => i)).Response : Response;
  });
  e2 instanceof n2 && !(null == r2 ? void 0 : r2.noResolveJson) ? e2.json().then((r3) => {
    const n3 = e2.status || 500, s2 = (null == r3 ? void 0 : r3.statusCode) || n3 + "";
    t2(new d(g(r3), n3, s2));
  }).catch((e3) => {
    t2(new f(g(e3), e3));
  }) : t2(new f(g(e2), e2));
}), v = (e2, t2, r2, n2) => {
  const s2 = { method: e2, headers: (null == t2 ? void 0 : t2.headers) || {} };
  return "GET" !== e2 && n2 ? (((e3) => {
    if ("object" != typeof e3 || null === e3)
      return false;
    const t3 = Object.getPrototypeOf(e3);
    return !(null !== t3 && t3 !== Object.prototype && null !== Object.getPrototypeOf(t3) || Symbol.toStringTag in e3 || Symbol.iterator in e3);
  })(n2) ? (s2.headers = Object.assign({ "Content-Type": "application/json" }, null == t2 ? void 0 : t2.headers), s2.body = JSON.stringify(n2)) : s2.body = n2, (null == t2 ? void 0 : t2.duplex) && (s2.duplex = t2.duplex), Object.assign(Object.assign({}, s2), r2)) : s2;
};
function b(e2, t2, r2, n2, s2, o2) {
  return y(this, void 0, void 0, function* () {
    return new Promise((a2, i2) => {
      e2(r2, v(t2, n2, s2, o2)).then((e3) => {
        if (!e3.ok)
          throw e3;
        return (null == n2 ? void 0 : n2.noResolveJson) ? e3 : e3.json();
      }).then((e3) => a2(e3)).catch((e3) => m(e3, i2, n2));
    });
  });
}
function _(e2, t2, r2, n2) {
  return y(this, void 0, void 0, function* () {
    return b(e2, "GET", t2, r2, n2);
  });
}
function x(e2, t2, r2, n2, s2) {
  return y(this, void 0, void 0, function* () {
    return b(e2, "POST", t2, n2, s2, r2);
  });
}
function j(e2, t2, r2, n2, s2) {
  return y(this, void 0, void 0, function* () {
    return b(e2, "PUT", t2, n2, s2, r2);
  });
}
function S(e2, t2, r2, n2) {
  return y(this, void 0, void 0, function* () {
    return b(e2, "HEAD", t2, Object.assign(Object.assign({}, r2), { noResolveJson: true }), n2);
  });
}
function E(e2, t2, r2, n2, s2) {
  return y(this, void 0, void 0, function* () {
    return b(e2, "DELETE", t2, n2, s2, r2);
  });
}
var A = globalThis && globalThis.__awaiter || function(e2, t2, r2, n2) {
  return new (r2 || (r2 = Promise))(function(s2, o2) {
    function a2(e3) {
      try {
        u2(n2.next(e3));
      } catch (e4) {
        o2(e4);
      }
    }
    function i2(e3) {
      try {
        u2(n2.throw(e3));
      } catch (e4) {
        o2(e4);
      }
    }
    function u2(e3) {
      var t3;
      e3.done ? s2(e3.value) : (t3 = e3.value, t3 instanceof r2 ? t3 : new r2(function(e4) {
        e4(t3);
      })).then(a2, i2);
    }
    u2((n2 = n2.apply(e2, t2 || [])).next());
  });
};
const O = (e2) => {
  let t2;
  return t2 = e2 || ("undefined" == typeof fetch ? n : fetch), (...e3) => t2(...e3);
}, q = (e2, t2, r2) => {
  const n2 = O(r2), o2 = "undefined" == typeof Headers ? s : Headers;
  return (r3, s2) => A(void 0, void 0, void 0, function* () {
    var a2;
    const i2 = null !== (a2 = yield t2()) && void 0 !== a2 ? a2 : e2;
    let u2 = new o2(null == s2 ? void 0 : s2.headers);
    return u2.has("apikey") || u2.set("apikey", e2), u2.has("Authorization") || u2.set("Authorization", `Bearer ${i2}`), n2(r3, Object.assign(Object.assign({}, s2), { headers: u2 }));
  });
}, k = "2.71.1", T = 3e4, P = 3, C = 9e4, R = "http://localhost:9999", J = "supabase.auth.token", U = { "X-Client-Info": `gotrue-js/${k}` }, B = "X-Supabase-Api-Version", I = { timestamp: Date.parse("2024-01-01T00:00:00.0Z"), name: "2024-01-01" }, $ = /^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i, N = 6e5;
class M extends Error {
  constructor(e2, t2, r2) {
    super(e2), this.__isAuthError = true, this.name = "AuthError", this.status = t2, this.code = r2;
  }
}
function D(e2) {
  return "object" == typeof e2 && null !== e2 && "__isAuthError" in e2;
}
class z extends M {
  constructor(e2, t2, r2) {
    super(e2, t2, r2), this.name = "AuthApiError", this.status = t2, this.code = r2;
  }
}
function H(e2) {
  return D(e2) && "AuthApiError" === e2.name;
}
class G extends M {
  constructor(e2, t2) {
    super(e2), this.name = "AuthUnknownError", this.originalError = t2;
  }
}
class W extends M {
  constructor(e2, t2, r2, n2) {
    super(e2, r2, n2), this.name = t2, this.status = r2;
  }
}
class F extends W {
  constructor() {
    super("Auth session missing!", "AuthSessionMissingError", 400, void 0);
  }
}
function L(e2) {
  return D(e2) && "AuthSessionMissingError" === e2.name;
}
class V extends W {
  constructor() {
    super("Auth session or user missing", "AuthInvalidTokenResponseError", 500, void 0);
  }
}
class K extends W {
  constructor(e2) {
    super(e2, "AuthInvalidCredentialsError", 400, void 0);
  }
}
class X extends W {
  constructor(e2, t2 = null) {
    super(e2, "AuthImplicitGrantRedirectError", 500, void 0), this.details = null, this.details = t2;
  }
  toJSON() {
    return { name: this.name, message: this.message, status: this.status, details: this.details };
  }
}
function Z(e2) {
  return D(e2) && "AuthImplicitGrantRedirectError" === e2.name;
}
class Y extends W {
  constructor(e2, t2 = null) {
    super(e2, "AuthPKCEGrantCodeExchangeError", 500, void 0), this.details = null, this.details = t2;
  }
  toJSON() {
    return { name: this.name, message: this.message, status: this.status, details: this.details };
  }
}
class Q extends W {
  constructor(e2, t2) {
    super(e2, "AuthRetryableFetchError", t2, void 0);
  }
}
function ee(e2) {
  return D(e2) && "AuthRetryableFetchError" === e2.name;
}
class te extends W {
  constructor(e2, t2, r2) {
    super(e2, "AuthWeakPasswordError", t2, "weak_password"), this.reasons = r2;
  }
}
function re(e2) {
  return D(e2) && "AuthWeakPasswordError" === e2.name;
}
class ne extends W {
  constructor(e2) {
    super(e2, "AuthInvalidJwtError", 400, "invalid_jwt");
  }
}
const se = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""), oe = " 	\n\r=".split(""), ae = (() => {
  const e2 = new Array(128);
  for (let t2 = 0; t2 < e2.length; t2 += 1)
    e2[t2] = -1;
  for (let t2 = 0; t2 < oe.length; t2 += 1)
    e2[oe[t2].charCodeAt(0)] = -2;
  for (let t2 = 0; t2 < se.length; t2 += 1)
    e2[se[t2].charCodeAt(0)] = t2;
  return e2;
})();
function ie(e2, t2, r2) {
  if (null !== e2)
    for (t2.queue = t2.queue << 8 | e2, t2.queuedBits += 8; t2.queuedBits >= 6; ) {
      const e3 = t2.queue >> t2.queuedBits - 6 & 63;
      r2(se[e3]), t2.queuedBits -= 6;
    }
  else if (t2.queuedBits > 0)
    for (t2.queue = t2.queue << 6 - t2.queuedBits, t2.queuedBits = 6; t2.queuedBits >= 6; ) {
      const e3 = t2.queue >> t2.queuedBits - 6 & 63;
      r2(se[e3]), t2.queuedBits -= 6;
    }
}
function ue(e2, t2, r2) {
  const n2 = ae[e2];
  if (!(n2 > -1)) {
    if (-2 === n2)
      return;
    throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e2)}"`);
  }
  for (t2.queue = t2.queue << 6 | n2, t2.queuedBits += 6; t2.queuedBits >= 8; )
    r2(t2.queue >> t2.queuedBits - 8 & 255), t2.queuedBits -= 8;
}
function ce(e2) {
  const t2 = [], r2 = (e3) => {
    t2.push(String.fromCodePoint(e3));
  }, n2 = { utf8seq: 0, codepoint: 0 }, s2 = { queue: 0, queuedBits: 0 }, o2 = (e3) => {
    !function(e4, t3, r3) {
      if (0 === t3.utf8seq) {
        if (e4 <= 127)
          return void r3(e4);
        for (let r4 = 1; r4 < 6; r4 += 1)
          if (!(e4 >> 7 - r4 & 1)) {
            t3.utf8seq = r4;
            break;
          }
        if (2 === t3.utf8seq)
          t3.codepoint = 31 & e4;
        else if (3 === t3.utf8seq)
          t3.codepoint = 15 & e4;
        else {
          if (4 !== t3.utf8seq)
            throw new Error("Invalid UTF-8 sequence");
          t3.codepoint = 7 & e4;
        }
        t3.utf8seq -= 1;
      } else if (t3.utf8seq > 0) {
        if (e4 <= 127)
          throw new Error("Invalid UTF-8 sequence");
        t3.codepoint = t3.codepoint << 6 | 63 & e4, t3.utf8seq -= 1, 0 === t3.utf8seq && r3(t3.codepoint);
      }
    }(e3, n2, r2);
  };
  for (let t3 = 0; t3 < e2.length; t3 += 1)
    ue(e2.charCodeAt(t3), s2, o2);
  return t2.join("");
}
function le(e2, t2) {
  if (!(e2 <= 127)) {
    if (e2 <= 2047)
      return t2(192 | e2 >> 6), void t2(128 | 63 & e2);
    if (e2 <= 65535)
      return t2(224 | e2 >> 12), t2(128 | e2 >> 6 & 63), void t2(128 | 63 & e2);
    if (e2 <= 1114111)
      return t2(240 | e2 >> 18), t2(128 | e2 >> 12 & 63), t2(128 | e2 >> 6 & 63), void t2(128 | 63 & e2);
    throw new Error(`Unrecognized Unicode codepoint: ${e2.toString(16)}`);
  }
  t2(e2);
}
function de(e2) {
  const t2 = [], r2 = { queue: 0, queuedBits: 0 }, n2 = (e3) => {
    t2.push(e3);
  };
  for (let t3 = 0; t3 < e2.length; t3 += 1)
    ue(e2.charCodeAt(t3), r2, n2);
  return new Uint8Array(t2);
}
function fe(e2) {
  const t2 = [];
  return function(e3, t3) {
    for (let r2 = 0; r2 < e3.length; r2 += 1) {
      let n2 = e3.charCodeAt(r2);
      if (n2 > 55295 && n2 <= 56319) {
        const t4 = 1024 * (n2 - 55296) & 65535;
        n2 = 65536 + (e3.charCodeAt(r2 + 1) - 56320 & 65535 | t4), r2 += 1;
      }
      le(n2, t3);
    }
  }(e2, (e3) => t2.push(e3)), new Uint8Array(t2);
}
function he(e2) {
  const t2 = [], r2 = { queue: 0, queuedBits: 0 }, n2 = (e3) => {
    t2.push(e3);
  };
  return e2.forEach((e3) => ie(e3, r2, n2)), ie(null, r2, n2), t2.join("");
}
function pe() {
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e2) {
    const t2 = 16 * Math.random() | 0;
    return ("x" == e2 ? t2 : 3 & t2 | 8).toString(16);
  });
}
const we = () => "undefined" != typeof window && "undefined" != typeof document, ye = { tested: false, writable: false }, ge = () => {
  if (!we())
    return false;
  try {
    if ("object" != typeof globalThis.localStorage)
      return false;
  } catch (e3) {
    return false;
  }
  if (ye.tested)
    return ye.writable;
  const e2 = `lswt-${Math.random()}${Math.random()}`;
  try {
    globalThis.localStorage.setItem(e2, e2), globalThis.localStorage.removeItem(e2), ye.tested = true, ye.writable = true;
  } catch (e3) {
    ye.tested = true, ye.writable = false;
  }
  return ye.writable;
};
function me(e2) {
  const t2 = {}, r2 = new URL(e2);
  if (r2.hash && "#" === r2.hash[0])
    try {
      new URLSearchParams(r2.hash.substring(1)).forEach((e3, r3) => {
        t2[r3] = e3;
      });
    } catch (e3) {
    }
  return r2.searchParams.forEach((e3, r3) => {
    t2[r3] = e3;
  }), t2;
}
const ve = (e2) => {
  let t2;
  return t2 = e2 || ("undefined" == typeof fetch ? (...e3) => Promise.resolve().then(() => i).then(({ default: t3 }) => t3(...e3)) : fetch), (...e3) => t2(...e3);
}, be = async (e2, t2, r2) => {
  await e2.setItem(t2, JSON.stringify(r2));
}, _e = async (e2, t2) => {
  const r2 = await e2.getItem(t2);
  if (!r2)
    return null;
  try {
    return JSON.parse(r2);
  } catch (e3) {
    return r2;
  }
}, xe = async (e2, t2) => {
  await e2.removeItem(t2);
};
class je {
  constructor() {
    this.promise = new je.promiseConstructor((e2, t2) => {
      this.resolve = e2, this.reject = t2;
    });
  }
}
function Se(e2) {
  const t2 = e2.split(".");
  if (3 !== t2.length)
    throw new ne("Invalid JWT structure");
  for (let e3 = 0; e3 < t2.length; e3++)
    if (!$.test(t2[e3]))
      throw new ne("JWT not in base64url format");
  return { header: JSON.parse(ce(t2[0])), payload: JSON.parse(ce(t2[1])), signature: de(t2[2]), raw: { header: t2[0], payload: t2[1] } };
}
async function Ee(e2) {
  return await new Promise((t2) => {
    setTimeout(() => t2(null), e2);
  });
}
function Ae(e2, t2) {
  return new Promise((r2, n2) => {
    (async () => {
      for (let s2 = 0; s2 < 1 / 0; s2++)
        try {
          const n3 = await e2(s2);
          if (!t2(s2, null, n3))
            return void r2(n3);
        } catch (e3) {
          if (!t2(s2, e3))
            return void n2(e3);
        }
    })();
  });
}
function Oe(e2) {
  return ("0" + e2.toString(16)).substr(-2);
}
async function qe(e2) {
  if (!("undefined" != typeof crypto && void 0 !== crypto.subtle && "undefined" != typeof TextEncoder))
    return e2;
  const t2 = await async function(e3) {
    const t3 = new TextEncoder().encode(e3), r2 = await crypto.subtle.digest("SHA-256", t3), n2 = new Uint8Array(r2);
    return Array.from(n2).map((e4) => String.fromCharCode(e4)).join("");
  }(e2);
  return btoa(t2).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
}
async function ke(e2, t2, r2 = false) {
  const n2 = function() {
    const e3 = new Uint32Array(56);
    if ("undefined" == typeof crypto) {
      const e4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", t3 = e4.length;
      let r3 = "";
      for (let n3 = 0; n3 < 56; n3++)
        r3 += e4.charAt(Math.floor(Math.random() * t3));
      return r3;
    }
    return crypto.getRandomValues(e3), Array.from(e3, Oe).join("");
  }();
  let s2 = n2;
  r2 && (s2 += "/PASSWORD_RECOVERY"), await be(e2, `${t2}-code-verifier`, s2);
  const o2 = await qe(n2);
  return [o2, n2 === o2 ? "plain" : "s256"];
}
je.promiseConstructor = Promise;
const Te = /^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;
function Pe(e2) {
  if (!e2)
    throw new Error("Missing exp claim");
  if (e2 <= Math.floor(Date.now() / 1e3))
    throw new Error("JWT has expired");
}
function Ce(e2) {
  switch (e2) {
    case "RS256":
      return { name: "RSASSA-PKCS1-v1_5", hash: { name: "SHA-256" } };
    case "ES256":
      return { name: "ECDSA", namedCurve: "P-256", hash: { name: "SHA-256" } };
    default:
      throw new Error("Invalid alg claim");
  }
}
const Re = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
function Je(e2) {
  if (!Re.test(e2))
    throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not");
}
function Ue() {
  return new Proxy({}, { get: (e2, t2) => {
    if ("__isUserNotAvailableProxy" === t2)
      return true;
    if ("symbol" == typeof t2) {
      const e3 = t2.toString();
      if ("Symbol(Symbol.toPrimitive)" === e3 || "Symbol(Symbol.toStringTag)" === e3 || "Symbol(util.inspect.custom)" === e3)
        return;
    }
    throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t2}" property of the session object is not supported. Please use getUser() instead.`);
  }, set: (e2, t2) => {
    throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t2}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`);
  }, deleteProperty: (e2, t2) => {
    throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t2}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`);
  } });
}
function Be(e2) {
  return JSON.parse(JSON.stringify(e2));
}
var Ie = globalThis && globalThis.__rest || function(e2, t2) {
  var r2 = {};
  for (var n2 in e2)
    Object.prototype.hasOwnProperty.call(e2, n2) && t2.indexOf(n2) < 0 && (r2[n2] = e2[n2]);
  if (null != e2 && "function" == typeof Object.getOwnPropertySymbols) {
    var s2 = 0;
    for (n2 = Object.getOwnPropertySymbols(e2); s2 < n2.length; s2++)
      t2.indexOf(n2[s2]) < 0 && Object.prototype.propertyIsEnumerable.call(e2, n2[s2]) && (r2[n2[s2]] = e2[n2[s2]]);
  }
  return r2;
};
const $e = (e2) => e2.msg || e2.message || e2.error_description || e2.error || JSON.stringify(e2), Ne = [502, 503, 504];
async function Me(e2) {
  var t2, r2;
  if (!("object" == typeof (r2 = e2) && null !== r2 && "status" in r2 && "ok" in r2 && "json" in r2 && "function" == typeof r2.json))
    throw new Q($e(e2), 0);
  if (Ne.includes(e2.status))
    throw new Q($e(e2), e2.status);
  let n2, s2;
  try {
    n2 = await e2.json();
  } catch (e3) {
    throw new G($e(e3), e3);
  }
  const o2 = function(e3) {
    const t3 = e3.headers.get(B);
    if (!t3)
      return null;
    if (!t3.match(Te))
      return null;
    try {
      return /* @__PURE__ */ new Date(`${t3}T00:00:00.0Z`);
    } catch (e4) {
      return null;
    }
  }(e2);
  if (o2 && o2.getTime() >= I.timestamp && "object" == typeof n2 && n2 && "string" == typeof n2.code ? s2 = n2.code : "object" == typeof n2 && n2 && "string" == typeof n2.error_code && (s2 = n2.error_code), s2) {
    if ("weak_password" === s2)
      throw new te($e(n2), e2.status, (null === (t2 = n2.weak_password) || void 0 === t2 ? void 0 : t2.reasons) || []);
    if ("session_not_found" === s2)
      throw new F();
  } else if ("object" == typeof n2 && n2 && "object" == typeof n2.weak_password && n2.weak_password && Array.isArray(n2.weak_password.reasons) && n2.weak_password.reasons.length && n2.weak_password.reasons.reduce((e3, t3) => e3 && "string" == typeof t3, true))
    throw new te($e(n2), e2.status, n2.weak_password.reasons);
  throw new z($e(n2), e2.status || 500, s2);
}
async function De(e2, t2, r2, n2) {
  var s2;
  const o2 = Object.assign({}, null == n2 ? void 0 : n2.headers);
  o2[B] || (o2[B] = I.name), (null == n2 ? void 0 : n2.jwt) && (o2.Authorization = `Bearer ${n2.jwt}`);
  const a2 = null !== (s2 = null == n2 ? void 0 : n2.query) && void 0 !== s2 ? s2 : {};
  (null == n2 ? void 0 : n2.redirectTo) && (a2.redirect_to = n2.redirectTo);
  const i2 = Object.keys(a2).length ? "?" + new URLSearchParams(a2).toString() : "", u2 = await async function(e3, t3, r3, n3, s3, o3) {
    const a3 = ((e4, t4, r4, n4) => {
      const s4 = { method: e4, headers: (null == t4 ? void 0 : t4.headers) || {} };
      return "GET" === e4 ? s4 : (s4.headers = Object.assign({ "Content-Type": "application/json;charset=UTF-8" }, null == t4 ? void 0 : t4.headers), s4.body = JSON.stringify(n4), Object.assign(Object.assign({}, s4), r4));
    })(t3, n3, s3, o3);
    let i3;
    try {
      i3 = await e3(r3, Object.assign({}, a3));
    } catch (e4) {
      throw new Q($e(e4), 0);
    }
    i3.ok || await Me(i3);
    if (null == n3 ? void 0 : n3.noResolveJson)
      return i3;
    try {
      return await i3.json();
    } catch (e4) {
      await Me(e4);
    }
  }(e2, t2, r2 + i2, { headers: o2, noResolveJson: null == n2 ? void 0 : n2.noResolveJson }, {}, null == n2 ? void 0 : n2.body);
  return (null == n2 ? void 0 : n2.xform) ? null == n2 ? void 0 : n2.xform(u2) : { data: Object.assign({}, u2), error: null };
}
function ze(e2) {
  var t2;
  let r2 = null;
  var n2;
  (function(e3) {
    return e3.access_token && e3.refresh_token && e3.expires_in;
  })(e2) && (r2 = Object.assign({}, e2), e2.expires_at || (r2.expires_at = (n2 = e2.expires_in, Math.round(Date.now() / 1e3) + n2)));
  return { data: { session: r2, user: null !== (t2 = e2.user) && void 0 !== t2 ? t2 : e2 }, error: null };
}
function He(e2) {
  const t2 = ze(e2);
  return !t2.error && e2.weak_password && "object" == typeof e2.weak_password && Array.isArray(e2.weak_password.reasons) && e2.weak_password.reasons.length && e2.weak_password.message && "string" == typeof e2.weak_password.message && e2.weak_password.reasons.reduce((e3, t3) => e3 && "string" == typeof t3, true) && (t2.data.weak_password = e2.weak_password), t2;
}
function Ge(e2) {
  var t2;
  return { data: { user: null !== (t2 = e2.user) && void 0 !== t2 ? t2 : e2 }, error: null };
}
function We(e2) {
  return { data: e2, error: null };
}
function Fe(e2) {
  const { action_link: t2, email_otp: r2, hashed_token: n2, redirect_to: s2, verification_type: o2 } = e2, a2 = Ie(e2, ["action_link", "email_otp", "hashed_token", "redirect_to", "verification_type"]);
  return { data: { properties: { action_link: t2, email_otp: r2, hashed_token: n2, redirect_to: s2, verification_type: o2 }, user: Object.assign({}, a2) }, error: null };
}
function Le(e2) {
  return e2;
}
export {
  R as $,
  G as A,
  _e as B,
  xe as C,
  We as D,
  F as E,
  Ue as F,
  L as G,
  Se as H,
  X as I,
  Y as J,
  H as K,
  pe as L,
  Ae as M,
  be as N,
  C as O,
  ee as P,
  je as Q,
  Be as R,
  c as S,
  T,
  P as U,
  N as V,
  Pe as W,
  Ce as X,
  fe as Y,
  ne as Z,
  De as _,
  p as a,
  J as a0,
  U as a1,
  He as a2,
  Ee as a3,
  q as a4,
  z as a5,
  M as a6,
  Q as a7,
  te as a8,
  W as a9,
  re as aa,
  i as ab,
  x as b,
  w as c,
  f as d,
  E as e,
  ve as f,
  _ as g,
  S as h,
  l as i,
  D as j,
  Le as k,
  Ge as l,
  Fe as m,
  we as n,
  k as o,
  j as p,
  me as q,
  u as r,
  ge as s,
  Z as t,
  ke as u,
  Je as v,
  K as w,
  V as x,
  he as y,
  ze as z
};
