import{a as e,d as t,i as n}from"./objectSpread2-DtFdQpqy.js";import{a as r,n as i}from"./preload-helper-EQ20WQt-.js";import{o as a}from"./prop-types-DdDwMzX7.js";import{t as o}from"./helmet-xJbX5x_5.js";import{n as s}from"./short_number-CCNBtmoH.js";import{t as c}from"./classnames-CFUb2mE1.js";import{t as l}from"./column-CvSGioVA.js";import{t as u}from"./intl-DxYtUOxD.js";import{un as d}from"./status_quoted-DSI-CjDl.js";import{t as f}from"./gif-RJPLaNNt.js";var p=t(r()),m=t(c()),h=i();e();var g=class extends p.PureComponent{constructor(...e){super(...e),n(this,`state`,{copied:!1}),n(this,`handleClick`,()=>{let{value:e}=this.props;navigator.clipboard.writeText(e),this.setState({copied:!0}),this.timeout=setTimeout(()=>this.setState({copied:!1}),700)})}componentWillUnmount(){this.timeout&&clearTimeout(this.timeout)}render(){let{children:e}=this.props,{copied:t}=this.state;return(0,h.jsx)(d,{onClick:this.handleClick,className:t?`copied`:`copyable`,children:t?(0,h.jsx)(a,{id:`copypaste.copied`,defaultMessage:`Copied`}):e})}},_=class extends p.PureComponent{constructor(...e){super(...e),n(this,`handleRetry`,()=>{let{onRetry:e}=this.props;e&&e()})}render(){let{errorType:e,multiColumn:t,stacktrace:n}=this.props,r,i;switch(e){case`routing`:r=(0,h.jsx)(a,{id:`bundle_column_error.routing.title`,defaultMessage:`404`}),i=(0,h.jsx)(a,{id:`bundle_column_error.routing.body`,defaultMessage:`The requested page could not be found. Are you sure the URL in the address bar is correct?`});break;case`network`:r=(0,h.jsx)(a,{id:`bundle_column_error.network.title`,defaultMessage:`Network error`}),i=(0,h.jsx)(a,{id:`bundle_column_error.network.body`,defaultMessage:`There was an error when trying to load this page. This could be due to a temporary problem with your internet connection or this server.`});break;case`error`:r=(0,h.jsx)(a,{id:`bundle_column_error.error.title`,defaultMessage:`Oh, no!`}),i=(0,h.jsx)(a,{id:`bundle_column_error.error.body`,defaultMessage:`The requested page could not be rendered. It could be due to a bug in our code, or a browser compatibility issue.`});break}return(0,h.jsxs)(l,{bindToDocument:!t,children:[(0,h.jsxs)(`div`,{className:`error-column`,children:[(0,h.jsx)(f,{src:`/oops.gif`,staticSrc:`/oops.png`,className:`error-column__image`}),(0,h.jsxs)(`div`,{className:`error-column__message`,children:[(0,h.jsx)(`h1`,{children:r}),(0,h.jsx)(`p`,{children:i}),(0,h.jsxs)(`div`,{className:`error-column__message__actions`,children:[e===`network`&&(0,h.jsx)(d,{onClick:this.handleRetry,children:(0,h.jsx)(a,{id:`bundle_column_error.retry`,defaultMessage:`Try again`})}),e===`error`&&(0,h.jsx)(g,{value:n,children:(0,h.jsx)(a,{id:`bundle_column_error.copy_stacktrace`,defaultMessage:`Copy error report`})}),(0,h.jsx)(s,{to:`/`,className:(0,m.default)(`button`,{"button-secondary":e!==`routing`}),children:(0,h.jsx)(a,{id:`bundle_column_error.return`,defaultMessage:`Go back home`})})]})]})]}),(0,h.jsx)(o,{children:(0,h.jsx)(`meta`,{name:`robots`,content:`noindex`})})]})}};n(_,`defaultProps`,{errorType:`routing`});var v=u(_);export{v as t};
//# sourceMappingURL=bundle_column_error-I_QiSB1O.js.map