"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index = require("../../../hooks/use-namespace/index.js");
const index$1 = require("../../icon/index.js");
const backtop = require("./backtop.js");
const useBacktop = require("./use-backtop.js");
const index$2 = require("../../../../../@element-plus/icons-vue/dist/index.js");
const Vue = require("vue");
const COMPONENT_NAME = "ElBacktop";
var backtop_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ Vue.defineComponent({
  name: COMPONENT_NAME,
  __name: "backtop",
  props: backtop.backtopProps,
  emits: backtop.backtopEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const ns = index.useNamespace("backtop");
    const { handleClick, visible } = useBacktop.useBackTop(props, emit, COMPONENT_NAME);
    const backTopStyle = Vue.computed(() => ({
      right: `${props.right}px`,
      bottom: `${props.bottom}px`
    }));
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createBlock(Vue.Transition, { name: `${Vue.unref(ns).namespace.value}-fade-in` }, {
        default: Vue.withCtx(() => [Vue.unref(visible) ? (Vue.openBlock(), Vue.createElementBlock("div", {
          key: 0,
          style: Vue.normalizeStyle(backTopStyle.value),
          class: Vue.normalizeClass(Vue.unref(ns).b()),
          onClick: _cache[0] || (_cache[0] = Vue.withModifiers((...args) => Vue.unref(handleClick) && Vue.unref(handleClick)(...args), ["stop"]))
        }, [Vue.renderSlot(_ctx.$slots, "default", {}, () => [Vue.createVNode(Vue.unref(index$1.ElIcon), { class: Vue.normalizeClass(Vue.unref(ns).e("icon")) }, {
          default: Vue.withCtx(() => [Vue.createVNode(Vue.unref(index$2.CaretTop))]),
          _: 1
        }, 8, ["class"])])], 6)) : Vue.createCommentVNode("v-if", true)]),
        _: 3
      }, 8, ["name"]);
    };
  }
});
exports.default = backtop_vue_vue_type_script_setup_true_lang_default;
