import{useMount}from"@redocly/theme";import{onCLS,onLCP,onFCP,onTTFB}from"web-vitals";export function usePerformanceMetrics({sendTelemetry:e}){useMount((()=>{const n={},o=[new Promise((e=>onCLS((n=>e({name:"CLS",value:n.value}))))),new Promise((e=>onLCP((n=>e({name:"LCP",value:n.value}))))),new Promise((e=>onFCP((n=>e({name:"FCP",value:n.value}))))),new Promise((e=>onTTFB((n=>e({name:"TTFB",value:n.value})))))];Promise.allSettled(o).then((o=>{o.forEach((e=>{if("fulfilled"===e.status){const{name:o,value:a}=e.value;n[o]=Math.round(a)}})),e(n)}))}))}
//# sourceMappingURL=usePerformanceMetrics.js.map