"use client";
import { j as n } from "../../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import { Menu as m } from "@mantine/core";
import r from "../../Button/index.mjs";
import f from "../../Checkbox/index.mjs";
import c from "../GenericDropdown/index.mjs";
import u from "./OptionsDropdown.module.scss.mjs";
function C(o) {
  function a(t) {
    const e = {};
    for (const s in o.options)
      e[s] = !1;
    e[t] = !0, o.setOptions((s) => ({
      ...s,
      ...e
    }));
  }
  const i = [];
  Object.keys(o.options).forEach(
    (t, e) => i.push(
      /* @__PURE__ */ n.jsx(
        m.Item,
        {
          closeMenuOnClick: !1,
          className: u.menuItem,
          children: /* @__PURE__ */ n.jsxs(
            "div",
            {
              style: {
                display: "flex",
                flexDirection: "row",
                justifyContent: "space-between"
              },
              children: [
                /* @__PURE__ */ n.jsx(
                  f,
                  {
                    type: "secondary",
                    checked: o.options[t],
                    onChange: (s) => {
                      const l = {};
                      l[t] = s.target.checked, o.setOptions((d) => ({
                        ...d,
                        ...l
                      }));
                    },
                    children: /* @__PURE__ */ n.jsx(
                      "div",
                      {
                        className: "body",
                        style: { paddingLeft: "var(--space-sm)", margin: "auto 0px" },
                        children: t
                      }
                    )
                  }
                ),
                /* @__PURE__ */ n.jsx(r, { type: "link", size: "small", onClick: () => a(t), children: "Only" })
              ]
            }
          )
        },
        `toggleItem${e}`
      )
    )
  );
  function p() {
    const t = {};
    for (const e in o.options)
      t[e] = !1;
    o.setOptions((e) => ({
      ...e,
      ...t
    }));
  }
  return i.push(
    /* @__PURE__ */ n.jsx(r, { type: "tertiary", size: "small", onClick: p, children: /* @__PURE__ */ n.jsx("div", { className: "button-sm", children: "Clear filter" }) })
  ), /* @__PURE__ */ n.jsx(
    c,
    {
      menuItemsGap: "0px",
      closeOnClickOutside: !1,
      styles: {
        itemLabel: { color: "var(--color-neutral-100)" },
        dropdown: {
          position: "relative",
          top: "0px !important",
          left: "0px !important",
          transform: "none"
        }
      },
      target: /* @__PURE__ */ n.jsx(
        c.GenericButton,
        {
          text: o.title,
          style: { width: "300px" }
        }
      ),
      children: i
    }
  );
}
export {
  C as default
};
//# sourceMappingURL=index.mjs.map
