import { jsx as a, jsxs as c } from "react/jsx-runtime";
import { AreaChart as x, CartesianGrid as b, XAxis as y, YAxis as A, Area as g } from "recharts";
import { ChartContainer as j, ChartTooltip as I, ChartTooltipContent as N, ChartLegend as T, ChartLegendContent as w } from "../ChartPrimitive.js";
const z = ({
  id: f,
  chartConfig: t,
  data: p,
  grid: d = !0,
  areaType: h = "natural",
  xAxisOptions: e,
  yAxisOptions: l,
  gridHorizontal: C,
  gridVertical: m = !1,
  isStack: u = !1,
  stackOffset: o,
  showLegend: L = !1,
  height: i = 300,
  tooltipContent: $,
  useGradient: s = !1,
  hideLegendIcon: v = !1
}) => {
  const n = Object.keys(t);
  return /* @__PURE__ */ a(
    j,
    {
      id: f,
      config: t,
      className: "w-full",
      ...i && {
        style: { height: i }
      },
      children: /* @__PURE__ */ c(
        x,
        {
          accessibilityLayer: !0,
          data: p,
          margin: {
            left: 12,
            right: 12
          },
          ...o && { stackOffset: o },
          children: [
            d && /* @__PURE__ */ a(b, { opacity: 0.8, stroke: "var(--base-border)", vertical: m, horizontal: C }),
            e && /* @__PURE__ */ a(y, { tickLine: !1, axisLine: !1, ...e }),
            l && /* @__PURE__ */ a(A, { tickLine: !1, axisLine: !1, ...l }),
            /* @__PURE__ */ a(I, { cursor: !1, content: /* @__PURE__ */ a(N, { hideLabel: !0, ...$ }) }),
            s && /* @__PURE__ */ a("defs", { children: n.map((r) => /* @__PURE__ */ c("linearGradient", { id: `fill-${r}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
              /* @__PURE__ */ a("stop", { offset: "5%", stopColor: `var(--color-${r})`, stopOpacity: 0.8 }),
              /* @__PURE__ */ a("stop", { offset: "95%", stopColor: `var(--color-${r})`, stopOpacity: 0.1 })
            ] }, r)) }),
            n.map((r) => /* @__PURE__ */ a(
              g,
              {
                fill: `var(--color-${r})`,
                fillOpacity: 0.4,
                stroke: `var(--color-${r})`,
                dataKey: r,
                type: h,
                ...u && { stackId: "a" },
                ...s && { fill: `url(#fill-${r})` }
              },
              r
            )),
            L && /* @__PURE__ */ a(T, { content: /* @__PURE__ */ a(w, { hideIcon: v }) })
          ]
        }
      )
    }
  );
};
z.displayName = "AreaChart";
export {
  z as default
};
//# sourceMappingURL=AreaChart.js.map
