1
0
forked from sent/waves
waves/public/assets/g/mcdemo/chunk/stats.9efecb03.js
2025-04-09 17:11:14 -05:00

2 lines
1.9 KiB
JavaScript

var b=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g={exports:{}};(function(w,P){(function(p,o){w.exports=o()})(b,function(){var p=function(){function o(n){return i.appendChild(n.dom),n}function r(n){for(var l=0;l<i.children.length;l++)i.children[l].style.display=l===n?"block":"none";c=n}var c=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(n){n.preventDefault(),r(++c%i.children.length)},!1);var f=(performance||Date).now(),a=f,e=0,h=o(new p.Panel("FPS","#0ff","#002")),x=o(new p.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var v=o(new p.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:i,addPanel:o,showPanel:r,begin:function(){f=(performance||Date).now()},end:function(){e++;var n=(performance||Date).now();if(x.update(n-f,200),n>a+1e3&&(h.update(1e3*e/(n-a),100),a=n,e=0,v)){var l=performance.memory;v.update(l.usedJSHeapSize/1048576,l.jsHeapSizeLimit/1048576)}return n},update:function(){f=this.end()},domElement:i,setMode:r}};return p.Panel=function(o,r,c){var i=1/0,f=0,a=Math.round,e=a(window.devicePixelRatio||1),h=80*e,x=48*e,v=3*e,n=2*e,l=3*e,d=15*e,s=74*e,u=30*e,m=document.createElement("canvas");m.width=h,m.height=x,m.style.cssText="width:80px;height:48px";var t=m.getContext("2d");return t.font="bold "+9*e+"px Helvetica,Arial,sans-serif",t.textBaseline="top",t.fillStyle=c,t.fillRect(0,0,h,x),t.fillStyle=r,t.fillText(o,v,n),t.fillRect(l,d,s,u),t.fillStyle=c,t.globalAlpha=.9,t.fillRect(l,d,s,u),{dom:m,update:function(y,S){i=Math.min(i,y),f=Math.max(f,y),t.fillStyle=c,t.globalAlpha=1,t.fillRect(0,0,h,d),t.fillStyle=r,t.fillText(a(y)+" "+o+" ("+a(i)+"-"+a(f)+")",v,n),t.drawImage(m,l+e,d,s-e,u,l,d,s-e,u),t.fillRect(l+s-e,d,e,u),t.fillStyle=c,t.globalAlpha=.9,t.fillRect(l+s-e,d,e,a((1-y/S)*u))}}},p})})(g);const R=g.exports;export{R as S};