"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const SvgIcon = require("./SvgIcon.vue.js");
const ArrowUpIcon = require("../icons/ArrowUpIcon.vue.js");
const room = require("../../../constants/room.js");
const environment = require("../../../utils/environment.js");
const UnSupportIcon = require("../icons/UnSupportIcon.vue.js");
const vTap = require("../../../directives/vTap.js");
const _hoisted_1 = { class: "icon-button-container" };
const _hoisted_2 = { class: "title" };
const _hoisted_3 = { class: "title" };
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
  __name: "IconButton",
  props: {
    title: { default: "" },
    hasMore: { type: Boolean, default: false },
    hideHoverEffect: { type: Boolean, default: false },
    disabled: { type: Boolean, default: false },
    isActive: { type: Boolean, default: false },
    layout: { default: room.IconButtonLayout.VERTICAl },
    icon: { default: null },
    isNotSupport: { type: Boolean, default: false },
    theme: { default: void 0 }
  },
  emits: ["click-icon", "click-more"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const themeClass = Vue.computed(
      () => props.theme ? `tui-theme-${props.theme}` : ""
    );
    const iconContentClass = Vue.computed(() => {
      if (props.layout === room.IconButtonLayout.HORIZONTAL) {
        return "icon-content-horizontal";
      }
      return "icon-content-vertical";
    });
    const handleClickEvent = () => {
      emit("click-icon");
    };
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createElementBlock("div", {
        class: Vue.normalizeClass([themeClass.value])
      }, [
        Vue.createElementVNode("div", _hoisted_1, [
          Vue.unref(environment.isMobile) ? Vue.withDirectives((Vue.openBlock(), Vue.createElementBlock("div", {
            key: 0,
            class: Vue.normalizeClass(["icon-content", iconContentClass.value, `${_ctx.disabled && "disabled"}`])
          }, [
            Vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
            _ctx.icon ? (Vue.openBlock(), Vue.createBlock(SvgIcon.default, {
              key: 0,
              icon: _ctx.icon
            }, null, 8, ["icon"])) : Vue.createCommentVNode("", true),
            Vue.createElementVNode("span", _hoisted_2, Vue.toDisplayString(_ctx.title), 1)
          ], 2)), [
            [Vue.unref(vTap.default), handleClickEvent]
          ]) : (Vue.openBlock(), Vue.createElementBlock("div", {
            key: 1,
            class: Vue.normalizeClass(["icon-content", iconContentClass.value, `${_ctx.disabled && "disabled"}`]),
            onClick: handleClickEvent
          }, [
            Vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
            _ctx.icon ? (Vue.openBlock(), Vue.createBlock(SvgIcon.default, {
              key: 0,
              icon: _ctx.icon
            }, null, 8, ["icon"])) : Vue.createCommentVNode("", true),
            _ctx.isNotSupport ? (Vue.openBlock(), Vue.createBlock(SvgIcon.default, {
              key: 1,
              class: "unsupport-icon",
              icon: UnSupportIcon.default
            })) : Vue.createCommentVNode("", true),
            Vue.createElementVNode("span", _hoisted_3, [
              Vue.createTextVNode(Vue.toDisplayString(_ctx.title) + " ", 1),
              Vue.renderSlot(_ctx.$slots, "title", {}, void 0, true)
            ])
          ], 2)),
          _ctx.hasMore ? (Vue.openBlock(), Vue.createElementBlock("div", {
            key: 2,
            ref: "moreSpanRef",
            class: "icon-arrow",
            onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click-more"))
          }, [
            Vue.createVNode(SvgIcon.default, { icon: ArrowUpIcon.default })
          ], 512)) : Vue.createCommentVNode("", true)
        ])
      ], 2);
    };
  }
});
exports.default = _sfc_main;
