"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));

var _ArrayField = _interopRequireDefault(require("@visma/rjsf-core/lib/components/fields/ArrayField"));

var _reactIntl = require("react-intl");

//import { show } from '@visma/formula/lib/useDynamicElements';
var withMultipleFilesAsList = function withMultipleFilesAsList(Base) {
  var _Base$WrappedComponen;

  return /*#__PURE__*/function (_ref) {
    (0, _inherits2["default"])(ArrayField, _ref);

    var _super = (0, _createSuper2["default"])(ArrayField);

    function ArrayField() {
      (0, _classCallCheck2["default"])(this, ArrayField);
      return _super.apply(this, arguments);
    }

    (0, _createClass2["default"])(ArrayField, [{
      key: "renderFiles",
      value: function renderFiles() {
        return this.renderNormalArray();
      }
    }]);
    return ArrayField;
  }((_Base$WrappedComponen = Base.WrappedComponent) !== null && _Base$WrappedComponen !== void 0 ? _Base$WrappedComponen : Base);
}; // const withFilterFields = (Base) =>
//   class ArrayField extends (Base.WrappedComponent ?? Base) {
//     renderArrayFieldItem(props) {
//       return super.renderArrayFieldItem(
//         props.itemSchema.type === 'object'
//           ? {
//               ...props,
//               itemSchema: {
//                 ...props.itemSchema,
//                 properties: pickBy(
//                   props.itemSchema.properties,
//                   (property, id) =>
//                     show(
//                       props.itemData || {},
//                       props.itemUiSchema?.[id]?.['ui:options']?.element || {}
//                     )
//                 ),
//               },
//             }
//           : props
//       );
//     }
//   };


var _default = function _default() {
  var _ref2, _Base;

  var Base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _ArrayField["default"];
  return _ref2 = (_Base = Base, withMultipleFilesAsList(_Base)), ( //withFilterFields |>
  0, _reactIntl.injectIntl)(_ref2);
};

exports["default"] = _default;
//# sourceMappingURL=ArrayField.cjs.map