import { defineComponent, ref, createElementBlock, openBlock, createElementVNode, createVNode, normalizeClass, renderSlot, withCtx } from "vue";
import _sfc_main$1 from "./OScrollbar.vue.mjs";
import { scrollerProps } from "./types.mjs";
const _hoisted_1 = { class: "o-scroller o-scrollbar-wrapper" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "OScroller",
  props: scrollerProps,
  setup(__props, { expose: __expose }) {
    const props = __props;
    const targetRef = ref(null);
    const scrollTo = (options) => {
      if (!targetRef.value) {
        return;
      }
      targetRef.value.scrollTo(options);
    };
    __expose({
      scrollTo,
      getContainerEl() {
        return targetRef.value;
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode(
          "div",
          {
            ref_key: "targetRef",
            ref: targetRef,
            class: normalizeClass(["o-scroller-container", [
              {
                "is-x-disabled": props.disabledX,
                "is-y-disabled": props.disabledY
              },
              props.wrapClass
            ]])
          },
          [
            renderSlot(_ctx.$slots, "default")
          ],
          2
          /* CLASS */
        ),
        createVNode(_sfc_main$1, {
          target: targetRef.value,
          "disabled-x": props.disabledX,
          "disabled-y": props.disabledY,
          duration: props.duration,
          "show-type": props.showType,
          size: props.size,
          "auto-update-on-scroll-size": props.autoUpdateOnScrollSize
        }, {
          thumb: withCtx(() => [
            renderSlot(_ctx.$slots, "thumb")
          ]),
          track: withCtx(() => [
            renderSlot(_ctx.$slots, "track")
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["target", "disabled-x", "disabled-y", "duration", "show-type", "size", "auto-update-on-scroll-size"])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
