import { jsx as w } from "react/jsx-runtime";
import a from "react";
import S from "./SystemColors.js";
import x from "./PlainColor.js";
import b from "./ManualColors.js";
import { isSequentialColorScheme as g, isCategoricalColorScheme as v } from "@nivo/colors";
import M from "./SequentialColors.js";
import q from "./CategoricalColors.js";
class z extends a.Component {
  constructor(l) {
    super(l);
  }
  render() {
    const {
      app: l,
      type: n,
      colorBy: s,
      scheme: o,
      barColor: C,
      manualColors: d,
      locale: m,
      overallLabel: u,
      customLabels: h,
      options: p
    } = this.props;
    let e;
    const { data: r, keys: t, indexBy: i, dimensionsMetadata: c, measuresMetadata: f } = this.props.options;
    return r ? (o === "system" ? e = new S(
      l,
      n,
      s,
      o,
      r,
      t,
      i,
      c,
      f,
      m,
      p
    ) : o === "plain_color" ? e = new x(C) : o == "manual" ? e = new b(
      l,
      n,
      s,
      o,
      r,
      c,
      f,
      t,
      i,
      d,
      m,
      u,
      h,
      p
    ) : (g(o) && (e = new M(
      s,
      o,
      r,
      t,
      i
    )), v(o) && (e = new q(
      s,
      o,
      r,
      t,
      i
    ))), /* @__PURE__ */ w("div", { children: a.Children.map(
      this.props.children,
      (y) => a.cloneElement(y, {
        ...this.props,
        colorGenerator: e
      })
    ) })) : null;
  }
}
export {
  z as default
};
