text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = void 0;
  
  var _react = _interopRequireDefault(require("react"));
  
  var _classnames = _interopRequireDefault(require("classnames"));
  
  var _defaultStyle = _interopRequireDefault(require("part:@sanity/components/formfields/default-style"));
  
  var _default2 = _interopRequireDefault(require("part:@sanity/components/labels/default"));
  
  var _status = _interopRequireDefault(require("part:@sanity/components/validation/status"));
  
  var _presence = require("../../../../presence");
  
  var _changeIndicators = require("../../../../change-indicators");
  
  var _FieldStatus = _interopRequireDefault(require("../fieldsets/FieldStatus"));
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  var EMPTY_MARKERS = [];
  
  var _default = /*#__PURE__*/_react.default.memo(function DefaultFormField(_ref) {
    var _ref$level = _ref.level,
        level = _ref$level === void 0 ? 1 : _ref$level,
        label = _ref.label,
        labelFor = _ref.labelFor,
        description = _ref.description,
        children = _ref.children,
        inline = _ref.inline,
        wrapped = _ref.wrapped,
        className = _ref.className,
        _ref$changeIndicator = _ref.changeIndicator,
        changeIndicator = _ref$changeIndicator === void 0 ? true : _ref$changeIndicator,
        _ref$markers = _ref.markers,
        markers = _ref$markers === void 0 ? EMPTY_MARKERS : _ref$markers,
        presence = _ref.presence;
    var levelClass = "level_".concat(level);
    var rootClassName = (0, _classnames.default)(className, inline ? _defaultStyle.default.inline : _defaultStyle.default.block, _defaultStyle.default[levelClass], wrapped && _defaultStyle.default.wrapped);
    return /*#__PURE__*/_react.default.createElement("div", {
      className: rootClassName
    }, /*#__PURE__*/_react.default.createElement("label", {
      className: _defaultStyle.default.inner,
      htmlFor: labelFor
    }, label && /*#__PURE__*/_react.default.createElement("div", {
      className: _defaultStyle.default.header
    }, /*#__PURE__*/_react.default.createElement("div", {
      className: _defaultStyle.default.headerMain
    }, /*#__PURE__*/_react.default.createElement("div", {
      className: _defaultStyle.default.title
    }, label && /*#__PURE__*/_react.default.createElement(_default2.default, {
      className: _defaultStyle.default.label,
      level: level
    }, label), /*#__PURE__*/_react.default.createElement(_status.default, {
      className: _defaultStyle.default.validationStatus,
      markers: markers
    })), description && /*#__PURE__*/_react.default.createElement("div", {
      className: _defaultStyle.default.description
    }, description)), presence && /*#__PURE__*/_react.default.createElement(_FieldStatus.default, null, /*#__PURE__*/_react.default.createElement(_presence.FieldPresence, {
      maxAvatars: 4,
      presence: presence
    })))), /*#__PURE__*/_react.default.createElement("div", {
      className: _defaultStyle.default.content
    }, changeIndicator ? /*#__PURE__*/_react.default.createElement(_changeIndicators.ChangeIndicator, changeIndicator, children) : children));
  });
  
  exports.default = _default;