Liferay.Loader.define("segments-web@2.0.29/js/components/criteria_builder/ContributorInputs.es", ['module', 'exports', 'require', 'frontend-js-react-web$prop-types', 'frontend-js-react-web$react', '../../utils/constants.es', '../../utils/types.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = void 0;

    var _propTypes = _interopRequireDefault(require("frontend-js-react-web$prop-types"));

    var _react = _interopRequireDefault(require("frontend-js-react-web$react"));

    var _constants = require("../../utils/constants.es");

    var _types = require("../../utils/types.es");

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * This library is free software; you can redistribute it and/or modify it under
     * the terms of the GNU Lesser General Public License as published by the Free
     * Software Foundation; either version 2.1 of the License, or (at your option)
     * any later version.
     *
     * This library is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
     * details.
     */
    function ContributorInputs(_ref) {
      var contributors = _ref.contributors;
      return contributors.filter(function (criteria) {
        return criteria.query;
      }).map(function (criteria, i) {
        /**
         * First criteria has to be preceded by a `AND` conjunction
         */
        var conjunction = i === 0 ? _constants.CONJUNCTIONS.AND : criteria.conjunctionId;
        return (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
            key: i
          }, /*#__PURE__*/_react.default.createElement("input", {
            className: "field form-control",
            "data-testid": criteria.inputId,
            id: criteria.inputId,
            name: criteria.inputId,
            readOnly: true,
            type: "hidden",
            value: criteria.query
          }), /*#__PURE__*/_react.default.createElement("input", {
            id: criteria.conjunctionInputId,
            name: criteria.conjunctionInputId,
            readOnly: true,
            type: "hidden",
            value: conjunction
          }))
        );
      });
    }

    var _default = ContributorInputs;
    exports.default = _default;
    //# sourceMappingURL=ContributorInputs.es.js.map
  }
});
//# sourceMappingURL=ContributorInputs.es.js.map