var V = Object.defineProperty;
var g = (t, r, e) => r in t ? V(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
var y = (t, r, e) => (g(t, typeof r != "symbol" ? r + "" : r, e), e);
import { dr as c, w as n, O as a, aA as C, dc as m, Z as h, fY as b, de as S, fZ as P, f_ as T, v, bS as H, C as x, M as D, ft as B, _ as u, x as O, z as E, f$ as d, dV as w, dW as F, Y as s, s as M } from "./603b75d9.js";
import { ContainerBodyChildComp as N } from "./046c0def.js";
import "react";
import "react-dom";
const _ = {
  header: c,
  // Support future tab or step container expansion
  body: n(M(N), {
    0: {
      view: {
        layout: {},
        items: {}
      }
    }
  }),
  footer: c,
  showHeader: a.DEFAULT_TRUE,
  showBody: a.DEFAULT_TRUE,
  showFooter: a,
  autoHeight: C,
  showVerticalScrollbar: n(a, !1),
  horizontalGridCells: m,
  scrollbars: n(a, !1),
  style: n(h(b, "style"), {
    borderWidth: "1px"
  }),
  headerStyle: h(S, "headerStyle"),
  bodyStyle: h(P, "bodyStyle"),
  footerStyle: h(T, "footerStyle"),
  appliedThemeId: v("")
  // for comp containing container, comps's appliedThemeId will always be empty so maintaining here
}, z = H(new D(_, (t, r) => (B(t, r), {
  ...t,
  dispatch: r
})).build(), x);
class I extends z {
  constructor() {
    super(...arguments);
    y(this, "scrollbars");
  }
  allContainers() {
    return [this.children.header, ...Object.values(this.children.body.getView()).map((e) => e.children.view), this.children.footer];
  }
  realSimpleContainer(e) {
    return u.isNil(e) ? this.children.body.getView()[0].children.view : this.allContainers().find((o) => o.realSimpleContainer(e));
  }
  getCompTree() {
    return O(this.allContainers().map((e) => e.getCompTree()));
  }
  findContainer(e) {
    for (const o of this.allContainers()) {
      const i = o.findContainer(e);
      if (i)
        return i === o ? this : i;
    }
  }
  getPasteValue(e) {
    return {
      ...this.toJsonValue(),
      header: this.children.header.getPasteValue(e),
      body: u.mapValues(this.children.body.getView(), (o) => ({
        ...o.toJsonValue(),
        view: o.children.view.getPasteValue(e)
      })),
      footer: this.children.footer.getPasteValue(e)
    };
  }
  autoHeight() {
    return this.children.autoHeight.getView();
  }
  exposingNode() {
    const e = {};
    return E(this.getCompTree(), (o) => {
      const i = o.children.comp;
      let l = i.exposingNode();
      if (d(l) && !l.children.hasOwnProperty("formDataKey")) {
        const p = i.children.formDataKey;
        p && (l = w({
          ...l.children,
          formDataKey: p.exposingNode()
        }));
      }
      return e[o.children.name.getView()] = l, !0;
    }), F(this, "exposing_node", w(e), f);
  }
  getPropertyView() {
    return [this.areaPropertyView(), this.heightPropertyView(), this.gridPropertyView()];
  }
  areaPropertyView() {
    return [this.children.showHeader.propertyView({
      label: s("prop.showHeader")
    }), this.children.showBody.propertyView({
      label: s("prop.showBody")
    }), this.children.showFooter.propertyView({
      label: s("prop.showFooter")
    })];
  }
  heightPropertyView() {
    return [this.children.autoHeight.getPropertyView(), !this.children.autoHeight.getView() && this.children.showVerticalScrollbar.propertyView({
      label: s("prop.showVerticalScrollbar")
    })];
  }
  gridPropertyView() {
    return [this.children.horizontalGridCells.propertyView({
      label: s("prop.horizontalGridCells")
    })];
  }
  stylePropertyView() {
    return this.children.style.getPropertyView();
  }
  headerStylePropertyView() {
    return this.children.headerStyle.getPropertyView();
  }
  bodyStylePropertyView() {
    return this.children.bodyStyle.getPropertyView();
  }
  footerStylePropertyView() {
    return this.children.footerStyle.getPropertyView();
  }
}
function f(t, r) {
  if (t === r)
    return !0;
  if (t && r && d(t) && d(r)) {
    const e = t.children, o = r.children, i = Object.keys(e);
    return i.length === Object.keys(o).length && i.every((l) => f(e[l], o[l]));
  }
  return !1;
}
export {
  I as TriContainerComp
};
