Liferay.Loader.define("app-builder-web@1.0.76/js/components/loading/Loading.es", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/loading-indicator', 'frontend-js-react-web$react'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.Loading = exports.withLoading = void 0;

    var _loadingIndicator = _interopRequireDefault(require("@frontend-taglib-clay$clayui/loading-indicator"));

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

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

    function _objectWithoutProperties(source, excluded) {
      if (source == null) return {};var target = _objectWithoutPropertiesLoose(source, excluded);var key, i;if (Object.getOwnPropertySymbols) {
        var sourceSymbolKeys = Object.getOwnPropertySymbols(source);for (i = 0; i < sourceSymbolKeys.length; i++) {
          key = sourceSymbolKeys[i];if (excluded.indexOf(key) >= 0) continue;if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;target[key] = source[key];
        }
      }return target;
    }

    function _objectWithoutPropertiesLoose(source, excluded) {
      if (source == null) return {};var target = {};var sourceKeys = Object.keys(source);var key, i;for (i = 0; i < sourceKeys.length; i++) {
        key = sourceKeys[i];if (excluded.indexOf(key) >= 0) continue;target[key] = source[key];
      }return target;
    }

    var withLoading = function withLoading(Component) {

      return function Wrapper(props) {
        var isLoading = props.isLoading,
            restProps = _objectWithoutProperties(props, ["isLoading"]);

        if (isLoading) {
          return (/*#__PURE__*/_react.default.createElement("div", {
              className: "align-items-center d-flex loading-wrapper w-100"
            }, /*#__PURE__*/_react.default.createElement(_loadingIndicator.default, null))
          );
        }

        return (/*#__PURE__*/_react.default.createElement(Component, restProps)
        );
      };
    };

    exports.withLoading = withLoading;
    var Loading = withLoading(function (_ref) {
      var children = _ref.children;
      return (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children)
      );
    });
    exports.Loading = Loading;
    //# sourceMappingURL=Loading.es.js.map
  }
});
//# sourceMappingURL=Loading.es.js.map