import{aN as u,aw as o,aQ as c}from"./chunk-02oqS8tD.js";import"./chunk-B8Q4vgLh.js";import"./chunk-x_Z6cwvR.js";const a={capturing:!1,consoleErrors:[],failedRequests:[],requests:[],performance:[]},m=new Set(["error","exception","unhandledrejection"]);async function g(n=300){if(!(await u())?.enabled)return a;await o();const e=await c(n);if(!e)return{...a,capturing:!0};if(e.stale===!0)return{...a,capturing:!0};const i=e.console.filter(t=>m.has(String(t.level))).map(t=>({message:String(t.message??""),...typeof t.stack=="string"?{stack:t.stack}:{},timestamp:Number(t.timestamp??0)})),s=e.network.map(t=>{const r=t.trace;return{url:String(t.url??""),method:String(t.method??"GET"),status:Number(t.status??0),duration:Number(t.duration??0),failed:t.failed===!0,timestamp:Number(t.startTime??0),...r?.traceId?{traceId:r.traceId}:{}}});return{capturing:!0,consoleErrors:i,failedRequests:s.filter(t=>t.failed||t.status>=400).map(t=>({url:t.url,status:t.status,method:t.method,timestamp:t.timestamp})),requests:s,performance:e.performance??[],counts:{network:e.counts.network,console:e.counts.console,events:e.counts.events}}}export{g as readTelemetrySignals};
//# sourceMappingURL=chunk-ngFx90MH.js.map
