"use strict";
const index = require("./user-v6mfWQ2d.cjs");
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 (![index.CONSOLE_URL, index.WEBAPP_URL, index.WEBSITE_URL].some((u) => new URL(u).origin === urlParsed.origin)) {
    url = `${index.WEBAPP_URL}/`;
  }
  return url;
};
exports.getSafeRedirectUrl = getSafeRedirectUrl;
