"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const shared_esmBundler = require("../../../../../@vue/shared/dist/shared.esm-bundler.js");
const index = require("../../../hooks/use-namespace/index.js");
const types = require("./types.js");
const vue = require("vue");
function isVNodeEmpty(vnodes) {
  return !!(shared_esmBundler.isArray(vnodes) ? vnodes.every(({ type }) => type === vue.Comment) : (vnodes == null ? void 0 : vnodes.type) === vue.Comment);
}
var node_content_default = /* @__PURE__ */ vue.defineComponent({
  name: "NodeContent",
  props: { node: {
    type: Object,
    required: true
  } },
  setup(props) {
    const ns = index.useNamespace("cascader-node");
    const { renderLabelFn } = vue.inject(types.CASCADER_PANEL_INJECTION_KEY);
    const { node } = props;
    const { data, label: nodeLabel } = node;
    const label = () => {
      const renderLabel = renderLabelFn == null ? void 0 : renderLabelFn({
        node,
        data
      });
      return isVNodeEmpty(renderLabel) ? nodeLabel : renderLabel ?? nodeLabel;
    };
    return () => vue.createVNode("span", { "class": ns.e("label") }, [label()]);
  }
});
exports.default = node_content_default;
