import { j as s } from "../../node_modules/react/jsx-runtime.js";
import * as a from "react";
import { Viewport as i, Root as c, Action as n, Close as d, Title as f, Description as l, Provider as x } from "../../node_modules/@radix-ui/react-toast/dist/index.js";
import { cva as v } from "../../node_modules/class-variance-authority/dist/index.js";
import { cn as r } from "../../utils/index.js";
import { Icon as m } from "../Icon/index.js";
const A = x, $ = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s.jsx(
  i,
  {
    ref: o,
    className: r(
      "fixed top-0 z-[100] flex items-center max-h-screen w-full flex-col-reverse",
      t
    ),
    ...e
  }
));
$.displayName = i.displayName;
const g = v(
  "toast group pointer-events-auto relative flex w-full items-center gap-2 justify-start top-16 data-[state=open]:animate-in data-[state=open]:slide-in-from-top-10 data-[state=close]:animate-out data-[state=close]:fade-out-100",
  {
    variants: {
      variant: {
        default: "toast-success",
        critical: "critical",
        warn: "warn",
        info: "info"
      }
    },
    defaultVariants: {
      variant: "default"
    }
  }
), N = a.forwardRef(({ className: t, variant: e, children: o, ...p }, u) => {
  const b = {
    default: "check-circle",
    critical: "info-circle",
    warn: "info-circle",
    info: "info-circle"
  }[e ?? "default"];
  return /* @__PURE__ */ s.jsxs(
    c,
    {
      ref: u,
      className: r(g({ variant: e }), t),
      ...p,
      children: [
        /* @__PURE__ */ s.jsx(m, { name: b, className: "toast-icon-font", size: "sm" }),
        o
      ]
    }
  );
});
N.displayName = c.displayName;
const y = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s.jsx(
  n,
  {
    ref: o,
    className: r(
      "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
      t
    ),
    ...e
  }
));
y.displayName = n.displayName;
const w = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s.jsx(
  d,
  {
    ref: o,
    className: r(
      "absolute right-2 rounded-md p-1 focus:opacity-100 focus:outline-none focus:ring-2 flex items-center",
      t
    ),
    "toast-close": "",
    ...e,
    children: /* @__PURE__ */ s.jsx(m, { name: "x", size: "sm" })
  }
));
w.displayName = d.displayName;
const j = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s.jsx(
  f,
  {
    ref: o,
    className: r("font-semibold", t),
    ...e
  }
));
j.displayName = f.displayName;
const h = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s.jsx(
  l,
  {
    ref: o,
    className: r("opacity-90", t),
    ...e
  }
));
h.displayName = l.displayName;
export {
  N as Toast,
  y as ToastAction,
  w as ToastClose,
  h as ToastDescription,
  A as ToastProvider,
  j as ToastTitle,
  $ as ToastViewport
};
