"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf3=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_assertThisInitialized2=_interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_react=_interopRequireWildcard(require("react")),_withStyles=_interopRequireDefault(require("../withStyles")),_styles=_interopRequireDefault(require("./styles")),ErrorBoundary=/*#__PURE__*/function(_Component){function ErrorBoundary(){var _getPrototypeOf2,_this;(0,_classCallCheck2.default)(this,ErrorBoundary);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _this=(0,_possibleConstructorReturn2.default)(this,(_getPrototypeOf2=(0,_getPrototypeOf3.default)(ErrorBoundary)).call.apply(_getPrototypeOf2,[this].concat(args))),(0,_defineProperty2.default)((0,_assertThisInitialized2.default)((0,_assertThisInitialized2.default)(_this)),"state",{hasError:!1}),_this}return(0,_inherits2.default)(ErrorBoundary,_Component),(0,_createClass2.default)(ErrorBoundary,[{key:"componentDidCatch",value:function componentDidCatch(){this.setState({hasError:!0})}},{key:"render",value:function render(){var classes=this.props.classes;return this.state.hasError?_react.default.createElement("div",{className:classes.component},_react.default.createElement("h1",{className:classes.message},"Something went wrong.")):this.props.children}}]),ErrorBoundary}(_react.Component),_default=(0,_withStyles.default)(_styles.default)(ErrorBoundary);exports.default=_default;