import { k as CONSOLE_URL, m as WEBAPP_URL, n as WEBSITE_URL } from "./index-Cw1zbw54.js";
const getSafeRedirectUrl = (url = "") => {
  if (!url) {
    return null;
  }
  if (url.search(/^https?:\/\//) === -1) {
    throw new Error("Pass an absolute URL");
  }
  const urlParsed = new URL(url);
  if (![CONSOLE_URL, WEBAPP_URL, WEBSITE_URL].some((u) => new URL(u).origin === urlParsed.origin)) {
    url = `${WEBAPP_URL}/`;
  }
  return url;
};
export {
  getSafeRedirectUrl as g
};
