var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
  default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_react = __toESM(require("react"));
var import_classnames = __toESM(require("classnames"));
var import_rc_field_form = __toESM(require("rc-field-form"));
var import_ConfigProviderContext = __toESM(require("../config-provider/ConfigProviderContext"));
var import_FormContext = require("./FormContext");
var import_cell = require("../cell");
function _extends() {
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var r in t)
        ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
    }
    return n;
  }, _extends.apply(null, arguments);
}
const Form = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
  const {
    prefixCls,
    createNamespace
  } = (0, import_react.useContext)(import_ConfigProviderContext.default);
  const [bem] = createNamespace("form", prefixCls);
  const _a = props, {
    className,
    style,
    layout,
    footer,
    children,
    border,
    inset,
    colon,
    showValidateMessage
  } = _a, formProps = __objRest(_a, [
    "className",
    "style",
    "layout",
    "footer",
    "children",
    "border",
    "inset",
    "colon",
    "showValidateMessage"
  ]);
  return /* @__PURE__ */ import_react.default.createElement(import_FormContext.FormContext.Provider, {
    value: {
      layout,
      colon,
      showValidateMessage,
      validateTrigger: formProps.validateTrigger
    }
  }, /* @__PURE__ */ import_react.default.createElement(import_rc_field_form.default, _extends({
    className: (0, import_classnames.default)(bem(), className),
    style,
    ref
  }, formProps), /* @__PURE__ */ import_react.default.createElement(import_cell.CellGroup, {
    border,
    inset
  }, children), footer && /* @__PURE__ */ import_react.default.createElement("div", {
    className: (0, import_classnames.default)(bem("footer"))
  }, footer)));
});
Form.defaultProps = {
  showValidateMessage: true,
  validateTrigger: "onChange"
};
var stdin_default = Form;
