"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 utils = require("../../../../utils/utils.js");
require("../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.js");
require("../../../../enums/pageEnum.js");
require("../../../../router/index.js");
require("../../../../store/modules/designStore/designStore.js");
require("../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js");
require("../../../../components/GoSkeleton/index.vue.js");
require("../../../../components/GoLoading/index.js");
const icon = require("../../../../plugins/icon.js");
require("../../../../settings/designSetting.js");
require("../../hooks/useKeyboard.hook.js");
const chartEditStore = require("../../../../store/modules/chartEditStore/chartEditStore.js");
const chartHistoryStore = require("../../../../store/modules/chartHistoryStore/chartHistoryStore.js");
const chartHistoryStore_d = require("../../../../store/modules/chartHistoryStore/chartHistoryStore.d.js");
const chartLayoutStore = require("../../../../store/modules/chartLayoutStore/chartLayoutStore.js");
const chartLayoutStore_d = require("../../../../store/modules/chartLayoutStore/chartLayoutStore.d.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 reactivity_esmBundler = require("../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.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 _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "index",
  setup(__props) {
    const { LayersIcon, BarChartIcon, PrismIcon, HomeIcon, ArrowBackIcon, ArrowForwardIcon } = icon.icon.ionicons5;
    const { setItem } = chartLayoutStore.useChartLayoutStore();
    const { getLayers, getCharts, getDetails } = reactivity_esmBundler.toRefs(chartLayoutStore.useChartLayoutStore());
    chartEditStore.useChartEditStore();
    const chartHistoryStore$1 = chartHistoryStore.useChartHistoryStore();
    const btnList = reactivity_esmBundler.reactive([
      {
        key: chartLayoutStore_d.ChartLayoutStoreEnum.CHARTS,
        select: getCharts,
        title: "图表组件",
        icon: utils.renderIcon(BarChartIcon)
      },
      {
        key: chartLayoutStore_d.ChartLayoutStoreEnum.LAYERS,
        select: getLayers,
        title: "图层控制",
        icon: utils.renderIcon(LayersIcon)
      },
      {
        key: chartLayoutStore_d.ChartLayoutStoreEnum.DETAILS,
        select: getDetails,
        title: "详情设置",
        icon: utils.renderIcon(PrismIcon)
      }
    ]);
    const isBackStack = runtimeCore_esmBundler.computed(() => chartHistoryStore$1.getBackStack.length > 1);
    const isForwardStack = runtimeCore_esmBundler.computed(() => chartHistoryStore$1.getForwardStack.length > 0);
    reactivity_esmBundler.reactive([
      {
        key: chartHistoryStore_d.HistoryStackEnum.BACK_STACK,
        // 一定会有初始化画布
        select: isBackStack,
        title: "后退",
        icon: utils.renderIcon(ArrowBackIcon)
      },
      {
        key: chartHistoryStore_d.HistoryStackEnum.FORWARD_STACK,
        select: isForwardStack,
        title: "前进",
        icon: utils.renderIcon(ArrowForwardIcon)
      }
    ]);
    const styleHandle = (item) => {
      if (item.key === chartLayoutStore_d.ChartLayoutStoreEnum.DETAILS) {
        return item.select ? "" : "primary";
      }
      return item.select ? "primary" : "";
    };
    const clickHandle = (item) => {
      setItem(item.key, !item.select);
    };
    return (_ctx, _cache) => {
      const _component_n_button = runtimeCore_esmBundler.resolveComponent("n-button");
      const _component_n_tooltip = runtimeCore_esmBundler.resolveComponent("n-tooltip");
      const _component_n_space = runtimeCore_esmBundler.resolveComponent("n-space");
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(_component_n_space, {
        class: "header-left-btn",
        size: 25
      }, {
        default: runtimeCore_esmBundler.withCtx(() => [
          runtimeCore_esmBundler.createVNode(_component_n_space, null, {
            default: runtimeCore_esmBundler.withCtx(() => [
              (runtimeCore_esmBundler.openBlock(true), runtimeCore_esmBundler.createElementBlock(runtimeCore_esmBundler.Fragment, null, runtimeCore_esmBundler.renderList(btnList, (item) => {
                return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(_component_n_tooltip, {
                  key: item.key,
                  placement: "bottom",
                  trigger: "hover"
                }, {
                  trigger: runtimeCore_esmBundler.withCtx(() => [
                    runtimeCore_esmBundler.createVNode(_component_n_button, {
                      size: "small",
                      ghost: "",
                      type: styleHandle(item),
                      focusable: false,
                      onClick: ($event) => clickHandle(item)
                    }, {
                      default: runtimeCore_esmBundler.withCtx(() => [
                        (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(runtimeCore_esmBundler.resolveDynamicComponent(item.icon)))
                      ]),
                      _: 2
                    }, 1032, ["type", "onClick"])
                  ]),
                  default: runtimeCore_esmBundler.withCtx(() => [
                    runtimeCore_esmBundler.createElementVNode("span", null, shared_esmBundler.toDisplayString(item.title), 1)
                  ]),
                  _: 2
                }, 1024);
              }), 128))
            ]),
            _: 1
          })
        ]),
        _: 1
      });
    };
  }
});
exports.default = _sfc_main;
