import { TOAST_VARIANT_DEFAULT as c } from "../constants.js";
import { makeMessageId as f } from "./makeMessageId.js";
const o = (e, r, n) => (a, t) => {
  const { position: u, ...m } = r, g = {
    variant: n || c,
    ...m
  }, s = f();
  e({
    type: "add",
    message: {
      id: s,
      message: a,
      onClose: () => e({ type: "remove", messageId: s }),
      ...g,
      ...t
    }
  });
}, A = (e, r) => ({
  clear: () => e({ type: "clear" }),
  custom: o(e, r),
  error: o(e, r, "error"),
  info: o(e, r, "info"),
  success: o(e, r, "positive"),
  warning: o(e, r, "warning")
});
export {
  A as createMessageMethods
};
