Liferay.Loader.define("frontend-js-web@4.0.43/liferay/modal/commands/OpenSimpleInputModal.es", ['module', 'exports', 'require', 'frontend-js-react-web', 'frontend-js-react-web$react', 'frontend-js-react-web$react-dom', '../components/SimpleInputModal.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.openSimpleInputModal = openSimpleInputModal;
    exports.default = void 0;

    var _frontendJsReactWeb = require("frontend-js-react-web");

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

    var _reactDom = require("frontend-js-react-web$react-dom");

    var _SimpleInputModal = _interopRequireDefault(require("../components/SimpleInputModal.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.
     */
    var DEFAULT_MODAL_CONTAINER_ID = 'modalContainer';
    var DEFAULT_RENDER_DATA = {
      portletId: 'UNKNOWN_PORTLET_ID'
    };

    function getDefaultModalContainer() {
      var container = document.getElementById(DEFAULT_MODAL_CONTAINER_ID);

      if (!container) {
        container = document.createElement('div');
        container.id = DEFAULT_MODAL_CONTAINER_ID;
        document.body.appendChild(container);
      }

      return container;
    }

    function dispose() {
      (0, _reactDom.unmountComponentAtNode)(getDefaultModalContainer());
    }

    function openSimpleInputModalImplementation(_ref) {
      var alert = _ref.alert,
          checkboxFieldLabel = _ref.checkboxFieldLabel,
          checkboxFieldName = _ref.checkboxFieldName,
          checkboxFieldValue = _ref.checkboxFieldValue,
          dialogTitle = _ref.dialogTitle,
          formSubmitURL = _ref.formSubmitURL,
          idFieldName = _ref.idFieldName,
          idFieldValue = _ref.idFieldValue,
          mainFieldLabel = _ref.mainFieldLabel,
          mainFieldName = _ref.mainFieldName,
          namespace = _ref.namespace,
          onFormSuccess = _ref.onFormSuccess,
          placeholder = _ref.placeholder;
      dispose();
      (0, _frontendJsReactWeb.render)( /*#__PURE__*/_react.default.createElement(_SimpleInputModal.default, {
        alert: alert,
        checkboxFieldLabel: checkboxFieldLabel,
        checkboxFieldName: checkboxFieldName,
        checkboxFieldValue: checkboxFieldValue,
        closeModal: dispose,
        dialogTitle: dialogTitle,
        formSubmitURL: formSubmitURL,
        idFieldName: idFieldName,
        idFieldValue: idFieldValue,
        initialVisible: "true",
        mainFieldLabel: mainFieldLabel,
        mainFieldName: mainFieldName,
        namespace: namespace,
        onFormSuccess: onFormSuccess,
        placeholder: placeholder
      }), DEFAULT_RENDER_DATA, getDefaultModalContainer());
    }

    var didEmitDeprecationWarning = false;
    /**
     * Function that implements the SimpleInputModal pattern, which allows
     * manipulating small amounts of data with a form shown inside a modal.
     *
     * @deprecated As of Athanasius (7.3.x), replaced by the default export
     */

    function openSimpleInputModal(data) {

      return openSimpleInputModalImplementation.call(null, data);
    }

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