'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../popper/index.js');
require('../../../utils/index.js');
require('../../../hooks/index.js');
var trigger = require('./trigger.js');
var tooltip = require('./tooltip.js');
var tokens = require('./tokens.js');
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../hooks/use-model-toggle/index.js');
var arrow = require('../../popper/src/arrow2.js');
var index$1 = require('../../../hooks/use-popper-container/index.js');
var index$2 = require('../../../hooks/use-id/index.js');
var core = require('@vueuse/core');

const { useModelToggleProps } = index.createModelToggleComposable("visible");
const _sfc_main = vue.defineComponent({
  name: "PsTooltip",
  components: {
    PsTooltipTrigger: trigger["default"]
  },
  props: {
    ...useModelToggleProps,
    ...tooltip.useTooltipContentProps,
    ...tooltip.useTooltipTriggerProps,
    ...arrow.usePopperArrowProps,
    ...tooltip.useTooltipProps
  },
  setup(props) {
    index$1.usePopperContainer();
    const id = index$2.useId();
    const open = vue.ref(false);
    const controlled = vue.computed(() => core.isBoolean(props.visible));
    vue.provide(tokens.TOOLTIP_INJECTION_KEY, {
      controlled,
      id,
      open: vue.readonly(open),
      trigger: vue.toRef(props, "trigger")
    });
  }
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_ps_tooltip_trigger = vue.resolveComponent("ps-tooltip-trigger");
  return vue.openBlock(), vue.createBlock(_component_ps_tooltip_trigger, {
    disabled: _ctx.disabled,
    trigger: _ctx.trigger,
    "virtual-ref": _ctx.virtualRef,
    "virtual-triggering": _ctx.virtualTriggering
  }, {
    default: vue.withCtx(() => [
      _ctx.$slots.default ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : vue.createCommentVNode("v-if", true)
    ]),
    _: 3
  }, 8, ["disabled", "trigger", "virtual-ref", "virtual-triggering"]);
}
var Tooltip = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/tooltip/src/tooltip.vue"]]);

exports["default"] = Tooltip;
//# sourceMappingURL=tooltip2.js.map
