import { c } from "react/compiler-runtime";
import React, { useEffect } from "react";
import { toast } from "sonner";
var Snackbar_default = (r) => {
	let i = c(10), { message: a, variant: o, show: s, icon: l, duration: u, position: d, id: f, onDismiss: p } = r, m = o === void 0 ? "info" : o, h = s === void 0 ? !0 : s, g = u === void 0 ? 4e3 : u, _ = d === void 0 ? "bottom-center" : d, v, y;
	return i[0] !== g || i[1] !== l || i[2] !== f || i[3] !== a || i[4] !== p || i[5] !== _ || i[6] !== h || i[7] !== m ? (v = () => {
		if (!a || !h) {
			f && !h && (toast.dismiss(f), p?.());
			return;
		}
		let e = {
			duration: g,
			position: _,
			id: f,
			...l && { icon: l }
		};
		bb39: switch (m) {
			case "success":
				toast.success(a, e);
				break bb39;
			case "error":
				toast.error(a, e);
				break bb39;
			case "warning":
				toast.warning(a, e);
				break bb39;
			case "loading":
				toast.loading(a, e);
				break bb39;
			case "info":
			default: toast(a, e);
		}
	}, y = [
		a,
		h,
		m,
		l,
		g,
		_,
		f,
		p
	], i[0] = g, i[1] = l, i[2] = f, i[3] = a, i[4] = p, i[5] = _, i[6] = h, i[7] = m, i[8] = v, i[9] = y) : (v = i[8], y = i[9]), useEffect(v, y), null;
};
export { Snackbar_default as default };
