import { jsx as l, jsxs as m, Fragment as f } from "@emotion/react/jsx-runtime";
import { isValidElement as h, cloneElement as u } from "react";
import { Chip as F } from "../../../Chip/Chip.js";
import b from "../DynamicFilterBase/useDynamicFilterBase.js";
import y from "./useAppliedFilterChip.js";
import { Typography as C } from "../../../extended/mui/Typography/Typography.js";
function j(i) {
  const { fixed: n, isSet: a, field: c } = i, { size: o } = b(), { onEditFilter: p, onDelete: s, iconFieldUrl: e, labels: r } = y(i), t = a ? c.color ?? "default" : "error", d = h(e) ? u(e, {
    size: o,
    color: `chips.${t}.contained.color`
  }) : e;
  return /* @__PURE__ */ l(
    F,
    {
      size: o,
      opacity: !0,
      color: t,
      variant: "contained",
      onClick: p,
      startIcon: d,
      label: /* @__PURE__ */ m(f, { children: [
        /* @__PURE__ */ l(C, { component: "span", variant: "bodyDens", size: o, color: "inherit", children: `${r.labelField} ${r.labelOperator} ` }),
        ` ${r.labelOperands}`
      ] }),
      onDeleted: n ? void 0 : s
    }
  );
}
export {
  j as default
};
