@palette.dev/browser
Version:
Monitor your web app's performance
2 lines (1 loc) • 19.4 kB
JavaScript
const e="<unknown>",t="undefined"==typeof window,n=new Map,r={emit(e,t){const r=n.get(e);r&&r.forEach(e=>e(t))},on(e,t){const r=n.get(e);r?r.push(t):n.set(e,[t])},off(e,t){const r=n.get(e);if(r){if(!t)return void(r.length=0);const e=r.indexOf(t);r.splice(e)}}};class i extends Error{constructor(e){super(e+"\nThis error will be suppressed in production"),this.name="PaletteError"}}const a=e=>"scheduler"in globalThis?scheduler.postTask(e,{priority:"background"}):"function"==typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e,0),o=()=>Math.random().toString(36).substring(2);let s={};const c={endpoint:"https://api.palette.dev/api/collect",plugins:[],debug:!1,enabled:!0},u=e=>Object.assign(e.bind(e,s),e),l=new Map;function d(e,t){l.set(e,t)}const p=()=>{const e=o();return d("palette.instanceId",e),e},f=new Map,m=()=>!0===f.get("enabled"),h=()=>"function"==typeof PerformanceObserver,v=(e,t,n=1e3)=>{let r;const i="number"==typeof t?t:n,a="function"==typeof t?t:()=>{};return(...t)=>{void 0===r?a(!0):(a(!1),clearTimeout(r)),r=setTimeout(()=>{e(...t),r=void 0},i)}},g="function"==typeof CompressionStream,y=async(e,n,r)=>{if(t)return{ok:!1};const i=JSON.stringify(n),a=g&&i.length>1e3,o=a?await(async e=>{const t=new Blob([e],{type:"application/json"}).stream().pipeThrough(new CompressionStream("gzip"));return new Response(t).arrayBuffer()})(i):i,s=`${e}?${new URLSearchParams({...r,...a?{encoding:"gzip"}:{}})}`;return navigator.onLine?fetch(s,{body:o,method:"POST",keepalive:!0,priority:"low",mode:"no-cors",headers:{"Content-Type":"application/json",...a?{"Content-Encoding":"gzip"}:{}}}):{ok:!1}},E=(e,t,n)=>{e.buffer.length&&navigator.onLine&&(async(e,t,n)=>{const r=e.clear();r.forEach(e=>{if(e.time=Math.trunc(e.time),n){const t=n({type:e.type,details:e.details});t?.type&&(e.type=t.type),t?.details&&(e.details=t.details)}});const a={data:r,timeOrigin:new Date(performance.timeOrigin).toISOString(),tags:Object.fromEntries(l)};try{const e=f.get("key");if("string"!=typeof e)throw new i("Key is required");f.get("debug");const n=f.get("endpoint");await t(n,a,{key:e})}catch(e){return}})(e,y,n)},b=[],T=()=>w.buffer.splice(0,w.buffer.length),w={clear:T,add:e=>{const t=b.push(e);r.emit("onAdd",e),t>=1e3&&(r.emit("onFull",w),T())},buffer:b};let k=-1;const L=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,S=e=>{"visible"===document.visibilityState?k=1/0:"hidden"===document.visibilityState&&k>-1&&(k="visibilitychange"===e.type?e.timeStamp:0)},P=()=>{addEventListener("visibilitychange",S,!0),addEventListener("prerenderingchange",S,!0)},C=()=>(k<0&&(k=L(),P(),(e=>{addEventListener("pageshow",t=>{t.persisted&&e(t)},!0)})(()=>{setTimeout(()=>{k=L(),P()},0)})),{get firstHiddenTime(){return k}}),A=e=>{const t=t=>{"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},O=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()};let I;var M,N,q,$,_,j=-1,F=function(e){addEventListener("pageshow",function(t){t.persisted&&(j=t.timeStamp,e(t))},!0)},R=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},D=function(){var e=R();return e&&e.activationStart||0},x=function(e,t){var n=R(),r="navigate";return j>=0?r="back-forward-cache":n&&(document.prerendering||D()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},B=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},H=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},z=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},J=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},U=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},W=-1,V=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},G=function(e){"hidden"===document.visibilityState&&W>-1&&(W="visibilitychange"===e.type?e.timeStamp:0,X())},K=function(){addEventListener("visibilitychange",G,!0),addEventListener("prerenderingchange",G,!0)},X=function(){removeEventListener("visibilitychange",G,!0),removeEventListener("prerenderingchange",G,!0)},Q=function(){return W<0&&(W=V(),K(),F(function(){setTimeout(function(){W=V(),K()},0)})),{get firstHiddenTime(){return W}}},Y=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Z=[1800,3e3],ee=function(e,t){t=t||{},Y(function(){var n,r=Q(),i=x("FCP"),a=B("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(a.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-D(),0),i.entries.push(e),n(!0)))})});a&&(n=H(e,i,Z,t.reportAllChanges),F(function(r){i=x("FCP"),n=H(e,i,Z,t.reportAllChanges),z(function(){i.value=performance.now()-r.timeStamp,n(!0)})}))})},te=[.1,.25],ne={passive:!0,capture:!0},re=new Date,ie=function(e,t){M||(M=t,N=e,q=new Date,se(removeEventListener),ae())},ae=function(){if(N>=0&&N<q-re){var e={entryType:"first-input",name:M.type,target:M.target,cancelable:M.cancelable,startTime:M.timeStamp,processingStart:M.timeStamp+N};$.forEach(function(t){t(e)}),$=[]}},oe=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){ie(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,ne),removeEventListener("pointercancel",r,ne)};addEventListener("pointerup",n,ne),addEventListener("pointercancel",r,ne)}(t,e):ie(t,e)}},se=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,oe,ne)})},ce=[100,300],ue=0,le=1/0,de=0,pe=function(e){e.forEach(function(e){e.interactionId&&(le=Math.min(le,e.interactionId),de=Math.max(de,e.interactionId),ue=de?(de-le)/7+1:0)})},fe=function(){return _?ue:performance.interactionCount||0},me=function(){"interactionCount"in performance||_||(_=B("event",pe,{type:"event",buffered:!0,durationThreshold:0}))},he=[200,500],ve=0,ge=function(){return fe()-ve},ye=[],Ee={},be=function(e){var t=ye[ye.length-1],n=Ee[e.interactionId];if(n||ye.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};Ee[r.id]=r,ye.push(r)}ye.sort(function(e,t){return t.latency-e.latency}),ye.splice(10).forEach(function(e){delete Ee[e.id]})}},Te=function(e,t){t=t||{},Y(function(){var n;me();var r,i=x("INP"),a=function(e){e.forEach(function(e){e.interactionId&&be(e),"first-input"===e.entryType&&!ye.some(function(t){return t.entries.some(function(t){return e.duration===t.duration&&e.startTime===t.startTime})})&&be(e)});var t,n=(t=Math.min(ye.length-1,Math.floor(ge()/50)),ye[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=B("event",a,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=H(e,i,he,t.reportAllChanges),o&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&o.observe({type:"first-input",buffered:!0}),J(function(){a(o.takeRecords()),i.value<0&&ge()>0&&(i.value=0,i.entries=[]),r(!0)}),F(function(){ye=[],ve=fe(),i=x("INP"),r=H(e,i,he,t.reportAllChanges)}))})},we=[2500,4e3],ke={},Le=[800,1800],Se=function e(t){document.prerendering?Y(function(){return e(t)}):"complete"!==document.readyState?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Pe=function(e,t){t=t||{};var n=x("TTFB"),r=H(e,n,Le,t.reportAllChanges);Se(function(){var i=R();if(i){var a=i.responseStart;if(a<=0||a>performance.now())return;n.value=Math.max(a-D(),0),n.entries=[i],r(!0),F(function(){n=x("TTFB",0),(r=H(e,n,Le,t.reportAllChanges))(!0)})}})};let Ce;const Ae=e=>{const{name:t,value:n}=e;Ce.add({type:`vitals.${t.toLowerCase()}`,time:e.entries[0]?.startTime??0,value:n,details:e.entries.map(e=>e.toJSON?.())})},Oe=u(({q:e})=>{t||(Ce=e,function(e,t){t=t||{},ee(U(function(){var n,r=x("CLS",0),i=0,a=[],o=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=a[0],n=a[a.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,a.push(e)):(i=e.value,a=[e])}}),i>r.value&&(r.value=i,r.entries=a,n())},s=B("layout-shift",o);s&&(n=H(e,r,te,t.reportAllChanges),J(function(){o(s.takeRecords()),n(!0)}),F(function(){i=0,r=x("CLS",0),n=H(e,r,te,t.reportAllChanges),z(function(){return n()})}),setTimeout(n,0))}))}(Ae,{reportAllChanges:!0}),ee(Ae),function(e,t){t=t||{},Y(function(){var n,r=Q(),i=x("LCP"),a=function(e){var t=e[e.length-1];t&&t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-D(),0),i.entries=[t],n())},o=B("largest-contentful-paint",a);if(o){n=H(e,i,we,t.reportAllChanges);var s=U(function(){ke[i.id]||(a(o.takeRecords()),o.disconnect(),ke[i.id]=!0,n(!0))});["keydown","click"].forEach(function(e){addEventListener(e,function(){return setTimeout(s,0)},!0)}),J(s),F(function(r){i=x("LCP"),n=H(e,i,we,t.reportAllChanges),z(function(){i.value=performance.now()-r.timeStamp,ke[i.id]=!0,n(!0)})})}})}(Ae),Pe(Ae),function(e,t){t=t||{},Y(function(){var n,r=Q(),i=x("FID"),a=function(e){e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},o=function(e){e.forEach(a)},s=B("first-input",o);n=H(e,i,ce,t.reportAllChanges),s&&J(U(function(){o(s.takeRecords()),s.disconnect()})),s&&F(function(){var r;i=x("FID"),n=H(e,i,ce,t.reportAllChanges),$=[],N=-1,M=null,se(addEventListener),r=a,$.push(r),ae()})})}(Ae),Te(Ae,{reportAllChanges:!0}))}),Ie={names:[],timestamps:[],length:0};let Me=0;const Ne=(e,t)=>(Me++,r.emit(t),Ie.length++),qe=()=>0===Me,$e=()=>{Ie.length=0,Ie.timestamps.length=0,Ie.names.length=0,Me=0},_e=(e,t,n)=>{Me--;Ie.timestamps[e];qe()&&($e(),r.emit("idle"))},je=e=>{Me--,qe()&&($e(),r.emit("idle"))},Fe="markers.measure",Re=u(({q:e})=>{!t&&h()&&O(()=>{const t=C(),n=new PerformanceObserver(n=>{const r=n.getEntries(),{firstHiddenTime:i}=t;r.forEach(({startTime:t,duration:n,name:r,entryType:a,detail:o})=>{if(r.startsWith("GTM-")||r.includes("grammarly"))return;const s="mark"===a?"markers.mark":"measure"===a?Fe:"events.longtask";t<i&&e.add({type:s,time:t,value:"mark"===a?t:n,details:o?{name:r,detail:o}:{name:r}})})}),r=["mark","measure"];PerformanceObserver.supportedEntryTypes.includes("longtask")&&r.push("longtask"),r.forEach(e=>{n.observe({type:e,buffered:!0})})})}),De={start:e=>{const{startTime:t}=performance.mark(e);Ne(0,Fe)},end:e=>{try{performance.measure(e,e)}catch(e){0}je()}};let xe;function Be(t,n){try{let e=t;const r=5,i=80,a=[];let o=0,s=0;const c=" > ",u=c.length;let l;for(;e&&o++<r&&(l=He(e,n),!("html"===l||o>1&&s+a.length*u+l.length>=i));)a.push(l),s+=l.length,e=e.parentNode;return a.reverse().join(c)}catch(t){return e}}function He(e,t){const n=e,r=[];let i,a,o,s,c;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const u=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(u&&u.length)u.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&"string"==typeof i)for(a=i.split(/\s+/),c=0;c<a.length;c++)r.push(`.${a[c]}`);const l=["type","name","title","alt"];for(c=0;c<l.length;c++)o=l[c],s=n.getAttribute(o),s&&r.push(`[${o}="${s}"]`);return r.join()}let ze,Je;const Ue=[],We=new WeakMap;let Ve=!1,Ge=!1;function Ke(t){let n,r;try{n=t.event.target?Be(t.event.target,r):Be(t.event,r)}catch{n=e}0!==n.length&&xe.add({type:`events.${t.event.type}`,time:t.event.timeStamp,details:{target:n}})}const Xe=e=>{let t,n;return v(()=>{xe.add({type:e,time:n,value:t-n})},e=>{e&&(n=performance.now()),t=performance.now()})},Qe=u(({q:e})=>{if(t)return;xe=e;const n=function(e,t=!1){return n=>{if(!n||Je===n)return;if(function(e){if("keypress"!==e.type)return!1;try{const t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch{}return!0}(n))return;const r="keypress"===n.type?"input":n.type;(void 0===ze||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch{}return!1}(Je,n))&&(e({event:n,name:r,global:t}),Je=n),clearTimeout(ze),ze=window.setTimeout(()=>{ze=void 0},10)}}(Ke,!0);addEventListener("click",n,!0),addEventListener("wheel",Xe("events.scroll"),!0),addEventListener("mousemove",Xe("events.mousemove"),!0),addEventListener("keypress",Xe("events.keypress"),!0);const{readyState:r}=document,i={once:!0,capture:!0};if("loading"===r){const t="events.dcl",n=Ne(0,t);addEventListener("DOMContentLoaded",r=>{_e(n,r.timeStamp),e.add({type:t,time:0,value:r.timeStamp})},i)}if("complete"!==r){const t="events.load",n=Ne(0,t);addEventListener("load",r=>{_e(n,r.timeStamp),e.add({type:t,time:0,value:r.timeStamp})},i)}!function(){if(Ve)return;Ve=!0;const e=()=>{try{new URLSearchParams(location.search).forEach((e,t)=>{d(`router.query.${t}`,e)})}catch{}};["pushState","replaceState"].forEach(e=>{const t=history[e];history[e]=function(...e){const n=location.href,r=t.apply(this,e);return location.href!==n&&window.dispatchEvent(new Event("palette.urlchange")),r}}),window.addEventListener("palette.urlchange",()=>{d("palette.location",location.pathname),e()}),window.addEventListener("popstate",()=>{d("palette.location",location.pathname),e()}),d("palette.location",location.pathname),e()}()});let Ye;const Ze="undefined"!=typeof Profiler,et=({q:e})=>{Ye=e};let tt,nt;const rt=e=>{if(Ze&&(!tt||tt.stopped)&&m())try{tt=new Profiler(e),nt=performance.now(),tt.addEventListener("samplebufferfull",it)}catch(e){0}},it=async()=>{if(m()&&tt&&!tt.stopped){const e=performance.now(),t=await tt.stop();Ye.add({type:"profile",time:nt,value:e-nt,details:t})}};let at;const ot=()=>{clearTimeout(at),at=globalThis.setTimeout(()=>{it(),at=void 0},1e3)};et.start=rt,et.stop=it,et.on=(e,t)=>{const n=()=>{rt(t),clearTimeout(at)};e.forEach(e=>r.on(e,n)),r.on("idle",ot)},et.off=()=>{0};const st=u(et),ct=u(({q:e})=>{if(t||!h())return;const n=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.name.includes("api.palette.dev")||e.add({type:`network.${t.entryType}`,time:t.startTime,value:t.duration,details:t.toJSON()})})});["navigation","resource"].forEach(e=>{n.observe({type:e,buffered:!0})})});let ut;const lt=[],dt=new MessageChannel,pt=()=>{dt.port1.postMessage(void 0)};function ft(e){1===lt.push(e)&&requestAnimationFrame(pt)}dt.port2.onmessage=()=>lt.splice(0,lt.length).forEach(e=>e());const mt=e=>{const t=performance.now(),n=Ne(0,"paint.mark");ft(()=>{const r=performance.now()-t;_e(n),ut.add({type:"paint.mark",time:t,value:r,details:{name:e}})})},ht=u(({q:e},n)=>{ut=e,!t&&h()&&O(()=>{const e=C(),t=[];let r=!1;const i=(n,i,o)=>{const c=[];return(l,d,p,f,m)=>{const h=c.length<3,v=h?1/0:c[0];if(!h&&d<v&&d>40&&l<e.firstHiddenTime){if(i&&_e(p),o){let e=m&&f?u(f).join(" > "):"";e.length||(e=Be(f)),t.push({delta:d,start:l,type:n,path:e})}r||(r=!0,a(s))}else i&&je();(h||d>v)&&(c.length<3?c.push(d):c[0]=d,c.sort((e,t)=>e-t))}},o=(e,t,n)=>{let r,a=!1;const o=i(e,t,n);return t=>{if(a||t===r)return;const{timeStamp:n}=t,i=Ne(0,e);a=!0,ft(()=>{a=!1,r=void 0;const e=performance.now()-n;o(n,e,i)})}},s=()=>{lt.length=0,t.splice(0,t.length).forEach(e=>{ut.add({type:e.type,time:e.start,value:e.delta,details:{detail:{path:e.path??""}}})}),r=!1};let c=new WeakMap;const u=e=>{if(c.has(e))return c.get(e);let t=e.closest("[data-palette]");const n=[];for(;t;){t.hasAttribute("data-palette-root")&&(n.length=0);const e=t.getAttribute("data-palette");if(e&&n.push(e),n.length>100)break;t=t.parentElement?.closest("[data-palette]")}return c.set(e,n.reverse()),n},l=e=>{if(!e.target)return;const t=u(e.target),n=t[t.length-1];n&&ut.add({type:"markers.measure",value:e.duration,time:e.startTime,details:{name:`${n} ${e.name} to Paint`,detail:{path:t.join(" > ")}}})};A(s),function(){if(Ge)return;Ge=!0;const e=EventTarget.prototype.addEventListener,t=EventTarget.prototype.removeEventListener;EventTarget.prototype.addEventListener=function(t,n,r){const i=Ue.find(e=>e.type===t);if(i&&this&&"function"==typeof n){let n=We.get(this);n||(n=new Set,We.set(this,n)),n.has(t)||(n.add(t),e.call(this,t,i.listener,{capture:!0}))}return e.call(this,t,n,r)},EventTarget.prototype.removeEventListener=t}(),Ue.push({type:"click",listener:o("paint.click",!0,!1)},{type:"keydown",listener:o("paint.keydown",!0,!1)},{type:"wheel",listener:o("paint.scroll",!0,!0)},{type:"mousemove",listener:o("paint.mousemove",!0,!0)}),addEventListener("click",o("paint.click",!0,!0),{capture:!0}),addEventListener("keydown",o("paint.keydown",!0,!0),{capture:!0}),addEventListener("wheel",o("paint.scroll",!0,!0),{capture:!0}),addEventListener("mousemove",o("paint.mousemove",!0,!0),{capture:!0});const d=i("paint.click",!1,!0),p=i("paint.keydown",!1,!0);new PerformanceObserver(e=>{e.getEntriesByName("keydown").forEach(e=>{const{duration:t,startTime:r}=e;p(r,t,0,e.target,n?.componentPaint),n?.componentPaint&&l(e)}),e.getEntriesByName("click").forEach(e=>{const{duration:t,startTime:r}=e;d(r,t,0,e.target,n?.componentPaint),n?.componentPaint&&l(e)})}).observe({type:"event",durationThreshold:40,buffered:!0})})}),vt=((e,n,i,a,u)=>(s.q=i,s=>{if(!performance.timeOrigin)return;const{endpoint:m,plugins:h,key:g,version:y,enabled:E,debug:b}={...c,...s};const T=!!g&&E;if(f.set("debug",b),f.set("key",g),f.set("endpoint",m),f.set("enabled",T),!1===T)return;performance.mark("palette.startInit");const w=["@palette.dev/browser","1.30.0","fd397c1"];if(globalThis.__palette__||Object.defineProperty(globalThis,"__palette__",{value:{client:Object.freeze(w),endpoint:m},writable:!1}),d("palette.process","browser"),l.set("palette.client",w),y?d("palette.app",y):"PALETTE_APP_VERSION"in globalThis&&d("palette.app",PALETTE_APP_VERSION),d("palette.sessionId",o()),p(),r.on("onAdd",v(p,3e5)),r.on("onFull",()=>a(i,n,s.beforeSend)),l.set("palette.pid",0),globalThis.location&&!l.has("palette.location")&&d("palette.location",globalThis.location.toString()),"undefined"!=typeof navigator){const e=(()=>{const e=navigator.language;if(!e)return;return new Intl.Locale(e).region})();e&&d("palette.region",e);const t=navigator.connection?.effectiveType;t&&d("palette.connection",t)}if(e(i).then(()=>{u?.(l,s.beforeSend)}),!t){0;{const e=()=>{h?.forEach(e=>{e&&e()})};document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()}performance.measure("palette.init","palette.startInit")}}))(async()=>{t||l.set("palette.userAgent",{"cpu.cores":navigator.hardwareConcurrency,"gpu.model":I??e,"memory.total":navigator.deviceMemory??e})},y,w,E,(e,n)=>((e,n,i,o)=>{if(t)return;const s=()=>a(()=>n(e,i,o));r.on("onAdd",v(s,5e3)),A(s)})(w,E,y,n));export{v as debounce,Qe as events,vt as init,mt as markToPaint,Re as markers,De as measure,ct as network,ht as paint,st as profiler,d as tag,Oe as vitals};