"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");
require("../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js");
require("../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.js");
require("../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js");
require("../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js");
require("../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.js");
require("../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.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("../../../settings/designSetting.js");
const components = require("../../../utils/components.js");
require("../../../components/GoSkeleton/index.vue.js");
require("../../../components/GoLoading/index.js");
const icon = require("../../../plugins/icon.js");
const index = require("../ContentBox/index.vue.js");
const index_d = require("./index.d.js");
const chartLayoutStore = require("../../../store/modules/chartLayoutStore/chartLayoutStore.js");
const chartLayoutStore_d = require("../../../store/modules/chartLayoutStore/chartLayoutStore.d.js");
const chartEditStore = require("../../../store/modules/chartEditStore/chartEditStore.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 { getDetails } = reactivity_esmBundler.toRefs(chartLayoutStore.useChartLayoutStore());
    const { setItem } = chartLayoutStore.useChartLayoutStore();
    const chartEditStore$1 = chartEditStore.useChartEditStore();
    const { ConstructIcon, FlashIcon, DesktopOutlineIcon, LeafIcon, RocketIcon } = icon.icon.ionicons5;
    const ContentEdit = components.loadAsyncComponent(() => Promise.resolve().then(() => require("../ContentEdit/index.vue.js")));
    const CanvasPage = components.loadAsyncComponent(() => Promise.resolve().then(() => require("./components/CanvasPage/index.vue.js")));
    const ChartSetting = components.loadAsyncComponent(() => Promise.resolve().then(() => require("./components/ChartSetting/index.vue.js")));
    const ChartData = components.loadAsyncComponent(() => Promise.resolve().then(() => require("./components/ChartData/index.vue.js")));
    components.loadAsyncComponent(() => Promise.resolve().then(() => require("./components/ChartEvent/index.vue.js")));
    components.loadAsyncComponent(() => Promise.resolve().then(() => require("./components/ChartAnimation/index.vue.js")));
    const collapsed = reactivity_esmBundler.ref(getDetails.value);
    const tabsSelect = reactivity_esmBundler.ref(index_d.TabsEnum.CHART_SETTING);
    const collapsedHandle = () => {
      collapsed.value = true;
      setItem(chartLayoutStore_d.ChartLayoutStoreEnum.DETAILS, true);
    };
    const expandHandle = () => {
      collapsed.value = false;
      setItem(chartLayoutStore_d.ChartLayoutStoreEnum.DETAILS, false);
    };
    const selectTarget = runtimeCore_esmBundler.computed(() => {
      const selectId = chartEditStore$1.getTargetChart.selectId;
      if (selectId.length !== 1)
        return void 0;
      const target = chartEditStore$1.componentList[chartEditStore$1.fetchTargetIndex()];
      if (target == null ? void 0 : target.isGroup) {
        tabsSelect.value = index_d.TabsEnum.CHART_SETTING;
      }
      return target;
    });
    runtimeCore_esmBundler.watch(getDetails, (newData) => {
      if (newData) {
        collapsedHandle();
      } else {
        expandHandle();
      }
    });
    const globalTabList = [
      {
        key: index_d.TabsEnum.PAGE_SETTING,
        title: "页面配置",
        icon: DesktopOutlineIcon,
        render: CanvasPage
      }
    ];
    const chartsDefaultTabList = [
      {
        key: index_d.TabsEnum.CHART_SETTING,
        title: "参数设置",
        icon: ConstructIcon,
        render: ChartSetting
      }
      // {
      //   key: TabsEnum.CHART_ANIMATION,
      //   title: '动画',
      //   icon: LeafIcon,
      //   render: ChartAnimation
      // }
    ];
    const chartsTabList = [
      ...chartsDefaultTabList,
      {
        key: index_d.TabsEnum.CHART_DATA,
        title: "数据源",
        icon: FlashIcon,
        render: ChartData
      }
      // {
      //   key: TabsEnum.CHART_EVENT,
      //   title: '事件',
      //   icon: RocketIcon,
      //   render: ChartEvent
      // }
    ];
    return (_ctx, _cache) => {
      const _component_n_layout_content = runtimeCore_esmBundler.resolveComponent("n-layout-content");
      const _component_n_icon = runtimeCore_esmBundler.resolveComponent("n-icon");
      const _component_n_space = runtimeCore_esmBundler.resolveComponent("n-space");
      const _component_n_tab_pane = runtimeCore_esmBundler.resolveComponent("n-tab-pane");
      const _component_n_tabs = runtimeCore_esmBundler.resolveComponent("n-tabs");
      const _component_n_layout_sider = runtimeCore_esmBundler.resolveComponent("n-layout-sider");
      const _component_n_layout = runtimeCore_esmBundler.resolveComponent("n-layout");
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(_component_n_layout, {
        "has-sider": "",
        "sider-placement": "right"
      }, {
        default: runtimeCore_esmBundler.withCtx(() => [
          runtimeCore_esmBundler.createVNode(_component_n_layout_content, null, {
            default: runtimeCore_esmBundler.withCtx(() => [
              runtimeCore_esmBundler.createVNode(reactivity_esmBundler.unref(ContentEdit))
            ]),
            _: 1
          }),
          runtimeCore_esmBundler.createVNode(_component_n_layout_sider, {
            "collapse-mode": "transform",
            "collapsed-width": 0,
            width: 350,
            collapsed: collapsed.value,
            "native-scrollbar": false,
            "show-trigger": "bar",
            onCollapse: collapsedHandle,
            onExpand: expandHandle
          }, {
            default: runtimeCore_esmBundler.withCtx(() => [
              runtimeCore_esmBundler.createVNode(reactivity_esmBundler.unref(index.default), {
                class: "go-content-configurations go-boderbox",
                "show-top": false,
                depth: 2
              }, {
                default: runtimeCore_esmBundler.withCtx(() => [
                  !selectTarget.value ? (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(_component_n_tabs, {
                    key: 0,
                    class: "tabs-box",
                    size: "small",
                    type: "segment"
                  }, {
                    default: runtimeCore_esmBundler.withCtx(() => [
                      (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock(runtimeCore_esmBundler.Fragment, null, runtimeCore_esmBundler.renderList(globalTabList, (item) => {
                        return runtimeCore_esmBundler.createVNode(_component_n_tab_pane, {
                          key: item.key,
                          name: item.key,
                          size: "small",
                          "display-directive": "show:lazy"
                        }, {
                          tab: runtimeCore_esmBundler.withCtx(() => [
                            runtimeCore_esmBundler.createVNode(_component_n_space, null, {
                              default: runtimeCore_esmBundler.withCtx(() => [
                                runtimeCore_esmBundler.createElementVNode("span", null, shared_esmBundler.toDisplayString(item.title), 1),
                                runtimeCore_esmBundler.createVNode(_component_n_icon, {
                                  size: "16",
                                  class: "icon-position"
                                }, {
                                  default: runtimeCore_esmBundler.withCtx(() => [
                                    (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(runtimeCore_esmBundler.resolveDynamicComponent(item.icon)))
                                  ]),
                                  _: 2
                                }, 1024)
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          default: runtimeCore_esmBundler.withCtx(() => [
                            (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(runtimeCore_esmBundler.resolveDynamicComponent(item.render)))
                          ]),
                          _: 2
                        }, 1032, ["name"]);
                      }), 64))
                    ]),
                    _: 1
                  })) : runtimeCore_esmBundler.createCommentVNode("", true),
                  selectTarget.value ? (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(_component_n_tabs, {
                    key: 1,
                    value: tabsSelect.value,
                    "onUpdate:value": _cache[0] || (_cache[0] = ($event) => tabsSelect.value = $event),
                    class: "tabs-box",
                    size: "small",
                    type: "segment"
                  }, {
                    default: runtimeCore_esmBundler.withCtx(() => [
                      (runtimeCore_esmBundler.openBlock(true), runtimeCore_esmBundler.createElementBlock(runtimeCore_esmBundler.Fragment, null, runtimeCore_esmBundler.renderList(selectTarget.value.isGroup ? chartsDefaultTabList : chartsTabList, (item) => {
                        return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(_component_n_tab_pane, {
                          key: item.key,
                          name: item.key,
                          size: "small",
                          "display-directive": "show:lazy"
                        }, {
                          tab: runtimeCore_esmBundler.withCtx(() => [
                            runtimeCore_esmBundler.createVNode(_component_n_space, null, {
                              default: runtimeCore_esmBundler.withCtx(() => [
                                runtimeCore_esmBundler.createElementVNode("span", null, shared_esmBundler.toDisplayString(item.title), 1),
                                runtimeCore_esmBundler.createVNode(_component_n_icon, {
                                  size: "16",
                                  class: "icon-position"
                                }, {
                                  default: runtimeCore_esmBundler.withCtx(() => [
                                    (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(runtimeCore_esmBundler.resolveDynamicComponent(item.icon)))
                                  ]),
                                  _: 2
                                }, 1024)
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          default: runtimeCore_esmBundler.withCtx(() => [
                            (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(runtimeCore_esmBundler.resolveDynamicComponent(item.render)))
                          ]),
                          _: 2
                        }, 1032, ["name"]);
                      }), 128))
                    ]),
                    _: 1
                  }, 8, ["value"])) : runtimeCore_esmBundler.createCommentVNode("", true)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["collapsed"])
        ]),
        _: 1
      });
    };
  }
});
exports.default = _sfc_main;
