"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.js");
const chartEditStore = require("../../../../../store/modules/chartEditStore/chartEditStore.js");
const chartEditStore_d = require("../../../../../store/modules/chartEditStore/chartEditStore.d.js");
const designStore = require("../../../../../store/modules/designStore/designStore.js");
const useStyle_hook = require("../../hooks/useStyle.hook.js");
const useDrag_hook = require("../../hooks/useDrag.hook.js");
const runtimeCore_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");
const runtimeDom_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_runtime-dom@3.3.4/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js");
const shared_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.js");
const reactivity_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");
const _hoisted_1 = ["onMousedown"];
const _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "index",
  props: {
    item: {
      type: Object,
      required: true
    },
    hiddenPoint: {
      type: Boolean,
      required: false
    }
  },
  setup(__props) {
    const props = __props;
    runtimeDom_esmBundler.useCssVars((_ctx) => ({
      "2d925dfa": themeColor.value
    }));
    const designStore$1 = designStore.useDesignStore();
    const chartEditStore$1 = chartEditStore.useChartEditStore();
    const pointList = ["t", "r", "b", "l", "lt", "rt", "lb", "rb"];
    const cursorResize = ["n", "e", "s", "w", "nw", "ne", "sw", "se"];
    const themeColor = runtimeCore_esmBundler.computed(() => {
      return designStore$1.getAppTheme;
    });
    const hover = runtimeCore_esmBundler.computed(() => {
      const isDrag = chartEditStore$1.getEditCanvas[chartEditStore_d.EditCanvasTypeEnum.IS_DRAG];
      if (isDrag)
        return false;
      if (props.item.status.lock)
        return false;
      return props.item.id === chartEditStore$1.getTargetChart.hoverId;
    });
    const select = runtimeCore_esmBundler.computed(() => {
      const id = props.item.id;
      if (props.item.status.lock)
        return false;
      return chartEditStore$1.getTargetChart.selectId.find((e) => e === id);
    });
    const lock = runtimeCore_esmBundler.computed(() => {
      return props.item.status.lock;
    });
    const hide = runtimeCore_esmBundler.computed(() => {
      return props.item.status.hide;
    });
    return (_ctx, _cache) => {
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", {
        class: shared_esmBundler.normalizeClass(["go-shape-box", { lock: lock.value, hide: hide.value }])
      }, [
        runtimeCore_esmBundler.renderSlot(_ctx.$slots, "default", {}, void 0, true),
        !__props.hiddenPoint ? (runtimeCore_esmBundler.openBlock(true), runtimeCore_esmBundler.createElementBlock(runtimeCore_esmBundler.Fragment, { key: 0 }, runtimeCore_esmBundler.renderList(select.value ? pointList : [], (point, index) => {
          return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", {
            class: shared_esmBundler.normalizeClass(`shape-point ${point}`),
            key: index,
            style: shared_esmBundler.normalizeStyle(reactivity_esmBundler.unref(useStyle_hook.usePointStyle)(point, index, __props.item.attr, cursorResize)),
            onMousedown: ($event) => reactivity_esmBundler.unref(useDrag_hook.useMousePointHandle)($event, point, __props.item.attr)
          }, null, 46, _hoisted_1);
        }), 128)) : runtimeCore_esmBundler.createCommentVNode("", true),
        runtimeCore_esmBundler.createElementVNode("div", {
          class: "shape-modal",
          style: shared_esmBundler.normalizeStyle(reactivity_esmBundler.unref(useStyle_hook.useSizeStyle)(__props.item.attr))
        }, [
          runtimeCore_esmBundler.createElementVNode("div", {
            class: shared_esmBundler.normalizeClass(["shape-modal-select", { active: select.value }])
          }, null, 2),
          runtimeCore_esmBundler.createElementVNode("div", {
            class: shared_esmBundler.normalizeClass(["shape-modal-change", { selectActive: select.value, hoverActive: hover.value }])
          }, null, 2)
        ], 4)
      ], 2);
    };
  }
});
exports.default = _sfc_main;
