import "../../../../../node_modules/element-plus/es/index.mjs";
/* empty css                                                             */
/* empty css                                                                  */
/* empty css                                                                   */
/* empty css                                                                  */
/* empty css                                                                 */
/* empty css                                                                */
import { inject, ref, resolveComponent, createElementBlock, openBlock, createVNode, withCtx, createElementVNode, createTextVNode, withDirectives, vShow, unref } from "vue";
/* empty css         */
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.mjs";
import { ElPopover } from "../../../../../node_modules/element-plus/es/components/popover/index.mjs";
import { ElSpace } from "../../../../../node_modules/element-plus/es/components/space/index.mjs";
import { ElText } from "../../../../../node_modules/element-plus/es/components/text/index.mjs";
import { ElButton } from "../../../../../node_modules/element-plus/es/components/button/index.mjs";
const _hoisted_1 = { class: "add-but" };
const _sfc_main = {
  __name: "Add",
  emits: ["addNode"],
  setup(__props, { emit: __emit }) {
    const { readOnly } = inject("flowDesign", { readOnly: ref(false) });
    const popoverRef = ref();
    const $emits = __emit;
    const addApprovalNode = () => {
      var _a;
      $emits("addNode", "approval");
      (_a = popoverRef.value) == null ? void 0 : _a.hide();
    };
    const addExclusiveNode = () => {
      var _a;
      $emits("addNode", "exclusive");
      (_a = popoverRef.value) == null ? void 0 : _a.hide();
    };
    return (_ctx, _cache) => {
      const _component_svg_icon = resolveComponent("svg-icon");
      const _component_el_text = ElText;
      const _component_el_space = ElSpace;
      const _component_el_button = ElButton;
      const _component_el_popover = ElPopover;
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(_component_el_popover, {
          placement: "bottom-start",
          ref_key: "popoverRef",
          ref: popoverRef,
          trigger: "click",
          width: 336
        }, {
          reference: withCtx(() => [
            withDirectives(createVNode(_component_el_button, {
              icon: "Plus",
              type: "primary",
              style: { "z-index": "1" },
              circle: ""
            }, null, 512), [
              [vShow, !unref(readOnly)]
            ])
          ]),
          default: withCtx(() => [
            createVNode(_component_el_space, { wrap: "" }, {
              default: withCtx(() => [
                createElementVNode("div", {
                  class: "node-select",
                  onClick: addApprovalNode
                }, [
                  createVNode(_component_svg_icon, { name: "el:Stamp" }),
                  createVNode(_component_el_text, null, {
                    default: withCtx(() => _cache[0] || (_cache[0] = [
                      createTextVNode("动作")
                    ])),
                    _: 1
                  })
                ]),
                createElementVNode("div", {
                  class: "node-select",
                  onClick: addExclusiveNode
                }, [
                  createVNode(_component_svg_icon, { name: "el:Share" }),
                  createVNode(_component_el_text, null, {
                    default: withCtx(() => _cache[1] || (_cache[1] = [
                      createTextVNode("条件")
                    ])),
                    _: 1
                  })
                ])
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 512)
      ]);
    };
  }
};
const Add = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3b2a9845"]]);
export {
  Add as default
};
