import { defineComponent as b, useAttrs as m, useTemplateRef as y, resolveComponent as x, createElementBlock as h, openBlock as k, renderSlot as u, createVNode as B, normalizeProps as r, guardReactiveProps as i, mergeProps as g, unref as c, toHandlers as P, withCtx as w } from "vue";
const I = /* @__PURE__ */ b({
  __name: "wt-popover",
  props: {
    disabled: { type: Boolean, default: !1 },
    dismissable: { type: Boolean },
    appendTo: { default: "body" },
    baseZIndex: { default: 0 },
    autoZIndex: { type: Boolean, default: !0 },
    breakpoints: { default: null },
    dt: { default: null },
    pt: { default: null },
    ptOptions: { default: null },
    unstyled: { type: Boolean, default: !1 },
    closeOnEscape: { type: Boolean, default: !0 }
  },
  emits: ["show", "hide"],
  setup(e, { expose: f }) {
    const s = m(), o = y("innerPopover"), d = e, a = (t, n) => {
      d.disabled || o.value?.toggle(t, n ?? void 0);
    }, p = (t, n) => {
      d.disabled || o.value?.show(t, n ?? void 0);
    }, l = (t) => {
      o.value?.hide(t);
    };
    return f({
      toggle: a,
      show: p,
      hide: l
    }), (t, n) => {
      const v = x("p-popover");
      return k(), h("div", null, [
        u(t.$slots, "activator", r(i({ show: p, toggle: a, hide: l }))),
        B(v, g(c(s), {
          ref_key: "innerPopover",
          ref: o
        }, {
          "append-to": e.appendTo,
          "base-z-index": e.baseZIndex,
          "auto-z-index": e.autoZIndex,
          breakpoints: e.breakpoints,
          dt: e.dt,
          pt: e.pt,
          "pt-options": e.ptOptions,
          "close-on-escape": e.closeOnEscape,
          unstyled: e.unstyled
        }, P(c(s))), {
          default: w(() => [
            u(t.$slots, "default", r(i({ hide: l, toggle: a })))
          ], void 0, !0),
          _: 3
        }, 16, ["append-to", "base-z-index", "auto-z-index", "breakpoints", "dt", "pt", "pt-options", "close-on-escape", "unstyled"])
      ]);
    };
  }
});
export {
  I as default
};
