import { y as CONSOLE_URL, z as WEBAPP_URL, D as WEBSITE_URL } from "./orgDomains-eTg-cjth.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
};
