import { defineComponent as L, useCssVars as M, unref as e, toRefs as s, watch as P, ref as Q, openBlock as n, createElementBlock as l, createElementVNode as h, Fragment as u, renderList as p, normalizeStyle as C, toDisplayString as b, createTextVNode as U } from "vue";
const X = { class: "table" }, Y = { class: "tHeader" }, Z = { class: "tBorder" }, j = ["title"], ee = { class: "unit" }, te = L({ name: "ETableFix" }), ne = /* @__PURE__ */ L({
  ...te,
  props: {
    chartConfig: {
      type: Object,
      required: !0
    }
  },
  setup(B) {
    const g = B;
    M((o) => ({
      "78f167bb": e(W) + "px",
      "5ab3985f": e(k) + "px",
      "2e4ebe6f": e(E),
      "503a1ffd": e(F),
      "156d7c1b": e(H),
      "108ba6de": e(z) + "px",
      "5c3aecbc": e(O) + "px",
      "95a8ca32": e(q) + "px",
      "496cfdbd": e(T) + "px",
      "02925e67": e(D),
      "10609ca3": e(R),
      "3f3de14b": e(I),
      "6437d6ca": e(J) + "px",
      "3b7671fa": e(a) ? e(a) : e($),
      a36ee93e: e(c) ? e(c) : e(A),
      "2b19dbbf": e(a) ? e(a) : e(V),
      cd6ba4a8: e(m),
      fd28f040: e(G),
      b13dd6b0: e(N),
      "68b535fe": e(a),
      "01848fd0": e(c)
    }));
    const { dataset: y, tBorder: S, tHeader: w } = s(g.chartConfig.option), { columns: i, data: oe } = s(y.value), { fontSize: k, headerHeight: W, headerSpace: z, color: E, headerBGC: F, fontWeight: H } = s(w.value), {
      firstLineBgColor: $,
      firstLineLeftColor: m,
      SecondLineBgColor: A,
      SecondLineLeftColor: G,
      thirdlyLineBgColor: V,
      thirdlyLineLeftColor: N,
      borderHeight: O,
      borderSpace: T,
      fontSize: q,
      fontWeight: D,
      color: R,
      unitColor: I,
      unitSize: J,
      borderBGC: a,
      borderBGCeven: c
    } = s(S.value);
    P(
      () => g.chartConfig.option.dataset,
      (o) => {
        x(), v();
      },
      {
        deep: !1
      }
    );
    let _ = Q(null);
    console.log(i.value);
    let v = () => {
      i.value.forEach((o) => {
        let { width: r } = o, t;
        typeof r == "number" ? t = r + "px" : typeof r == "string" && (t = r), o.style = { width: t || _.value };
      });
    }, x = () => {
      let o = "100%";
      i.value.forEach((t) => {
        typeof t.width == "number" ? o += ` - ${t.width + "px"}` : typeof t.width == "string" && (o += ` - ${t.width}`);
      });
      let r = i.value.filter((t) => !t.width).length;
      _.value = `calc((${o}) / ${r})`;
    };
    return x(), v(), (o, r) => (n(), l("div", X, [
      h("div", Y, [
        (n(!0), l(u, null, p(e(i), (t, f) => (n(), l("div", {
          key: f,
          style: C({
            textAlign: "left",
            ...t.style
          })
        }, b(t.title), 5))), 128))
      ]),
      h("div", Z, [
        (n(!0), l(u, null, p(e(y).data, (t, f) => (n(), l("div", { key: f }, [
          (n(!0), l(u, null, p(e(i), (d, K) => (n(), l("div", {
            key: K,
            style: C({
              textAlign: d.align || "left",
              ...d.style
            }),
            title: t[d.key]
          }, [
            U(b(t[d.key]) + " ", 1),
            h("span", ee, b(d.unit || ""), 1)
          ], 12, j))), 128))
        ]))), 128))
      ])
    ]));
  }
});
export {
  ne as default
};
