import { q as v, S as p, v as y, g3 as F, w as e, X as d, M as T, F as r, G as m, dT as A, _ as w, dV as N, a6 as C, Y as t, cs as V, bN as b, g4 as S, g5 as I, g6 as k, g7 as h, e3 as R, dm as s, at as _, am as n, d$ as c } from "./603b75d9.js";
import "react";
import { ColumnTypeComp as z } from "./18a95abc.js";
import { TextOverflowControl as M } from "./be662667.js";
import "react-dom";
import "./c2be1293.js";
import "./4963ac97.js";
import "./ffcffc16.js";
import "./62f393ec.js";
import "./26dac75c.js";
import "./11b05d65.js";
import "./56edae87.js";
import "./0cc240d3.js";
import "./00d44232.js";
import "./f9847c56.js";
import "./a4d0e31e.js";
import "./41aba172.js";
import "./e735e391.js";
import "./140b48ce.js";
import "./f5fb28b1.js";
import "./930af84f.js";
import "./9c5ea6de.js";
import "./7f1b43fa.js";
import "./cee178c0.js";
import "./43b58a96.js";
import "./19a46fb5.js";
import "./98f17e53.js";
import "./794d827a.js";
import "./0cdeb449.js";
import "./d50792b8.js";
import "./f64a8554.js";
import "./cf72e8e5.js";
import "./84cede66.js";
import "./3dfed0b7.js";
import "./57f24d28.js";
const g = v(z), H = {
  cellTooltip: p,
  // a custom column or a data column
  isCustom: y(!1),
  // If it is a data column, it must be the name of the column and cannot be duplicated as a react key
  dataIndex: y(""),
  render: g,
  align: F,
  background: e(n, ""),
  margin: e(c, ""),
  text: e(n, ""),
  border: e(n, ""),
  radius: e(c, ""),
  textSize: e(c, ""),
  textWeight: e(p, "normal"),
  fontFamily: e(p, "sans-serif"),
  fontStyle: e(p, "normal"),
  cellColor: p,
  textOverflow: e(M, "ellipsis"),
  linkColor: e(n, "#3377ff"),
  linkHoverColor: e(n, ""),
  linkActiveColor: e(n, "")
}, O = d(S)` width: 24px; margin: 0 8px 0 -3px; padding: 3px;`, P = d(I)` width: 24px; margin: 0 8px 0 -3px; padding: 3px;`, f = d(h)` width: 24px; margin: 0 8px 0 -3px; padding: 3px;`, W = d(k)` width: 24px; margin: 0 8px 0 -3px; padding: 3px;`, $ = new T(H, (u, o) => ({
  ...u
})).setPropertyViewFn(() => /* @__PURE__ */ r(m, {})).build();
class be extends $ {
  reduce(o) {
    return super.reduce(o);
  }
  getView() {
    const o = super.getView(), i = this.children.render.getSelectedComp().getComp().children.compType.getView();
    return {
      ...o,
      columnType: i
    };
  }
  exposingNode() {
    const o = this.children.dataIndex.exposingNode(), i = A(this.children.render.node(), (l) => ({
      wrap: l.__comp__.wrap,
      map: w.mapValues(l.__map__, (a) => a.comp)
    }));
    return N({
      dataIndex: o,
      render: i
    });
  }
  propertyView(o) {
    var a, x;
    const i = this.children.render.getSelectedComp().getComp().children.compType.getView(), l = this.children.render.getSelectedComp().getComp().toJsonValue();
    return (a = l.comp) != null && a.hasOwnProperty("src") ? l.comp.src : (x = l.comp) != null && x.hasOwnProperty("text") && l.comp.text, /* @__PURE__ */ C(m, {
      children: [this.children.cellTooltip.propertyView({
        label: t("table.columnTooltip")
      }), this.children.render.getPropertyView(), this.children.align.propertyView({
        label: t("table.align"),
        radioButton: !0
      }), (i === "link" || i === "links") && /* @__PURE__ */ C(m, {
        children: [/* @__PURE__ */ r(V, {
          style: {
            margin: "12px 0"
          }
        }), b({}, /* @__PURE__ */ r("div", {
          children: /* @__PURE__ */ r("b", {
            children: "Link Style"
          })
        })), this.children.linkColor.propertyView({
          label: t("text")
        }), this.children.linkHoverColor.propertyView({
          label: "Hover text"
        }), this.children.linkActiveColor.propertyView({
          label: "Active text"
        })]
      }), /* @__PURE__ */ r(V, {
        style: {
          margin: "12px 0"
        }
      }), b({}, /* @__PURE__ */ r("div", {
        children: /* @__PURE__ */ r("b", {
          children: "Column Style"
        })
      })), this.children.background.propertyView({
        label: t("style.background")
      }), i !== "link" && this.children.text.propertyView({
        label: t("text")
      }), this.children.border.propertyView({
        label: t("style.border")
      }), this.children.radius.propertyView({
        label: t("style.borderRadius"),
        preInputNode: /* @__PURE__ */ r(O, {
          as: S,
          title: ""
        }),
        placeholder: "3px"
      }), this.children.textSize.propertyView({
        label: t("style.textSize"),
        preInputNode: /* @__PURE__ */ r(P, {
          as: I,
          title: ""
        }),
        placeholder: "14px"
      }), this.children.textWeight.propertyView({
        label: t("style.textWeight"),
        preInputNode: /* @__PURE__ */ r(W, {
          as: k,
          title: ""
        }),
        placeholder: "normal"
      }), this.children.fontFamily.propertyView({
        label: t("style.fontFamily"),
        preInputNode: /* @__PURE__ */ r(f, {
          as: h,
          title: ""
        }),
        placeholder: "sans-serif"
      }), this.children.fontStyle.propertyView({
        label: t("style.fontStyle"),
        preInputNode: /* @__PURE__ */ r(f, {
          as: h,
          title: ""
        }),
        placeholder: "normal"
      }), this.children.cellColor.propertyView({
        label: t("table.cellColor")
      })]
    });
  }
  getChangeSet() {
    const o = this.children.dataIndex.getView(), i = w.mapValues(this.children.render.getMap(), (l) => l.getComp().children.comp.children.changeValue.getView());
    return {
      [o]: i
    };
  }
  dispatchClearChangeSet() {
    this.children.render.dispatch(R(g.forEachAction(s("comp", s("comp", _("changeValue", null, !1))))));
  }
  static setSelectionAction(o) {
    return s("render", g.setSelectionAction(o));
  }
}
export {
  g as RenderComp,
  be as SummaryColumnComp,
  H as columnChildrenMap
};
