import { defineComponent, useSlots, computed, ref, resolveComponent, createBlock, openBlock, createSlots, withCtx, unref, renderSlot } from 'vue';
import { containerProps } from './container.mjs';

var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: "GmContainer"
  },
  __name: "Container",
  props: containerProps,
  setup(__props, { expose: __expose }) {
    const slots = useSlots();
    const props = __props;
    const isVertical = computed(() => {
      if (props.direction === "vertical") {
        return true;
      } else if (props.direction === "horizontal") {
        return false;
      }
      if (slots && slots.default) {
        const vNodes = slots.default();
        return vNodes.some((vNode) => {
          const tag = vNode.type.name || "";
          return ["ElHeader", "ElFooter", "GmHeader", "GmFooter"].includes(tag);
        });
      } else {
        return false;
      }
    });
    const direction = computed(() => {
      return isVertical.value ? "vertical" : "horizontal";
    });
    const elRef = ref();
    __expose({
      elRef
    });
    return (_ctx, _cache) => {
      const _component_el_container = resolveComponent("el-container");
      return openBlock(), createBlock(_component_el_container, {
        ref_key: "elRef",
        ref: elRef,
        direction: direction.value
      }, createSlots({
        _: 2
        /* DYNAMIC */
      }, [
        unref(slots).default ? {
          name: "default",
          fn: withCtx(() => [
            renderSlot(_ctx.$slots, "default")
          ]),
          key: "0"
        } : void 0
      ]), 1032, ["direction"]);
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=Container.vue2.mjs.map
