/**
 * Webpack has bug for import loop, which is not the same behavior as ES module.
 * When util.js imports the TreeNode for tree generate will cause treeContextTypes be empty.
 */
import { inject, computed, defineComponent, provide } from 'vue';
var TreeContextKey = Symbol('TreeContextKey');
export var TreeContext = defineComponent({
  name: 'TreeContext',
  props: {
    value: {
      type: Object
    }
  },
  setup: function setup(props, _ref) {
    var slots = _ref.slots;
    provide(TreeContextKey, computed(function () {
      return props.value;
    }));
    return function () {
      var _slots$default;

      return (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots);
    };
  }
});
export var useInjectTreeContext = function useInjectTreeContext() {
  return inject(TreeContextKey, computed(function () {
    return {};
  }));
};