var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
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));
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
  ProHelpModal: () => ProHelpModal,
  proHelpModalProps: () => proHelpModalProps
});
module.exports = __toCommonJS(stdin_exports);
var import_vue = require("vue");
var import_pro_utils = require("@antdv/pro-utils");
var import_ant_design_vue = require("ant-design-vue");
var import_vue2 = require("vue");
var import_ProHelpPanel = require("./ProHelpPanel");
const proHelpModalProps = __spreadValues({
  modalProps: (0, import_pro_utils.objectType)()
}, (0, import_pro_utils.omit)(import_ProHelpPanel.propHelpPanelProps, ["onClose"]));
const ProHelpModal = (0, import_vue2.defineComponent)({
  name: "ProHelpModal",
  props: proHelpModalProps,
  emits: {
    "update:modalProps": (val) => true
  },
  setup(props) {
    var _a, _b;
    const modalOpen = (0, import_vue2.ref)((_b = (_a = props.modalProps) == null ? void 0 : _a.open) != null ? _b : false);
    (0, import_vue2.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: (0, import_pro_utils.isNumeric)(height) ? `${height}px` : height
      });
      return (0, import_vue.createVNode)(import_ant_design_vue.Modal, (0, import_vue.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: () => [(0, import_vue.createVNode)(import_ProHelpPanel.ProHelpPanel, (0, import_vue.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)]
      });
    };
  }
});
