import { provide, inject, ref, defineComponent, toRef, watch } from 'vue';

const RangeContextKey = Symbol("RangeContextProps");
function useProvideRange(props) {
  provide(RangeContextKey, props);
}
function useInjectRange() {
  return inject(RangeContextKey, {
    rangedValue: ref(),
    hoverRangedValue: ref(),
    inRange: ref(),
    panelPosition: ref()
  });
}
const RangeContextProvider = /* @__PURE__ */ defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "PanelContextProvider",
  inheritAttrs: false,
  props: {
    value: {
      type: Object,
      default: () => ({})
    }
  },
  setup(props, {
    slots
  }) {
    const value = {
      rangedValue: ref(props.value.rangedValue),
      hoverRangedValue: ref(props.value.hoverRangedValue),
      inRange: ref(props.value.inRange),
      panelPosition: ref(props.value.panelPosition)
    };
    useProvideRange(value);
    toRef;
    watch(() => props.value, () => {
      Object.keys(props.value).forEach((key) => {
        if (value[key])
          value[key].value = props.value[key];
      });
    });
    return () => {
      var _a;
      return (_a = slots.default) == null ? void 0 : _a.call(slots);
    };
  }
});

export { RangeContextProvider, RangeContextKey as default, useInjectRange, useProvideRange };
//# sourceMappingURL=RangeContext.mjs.map
