import*as n from"react";import{ErrorDetails as a}from"./app/Error/ErrorDetails";import{otelTelemetry as s}from"./app/telemetry/otel/telemetry";class m extends n.Component{constructor(r){super(r),this.state={error:void 0}}componentDidCatch(r,c){const{name:e,message:t}=r,o={name:e,message:t,stack:c.componentStack??void 0};this.setState({error:o}),s.send({type:"client.error",payload:{message:`${e}: ${t}`,url:location.href}}),s.sendError(o,"ReactErrorBoundary"),process.env.NODE_ENV!=="production"&&console.log(r)}render(){return this.state.error&&process.env.NODE_ENV!=="production"?n.createElement(a,{error:this.state.error}):this.props.children}}export{m as ErrorBoundary};
