Liferay.Loader.define("portal-search-ranking-web@3.0.58/js/components/shared/ErrorBoundary.es",["module","exports","require","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../utils/language.es","./ClayEmptyState.es"],(function(e,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=t("frontend-js-web"),n=(t("liferay!frontend-js-react-web$prop-types"),_interopRequireWildcard(t("liferay!frontend-js-react-web$react"))),o=t("../../utils/language.es"),s=_interopRequireWildcard(t("./ClayEmptyState.es"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=_getRequireWildcardCache();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(t,n,o):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}class ErrorBoundary extends n.Component{constructor(...e){super(...e),function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}(this,"state",{hasError:!1,message:this.props.component?(0,o.sub)(Liferay.Language.get("an-error-has-occurred-and-we-were-unable-to-load-x"),[this.props.component]):Liferay.Language.get("an-error-has-occurred-and-we-were-unable-to-load-the-results")})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(){this.props.toast&&(0,a.openToast)({message:this.state.message,type:"danger"})}render(){return this.state.hasError?!this.props.toast&&n.default.createElement(s.default,{description:this.state.message,displayState:s.DISPLAY_STATES.EMPTY,title:Liferay.Language.get("unable-to-load-content")}):this.props.children}}var i=ErrorBoundary;r.default=i}}));
//# sourceMappingURL=ErrorBoundary.es.js.map