var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
import { isNumeric, objectType, omit } from "@antdv/pro-utils";
import { Modal } from "ant-design-vue";
import { defineComponent, ref, watch } from "vue";
import { ProHelpPanel, propHelpPanelProps } from "./ProHelpPanel.mjs";
const proHelpModalProps = __spreadValues({
  modalProps: objectType()
}, omit(propHelpPanelProps, ["onClose"]));
const ProHelpModal = defineComponent({
  name: "ProHelpModal",
  props: proHelpModalProps,
  emits: {
    "update:modalProps": (val) => true
  },
  setup(props) {
    var _a, _b;
    const modalOpen = ref((_b = (_a = props.modalProps) == null ? void 0 : _a.open) != null ? _b : false);
    watch(() => {
      var _a2;
      return (_a2 = props.modalProps) == null ? void 0 : _a2.open;
    }, () => {
      var _a2, _b2;
      modalOpen.value = (_b2 = (_a2 = props.modalProps) == null ? void 0 : _a2.open) != null ? _b2 : false;
    });
    return () => {
      var _a2;
      const height = (_a2 = props.height) != null ? _a2 : 648;
      const getHelpPanelProps = __spreadProps(__spreadValues({}, props), {
        height: isNumeric(height) ? `${height}px` : height
      });
      return _createVNode(Modal, _mergeProps({
        "onCancel": () => {
          var _a3, _b2;
          modalOpen.value = false;
          (_b2 = (_a3 = props.modalProps) == null ? void 0 : _a3.afterClose) == null ? void 0 : _b2.call(_a3);
        },
        "bodyStyle": {
          margin: `-24px`
        },
        "centered": true,
        "closable": false,
        "footer": null,
        "width": 720,
        "open": modalOpen.value,
        "maskClosable": true
      }, props.modalProps), {
        default: () => [_createVNode(ProHelpPanel, _mergeProps(getHelpPanelProps, {
          "onClose": () => {
            var _a3, _b2;
            modalOpen.value = false;
            (_b2 = (_a3 = props.modalProps) == null ? void 0 : _a3.afterClose) == null ? void 0 : _b2.call(_a3);
          }
        }), null)]
      });
    };
  }
});
export {
  ProHelpModal,
  proHelpModalProps
};
