import { defineComponent as v, ref as m, createVNode as t, resolveComponent as o, isVNode as c } from "vue";
import { ElButton as y, ElDropdown as E, ElDropdownMenu as f, ElDropdownItem as h, ElIcon as g } from "element-plus";
import { useResolveVnode as p } from "@klweb/compose-app-engine";
import { A as b, ae as w, ao as x } from "./main-Blxobku2.js";
import { u as e } from "./script.code.block-DyZxbH0e.js";
import { e as A } from "./index-BbdVezoQ.js";
function r(n) {
  return typeof n == "function" || Object.prototype.toString.call(n) === "[object Object]" && !c(n);
}
const {
  IconScript: C,
  IconArrowRight: M
} = A, O = /* @__PURE__ */ v({
  name: "KlAddEvent",
  components: {
    ElButton: y,
    ElDropdown: E,
    ElDropdownMenu: f,
    ElDropdownItem: h,
    ElIcon: g
  },
  emits: ["handleAddEvent"],
  props: {
    disabled: {
      type: Array,
      default: () => []
    }
  },
  setup(n, {
    emit: d
  }) {
    const s = m([{
      type: "onSetup",
      value: e()
    }, {
      type: "onBeforeMount",
      value: e()
    }, {
      type: "onMounted",
      value: e()
    }, {
      type: "onBeforeUnmount",
      value: e()
    }, {
      type: "onUnmounted",
      value: e()
    }, {
      type: "onBeforeUpdate",
      value: e()
    }, {
      type: "onUpdated",
      value: e()
    }, {
      type: "onActivated",
      value: e()
    }, {
      type: "onDeactivated",
      value: e()
    }, {
      type: "other",
      value: null
    }, {
      type: "onClick",
      value: e("mouseEvent")
    }, {
      type: "onDblClick",
      value: e("mouseEvent")
    }, {
      type: "onContextMenu",
      value: e("mouseEvent")
    }, {
      type: "onMouseOver",
      value: e("mouseEvent")
    }, {
      type: "onMouseOut",
      value: e("mouseEvent")
    }, {
      type: "onMouseEnter",
      value: e("mouseEvent")
    }, {
      type: "onMouseLeave",
      value: e("mouseEvent")
    }, {
      type: "onMouseMove",
      value: e("mouseEvent")
    }]), i = (l) => {
      d("handleAddEvent", l);
    };
    return () => t(o("el-dropdown"), {
      trigger: "click",
      "max-height": "calc(100vh - 182px)",
      onCommand: i
    }, {
      default: () => [t(o("el-button"), {
        size: "large",
        type: "primary",
        icon: C
      }, {
        default: () => [b.ADD_EVENT]
      })],
      dropdown: () => {
        let l;
        return t(o("el-dropdown-menu"), {
          style: "width: 269px"
        }, r(l = s.value.map((u) => {
          let a;
          return u.type !== "other" ? t(o("el-dropdown-item"), {
            command: u,
            disabled: n.disabled.includes(u.type),
            style: "justify-content: space-between"
          }, {
            default: () => [t("span", null, [u.type, p(w, {
              content: x[u.type]
            })]), t(o("el-icon"), {
              style: "margin: 0; opacity: .85"
            }, r(a = p(M)) ? a : {
              default: () => [a]
            })]
          }) : t(o("el-dropdown-item"), {
            style: {
              height: "1px",
              padding: 0,
              margin: "5px 10px",
              background: "var(--editor-border-color-light)"
            }
          }, null);
        })) ? l : {
          default: () => [l]
        });
      }
    });
  }
});
export {
  O as default
};
