import "../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { MenuEnum } from "../../../../../enums/editPageEnum.mjs";
import "../../../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs";
import "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.mjs";
import "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.mjs";
import "../../../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs";
import "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.mjs";
import "../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.mjs";
import "../../../../../enums/pageEnum.mjs";
import "../../../../../router/index.mjs";
import { colorCustomMerge, animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle } from "../../../../../utils/style.mjs";
import "../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.mjs";
import "../../../../../components/GoSkeleton/index.vue.mjs";
import "../../../../../components/GoLoading/index.mjs";
import "../../../../../settings/designSetting.mjs";
import { useChartEditStore } from "../../../../../store/modules/chartEditStore/chartEditStore.mjs";
import { useContextMenu, divider } from "../../../hooks/useContextMenu.hook.mjs";
import { useMouseHandle } from "../../hooks/useDrag.hook.mjs";
import { useComponentStyle, useSizeStyle } from "../../hooks/useStyle.hook.mjs";
import EditShapeBox from "../EditShapeBox/index.vue.mjs";
import { defineComponent, computed, openBlock, createElementBlock, createBlock, withCtx, Fragment, renderList, resolveDynamicComponent } from "../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { unref } from "../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
import { normalizeStyle, normalizeClass } from "../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
const _hoisted_1 = { class: "go-edit-group-box" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    groupData: {
      type: Object,
      required: true
    },
    groupIndex: {
      type: Number,
      required: true
    }
  },
  setup(__props) {
    const chartEditStore = useChartEditStore();
    const { handleContextMenu } = useContextMenu();
    const { mouseenterHandle, mouseleaveHandle, mousedownHandle, mouseClickHandle } = useMouseHandle();
    const optionsHandle = (targetList, allList, targetInstance) => {
      const filter = (menulist) => {
        return allList.filter((i) => menulist.includes(i.key));
      };
      if (chartEditStore.getTargetChart.selectId.length > 1) {
        return filter([MenuEnum.GROUP, MenuEnum.DELETE]);
      } else {
        const statusMenuEnums = [];
        if (targetInstance.status.lock) {
          statusMenuEnums.push(MenuEnum.LOCK);
        } else {
          statusMenuEnums.push(MenuEnum.UNLOCK);
        }
        if (targetInstance.status.hide) {
          statusMenuEnums.push(MenuEnum.HIDE);
        } else {
          statusMenuEnums.push(MenuEnum.SHOW);
        }
        const singleMenuEnums = [MenuEnum.UN_GROUP];
        return [
          ...filter(singleMenuEnums),
          divider(),
          ...targetList.filter((i) => !statusMenuEnums.includes(i.key))
        ];
      }
    };
    const themeColor = computed(() => {
      const colorCustomMergeData = colorCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo);
      return colorCustomMergeData[chartEditStore.getEditCanvasConfig.chartThemeColor];
    });
    const themeSetting = computed(() => {
      const chartThemeSetting = chartEditStore.getEditCanvasConfig.chartThemeSetting;
      return chartThemeSetting;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        (openBlock(), createBlock(unref(EditShapeBox), {
          key: __props.groupData.id,
          "data-id": __props.groupData.id,
          index: __props.groupIndex,
          item: __props.groupData,
          hiddenPoint: true,
          class: normalizeClass(unref(animationsClass)(__props.groupData.styles.animations)),
          style: normalizeStyle({
            ...unref(useComponentStyle)(__props.groupData.attr, __props.groupIndex),
            ...unref(useSizeStyle)(__props.groupData.attr),
            ...unref(getFilterStyle)(__props.groupData.styles),
            ...unref(getTransformStyle)(__props.groupData.styles),
            ...unref(getBlendModeStyle)(__props.groupData.styles)
          }),
          onClick: _cache[0] || (_cache[0] = ($event) => unref(mouseClickHandle)($event, __props.groupData)),
          onMousedown: _cache[1] || (_cache[1] = ($event) => unref(mousedownHandle)($event, __props.groupData)),
          onMouseenter: _cache[2] || (_cache[2] = ($event) => unref(mouseenterHandle)($event, __props.groupData)),
          onMouseleave: _cache[3] || (_cache[3] = ($event) => unref(mouseleaveHandle)($event, __props.groupData)),
          onContextmenu: _cache[4] || (_cache[4] = ($event) => unref(handleContextMenu)($event, __props.groupData, optionsHandle))
        }, {
          default: withCtx(() => [
            (openBlock(true), createElementBlock(Fragment, null, renderList(__props.groupData.groupList, (item) => {
              return openBlock(), createBlock(unref(EditShapeBox), {
                key: item.id,
                "data-id": item.id,
                index: __props.groupIndex,
                item,
                hiddenPoint: true,
                style: normalizeStyle({
                  ...unref(useComponentStyle)(item.attr, __props.groupIndex)
                })
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(item.chartConfig.chartKey), {
                    class: normalizeClass(["edit-content-chart", unref(animationsClass)(item.styles.animations)]),
                    chartConfig: item,
                    themeSetting: themeSetting.value,
                    themeColor: themeColor.value,
                    style: normalizeStyle({
                      ...unref(useSizeStyle)(item.attr),
                      ...unref(getFilterStyle)(item.styles),
                      ...unref(getTransformStyle)(item.styles)
                    })
                  }, null, 8, ["class", "chartConfig", "themeSetting", "themeColor", "style"]))
                ]),
                _: 2
              }, 1032, ["data-id", "index", "item", "style"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["data-id", "index", "item", "class", "style"]))
      ]);
    };
  }
});
export {
  _sfc_main as default
};
