import "../../../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import "../../../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.mjs";
import { getUUID } from "../../../../../../../utils/utils.mjs";
import "../../../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.mjs";
import { fetchPathByName, routerTurnByPath } from "../../../../../../../utils/router.mjs";
import "../../../../../../../store/modules/designStore/designStore.mjs";
import "../../../../../../../settings/designSetting.mjs";
import "../../../../../../../components/GoLoading/index.mjs";
import "../../../../../../../components/GoSkeleton/index.vue.mjs";
import { icon } from "../../../../../../../plugins/icon.mjs";
import { ChartEnum, PageEnum } from "../../../../../../../enums/pageEnum.mjs";
import { defineComponent, watch, resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, resolveDynamicComponent, createElementBlock, renderList, Fragment } from "../../../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { ref, shallowRef, unref } from "../../../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    show: Boolean
  },
  emits: ["close"],
  setup(__props, { emit }) {
    const props = __props;
    const { FishIcon, CloseIcon } = icon.ionicons5;
    const { StoreIcon, ObjectStorageIcon } = icon.carbon;
    const showRef = ref(false);
    const typeList = shallowRef([
      {
        title: "新项目",
        key: ChartEnum.CHART_HOME_NAME,
        icon: FishIcon,
        disabled: false
      },
      {
        title: "我的模板",
        key: PageEnum.BASE_HOME_TEMPLATE_NAME,
        icon: ObjectStorageIcon,
        disabled: true
      },
      {
        title: "模板市场",
        key: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME,
        icon: StoreIcon,
        disabled: true
      }
    ]);
    watch(props, (newValue) => {
      showRef.value = newValue.show;
    });
    const closeHandle = () => {
      emit("close", false);
    };
    const btnHandle = (key) => {
      closeHandle();
      const id = getUUID();
      const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, "href");
      routerTurnByPath(path, [id], void 0, true);
    };
    return (_ctx, _cache) => {
      const _component_n_text = resolveComponent("n-text");
      const _component_n_icon = resolveComponent("n-icon");
      const _component_n_button = resolveComponent("n-button");
      const _component_n_space = resolveComponent("n-space");
      const _component_n_card = resolveComponent("n-card");
      const _component_n_modal = resolveComponent("n-modal");
      return openBlock(), createBlock(_component_n_modal, {
        show: showRef.value,
        "onUpdate:show": _cache[0] || (_cache[0] = ($event) => showRef.value = $event),
        class: "go-create-modal",
        onAfterLeave: closeHandle
      }, {
        default: withCtx(() => [
          createVNode(_component_n_space, { size: "large" }, {
            default: withCtx(() => [
              createVNode(_component_n_card, {
                class: "card-box",
                hoverable: ""
              }, {
                header: withCtx(() => [
                  createVNode(_component_n_text, { class: "card-box-tite" }, {
                    default: withCtx(() => [
                      createTextVNode(" project.create_tip")
                    ]),
                    _: 1
                  })
                ]),
                "header-extra": withCtx(() => [
                  createVNode(_component_n_text, { onClick: closeHandle }, {
                    default: withCtx(() => [
                      createVNode(_component_n_icon, { size: "20" }, {
                        default: withCtx(() => [
                          (openBlock(), createBlock(resolveDynamicComponent(unref(CloseIcon))))
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                action: withCtx(() => []),
                default: withCtx(() => [
                  createVNode(_component_n_space, {
                    class: "card-box-content",
                    justify: "center"
                  }, {
                    default: withCtx(() => [
                      (openBlock(true), createElementBlock(Fragment, null, renderList(typeList.value, (item) => {
                        return openBlock(), createBlock(_component_n_button, {
                          size: "large",
                          disabled: item.disabled,
                          key: item.key,
                          onClick: btnHandle
                        }, {
                          icon: withCtx(() => [
                            createVNode(_component_n_icon, { size: "18" }, {
                              default: withCtx(() => [
                                (openBlock(), createBlock(resolveDynamicComponent(item.icon)))
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          default: withCtx(() => [
                            (openBlock(), createBlock(resolveDynamicComponent(item.title)))
                          ]),
                          _: 2
                        }, 1032, ["disabled"]);
                      }), 128))
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["show"]);
    };
  }
});
export {
  _sfc_main as default
};
