function withFlash(url, message, type = "success") {
  const base = typeof window !== "undefined" && window.location ? window.location.origin : "http://localhost";
  const u = new URL(url, base);
  u.searchParams.set("flash", message);
  u.searchParams.set("type", type);
  const qs = u.searchParams.toString();
  return `${u.pathname}${qs ? `?${qs}` : ""}`;
}
function pushWithFlash(router, url, message, type = "success") {
  router.push(withFlash(url, message, type));
}
export {
  pushWithFlash,
  withFlash
};
//# sourceMappingURL=flash.js.map
