import { defineComponent, provide, h } from 'vue';
import { TIMELINE_INJECTION_KEY } from './tokens.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
import { flattedChildren } from '../../../utils/vue/vnode.mjs';

const Timeline = defineComponent({
  name: "ElTimeline",
  props: {
    reverse: Boolean
  },
  setup(props, { slots }) {
    const ns = useNamespace("timeline");
    provide(TIMELINE_INJECTION_KEY, slots);
    return () => {
      var _a, _b;
      const children = flattedChildren((_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : []).filter(
        (node) => {
          var _a2;
          return ((_a2 = node == null ? void 0 : node.type) == null ? void 0 : _a2.name) === "ElTimelineItem";
        }
      );
      return h(
        "ul",
        { class: [ns.b()] },
        props.reverse ? children.reverse() : children
      );
    };
  }
});

export { Timeline as default };
//# sourceMappingURL=timeline.mjs.map
