import "../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import PreviewRenderList from "./components/PreviewRenderList/index.vue.mjs";
import { setTitle } from "../../utils/utils.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 { getFilterStyle } 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 { getEditCanvasConfigStyle } from "./utils/style.mjs";
import { getSessionStorageInfo } from "./utils/storage.mjs";
import { keyRecordHandle } from "./utils/keyboard.mjs";
import { dragCanvas } from "./utils/drag.mjs";
import { useComInstall } from "./hooks/useComInstall.hook.mjs";
import { useScale } from "./hooks/useScale.hook.mjs";
import { useStore } from "./hooks/useStore.hook.mjs";
import { PreviewScaleEnum } from "../../enums/styleEnum.mjs";
import { useChartEditStore } from "../../store/modules/chartEditStore/chartEditStore.mjs";
import { defineComponent, withAsyncContext, computed, openBlock, createElementBlock, createElementVNode as createBaseVNode, createVNode, createCommentVNode } 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 _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "suspenseIndex",
  async setup(__props) {
    let __temp, __restore;
    [__temp, __restore] = withAsyncContext(() => getSessionStorageInfo()), await __temp, __restore();
    const chartEditStore = useChartEditStore();
    setTitle(`预览-${chartEditStore.editCanvasConfig.projectName}`);
    const previewRefStyle = computed(() => {
      return {
        ...getEditCanvasConfigStyle(chartEditStore.editCanvasConfig),
        ...getFilterStyle(chartEditStore.editCanvasConfig)
      };
    });
    const showEntity = computed(() => {
      const type = chartEditStore.editCanvasConfig.previewScaleType;
      return type === PreviewScaleEnum.SCROLL_Y || type === PreviewScaleEnum.SCROLL_X;
    });
    useStore(chartEditStore);
    const { entityRef, previewRef } = useScale(chartEditStore);
    const { show } = useComInstall(chartEditStore);
    keyRecordHandle();
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(`go-preview ${unref(chartEditStore).editCanvasConfig.previewScaleType}`),
        onMousedown: _cache[0] || (_cache[0] = //@ts-ignore
        (...args) => unref(dragCanvas) && unref(dragCanvas)(...args))
      }, [
        showEntity.value ? (openBlock(), createElementBlock("div", {
          key: 0,
          ref_key: "entityRef",
          ref: entityRef,
          class: "go-preview-entity"
        }, [
          createBaseVNode("div", {
            ref_key: "previewRef",
            ref: previewRef,
            class: "go-preview-scale"
          }, [
            unref(show) ? (openBlock(), createElementBlock("div", {
              key: 0,
              style: normalizeStyle(previewRefStyle.value)
            }, [
              createVNode(unref(PreviewRenderList))
            ], 4)) : createCommentVNode("", true)
          ], 512)
        ], 512)) : (openBlock(), createElementBlock("div", {
          key: 1,
          ref_key: "previewRef",
          ref: previewRef,
          class: "go-preview-scale"
        }, [
          unref(show) ? (openBlock(), createElementBlock("div", {
            key: 0,
            style: normalizeStyle(previewRefStyle.value)
          }, [
            createVNode(unref(PreviewRenderList))
          ], 4)) : createCommentVNode("", true)
        ], 512))
      ], 34);
    };
  }
});
export {
  _sfc_main as default
};
