Files
tildefriends/apps/trace/speedscope/speedscope-Y2522XSH.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

190 lines
476 KiB
JavaScript
Raw Normal View History

2025-12-03 19:21:18 -05:00
"use strict";(()=>{var Tf=Object.create;var ho=Object.defineProperty;var Hf=Object.getOwnPropertyDescriptor;var Mf=Object.getOwnPropertyNames;var Kf=Object.getPrototypeOf,Jf=Object.prototype.hasOwnProperty;var re=(t,e)=>()=>(t&&(e=t(t=0)),e);var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),$l=(t,e)=>{for(var n in e)ho(t,n,{get:e[n],enumerable:!0})},Pf=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Mf(e))!Jf.call(t,r)&&r!==n&&ho(t,r,{get:()=>e[r],enumerable:!(a=Hf(e,r))||a.enumerable});return t};var he=(t,e,n)=>(n=t!=null?Tf(Kf(t)):{},Pf(e||!t||!t.__esModule?ho(n,"default",{value:t,enumerable:!0}):n,t));function Ae(t){return t[t.length-1]||null}function Fe(t,e){function n(a,r){let A=e(a),o=e(r);return A<o?-1:A>o?1:0}t.sort(n)}function De(t,e,n){return t.has(e)||t.set(e,n(e)),t.get(e)}function ja(t,e,n){return t.has(e)?t.get(e):n(e)}function et(t,e){if(!t.has(e))throw new Error(`Expected key ${e}`);return t.get(e)}function*os(t,e){for(let n of t)yield e(n)}function is(t,e){for(let n of t)e(n)}function ln(t,e){return new Array(Math.max(e-t.length,0)+1).join("0")+t}function xt(t){let e=`${t.toFixed(0)}%`;return t===100?e="100%":t>99?e=">99%":t<.01?e="<0.01%":t<1?e=`${t.toFixed(2)}%`:t<10&&(e=`${t.toFixed(1)}%`),e}function Vf(t){return t-Math.floor(t)}function va(t){return 2*Math.abs(Vf(t)-.5)-1}function ls(t,e,n,a,r=1){for(console.assert(!isNaN(r)&&!isNaN(a));;){if(e-t<=r)return[t,e];let A=(e+t)/2;n(A)<a?t=A:e=A}}function ss(t,e){if(t.length===0)return-1;let n=0,a=t.length-1;for(;a!==n;){let r=Math.floor((n+a)/2);e(t[r])?a=r:n=r+1}return e(t[a])?a:-1}function On(...t){}function Qr(t,e){for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(t[n]!==e[n])return!1;return!0}function ze(t){let e=null;return n=>{let a;return e==null?(a=t(n),e={args:n,result:a},a):(Qr(e.args,n)||(e.args=n,e.result=t(n)),e.result)}}function qn(t){let e=null;return n=>{let a;return e==null?(a=t(n),e={args:n,result:a},a):(e.args===n||(e.args=n,e.result=t(n)),e.result)}}function Yf(t){let e=null;return()=>(e==null&&(e={result:t()}),e.result)}function cs(t){let e=Wf();if(t.length%4!==0)throw new Error(`Invalid length for base64 encoded string. Expected length % 4 = 0, got length = ${t.length}`);let n=t.length/4,a;t.length>=4&&t.charAt(t.length-1)==="="?t.charAt(t.length-2)==="="?a=n*3-2:a=n*3-1:a=n*3;let r=new Uint8Array(a),A=0;for(let o=0;o<n;o++){let i=t.charAt(o*4+0),l=t.charAt(o*4+1),s=t.charAt(o*4+2),c=t.charAt(o*4+3),h=e.get(i),_=e.get(l),f=e.get(s),m=e.get(c);if(h==null||_==null||f==null||m==null)throw new Error(`Invalid quartet at indices ${o*4} .. ${o*4+3}: ${t.substring(o*4,o*4+3)}`);r[A++]=h<<2|_>>4,s!=="="&&(r[A++]=(_&15)<<4|f>>2),c!=="="&&(r[A++]=(f&7)<<6|m)}if(A!==a)throw new Error(`Expected to decode ${a} bytes, but only decoded ${A})`);return r}var bt,Wf,V=re(()=>{"use strict";bt=class{constructor(){this.map=new Map}getOrInsert(e){let n=e.key,a=this.map.get(n);return a||(this.map.set(n,e),e)}forEach(e){this.map.forEach(e)}[Symbol.iterator](){return this.map.values()}};Wf=Yf(()=>{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Map;for(let n=0;n<t.length;n++)e.set(t.charAt(n),n);return e.set("=",-1),e})});var Bn=k((Pa,qs)=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.default=Ep;var yp=/-webkit-|-moz-|-ms-/;function Ep(t){return typeof t=="string"&&yp.test(t)}qs.exports=Pa.default});var $s=k((Ga,zs)=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.default=xp;var Bp=Bn(),Qp=wp(Bp);function wp(t){return t&&t.__esModule?t:{default:t}}var bp=["-webkit-","-moz-",""];function xp(t,e){if(typeof e=="string"&&!(0,Qp.default)(e)&&e.indexOf("calc(")>-1)return bp.map(function(n){return e.replace(/calc\(/g,n+"calc(")})}zs.exports=Ga.default});var Ys=k((Ua,Vs)=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.default=Dp;var kp=Bn(),Sp=Np(kp);function Np(t){return t&&t.__esModule?t:{default:t}}var Fp=["-webkit-",""];function Dp(t,e){if(typeof e=="string"&&!(0,Sp.default)(e)&&e.indexOf("cross-fade(")>-1)return Fp.map(function(n)
`;break;case 114:f+="\r";break;case 116:f+=" ";break;case 117:{for(var u=0,g=0;g<4;g++)_=a[h++],u<<=4,_>=48&&_<=57?u|=_-48:_>=97&&_<=102?u|=_+-87:_>=65&&_<=70?u|=_+-55:n(a,--h);f+=e(u);break}default:n(a,--h);break}else if(_<=127)f+=e(_);else if((_&224)===192)f+=e((_&31)<<6|a[h++]&63);else if((_&240)===224)f+=e((_&15)<<12|(a[h++]&63)<<6|a[h++]&63);else if((_&248)==240){var p=(_&7)<<18|(a[h++]&63)<<12|(a[h++]&63)<<6|a[h++]&63;p>65535&&(p-=65536,f+=e(p>>10&1023|55296),p=56320|p&1023),f+=e(p)}f[0];break}case 91:{f=[],r.push(l),A.push(c),o.push(s),l=null,c=f,s=1;continue}case 123:{f={},r.push(l),A.push(c),o.push(s),l=null,c=f,s=2;continue}case 93:{s!==1&&n(a,--h),f=c,l=r.pop(),c=A.pop(),s=o.pop();break}case 125:{s!==2&&n(a,--h),f=c,l=r.pop(),c=A.pop(),s=o.pop();break}default:n(a,--h)}for(_=a[h];_<=32;)_=a[++h];switch(s){case 0:{if(h===i)return f;break}case 1:{if(c.push(f),_===44){h++;continue}if(_===93)continue;break}case 2:{if(l===null){if(l=f,_===58){h++;continue}}else{if(c[l]=f,l=null,_===44){h++;continue}if(_===125)continue}break}}break}}n(a,h)}})(WA)});function bd(t){return t=t.trim(),t[0]==="["&&(t=t.replace(/,\s*$/,""),t[t.length-1]!=="]"&&(t+="]")),JSON.parse(t)}function Hv(t){let e=0;for(let n=0;n<t.length;n++)if(!/\s/.exec(String.fromCharCode(t[n]))){e=n;break}if(t[e]===91&&t[t.length-1]!==93){let n=t.length;for(;n>0&&/\s/.exec(String.fromCharCode(t[n-1]));)n--;if(String.fromCharCode(t[n-1])===","&&n--,String.fromCharCode(t[n-1])!=="]"){let a=new Uint8Array(n+1);a.set(t.subarray(0,n)),a[n]=93,t=a}}return(0,wd.JSON_parse)(t)}var Qd,wd,ZA,sl,cl,XA,an,_l=re(()=>{"use strict";Qd=he(Ed()),wd=he(Bd()),ZA=1<<27;sl=class{constructor(e){this.chunks=[];let n=this.byteArray=new Uint8Array(e),a="utf-8";if(n.length>2&&(n[0]===255&&n[1]===254?a="utf-16le":n[0]===254&&n[1]===255&&(a="utf-16be")),typeof TextDecoder<"u"){let r=new TextDecoder(a);for(let A=0;A<e.byteLength/ZA;A++){let o=A*ZA,i=new Uint8Array(e,o,Math.min(e.byteLength-o,ZA)),l=r.decode(i,{stream:!0});this.chunks.push(l)}}else{console.warn("This browser does not support TextDecoder. Decoding text as ASCII."),this.chunks.push("");for(let r=0;r<n.length;r++)this.chunks[this.chunks.length-1]+=String.fromCharCode(n[r]),this.chunks[this.chunks.length-1]|0,this.chunks[this.chunks.length-1].length>=ZA&&this.chunks.push("")}}splitLines(){let e=function*(){let n="";for(let a of this.chunks){let r=a.split(`
`);for(let A=0;A<r.length;A++)A===0?n+=r[A]:(yield n,n=r[A])}yield n};return{[Symbol.iterator]:e.bind(this)}}firstChunk(){return this.chunks[0]||""}parseAsJSON(){return this.chunks.length===1?bd(this.chunks[0]):Hv(this.byteArray)}},cl=class{constructor(e){this.s=e}splitLines(){return this.s.split(`
`)}firstChunk(){return this.s}parseAsJSON(){return bd(this.s)}},XA=class{constructor(e,n){this.fileName=e;this.contents=n}async name(){return this.fileName}async readAsArrayBuffer(){return new ArrayBuffer(0)}async readAsText(){return new cl(this.contents)}},an=class t{constructor(e,n){this.namePromise=e;this.uncompressedData=n.then(async a=>{try{return Qd.inflate(new Uint8Array(a)).buffer}catch{return a}})}async name(){return await this.namePromise}async readAsArrayBuffer(){return await this.uncompressedData}async readAsText(){let e=await this.readAsArrayBuffer();return new sl(e)}static fromFile(e){let n=new Promise(a=>{let r=new FileReader;r.addEventListener("loadend",()=>{if(!(r.result instanceof ArrayBuffer))throw new Error("Expected reader.result to be an instance of ArrayBuffer");a(r.result)}),r.readAsArrayBuffer(e)});return new t(Promise.resolve(e.name),n)}static fromArrayBuffer(e,n){return new t(Promise.resolve(e),Promise.resolve(n))}}});function Mv(t){let e=[...t.splitLines()].map(A=>A.split(" ")),n=e.shift();if(!n)return[];let a=new Map;for(let A=0;A<n.length;A++)a.set(A,n[A]);let r=[];for(let A of e){let o={};for(let i=0;i<A.length;i++)o[a.get(i)]=A[i];r.push(o)}return r}function Kv(t){if("Bytes Used"in t){let e=t["Bytes Used"],n=/\s*(\d+(?:[.]\d+)?) (\w+)\s+(?:\d+(?:[.]\d+))%/.exec(e);if(!n)return 0;let a=parseInt(n[1],10),r=n[2];switch(r){case"Bytes":return a;case"KB":return 1024*a;case"MB":return 1024*1024*a;case"GB":return 1024*1024*1024*a}throw new Error(`Unrecognized units ${r}`)}if("Weight"in t||"Running Time"in t){let e=t.Weight||t["Running Time"],n=/\s*(\d+(?:[.]\d+)?) ?(\w+)\s+(?:\d+(?:[.]\d+))%/.exec(e);if(!n)return 0;let a=parseInt(n[1],10),r=n[2];switch(r){case"ms":return a;case"s":return 1e3*a;case"min":return 60*1e3*a;case"cycles":return a;case"Kc":return 1e3*a;case"Mc":return 1e3*1e3*a;case"Gc":return 1e3*1e3*1e3*a}throw new Error(`Unrecognized units ${r}`)}return-1}function dl(t){let e=new Ie,n=Mv(t),a=[],r=0,A=n[0]["Symbol Names"]?n[0]["Symbol Names"].lastIndexOf(" ")+1:0;for(let o of n){let i=o["Symbol Name"]||o["Symbol Names"]?.slice(A);if(!i)continue;let l=i.trim(),s=i.length-l.length;if(a.length-s<0)throw new Error("Invalid format");let c=[];for(;s<a.length;){let _=a.pop();c.push(_)}for(let _ of c)r=Math.max(r,_.endValue),e.leaveFrame(_,r);let h={key:`${o["Source Path"]||""}:${l}`,name:l,file:o["Source Path"],endValue:r+Kv(o)};e.enterFrame(h,r),a.push(h)}for(;a.length>0;){let o=a.pop();r=Math.max(r,o.endValue),e.leaveFrame(o,r)}return"Bytes Used"in n[0]?e.setValueFormatter(new $e):("Weight"in n[0]||"Running Time"in n[0])&&e.setValueFormatter(new ee("milliseconds")),e.build()}async function kd(t){let e={name:t.name,files:new Map,subdirectories:new Map},n=await new Promise((a,r)=>{t.createReader().readEntries(A=>{a(A)},r)});for(let a of n)if(a.isDirectory){let r=await kd(a);e.subdirectories.set(r.name,r)}else{let r=await new Promise((A,o)=>{a.file(A,o)});e.files.set(r.name,r)}return e}function eo(t){return an.fromFile(t).readAsArrayBuffer()}function Jv(t){return an.fromFile(t).readAsText()}function Pv(t,e){let n=et(t.subdirectories,"corespace"),a=et(n.subdirectories,`run${e}`);return et(a.subdirectories,"core")}async function Gv(t){let e=et(t.subdirectories,"stores");for(let n of e.subdirectories.values()){let a=n.files.get("schema.xml");if(!a)continue;let r=await Jv(a);if(!/name="time-profile"/.exec(r.firstChunk()))continue;let A=new aa(await eo(et(n.files,"bulkstore")));A.readUint32(),A.readUint32(),A.readUint32();let o=A.readUint32(),i=A.readUint32();A.seek(o);let l=[];for(;;){let s=A.readUint48();if(s===0)break;let c=A.readUint32();A.skip(i-6-4-4);let h=A.readUint32();l.push({timestamp:s,threadID:c,backtraceID:h})}return l}throw new Error("Could not find sample list")}async function Uv(t,e){let n=et(e.subdirectories,"uniquing"),a=et(n.subdirectories,"arrayUniquer"),r=et(a.files,"integeruniquer.index"),A=et(a.files,"integeruniquer.data"),o=new aa(await eo(r)),i=new aa(await eo(A));o.seek(32);let l=[];for(;o.hasMore();){let s=o.readUint32()+o.readUint32()*1048576;if(s===0)continue;i.seek(
uniform mat3 configSpaceToNDC;
attribute vec2 configSpacePos;
attribute vec3 color;
varying vec3 vColor;
void main() {
vColor = color;
vec2 position = (configSpaceToNDC * vec3(configSpacePos, 1)).xy;
gl_Position = vec4(position, 1, 1);
}
`,np=`
precision mediump float;
varying vec3 vColor;
void main() {
gl_FragColor = vec4(vColor.rgb, 1);
}
`,vn=class{constructor(e){this.gl=e;this.rects=[];this.colors=[];this.buffer=null}getRectCount(){return this.rects.length}getBuffer(){if(this.buffer)return this.buffer;let e=[[0,0],[1,0],[0,1],[1,0],[0,1],[1,1]],n=new Uint8Array(wa.stride*e.length*this.rects.length),a=new Float32Array(n.buffer),r=0;for(let A=0;A<this.rects.length;A++){let o=this.rects[A],i=this.colors[A];for(let l of e)a[r++]=o.origin.x+l[0]*o.size.x,a[r++]=o.origin.y+l[1]*o.size.y,a[r++]=i.r,a[r++]=i.g,a[r++]=i.b}if(r!==a.length)throw new Error("Buffer expected to be full but wasn't");return this.buffer=this.gl.createVertexBuffer(n.length),this.buffer.upload(n),this.buffer}addRect(e,n){this.rects.push(e),this.colors.push(n),this.buffer&&(this.buffer.free(),this.buffer=null)}free(){this.buffer&&(this.buffer.free(),this.buffer=null)}},Qa=class{constructor(e){this.gl=e;this.material=e.createMaterial(wa,tp,np)}render(e){kt(this.material,"configSpaceToNDC",(()=>{let n=U.betweenRects(e.configSpaceSrcRect,e.physicalSpaceDstRect),a=new v(this.gl.viewport.width,this.gl.viewport.height);return U.withTranslation(new v(-1,1)).times(U.withScale(new v(2,-2).dividedByPointwise(a))).times(n)})()),this.gl.setUnpremultipliedBlendState(),this.gl.draw(q.Primitive.TRIANGLES,this.material,e.batch.getBuffer())}};var fe=class t{constructor(e=0,n=0,a=0,r=1){this.r=e;this.g=n;this.b=a;this.a=r}static fromLumaChromaHue(e,n,a){let r=a/60,A=n*(1-Math.abs(r%2-1)),[o,i,l]=r<1?[n,A,0]:r<2?[A,n,0]:r<3?[0,n,A]:r<4?[0,A,n]:r<5?[A,0,n]:[n,0,A],s=e-(.3*o+.59*i+.11*l);return new t(Re(o+s,0,1),Re(i+s,0,1),Re(l+s,0,1),1)}static fromCSSHex(e){if(e.length!==7||e[0]!=="#")throw new Error(`Invalid color input ${e}`);let n=parseInt(e.substr(1,2),16)/255,a=parseInt(e.substr(3,2),16)/255,r=parseInt(e.substr(5,2),16)/255;if(n<0||n>1||a<0||a>1||r<0||r>1)throw new Error(`Invalid color input ${e}`);return new t(n,a,r)}withAlpha(e){return new t(this.r,this.g,this.b,e)}toCSS(){return`rgba(${(255*this.r).toFixed()}, ${(255*this.g).toFixed()}, ${(255*this.b).toFixed()}, ${this.a.toFixed(2)})`}};var ba=class{constructor(e,n,a){this.gl=e;this.rectangleBatchRenderer=n;this.textureRenderer=a;this.texture=e.createTexture(q.TextureFormat.NEAREST_CLAMP,4096,4096),this.renderTarget=e.createRenderTarget(this.texture),this.rowCache=new Ea(this.texture.height),this.clearLineBatch=new vn(e),this.clearLineBatch.addRect(R.unit,new fe(0,0,0,0)),e.addContextResetHandler(()=>{this.rowCache.clear()})}has(e){return this.rowCache.has(e)}getResolution(){return this.texture.width}getCapacity(){return this.texture.height}allocateLine(e){if(this.rowCache.getSize()<this.rowCache.getCapacity()){let n=this.rowCache.getSize();return this.rowCache.insert(e,n),n}else{let[,n]=this.rowCache.removeLRU();return this.rowCache.insert(e,n),n}}writeToAtlasIfNeeded(e,n){Ba(this.gl,this.renderTarget,()=>{for(let a of e){let r=this.rowCache.get(a);if(r!=null)continue;r=this.allocateLine(a);let A=new R(new v(0,r),new v(this.texture.width,1));this.rectangleBatchRenderer.render({batch:this.clearLineBatch,configSpaceSrcRect:R.unit,physicalSpaceDstRect:A}),n(A,a)}})}renderViaAtlas(e,n){let a=this.rowCache.get(e);if(a==null)return!1;let r=new R(new v(0,a),new v(this.texture.width,1));return this.textureRenderer.render({texture:this.texture,srcRect:r,dstRect:n}),!0}};var rp=`
uniform mat3 uvTransform;
uniform mat3 positionTransform;
attribute vec2 position;
attribute vec2 uv;
varying vec2 vUv;
void main() {
vUv = (uvTransform * vec3(uv, 1)).xy;
gl_Position = vec4((positionTransform * vec3(position, 1)).xy, 0, 1);
}
`,ap=`
precision mediump float;
varying vec2 vUv;
uniform sampler2D texture;
void main() {
gl_FragColor = texture2D(texture, vUv);
}
`,xa=class{constructor(e){this.gl=e;let n=new q.VertexFormat;n.add("position",q.AttributeType.FLOAT,2),n.add("uv",q.AttributeType.FLOAT,2);let a=[{pos:[-1,1],uv:[0,1]},{pos:[1,1],uv:[1,1]},{pos:[-1,-1],uv:[0,0]},{pos:[1,-1],uv:[1,0]}],r=[];for(let A of a)r.push(A.pos[0]),r.push(A.pos[1]),r.push(A.uv[0]),r.push(A.uv[1]);this.buffer=e.createVertexBuffer(n.stride*a.length),this.buffer.upload(new Uint8Array(new Float32Array(r).buffer)),this.material=e.createMaterial(n,rp,ap)}render(e){this.material.setUniformSampler("texture",e.texture,0),kt(this.material,"uvTransform",(()=>{let{srcRect:n,texture:a}=e,A=U.withTranslation(new v(0,1)).times(U.withScale(new v(1,-1))).times(U.betweenRects(new R(v.zero,new v(a.width,a.height)),R.unit)).transformRect(n);return U.betweenRects(R.unit,A)})()),kt(this.material,"positionTransform",(()=>{let{dstRect:n}=e,{viewport:a}=this.gl,r=new v(a.width,a.height),o=U.withScale(new v(1,-1)).times(U.betweenRects(new R(v.zero,r),R.NDC)).transformRect(n);return U.betweenRects(R.NDC,o)})()),this.gl.setUnpremultipliedBlendState(),this.gl.draw(q.Primitive.TRIANGLE_STRIP,this.material,this.buffer)}};var Eo=new q.VertexFormat;Eo.add("position",q.AttributeType.FLOAT,2);var Ap=`
attribute vec2 position;
void main() {
gl_Position = vec4(position, 0, 1);
}
`,op=t=>{let{r:e,g:n,b:a}=fe.fromCSSHex(t.fgSecondaryColor),r=`${e.toFixed(1)}, ${n.toFixed(1)}, ${a.toFixed(1)}`;return`
precision mediump float;
uniform mat3 configSpaceToPhysicalViewSpace;
uniform vec2 physicalSize;
uniform vec2 physicalOrigin;
uniform vec2 configSpaceViewportOrigin;
uniform vec2 configSpaceViewportSize;
uniform float framebufferHeight;
void main() {
vec2 origin = (configSpaceToPhysicalViewSpace * vec3(configSpaceViewportOrigin, 1.0)).xy;
vec2 size = (configSpaceToPhysicalViewSpace * vec3(configSpaceViewportSize, 0.0)).xy;
vec2 halfSize = physicalSize / 2.0;
float borderWidth = 2.0;
origin = floor(origin * halfSize) / halfSize + borderWidth * vec2(1.0, 1.0);
size = floor(size * halfSize) / halfSize - 2.0 * borderWidth * vec2(1.0, 1.0);
vec2 coord = gl_FragCoord.xy;
coord.x = coord.x - physicalOrigin.x;
coord.y = framebufferHeight - coord.y - physicalOrigin.y;
vec2 clamped = clamp(coord, origin, origin + size);
vec2 gap = clamped - coord;
float maxdist = max(abs(gap.x), abs(gap.y));
// TOOD(jlfwong): Could probably optimize this to use mix somehow.
if (maxdist == 0.0) {
// Inside viewport rectangle
gl_FragColor = vec4(0, 0, 0, 0);
} else if (maxdist < borderWidth) {
// Inside viewport rectangle at border
gl_FragColor = vec4(${r}, 0.8);
} else {
// Outside viewport rectangle
gl_FragColor = vec4(${r}, 0.5);
}
}
`},ka=class{constructor(e,n){this.gl=e;let a=[[-1,1],[1,1],[-1,-1],[1,-1]],r=[];for(let A of a)r.push(A[0]),r.push(A[1]);this.buffer=e.createVertexBuffer(Eo.stride*a.length),this.buffer.upload(new Uint8Array(new Float32Array(r).buffer)),this.material=e.createMaterial(Eo,Ap,op(n))}render(e){kt(this.material,"configSpaceToPhysicalViewSpace",e.configSpaceToPhysicalViewSpace),yo(this.material,"configSpaceViewportOrigin",e.configSpaceViewportRect.origin),yo(this.material,"configSpaceViewportSize",e.configSpaceViewportRect.size);let n=this.gl.viewport;this.material.setUniformVec2("physicalOrigin",n.x,n.y),this.material.setUniformVec2("physicalSize",n.width,n.height),this.material.setUniformFloat("framebufferHeight",this.gl.renderTargetHeightInPixels),this.gl.setBlendState(q.BlendOperation.SOURCE_ALPHA,q.BlendOperation.INVERSE_SOURCE_ALPHA),this.gl.draw(q.Primitive.TRIANGLE_STRIP,this.material,this.buffer)}};var Sa=new q.VertexFormat;Sa.add("position",q.AttributeType.FLOAT,2);Sa.add("uv",q.AttributeType.FLOAT,2);var ip=`
uniform mat3 uvTransform;
uniform mat3 positionTransform;
attribute vec2 position;
attribute vec2 uv;
varying vec2 vUv;
void main() {
vUv = (uvTransform * vec3(uv, 1)).xy;
gl_Position = vec4((positionTransform * vec3(position, 1)).xy, 0, 1);
}
`,lp=t=>`
precision mediump float;
uniform vec2 uvSpacePixelSize;
uniform float renderOutlines;
varying vec2 vUv;
uniform sampler2D colorTexture;
// https://en.wikipedia.org/wiki/HSL_and_HSV#From_luma/chroma/hue
vec3 hcl2rgb(float H, float C, float L) {
float hPrime = H / 60.0;
float X = C * (1.0 - abs(mod(hPrime, 2.0) - 1.0));
vec3 RGB =
hPrime < 1.0 ? vec3(C, X, 0) :
hPrime < 2.0 ? vec3(X, C, 0) :
hPrime < 3.0 ? vec3(0, C, X) :
hPrime < 4.0 ? vec3(0, X, C) :
hPrime < 5.0 ? vec3(X, 0, C) :
vec3(C, 0, X);
float m = L - dot(RGB, vec3(0.30, 0.59, 0.11));
return RGB + vec3(m, m, m);
}
float triangle(float x) {
return 2.0 * abs(fract(x) - 0.5) - 1.0;
}
${t}
void main() {
vec4 here = texture2D(colorTexture, vUv);
if (here.z == 0.0) {
// Background color
gl_FragColor = vec4(0, 0, 0, 0);
return;
}
// Sample the 4 surrounding pixels in the depth texture to determine
// if we should draw a boundary here or not.
vec4 N = texture2D(colorTexture, vUv + vec2(0, uvSpacePixelSize.y));
vec4 E = texture2D(colorTexture, vUv + vec2(uvSpacePixelSize.x, 0));
vec4 S = texture2D(colorTexture, vUv + vec2(0, -uvSpacePixelSize.y));
vec4 W = texture2D(colorTexture, vUv + vec2(-uvSpacePixelSize.x, 0));
// NOTE: For outline checks, we intentionally check both the right
// and the left to determine if we're an edge. If a rectangle is a single
// pixel wide, we don't want to render it as an outline, so this method
// of checking ensures that we don't outline single physical-space
// pixel width rectangles.
if (
renderOutlines > 0.0 &&
(
here.y == N.y && here.y != S.y || // Top edge
here.y == S.y && here.y != N.y || // Bottom edge
here.x == E.x && here.x != W.x || // Left edge
here.x == W.x && here.x != E.x
)
) {
// We're on an edge! Draw transparent.
gl_FragColor = vec4(0, 0, 0, 0);
} else {
// Not on an edge. Draw the appropriate color.
gl_FragColor = vec4(colorForBucket(here.z), here.a);
}
}
`,Na=class{constructor(e,n){this.gl=e;let a=[{pos:[-1,1],uv:[0,1]},{pos:[1,1],uv:[1,1]},{pos:[-1,-1],uv:[0,0]},{pos:[1,-1],uv:[1,0]}],r=[];for(let A of a)r.push(A.pos[0]),r.push(A.pos[1]),r.push(A.uv[0]),r.push(A.uv[1]);this.buffer=e.createVertexBuffer(Sa.stride*a.length),this.buffer.uploadFloats(r),this.material=e.createMaterial(Sa,ip,lp(n.colorForBucketGLSL))}render(e){let{srcRect:n,rectInfoTexture:a}=e,A=U.withTranslation(new v(0,1)).times(U.withScale(new v(1,-1))).times(U.betweenRects(new R(v.zero,new v(a.width,a.height)),R.unit)).transformRect(n),o=U.betweenRects(R.unit,A),{dstRect:i}=e,l=new v(this.gl.viewport.width,this.gl.viewport.height),c=U.withScale(new v(1,-1)).times(U.betweenRects(new R(v.zero,l),R.NDC)).transformRect(i),h=U.betweenRects(R.NDC,c),_=v.unit.dividedByPointwise(new v(e.rectInfoTexture.width,e.rectInfoTexture.height));this.material.setUniformSampler("colorTexture",e.rectInfoTexture,0),kt(this.material,"uvTransform",o),this.material.setUniformFloat("renderOutlines",e.renderOutlines?1:0),this.material.setUniformVec2("uvSpacePixelSize",_.x,_.y),kt(this.material,"positionTransform",h),this.gl.setUnpremultipliedBlendState(),this.gl.draw(q.Primitive.TRIANGLE_STRIP,this.material,this.buffer)}};var Fa=class{constructor(e,n){this.animationFrameRequest=null;this.beforeFrameHandlers=new Set;this.onBeforeFrame=()=>{this.animationFrameRequest=null,this.gl.setViewport(0,0,this.gl.renderTargetWidthInPixels,this.gl.renderTargetHeightInPixels);let e=fe.fromCSSHex(this.theme.bgPrimaryColor);this.gl.clear(new q.Color(e.r,e.g,e.b,e.a));for(let n of this.beforeFrameHandlers)n()};this.gl=new vo.Context(e),this.rectangleBatchRenderer=new Qa(this.gl),this.textureRenderer=new xa(this.gl),this.viewportRectangleRenderer=new ka(this.gl,n),this.flamechartColorPassRenderer=new Na(this.gl,n),this.theme=n,this.gl.addAfterResizeEventHandler(this.onBeforeFrame);let a=this.gl.getWebGLInfo();a&&console.log(`WebGL initialized. renderer: ${a.renderer}, vendor: ${a.vendor}, version: ${a.version}`),window.testContextLoss=()=>{this.gl.testContextLoss()}}addBeforeFrameHandler(e){this.beforeFrameHandlers.add(e)}removeBeforeFrameHandler(e){this.beforeFrameHandlers.delete(e)}requestFrame(){this.animationFrameRequest||(this.animationFrameRequest=requestAnimationFrame(this.onBeforeFrame))}setViewport(e,n){let{origin:a,size:r}=e,A=this.gl.viewport;this.gl.setViewport(a.x,a.y,r.x,r.y),n();let{x:o,y:i,width:l,height:s}=A;this.gl.setViewport(o,i,l,s)}renderBehind(e,n){let a=e.getBoundingClientRect(),r=new R(new v(a.left*window.devicePixelRatio,a.top*window.devicePixelRatio),new v(a.width*window.devicePixelRatio,a.height*window.devicePixelRatio));this.setViewport(r,n)}};var sn=qn(t=>e=>t.get(e.key)||0),Ut=ze(({theme:t,frameToColorBucket:e})=>{let n=sn(e);return a=>{let r=n(a)/255;return t.colorForBucket(r).toCSS()}}),Ot=ze(({theme:t,canvas:e})=>new Fa(e,t)),_s=qn(t=>new ba(t.gl,t.rectangleBatchRenderer,t.textureRenderer)),hs=ze(({profile:t,flattenRecursion:e})=>e?t.getProfileWithRecursionFlattened():t),qt=qn(t=>{let e=[];t.forEachFrame(A=>e.push(A));function n(A){return(A.file||"")+A.name}function a(A,o){return n(A)>n(o)?1:-1}e.sort(a);let r=new Map;for(let A=0;A<e.length;A++)r.set(e[A].key,Math.floor(255*A/e.length));return r});var zn,it,gs,wr=0,Bo=[],ds=J.__r,us=J.diffed,fs=J.__c,ps=J.unmount;function br(t,e){J.__h&&J.__h(it,t,wr||e),wr=0;var n=it.__H||(it.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Ge(t){return wr=1,Cs(ms,t)}function Cs(t,e,n){var a=br(zn++,2);return a.__c||(a.__c=it,a.__=[n?n(e):ms(void 0,e),function(r){var A=t(a.__[0],r);a.__[0]!==A&&(a.__[0]=A,a.__c.setState({}))}]),a.__}function Ue(t,e){var n=br(zn++,3);!J.__s&&xo(n.__H,e)&&(n.__=t,n.__H=e,it.__H.__h.push(n))}function bo(t,e){var n=br(zn++,4);!J.__s&&xo(n.__H,e)&&(n.__=t,n.__H=e,it.__h.push(n))}function cn(t){return wr=5,oe(function(){return{current:t}},[])}function oe(t,e){var n=br(zn++,7);return xo(n.__H,e)?(n.__H=e,n.__h=t,n.__=t()):n.__}function P(t,e){return wr=8,oe(function(){return t},e)}function lt(t){var e=it.context[t.__c],n=br(zn++,
vec3 colorForBucket(float t) {
float x = triangle(30.0 * t);
float H = 360.0 * (0.9 * t);
float C = ${Ds.toFixed(1)} + ${Rs.toFixed(1)} * x;
float L = ${Ls.toFixed(1)} - ${Ts.toFixed(1)} * x;
return hcl2rgb(H, C, L);
}
`,Lo={fgPrimaryColor:"#D0D0D0",fgSecondaryColor:"#666666",bgPrimaryColor:"#060606",bgSecondaryColor:"#0C0C0C",altFgPrimaryColor:"#D0D0D0",altFgSecondaryColor:"#666666",altBgPrimaryColor:"#000000",altBgSecondaryColor:"#0C0C0C",selectionPrimaryColor:"#00769B",selectionSecondaryColor:"#004E75",weightColor:"#0F8A42",searchMatchTextColor:"#0C0C0C",searchMatchPrimaryColor:"#A66F1C",searchMatchSecondaryColor:"#D6AE24",colorForBucket:Cp,colorForBucketGLSL:mp};V();var Hs=.25,Ms=.2,Ks=.8,Js=.15,Ip=t=>{let e=va(30*t),n=360*(.9*t),a=Hs+Ms*e,r=Ks-Js*e;return fe.fromLumaChromaHue(r,a,n)},jp=`
vec3 colorForBucket(float t) {
float x = triangle(30.0 * t);
float H = 360.0 * (0.9 * t);
float C = ${Hs.toFixed(1)} + ${Ms.toFixed(1)} * x;
float L = ${Ks.toFixed(1)} - ${Js.toFixed(1)} * x;
return hcl2rgb(H, C, L);
}
`,Ja={fgPrimaryColor:"#000000",fgSecondaryColor:"#BDBDBD",bgPrimaryColor:"#FFFFFF",bgSecondaryColor:"#F6F6F6",altFgPrimaryColor:"#FFFFFF",altFgSecondaryColor:"#BDBDBD",altBgPrimaryColor:"#000000",altBgSecondaryColor:"#222222",selectionPrimaryColor:"#2F80ED",selectionSecondaryColor:"#8EB7ED",weightColor:"#6FCF97",searchMatchTextColor:"#000000",searchMatchPrimaryColor:"#FFAC02",searchMatchSecondaryColor:"#FEDC62",colorForBucket:Ip,colorForBucketGLSL:jp};var Gs=wt(Ja);function z(){return lt(Gs)}function Ce(t){return qn(t)}function Ps(){return matchMedia("(prefers-color-scheme: dark)")}function Us(t){switch(t){case 0:return"System";case 1:return"Dark";case 2:return"Light"}}function vp(t,e){switch(t){case 0:return e?Lo:Ja;case 1:return Lo;case 2:return Ja}}function Os(t){let[e,n]=Ge(()=>Ps().matches),a=P(o=>{n(o.matches)},[n]);Ue(()=>{let o=Ps();return o.addEventListener("change",a),()=>{o.removeEventListener("change",a)}},[a]);let r=Y(En),A=vp(r,e);return C(Gs.Provider,{value:A,children:t.children})}var e_=he($s()),t_=he(Ys()),n_=he(Zs()),r_=he(ec()),a_=he(rc()),A_=he(oc()),o_=he(sc()),i_=he(_c()),l_=he(gc()),s_=he(uc()),c_=he(pc()),__=he(Bc()),h_=he(wc()),g_=he(Mc()),d_=he(Yc()),L=["Webkit"],Go=["Moz"],ge=["ms"],Me=["Webkit","Moz"],xe=["Webkit","ms"],Sr=["Webkit","Moz","ms"],zC={plugins:[e_.default,t_.default,n_.default,r_.default,a_.default,A_.default,o_.default,i_.default,l_.default,s_.default,c_.default,__.default],prefixMap:{transform:xe,transformOrigin:xe,transformOriginX:xe,transformOriginY:xe,backfaceVisibility:L,perspective:L,perspectiveOrigin:L,transformStyle:L,transformOriginZ:L,animation:L,animationDelay:L,animationDirection:L,animationFillMode:L,animationDuration:L,animationIterationCount:L,animationName:L,animationPlayState:L,animationTimingFunction:L,appearance:Me,userSelect:Sr,fontKerning:L,textEmphasisPosition:L,textEmphasis:L,textEmphasisStyle:L,textEmphasisColor:L,boxDecorationBreak:L,clipPath:L,maskImage:L,maskMode:L,maskRepeat:L,maskPosition:L,maskClip:L,maskOrigin:L,maskSize:L,maskComposite:L,mask:L,maskBorderSource:L,maskBorderMode:L,maskBorderSlice:L,maskBorderWidth:L,maskBorderOutset:L,maskBorderRepeat:L,maskBorder:L,maskType:L,textDecorationStyle:Me,textDecorationSkip:Me,textDecorationLine:Me,textDecorationColor:Me,filter:L,fontFeatureSettings:Me,breakAfter:Sr,breakBefore:Sr,breakInside:Sr,columnCount:Me,columnFill:Me,columnGap:Me,columnRule:Me,columnRuleColor:Me,columnRuleStyle:Me,columnRuleWidth:Me,columns:Me,columnSpan:Me,columnWidth:Me,writingMode:xe,flex:xe,flexBasis:L,flexDirection:xe,flexGrow:L,flexFlow:xe,flexShrink:L,flexWrap:xe,alignContent:L,alignItems:L,alignSelf:L,justifyContent:L,order:L,transitionDelay:L,transitionDuration:L,transitionProperty:L,transitionTimingFunction:L,backdropFilter:L,scrollSnapType:xe,scrollSnapPointsX:xe,scrollSnapPointsY:xe,scrollSnapDestination:xe,scrollSnapCoordinate:xe,shapeImageThreshold:L,shapeImageMargin:L,shapeImageOutside:L,hyphens:Sr,flowInto:xe,flowFrom:xe,regionFragment:xe,boxSizing:Go,textAlignLast:Go,tabSize:Go,wrapFlow:ge,wrapThrough:ge,wrapMargin:ge,touchAction:ge,gridTemplateColumns:ge,gridTemplateRows:ge,gridTemplateAreas:ge,gridTemplate:ge,gridAutoColumns:ge,gridAutoRows:ge,gridAutoFlow:ge,grid:ge,gridRowStart:ge,gridColumnStart:ge,gridRowEnd:ge,gridRow:ge,gridColumn:ge,gridColumnEnd:ge,gridColumnGap:ge,gridRowGap:ge,gridArea:ge,gridGap:ge,textSizeAdjust:xe,borderImage:L,borderImageOutset:L,borderImageRepeat:L,borderImageSlice:L,borderImageSource:L,borderImageWidth:L}},$C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},VC=(function(){function t(e,n){for(var a=0;a<n.length;a++){var r=n[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,a){return n&&t(e.prototype,n),a&&t(e,a),e}})();function YC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Wc=typeof Map<"u",Uo=(function()
`);if(!e.length||(e[e.length-1]===""&&e.pop(),!e.length))return null;let n=new Map,a=/^(\d+):(.+)$/,r=/^([\$\w]+):([\$\w-]+)$/;for(let A of e){let o=a.exec(A);if(o){n.set(`wasm-function[${o[1]}]`,y_(o[2]));continue}let i=r.exec(A);if(i){n.set(i[1],y_(i[2]));continue}return null}return A=>n.has(A.name)?{name:n.get(A.name)}:null}Zo();V();var Wt=class{constructor(e){this.source=e;this.layers=[];this.totalWeight=0;this.minFrameWidth=1;let n=[],a=(A,o)=>{let i=Ae(n),l={node:A,parent:i,children:[],start:o,end:o};i&&i.children.push(l),n.push(l)};this.minFrameWidth=1/0;let r=(A,o)=>{console.assert(n.length>0);let i=n.pop();if(i.end=o,i.end-i.start===0)return;let l=n.length;for(;this.layers.length<=l;)this.layers.push([]);this.layers[l].push(i),this.minFrameWidth=Math.min(this.minFrameWidth,i.end-i.start)};this.totalWeight=e.getTotalWeight(),e.forEachCall(a,r),isFinite(this.minFrameWidth)||(this.minFrameWidth=1)}getTotalWeight(){return this.totalWeight}getLayers(){return this.layers}getColorBucketForFrame(e){return this.source.getColorBucketForFrame(e)}getMinFrameWidth(){return this.minFrameWidth}formatValue(e){return this.source.formatValue(e)}getClampedViewportWidth(e){let n=this.getTotalWeight(),a=Math.pow(2,40),r=Re(3*this.getMinFrameWidth(),n/a,n);return Re(e,r,n)}getClampedConfigSpaceViewportRect({configSpaceViewportRect:e,renderInverted:n}){let a=new v(this.getTotalWeight(),this.getLayers().length),r=this.getClampedViewportWidth(e.size.x),A=e.size.withX(r),o=v.clamp(e.origin,new v(0,n?0:-1),v.max(v.zero,a.minus(A).plus(new v(0,1))));return new R(o,e.size.withX(r))}};V();var Rm=1e4,CA=class{constructor(e,n,a){this.batch=e;this.bounds=n;this.numPrecedingRectanglesInRow=a;this.children=[]}getBatch(){return this.batch}getBounds(){return this.bounds}getRectCount(){return this.batch.getRectCount()}getChildren(){return this.children}getParity(){return this.numPrecedingRectanglesInRow%2}forEachLeafNodeWithinBounds(e,n){this.bounds.hasIntersectionWith(e)&&n(this)}},Xo=class{constructor(e){this.children=e;this.rectCount=0;if(e.length===0)throw new Error("Empty interior node");let n=1/0,a=-1/0,r=1/0,A=-1/0;for(let o of e){this.rectCount+=o.getRectCount();let i=o.getBounds();n=Math.min(n,i.left()),a=Math.max(a,i.right()),r=Math.min(r,i.top()),A=Math.max(A,i.bottom())}this.bounds=new R(new v(n,r),new v(a-n,A-r))}getBounds(){return this.bounds}getRectCount(){return this.rectCount}getChildren(){return this.children}forEachLeafNodeWithinBounds(e,n){if(this.bounds.hasIntersectionWith(e))for(let a of this.children)a.forEachLeafNodeWithinBounds(e,n)}},mA=class t{get key(){return`${this.stackDepth}_${this.index}_${this.zoomLevel}`}constructor(e){this.stackDepth=e.stackDepth,this.zoomLevel=e.zoomLevel,this.index=e.index}static getOrInsert(e,n){return e.getOrInsert(new t(n))}},IA=class{constructor(e,n,a,r,A,o={inverted:!1}){this.gl=e;this.rowAtlas=n;this.flamechart=a;this.rectangleBatchRenderer=r;this.colorPassRenderer=A;this.options=o;this.layers=[];this.rectInfoTexture=null;this.rectInfoRenderTarget=null;this.atlasKeys=new bt;let i=a.getLayers().length;for(let l=0;l<i;l++){let s=[],c=o.inverted?i-1-l:l,h=1/0,_=-1/0,f=new vn(this.gl),m=0,u=a.getLayers()[l];for(let g=0;g<u.length;g++){let p=u[g];f.getRectCount()>=Rm&&(s.push(new CA(f,new R(new v(h,c),new v(_-h,1)),m)),h=1/0,_=-1/0,f=new vn(this.gl));let I=new R(new v(p.start,c),new v(p.end-p.start,1));h=Math.min(h,I.left()),_=Math.max(_,I.right());let j=new fe((1+g%255)/256,(1+l%255)/256,(1+this.flamechart.getColorBucketForFrame(p.node.frame))/256);f.addRect(I,j),m++}f.getRectCount()>0&&s.push(new CA(f,new R(new v(h,c),new v(_-h,1)),m)),this.layers.push(new Xo(s))}}getRectInfoTexture(e,n){if(this.rectInfoTexture){let a=this.rectInfoTexture;(a.width!=e||a.height!=n)&&a.resize(e,n)}else this.rectInfoTexture=this.gl.createTexture(q.TextureFormat.NEAREST_CLAMP,e,n);return this.rectInfoTexture}getRectInfoRenderTarget(e,n){let a=this.getRectInfoTexture(e,n);return this.rectInfoRenderTarget&&this.rectInfoRenderTarget.texture!=a&&(this.rectInfoRenderTarget.texture.free(),this.rectInfoRenderTarget.setC
`)[c.originalLine-1];if(m){let u=/\w+/.exec(m.substr(c.originalColumn-1));u&&(h.name=u[0])}}}switch(h.name){case"constructor":{h.name=i.name+" constructor";break}case"function":{h.name=i.name;break}case"const":case"export":{h.name=i.name;break}}return h.name&&i.name.includes(h.name)&&(h.name=i.name),c.source!=null&&(h.file=c.source,h.line=c.originalLine,h.col=c.originalColumn),bI&&(console.groupCollapsed(`Remapping "${i.name}" -> "${h.name}"`),console.log("before",{...i}),console.log("item @ index",c),console.log("item @ index + 1",A[s+1]),console.log("after",h),console.groupEnd()),h}}V();var yh=({items:t,axis:e,renderItems:n,className:a,initialIndexInView:r})=>{let[A,o]=Ge(null),[i,l]=Ge(0),s=cn(null),c=e==="x"?"width":"height",h=e==="x"?"left":"top",_=e==="x"?"scrollLeft":"scrollTop",f=r?t.reduce((y,b,F)=>F<r?y+b.size:y,0):0,m=cn(f),u=P(y=>{y?requestAnimationFrame(()=>{o(y.getBoundingClientRect()[c]),m.current!=null&&(y.scrollTo({[h]:m.current}),m.current=null)}):o(null),s.current=y},[o,c,h]),g=oe(()=>{if(s.current==null||A==null||i==null)return null;let y=i-A/4,b=i+A+A/4,F=0,T=0,Q=0;for(;Q<t.length;Q++){let te=t[Q];if(T=F,F+=te.size,F>=y)break}let w=Q;for(;Q<t.length;Q++){let te=t[Q];if(F+=te.size,F>=b)break}let S=Math.min(Q,t.length-1);return{firstVisibleIndex:w,lastVisibleIndex:S,invisiblePrefixSize:T}},[A,i,t]),p=oe(()=>t.reduce((y,b)=>y+b.size,0),[t]),I=P(()=>{s.current!=null&&l(s.current[_])},[_]);Ue(()=>{let y=()=>{s.current!=null&&o(s.current.getBoundingClientRect()[c])};return window.addEventListener("resize",y),()=>{window.removeEventListener("resize",y)}},[c]);let j=oe(()=>g?n(g.firstVisibleIndex,g.lastVisibleIndex):null,[n,g]),E=oe(()=>C("div",{style:{height:p}},C("div",{style:{transform:`translateY(${g?.invisiblePrefixSize||0}px)`}},j)),[g,j,p]);return C("div",{className:a,ref:u,onScroll:I},E)};function Eh(t){let e=FA(z());return C("div",{className:B(e.hBarDisplay)},C("div",{className:B(e.hBarDisplayFilled),style:{width:`${t.perc}%`}}))}function Bi(t){let e=z(),n=FA(e),{activeDirection:a}=t,r=a===0?e.fgPrimaryColor:e.fgSecondaryColor,A=a===1?e.fgPrimaryColor:e.fgSecondaryColor;return C("svg",{width:"8",height:"10",viewBox:"0 0 8 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:B(n.sortIcon)},C("path",{d:"M0 4L4 0L8 4H0Z",fill:r}),C("path",{d:"M0 4L4 0L8 4H0Z",transform:"translate(0 10) scale(1 -1)",fill:A}))}function SI(t,e,n){let a=[],r=0;for(let A of e)a.push(t.slice(r,A[0])),a.push(C("span",{className:n},t.slice(A[0],A[1]))),r=A[1];return a.push(t.slice(r)),C("span",null,a)}var NI=({frame:t,matchedRanges:e,profile:n,index:a,selectedFrame:r,setSelectedFrame:A,getCSSColorForFrame:o})=>{let i=FA(z()),l=t.getTotalWeight(),s=t.getSelfWeight(),c=100*l/n.getTotalNonIdleWeight(),h=100*s/n.getTotalNonIdleWeight(),_=t===r;return C("tr",{key:`${a}`,onClick:A.bind(null,t),className:B(i.tableRow,a%2==0&&i.tableRowEven,_&&i.tableRowSelected)},C("td",{className:B(i.numericCell)},n.formatValue(l)," (",xt(c),")",C(Eh,{perc:c})),C("td",{className:B(i.numericCell)},n.formatValue(s)," (",xt(h),")",C(Eh,{perc:h})),C("td",{title:t.file,className:B(i.textCell)},C(EA,{color:o(t)}),e?SI(t.name,e,B(i.matched,_&&i.matchedSelected)):t.name))},FI=pe(({profile:t,sortMethod:e,setSortMethod:n,selectedFrame:a,setSelectedFrame:r,getCSSColorForFrame:A,searchQuery:o,searchIsActive:i})=>{let l=FA(z()),s=P((g,p)=>{if(p.preventDefault(),e.field==g)n({field:g,direction:e.direction===0?1:0});else switch(g){case 0:{n({field:g,direction:0});break}case 1:{n({field:g,direction:1});break}case 2:{n({field:g,direction:1});break}}},[e,n]),c=lt(Mr),h=P((g,p)=>{if(!c)return null;let I=[];for(let j=g;j<=p;j++){let E=c.rowList[j],y=c.getSearchMatchForFrame(E);I.push(NI({frame:E,matchedRanges:y??null,index:j,profile:t,selectedFrame:a,setSelectedFrame:r,getCSSColorForFrame:A}))}return I.length===0&&(i?I.push(C("tr",null,C("td",{className:B(l.emptyState)},'No symbol names match query "',o,'".'))):I.push(C("tr",null,C("td",{className:B(l.emptyState)},"No symbols found.")))),C("table",{className:B(l.tableView)},I)},[c,t,a,r,A,i,o,l.emptyState,l.ta
//# sourceMappingURL=speedscope-Y2522XSH.js.map