From 18e9252998ef9ea2c20400084600761c97d992bb Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 13 Jan 2024 02:34:41 +0000 Subject: [PATCH] speedscope 1.20.0. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4761 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- deps/speedscope/{import.66b10bc4.js => import.7f8cb9f9.js} | 4 ++-- deps/speedscope/index.html | 2 +- deps/speedscope/release.txt | 6 +++--- .../{speedscope.2f0dbaca.js => speedscope.80eb88d2.js} | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) rename deps/speedscope/{import.66b10bc4.js => import.7f8cb9f9.js} (98%) rename deps/speedscope/{speedscope.2f0dbaca.js => speedscope.80eb88d2.js} (99%) diff --git a/deps/speedscope/import.66b10bc4.js b/deps/speedscope/import.7f8cb9f9.js similarity index 98% rename from deps/speedscope/import.66b10bc4.js rename to deps/speedscope/import.7f8cb9f9.js index 077d557e..3ae57011 100644 --- a/deps/speedscope/import.66b10bc4.js +++ b/deps/speedscope/import.7f8cb9f9.js @@ -112,7 +112,7 @@ module.exports=t;var i=null;try{i=new WebAssembly.Instance(new WebAssembly.Modul },{"./profile.proto.js":"YdJi","../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4","long":"YvD4"}],"bNW7":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromChromeHeapProfile=i;var e=require("../lib/profile"),t=require("../lib/utils"),r=require("../lib/value-formatters");const n=new Map;function o(e){return(0,t.getOrInsert)(n,e,e=>{const t=e.url,r=e.lineNumber,n=e.columnNumber,o=e.functionName||(t?`(anonymous ${t.split("/").pop()}:${r})`:"(anonymous)");return{key:`${o}:${t}:${r}:${n}`,name:o,file:t,line:r,col:n}})}function i(t){const n=new Map;let i=0;const l=(e,t)=>{e.id=i++,n.set(e.id,e),t&&(e.parent=t.id),e.children.forEach(t=>l(t,e))};l(t.head);const s=e=>{if(0===e.children.length)return e.selfSize||0;const t=e.children.reduce((e,t)=>e+=s(t),e.selfSize);return e.totalSize=t,t},u=s(t.head),a=[];for(let e of n.values()){let t=[];for(t.push(e);void 0!==e.parent;){const r=n.get(e.parent);if(void 0===r)break;t.unshift(r),e=r}a.push(t)}const c=new e.StackListProfileBuilder(u);for(let e of a){const t=e[e.length-1];c.appendSampleWithWeight(e.map(e=>o(e.callFrame)),t.selfSize)}return c.setValueFormatter(new r.ByteFormatter),c.build()} },{"../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4"}],"KFvE":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isTraceEventFormatted=B,exports.importTraceEvents=F;var e,t=require("../lib/utils"),n=require("../lib/profile"),r=require("../lib/value-formatters");!function(e){e.HERMES="HERMES",e.UNKNOWN="UNKNOWN"}(e||(e={}));const s=["line","column","name","category","url","params","allocatedCategory","allocatedName"];function o(e,n){return`${(0,t.zeroPad)(""+e,10)}:${(0,t.zeroPad)(""+n,10)}`}function a(e){const n=new Map;for(let r of e){(0,t.getOrInsert)(n,o(Number(r.pid),Number(r.tid)),()=>[]).push(r)}return n}function i(e,t){if(0===e.length&&0===t.length)throw new Error("This method should not be given both queues empty");if(0===t.length)return"B";if(0===e.length)return"E";const n=e[0],r=t[0],s=n.ts,o=r.ts;return s0){let t=Number.MAX_SAFE_INTEGER;for(let n of e)t=Math.min(t,n.ts);for(let n of e)n.ts-=t}const r=[];for(let a of e)switch(a.ph){case"B":t.push(a);break;case"E":n.push(a);break;case"X":r.push(a);break;default:return a}function s(e){var t,n;return null!==(n=null!==(t=e.dur)&&void 0!==t?t:e.tdur)&&void 0!==n?n:0}r.sort((e,t)=>{if(e.tst.ts)return 1;const n=s(e),r=s(t);return n>r?-1:nt.ts?1:0}return t.sort(o),n.sort(o),[t,n]}function c(e){const t=[];for(let n of e)switch(n.ph){case"B":case"E":case"X":t.push(n)}return t}function f(e){const t=new Map;for(let n of e)"M"===n.ph&&"process_name"===n.name&&n.args&&n.args.name&&t.set(n.pid,n.args.name);return t}function l(e){const t=new Map;for(let n of e)"M"===n.ph&&"thread_name"===n.name&&n.args&&n.args.name&&t.set(o(n.pid,n.tid),n.args.name);return t}function h(e){return`${e.name||"(unnamed)"}`}function m(e){let t=h(e);return e.args&&(t+=` ${JSON.stringify(e.args)}`),t}function d(t,n=e.UNKNOWN){if(n===e.HERMES){const e=`${t.name}:${t.args.url}:${t.args.line}:${t.args.column}`;return{name:h(t),key:e,file:t.args.url,line:t.args.line,col:t.args.column}}const r=m(t);return{name:r,key:r}}function p(e,t){const n=f(e),r=l(e),s=new Map;return t.forEach(e=>{if(0===e.length)return;const{pid:t,tid:a}=e[0],i=o(t,a),u=n.get(t),c=r.get(i);null!=u&&null!=c?s.set(i,`${u} (pid ${t}), ${c} (tid ${a})`):null!=u?s.set(i,`${u} (pid ${t}, tid ${a})`):null!=c?s.set(i,`${c} (pid ${t}, tid ${a})`):s.set(i,`pid ${t}, tid ${a}`)}),s}function g(s,o,a=e.UNKNOWN){const[c,f]=u(s),l=new n.CallTreeProfileBuilder;l.setValueFormatter(new r.TimeFormatter("microseconds")),l.setName(o);const h=[],m=e=>{const n=(0,t.lastOf)(h);if(null==n)return void console.warn(`Tried to end frame "${d(e,a).key}", but the stack was empty. Doing nothing instead.`);const r=d(e,a),s=d(n,a);e.name===n.name?(r.key!==s.key&&console.warn(`ts=${e.ts}: Tried to end "${r.key}" when "${s.key}" was on the top of the stack. Ending ${s.key} instead.`),h.pop(),l.leaveFrame(s,e.ts)):console.warn(`ts=${e.ts}: Tried to end "${r.key}" when "${s.key}" was on the top of the stack. Doing nothing instead.`)};for(;c.length>0||f.length>0;){const e=i(c,f);switch(e){case"B":p=c.shift(),h.push(p),l.enterFrame(d(p,a),p.ts);break;case"E":{const e=(0,t.lastOf)(h);if(null!=e){const t=d(e,a);let n=!1;for(let e=1;ef[0].ts)break;const s=d(r,a);if(t.key===s.key){const t=f[0];f[0]=f[e],f[e]=t,n=!0;break}}if(!n)for(let r=1;rf[0].ts)break;if(t.name===e.name){const e=f[0];f[0]=f[r],f[r]=e,n=!0;break}}}m(f.shift());break}default:return e}}var p;for(let e=h.length-1;e>=0;e--){const t=d(h[e],a);console.warn(`Frame "${t.key}" was still open at end of profile. Closing automatically.`),l.leaveFrame(t,l.getTotalWeight())}return l.build()}function E(e){const t=[];let n=Number(e[0].ts);return e.forEach((e,r)=>{if(0===r)return;const s=Number(e.ts)-n;n=Number(e.ts),t.push(s)}),t.push(0),t}function $({name:e,category:t}){return{key:`${e}:${t}`,name:e}}function w(e,t){const n=[];let r=t;for(;r;){const t=e[r];if(!t)throw new Error(`Could not find frame for id ${r}`);n.push($(t)),r=t.parent}return n.reverse()}function k(e,t,s){const o=new n.StackListProfileBuilder;o.setValueFormatter(new r.TimeFormatter("microseconds")),o.setName(s);const a=E(t);return t.forEach((t,n)=>{const r=a[n],s=w(e.stackFrames,t.sf);o.appendSampleWithWeight(s,r)}),o.build()}function y(n,r=e.UNKNOWN){const s=a(c(n)),o=p(n,s),i=[];return o.forEach((e,t)=>{const n=s.get(t);if(!n)throw new Error(`Could not find events for key: ${n}`);i.push([t,g(n,e,r)])}),(0,t.sortBy)(i,e=>e[0]),{name:"",indexToView:0,profiles:i.map(e=>e[1])}}function b(e){const n=a(c(e.traceEvents)),r=a(e.samples),s=p(e.traceEvents,n),o=[];return s.forEach((t,n)=>{const s=r.get(n);if(!s)throw new Error(`Could not find samples for key: ${s}`);0!==s.length&&o.push([n,k(e,s,t)])}),(0,t.sortBy)(o,e=>e[0]),{name:"",indexToView:0,profiles:o.map(e=>e[1])}}function N(e){if(!Array.isArray(e))return!1;if(0===e.length)return!1;for(let t of e){if(!("ph"in t))return!1;switch(t.ph){case"B":case"E":case"X":if(!("ts"in t))return!1}}return!0}function v(e){return!!e&&s.every(t=>t in e)}function O(e){return!!N(e)&&v(e[0].args)}function M(e){return"traceEvents"in e&&N(e.traceEvents)}function T(e){return"traceEvents"in e&&"stackFrames"in e&&"samples"in e&&N(e.traceEvents)}function B(e){return M(e)||N(e)}function F(t){if(T(t))return b(t);if(M(t))return y(t.traceEvents);if(O(t))return y(t,e.HERMES);if(N(t))return y(t);return t} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isTraceEventFormatted=S,exports.importTraceEvents=W;var e,t=require("../lib/utils"),n=require("../lib/profile"),r=require("../lib/value-formatters");!function(e){e.HERMES="HERMES",e.UNKNOWN="UNKNOWN"}(e||(e={}));const s=["line","column","name","category","url","params","allocatedCategory","allocatedName"];function o(e,n){return`${(0,t.zeroPad)(""+e,10)}:${(0,t.zeroPad)(""+n,10)}`}function i(e){const n=new Map;for(let r of e){(0,t.getOrInsert)(n,o(Number(r.pid),Number(r.tid)),()=>[]).push(r)}return n}function a(e,t){if(0===e.length&&0===t.length)throw new Error("This method should not be given both queues empty");if(0===t.length)return"B";if(0===e.length)return"E";const n=e[0],r=t[0],s=n.ts,o=r.ts;return s0){let t=Number.MAX_SAFE_INTEGER;for(let n of e)t=Math.min(t,n.ts);for(let n of e)n.ts-=t}const r=[];for(let i of e)switch(i.ph){case"B":t.push(i);break;case"E":n.push(i);break;case"X":r.push(i);break;default:return i}function s(e){var t,n;return null!==(n=null!==(t=e.dur)&&void 0!==t?t:e.tdur)&&void 0!==n?n:0}r.sort((e,t)=>{if(e.tst.ts)return 1;const n=s(e),r=s(t);return n>r?-1:nt.ts?1:0}return t.sort(o),n.sort(o),[t,n]}function c(e){const t=[];for(let n of e)switch(n.ph){case"B":case"E":case"X":t.push(n)}return t}function f(e){const t=new Map;for(let n of e)"M"===n.ph&&"process_name"===n.name&&n.args&&n.args.name&&t.set(n.pid,n.args.name);return t}function l(e){const t=new Map;for(let n of e)"M"===n.ph&&"thread_name"===n.name&&n.args&&n.args.name&&t.set(o(n.pid,n.tid),n.args.name);return t}function h(e){return`${e.name||"(unnamed)"}`}function m(e){let t=h(e);return e.args&&(t+=` ${JSON.stringify(e.args)}`),t}function d(t,n=e.UNKNOWN){if(n===e.HERMES){const e=`${t.name}:${t.args.url}:${t.args.line}:${t.args.column}`;return{name:h(t),key:e,file:t.args.url,line:t.args.line,col:t.args.column}}const r=m(t);return{name:r,key:r}}function p(e,t,n,r){return null!=e&&null!=t?`${e} (pid ${n}), ${t} (tid ${r})`:null!=e?`${e} (pid ${n}, tid ${r})`:null!=t?`${t} (pid ${n}, tid ${r})`:`pid ${n}, tid ${r}`}function g(e,t){const n=f(e),r=l(e),s=new Map;return t.forEach(e=>{if(0===e.length)return;const t=Number(e[0].pid),i=Number(e[0].tid),a=o(t,i),u=p(n.get(t),r.get(a),t,i);s.set(a,u)}),s}function E(e,t){const n=f(e),r=l(e),s=new Map;return t.forEach(e=>{if(0===e.length)return;const{pid:t,tid:i}=e[0],a=o(t,i),u=p(n.get(t),r.get(a),t,i);s.set(a,u)}),s}function $(s,o,i=e.UNKNOWN){const[c,f]=u(s),l=new n.CallTreeProfileBuilder;l.setValueFormatter(new r.TimeFormatter("microseconds")),l.setName(o);const h=[],m=e=>{const n=(0,t.lastOf)(h);if(null==n)return void console.warn(`Tried to end frame "${d(e,i).key}", but the stack was empty. Doing nothing instead.`);const r=d(e,i),s=d(n,i);e.name===n.name?(r.key!==s.key&&console.warn(`ts=${e.ts}: Tried to end "${r.key}" when "${s.key}" was on the top of the stack. Ending ${s.key} instead.`),h.pop(),l.leaveFrame(s,e.ts)):console.warn(`ts=${e.ts}: Tried to end "${r.key}" when "${s.key}" was on the top of the stack. Doing nothing instead.`)};for(;c.length>0||f.length>0;){const e=a(c,f);switch(e){case"B":p=c.shift(),h.push(p),l.enterFrame(d(p,i),p.ts);break;case"E":{const e=(0,t.lastOf)(h);if(null!=e){const t=d(e,i);let n=!1;for(let e=1;ef[0].ts)break;const s=d(r,i);if(t.key===s.key){const t=f[0];f[0]=f[e],f[e]=t,n=!0;break}}if(!n)for(let r=1;rf[0].ts)break;if(t.name===e.name){const e=f[0];f[0]=f[r],f[r]=e,n=!0;break}}}m(f.shift());break}default:return e}}var p;for(let e=h.length-1;e>=0;e--){const t=d(h[e],i);console.warn(`Frame "${t.key}" was still open at end of profile. Closing automatically.`),l.leaveFrame(t,l.getTotalWeight())}return l.build()}function w(e){const t=[];let n=Number(e[0].ts);return e.forEach((e,r)=>{if(0===r)return;const s=Number(e.ts)-n;n=Number(e.ts),t.push(s)}),t.push(0),t}function k({name:e,category:t}){return{key:`${e}:${t}`,name:e}}function b(e,t){const n=[];let r=t;for(;r;){const t=e[r];if(!t)throw new Error(`Could not find frame for id ${r}`);n.push(k(t)),r=t.parent}return n.reverse()}function y(e,t,s){const o=new n.StackListProfileBuilder;o.setValueFormatter(new r.TimeFormatter("microseconds")),o.setName(s);const i=w(t);return t.forEach((t,n)=>{const r=i[n],s=b(e.stackFrames,t.sf);o.appendSampleWithWeight(s,r)}),o.build()}function N(n,r=e.UNKNOWN){const s=i(c(n)),o=E(n,s),a=[];return o.forEach((e,t)=>{const n=s.get(t);if(!n)throw new Error(`Could not find events for key: ${n}`);a.push([t,$(n,e,r)])}),(0,t.sortBy)(a,e=>e[0]),{name:"",indexToView:0,profiles:a.map(e=>e[1])}}function v(e){const n=i(e.samples),r=g(e.traceEvents,n),s=[];return r.forEach((t,r)=>{const o=n.get(r);if(!o)throw new Error(`Could not find samples for key: ${o}`);0!==o.length&&s.push([r,y(e,o,t)])}),(0,t.sortBy)(s,e=>e[0]),{name:"",indexToView:0,profiles:s.map(e=>e[1])}}function M(e){if(!Array.isArray(e))return!1;if(0===e.length)return!1;for(let t of e){if(!("ph"in t))return!1;switch(t.ph){case"B":case"E":case"X":if(!("ts"in t))return!1}}return!0}function O(e){return!!e&&s.every(t=>t in e)}function T(e){return!!M(e)&&O(e[0].args)}function B(e){return"traceEvents"in e&&M(e.traceEvents)}function F(e){return"traceEvents"in e&&"stackFrames"in e&&"samples"in e&&M(e.traceEvents)}function S(e){return B(e)||M(e)}function W(t){if(F(t))return v(t);if(B(t))return N(t.traceEvents);if(T(t))return N(t,e.HERMES);if(M(t))return N(t);return t} },{"../lib/utils":"ucYa","../lib/profile":"YG8z","../lib/value-formatters":"LsM4"}],"TZYa":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromCallgrind=r;var e=require("../lib/profile"),t=require("../lib/utils"),i=require("../lib/value-formatters");class s{constructor(e,i){this.fileName=e,this.fieldName=i,this.frameSet=new t.KeyedSet,this.totalWeights=new Map,this.childrenTotalWeights=new Map}getOrInsertFrame(t){return e.Frame.getOrInsert(this.frameSet,t)}addToTotalWeight(e,t){this.totalWeights.has(e)?this.totalWeights.set(e,this.totalWeights.get(e)+t):this.totalWeights.set(e,t)}addSelfWeight(e,t){this.addToTotalWeight(this.getOrInsertFrame(e),t)}addChildWithTotalWeight(e,i,s){const n=this.getOrInsertFrame(e),r=this.getOrInsertFrame(i),a=(0,t.getOrInsert)(this.childrenTotalWeights,n,e=>new Map);a.has(r)?a.set(r,a.get(r)+s):a.set(r,s),this.addToTotalWeight(n,s)}toProfile(){const s=new e.CallTreeProfileBuilder;let n=1;"Time_(10ns)"===this.fieldName?(s.setName(`${this.fileName} -- Time`),n=10,s.setValueFormatter(new i.TimeFormatter("nanoseconds"))):"Memory_(bytes)"==this.fieldName?(s.setName(`${this.fileName} -- Memory`),s.setValueFormatter(new i.ByteFormatter)):s.setName(`${this.fileName} -- ${this.fieldName}`);let r=0;const a=new Set;let l=0;for(let[e,t]of this.totalWeights)l=Math.max(l,t);const o=(e,i)=>{if(a.has(e))return;if(i<1e-4*l)return;const h=(0,t.getOrElse)(this.totalWeights,e,()=>0);if(0===h)return;let m=i;s.enterFrame(e,Math.round(r*n)),a.add(e);for(let[t,s]of this.childrenTotalWeights.get(e)||[]){let e=r;o(t,i*(s/h)),m-=r-e}a.delete(e),r+=m,s.leaveFrame(e,Math.round(r*n))},h=new Set(this.frameSet);for(let[e,t]of this.childrenTotalWeights)for(let[i,s]of t)h.delete(i);for(let e of h)o(e,this.totalWeights.get(e));return s.build()}}class n{constructor(e,t){this.importedFileName=t,this.callGraphs=null,this.eventsLine=null,this.filename=null,this.functionName=null,this.calleeFilename=null,this.calleeFunctionName=null,this.savedFileNames={},this.savedFunctionNames={},this.prevCostLineNumbers=[],this.lines=[...e.splitLines()],this.lineNum=0}parse(){for(;this.lineNume.toProfile())}:null}frameInfo(){const e=this.filename||"(unknown)",t=this.functionName||"(unknown)";return{key:`${e}:${t}`,name:t,file:e}}calleeFrameInfo(){const e=this.calleeFilename||this.filename||"(unknown)",t=this.calleeFunctionName||"(unknown)";return{key:`${e}:${t}`,name:t,file:e}}parseHeaderLine(e){const t=/^\s*(\w+):\s*(.*)+$/.exec(e);if(!t)return!1;if("events"!==t[1])return!0;const i=t[2].split(" ");if(null!=this.callGraphs)throw new Error(`Duplicate "events: " lines specified. First was "${this.eventsLine}", now received "${e}" on ${this.lineNum}.`);return this.callGraphs=i.map(e=>new s(this.importedFileName,e)),!0}parseAssignmentLine(e){const t=/^(\w+)=\s*(.*)$/.exec(e);if(!t)return!1;const i=t[1],s=t[2];switch(i){case"fe":case"fi":this.parseNameWithCompression(s,this.savedFileNames);break;case"fl":this.filename=this.parseNameWithCompression(s,this.savedFileNames);break;case"fn":this.functionName=this.parseNameWithCompression(s,this.savedFunctionNames);break;case"cfi":case"cfl":this.calleeFilename=this.parseNameWithCompression(s,this.savedFileNames);break;case"cfn":this.calleeFunctionName=this.parseNameWithCompression(s,this.savedFunctionNames);break;case"calls":this.parseCostLine(this.lines[this.lineNum++],"child"),this.calleeFilename=null,this.calleeFunctionName=null;break;case"cob":case"ob":break;default:console.log(`Ignoring assignment to unrecognized key "${e}" on line ${this.lineNum}`)}return!0}parseNameWithCompression(e,t){{const i=/^\((\d+)\)\s*(.+)$/.exec(e);if(i){const e=i[1],s=i[2];if(e in t)throw new Error(`Redefinition of name with id: ${e}. Original value was "${t[e]}". Tried to redefine as "${s}" on line ${this.lineNum}.`);return t[e]=s,s}}{const i=/^\((\d+)\)$/.exec(e);if(i){const e=i[1];if(!(e in t))throw new Error(`Tried to use name with id ${e} on line ${this.lineNum} before it was defined.`);return t[e]}}return e}parseCostLine(e,t){const i=e.split(/\s+/),s=[];for(let n=0;nspeedscope +speedscope \ No newline at end of file diff --git a/deps/speedscope/release.txt b/deps/speedscope/release.txt index 26b23261..3cef8f97 100644 --- a/deps/speedscope/release.txt +++ b/deps/speedscope/release.txt @@ -1,3 +1,3 @@ -speedscope@1.19.0 -Wed Dec 27 23:57:31 EST 2023 -a3c0b15935fe125130ef371ec79dbe1c5e744b63 +speedscope@1.20.0 +Fri Jan 12 09:57:49 PST 2024 +68fd88ceaf93d89aa27f3f0a20a27c9cfdc015c5 diff --git a/deps/speedscope/speedscope.2f0dbaca.js b/deps/speedscope/speedscope.80eb88d2.js similarity index 99% rename from deps/speedscope/speedscope.2f0dbaca.js rename to deps/speedscope/speedscope.80eb88d2.js index 5f832332..b44bff41 100644 --- a/deps/speedscope/speedscope.2f0dbaca.js +++ b/deps/speedscope/speedscope.80eb88d2.js @@ -166,7 +166,7 @@ var r=require("./bundle-url").getBundleURL;function e(r){Array.isArray(r)||(r=[r },{"./utils":"ucYa","./value-formatters":"LsM4","_bundle_loader":"TUK3","./demangle-cpp":[["demangle-cpp.1768f4cc.js","bS28"],"demangle-cpp.1768f4cc.js.map","bS28"]}],"x8nU":[function(require,module,exports) { "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileFormat=void 0,exports.FileFormat=e,function(e){let t,o;!function(e){e.EVENTED="evented",e.SAMPLED="sampled"}(t=e.ProfileType||(e.ProfileType={})),function(e){e.OPEN_FRAME="O",e.CLOSE_FRAME="C"}(o=e.EventType||(e.EventType={}))}(e||(exports.FileFormat=e={})); },{}],"EHrm":[function(require,module,exports) { -module.exports={name:"speedscope",version:"1.19.0",description:"",repository:"jlfwong/speedscope",main:"index.js",bin:{speedscope:"./bin/cli.js"},scripts:{deploy:"./scripts/deploy.sh",prepack:"./scripts/build-release.sh",prettier:"prettier --write 'src/**/*.ts' 'src/**/*.tsx'",lint:"eslint 'src/**/*.ts' 'src/**/*.tsx'",jest:"./scripts/test-setup.sh && jest --runInBand",coverage:"npm run jest -- --coverage",typecheck:"tsc --noEmit",test:"./scripts/ci.sh",serve:"parcel assets/index.html --open --no-autoinstall"},files:["bin/cli.js","dist/release/**","!*.map"],browserslist:["last 2 Chrome versions","last 2 Firefox versions"],author:"",license:"MIT",devDependencies:{"@types/jest":"22.2.3","@types/jszip":"3.1.4","@types/node":"14.0.1","@types/pako":"1.0.0","@typescript-eslint/eslint-plugin":"6.16.0","@typescript-eslint/parser":"6.16.0",acorn:"7.2.0",aphrodite:"2.1.0",eslint:"8.0.0","eslint-plugin-prettier":"5.1.2","eslint-plugin-react-hooks":"4.6.0",jest:"24.3.0",jsverify:"0.8.3",jszip:"3.1.5",pako:"1.0.6","parcel-bundler":"1.12.4",preact:"10.4.1",prettier:"3.1.1",protobufjs:"6.8.8","source-map":"0.6.1","ts-jest":"24.3.0",typescript:"5.3.3","typescript-json-schema":"0.42.0","uglify-es":"3.2.2","uint8array-json-parser":"0.0.2"},jest:{transform:{"^.+\\.tsx?$":"ts-jest"},setupFilesAfterEnv:["./src/jest-setup.js"],testRegex:"\\.test\\.tsx?$",collectCoverageFrom:["**/*.{ts,tsx}","!**/*.d.{ts,tsx}"],moduleFileExtensions:["ts","tsx","js","jsx","json"]},dependencies:{open:"7.2.0"}}; +module.exports={name:"speedscope",version:"1.20.0",description:"",repository:"jlfwong/speedscope",main:"index.js",bin:{speedscope:"./bin/cli.js"},scripts:{deploy:"./scripts/deploy.sh",prepack:"./scripts/build-release.sh",prettier:"prettier --write 'src/**/*.ts' 'src/**/*.tsx'",lint:"eslint 'src/**/*.ts' 'src/**/*.tsx'",jest:"./scripts/test-setup.sh && jest --runInBand",coverage:"npm run jest -- --coverage",typecheck:"tsc --noEmit",test:"./scripts/ci.sh",serve:"parcel assets/index.html --open --no-autoinstall"},files:["bin/cli.js","dist/release/**","!*.map"],browserslist:["last 2 Chrome versions","last 2 Firefox versions"],author:"",license:"MIT",devDependencies:{"@types/jest":"22.2.3","@types/jszip":"3.1.4","@types/node":"14.0.1","@types/pako":"1.0.0","@typescript-eslint/eslint-plugin":"6.16.0","@typescript-eslint/parser":"6.16.0",acorn:"7.2.0",aphrodite:"2.1.0",eslint:"8.0.0","eslint-plugin-prettier":"5.1.2","eslint-plugin-react-hooks":"4.6.0",jest:"24.3.0",jsverify:"0.8.3",jszip:"3.1.5",pako:"1.0.6","parcel-bundler":"1.12.4",preact:"10.4.1",prettier:"3.1.1",protobufjs:"6.8.8","source-map":"0.6.1","ts-jest":"24.3.0",typescript:"5.3.3","typescript-json-schema":"0.42.0","uglify-es":"3.2.2","uint8array-json-parser":"0.0.2"},jest:{transform:{"^.+\\.tsx?$":"ts-jest"},setupFilesAfterEnv:["./src/jest-setup.js"],testRegex:"\\.test\\.tsx?$",collectCoverageFrom:["**/*.{ts,tsx}","!**/*.d.{ts,tsx}"],moduleFileExtensions:["ts","tsx","js","jsx","json"]},dependencies:{open:"7.2.0"}}; },{}],"Xzb6":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.exportProfileGroup=r,exports.importSpeedscopeProfiles=s,exports.saveToFile=l;var e=require("./profile"),t=require("./value-formatters"),n=require("./file-format-spec");function r(e){const t=[],n=new Map;function r(e){let r=n.get(e);if(null==r){const o={name:e.name};null!=e.file&&(o.file=e.file),null!=e.line&&(o.line=e.line),null!=e.col&&(o.col=e.col),r=t.length,n.set(e,r),t.push(o)}return r}const a={exporter:`speedscope@${require("../../package.json").version}`,name:e.name,activeProfileIndex:e.indexToView,$schema:"https://www.speedscope.app/file-format-schema.json",shared:{frames:t},profiles:[]};for(let s of e.profiles)a.profiles.push(o(s,r));return a}function o(e,t){const r={type:n.FileFormat.ProfileType.EVENTED,name:e.getName(),unit:e.getWeightUnit(),startValue:0,endValue:e.getTotalWeight(),events:[]};return e.forEachCall((e,o)=>{r.events.push({type:n.FileFormat.EventType.OPEN_FRAME,frame:t(e.frame),at:o})},(e,o)=>{r.events.push({type:n.FileFormat.EventType.CLOSE_FRAME,frame:t(e.frame),at:o})}),r}function a(r,o){function a(e){const{name:n,unit:o}=r;switch(o){case"nanoseconds":case"microseconds":case"milliseconds":case"seconds":e.setValueFormatter(new t.TimeFormatter(o));break;case"bytes":e.setValueFormatter(new t.ByteFormatter);break;case"none":e.setValueFormatter(new t.RawValueFormatter)}e.setName(n)}switch(r.type){case n.FileFormat.ProfileType.EVENTED:return function(t){const{startValue:r,endValue:s,events:l}=t,i=new e.CallTreeProfileBuilder(s-r);a(i);const c=o.map((e,t)=>Object.assign({key:t},e));for(let e of l)switch(e.type){case n.FileFormat.EventType.OPEN_FRAME:i.enterFrame(c[e.frame],e.at-r);break;case n.FileFormat.EventType.CLOSE_FRAME:i.leaveFrame(c[e.frame],e.at-r)}return i.build()}(r);case n.FileFormat.ProfileType.SAMPLED:return function(t){const{startValue:n,endValue:r,samples:s,weights:l}=t,i=new e.StackListProfileBuilder(r-n);a(i);const c=o.map((e,t)=>Object.assign({key:t},e));if(s.length!==l.length)throw new Error(`Expected samples.length (${s.length}) to equal weights.length (${l.length})`);for(let e=0;ec[e]),n)}return i.build()}(r)}}function s(e){return{name:e.name||e.profiles[0].name||"profile",indexToView:e.activeProfileIndex||0,profiles:e.profiles.map(t=>a(t,e.shared.frames))}}function l(e){const t=r(e),n=new Blob([JSON.stringify(t)],{type:"text/json"}),o=`${(t.name?t.name.split(".")[0]:"profile").replace(/\W+/g,"_")}.speedscope.json`;console.log("Saving",o);const a=document.createElement("a");a.download=o,a.href=window.URL.createObjectURL(n),a.dataset.downloadurl=["text/json",a.download,a.href].join(":"),document.body.appendChild(a),a.click(),document.body.removeChild(a)} },{"./profile":"YG8z","./value-formatters":"LsM4","./file-format-spec":"x8nU","../../package.json":"EHrm"}],"C6HJ":[function(require,module,exports) { @@ -181,7 +181,7 @@ module.exports={name:"speedscope",version:"1.19.0",description:"",repository:"jl module.exports="perf-vertx-stacks-01-collapsed-all.2681da68.txt"; },{}],"wCGh":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Application=exports.GLCanvas=void 0;var e=require("preact"),t=require("aphrodite"),o=require("./style"),i=require("../lib/emscripten"),r=require("./sandwich-view"),s=require("../lib/file-format"),n=require("./flamechart-view-container"),a=require("./toolbar"),l=require("../lib/js-source-map"),c=require("./themes/theme"),p=require("../lib/view-mode"),d=require("../app-state"),h=require("../lib/preact-helpers"),u=function(e,t,o,i){return new(o||(o=Promise))(function(r,s){function n(e){try{l(i.next(e))}catch(t){s(t)}}function a(e){try{l(i.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(n,a)}l((i=i.apply(e,t||[])).next())})};const m=require("_bundle_loader")(require.resolve("../import"));function f(e,t){return u(this,void 0,void 0,function*(){return(yield m).importProfileGroupFromText(e,t)})}function v(e,t){return u(this,void 0,void 0,function*(){return(yield m).importProfileGroupFromBase64(e,t)})}function g(e,t){return u(this,void 0,void 0,function*(){return(yield m).importProfilesFromArrayBuffer(e,t)})}function w(e){return u(this,void 0,void 0,function*(){return(yield m).importProfilesFromFile(e)})}function y(e){return u(this,void 0,void 0,function*(){return(yield m).importFromFileSystemDirectoryEntry(e)})}m.then(()=>{}),require("_bundle_loader")(require.resolve("../lib/demangle-cpp")).then(()=>{}),require("_bundle_loader")(require.resolve("source-map")).then(()=>{});const b=require("../../sample/profiles/stackcollapse/perf-vertx-stacks-01-collapsed-all.txt");function x(e){return null!=e&&e.isDirectory}class C extends h.StatelessComponent{constructor(){super(...arguments),this.canvas=null,this.ref=(e=>{e instanceof HTMLCanvasElement?this.canvas=e:this.canvas=null,this.props.setGLCanvas(this.canvas)}),this.container=null,this.containerRef=(e=>{e instanceof HTMLElement?this.container=e:this.container=null}),this.maybeResize=(()=>{if(!this.container)return;if(!this.props.canvasContext)return;let{width:e,height:t}=this.container.getBoundingClientRect();const o=e,i=t,r=e*window.devicePixelRatio,s=t*window.devicePixelRatio;this.props.canvasContext.gl.resize(r,s,o,i)}),this.onWindowResize=(()=>{this.props.canvasContext&&this.props.canvasContext.requestFrame()})}componentWillReceiveProps(e){this.props.canvasContext!==e.canvasContext&&(this.props.canvasContext&&this.props.canvasContext.removeBeforeFrameHandler(this.maybeResize),e.canvasContext&&(e.canvasContext.addBeforeFrameHandler(this.maybeResize),e.canvasContext.requestFrame()))}componentDidMount(){window.addEventListener("resize",this.onWindowResize)}componentWillUnmount(){this.props.canvasContext&&this.props.canvasContext.removeBeforeFrameHandler(this.maybeResize),window.removeEventListener("resize",this.onWindowResize)}render(){const o=F(this.props.theme);return(0,e.h)("div",{ref:this.containerRef,className:(0,t.css)(o.glCanvasView)},(0,e.h)("canvas",{ref:this.ref,width:1,height:1}))}}exports.GLCanvas=C;class P extends h.StatelessComponent{constructor(){super(...arguments),this.loadExample=(()=>{this.loadProfile(()=>u(this,void 0,void 0,function*(){const e=yield fetch(b).then(e=>e.text());return yield f("perf-vertx-stacks-01-collapsed-all.txt",e)}))}),this.onDrop=(e=>{if(this.props.setDragActive(!1),e.preventDefault(),!e.dataTransfer)return;const t=e.dataTransfer.items[0];if("webkitGetAsEntry"in t){const e=t.webkitGetAsEntry();if(e&&x(e)&&e.name.endsWith(".trace")){console.log("Importing as Instruments.app .trace file");const t=e;return void this.loadProfile(()=>u(this,void 0,void 0,function*(){return yield y(t)}))}}let o=e.dataTransfer.files.item(0);o&&this.loadFromFile(o)}),this.onDragOver=(e=>{this.props.setDragActive(!0),e.preventDefault()}),this.onDragLeave=(e=>{this.props.setDragActive(!1),e.preventDefault()}),this.onWindowKeyPress=(e=>u(this,void 0,void 0,function*(){if("1"===e.key)this.props.setViewMode(p.ViewMode.CHRONO_FLAME_CHART);else if("2"===e.key)this.props.setViewMode(p.ViewMode.LEFT_HEAVY_FLAME_GRAPH);else if("3"===e.key)this.props.setViewMode(p.ViewMode.SANDWICH_VIEW);else if("r"===e.key){const{flattenRecursion:e}=this.props;this.props.setFlattenRecursion(!e)}else if("n"===e.key){const{activeProfileState:e}=this.props;e&&this.props.setProfileIndexToView(e.index+1)}else if("p"===e.key){const{activeProfileState:e}=this.props;e&&this.props.setProfileIndexToView(e.index-1)}})),this.saveFile=(()=>{if(this.props.profileGroup){const{name:e,indexToView:t,profiles:o}=this.props.profileGroup,i={name:e,indexToView:t,profiles:o.map(e=>e.profile)};(0,s.saveToFile)(i)}}),this.browseForFile=(()=>{const e=document.createElement("input");e.type="file",e.addEventListener("change",this.onFileSelect),e.click()}),this.onWindowKeyDown=(e=>u(this,void 0,void 0,function*(){"s"===e.key&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),this.saveFile()):"o"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.browseForFile())})),this.onDocumentPaste=(e=>{if(null!=document.activeElement&&"INPUT"===document.activeElement.nodeName)return;e.preventDefault(),e.stopPropagation();const t=e.clipboardData;if(!t)return;const o=t.getData("text");this.loadProfile(()=>u(this,void 0,void 0,function*(){return yield f("From Clipboard",o)}))}),this.onFileSelect=(e=>{const t=e.target.files.item(0);t&&this.loadFromFile(t)})}loadProfile(e){return u(this,void 0,void 0,function*(){if(this.props.setLoading(!0),yield new Promise(e=>setTimeout(e,0)),!this.props.glCanvas)return;console.time("import");let t=null;try{t=yield e()}catch(o){return console.log("Failed to load format",o),void this.props.setError(!0)}if(null==t)return alert("Unrecognized format! See documentation about supported formats."),void this.props.setLoading(!1);if(0===t.profiles.length)return alert("Successfully imported profile, but it's empty!"),void this.props.setLoading(!1);this.props.hashParams.title&&(t=Object.assign(Object.assign({},t),{name:this.props.hashParams.title})),document.title=`${t.name} - speedscope`,this.props.hashParams.viewMode&&this.props.setViewMode(this.props.hashParams.viewMode);for(let e of t.profiles)yield e.demangle();for(let e of t.profiles){const t=this.props.hashParams.title||e.getName();e.setName(t)}console.timeEnd("import"),this.props.setProfileGroup(t),this.props.setLoading(!1)})}getStyle(){return F(this.props.theme)}loadFromFile(e){this.loadProfile(()=>u(this,void 0,void 0,function*(){const t=yield w(e);if(t){for(let o of t.profiles)o.getName()||o.setName(e.name);return t}if(this.props.profileGroup&&this.props.activeProfileState){const t=new FileReader,o=new Promise(e=>{t.addEventListener("loadend",()=>{if("string"!=typeof t.result)throw new Error("Expected reader.result to be a string");e(t.result)})});t.readAsText(e);const r=yield o;let s=null;const n=(0,i.importEmscriptenSymbolMap)(r);n&&(console.log("Importing as emscripten symbol map"),s=n);const a=yield(0,l.importJavaScriptSourceMapSymbolRemapper)(r,e.name);if(!s&&a&&(console.log("Importing as JavaScript source map"),s=a),null!=s)return{name:this.props.profileGroup.name||"profile",indexToView:this.props.profileGroup.indexToView,profiles:this.props.profileGroup.profiles.map(e=>{const t=e.profile.shallowClone();return t.remapSymbols(s),t})}}return null}))}componentDidMount(){window.addEventListener("keydown",this.onWindowKeyDown),window.addEventListener("keypress",this.onWindowKeyPress),document.addEventListener("paste",this.onDocumentPaste),this.maybeLoadHashParamProfile()}componentWillUnmount(){window.removeEventListener("keydown",this.onWindowKeyDown),window.removeEventListener("keypress",this.onWindowKeyPress),document.removeEventListener("paste",this.onDocumentPaste)}maybeLoadHashParamProfile(){return u(this,void 0,void 0,function*(){const{profileURL:e}=this.props.hashParams;if(e){if(!d.canUseXHR)return void alert(`Cannot load a profile URL when loading from "${window.location.protocol}" URL protocol`);this.loadProfile(()=>u(this,void 0,void 0,function*(){const t=yield fetch(e);let o=new URL(e,window.location.href).pathname;return o.includes("/")&&(o=o.slice(o.lastIndexOf("/")+1)),yield g(o,yield t.arrayBuffer())}))}else if(this.props.hashParams.localProfilePath){window.speedscope={loadFileFromBase64:(e,t)=>{this.loadProfile(()=>v(e,t))}};const e=document.createElement("script");e.src=`file:///${this.props.hashParams.localProfilePath}`,document.head.appendChild(e)}})}renderLanding(){const o=this.getStyle();return(0,e.h)("div",{className:(0,t.css)(o.landingContainer)},(0,e.h)("div",{className:(0,t.css)(o.landingMessage)},(0,e.h)("p",{className:(0,t.css)(o.landingP)},"👋 Hi there! Welcome to 🔬speedscope, an interactive"," ",(0,e.h)("a",{className:(0,t.css)(o.link),href:"http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html"},"flamegraph")," ","visualizer. Use it to help you make your software faster."),d.canUseXHR?(0,e.h)("p",{className:(0,t.css)(o.landingP)},"Drag and drop a profile file onto this window to get started, click the big blue button below to browse for a profile to explore, or"," ",(0,e.h)("a",{tabIndex:0,className:(0,t.css)(o.link),onClick:this.loadExample},"click here")," ","to load an example profile."):(0,e.h)("p",{className:(0,t.css)(o.landingP)},"Drag and drop a profile file onto this window to get started, or click the big blue button below to browse for a profile to explore."),(0,e.h)("div",{className:(0,t.css)(o.browseButtonContainer)},(0,e.h)("input",{type:"file",name:"file",id:"file",onChange:this.onFileSelect,className:(0,t.css)(o.hide)}),(0,e.h)("label",{for:"file",className:(0,t.css)(o.browseButton),tabIndex:0},"Browse")),(0,e.h)("p",{className:(0,t.css)(o.landingP)},"See the"," ",(0,e.h)("a",{className:(0,t.css)(o.link),href:"https://github.com/jlfwong/speedscope#usage",target:"_blank"},"documentation")," ","for information about supported file formats, keyboard shortcuts, and how to navigate around the profile."),(0,e.h)("p",{className:(0,t.css)(o.landingP)},"speedscope is open source. Please"," ",(0,e.h)("a",{className:(0,t.css)(o.link),target:"_blank",href:"https://github.com/jlfwong/speedscope/issues"},"report any issues on GitHub"),".")))}renderError(){const o=this.getStyle();return(0,e.h)("div",{className:(0,t.css)(o.error)},(0,e.h)("div",null,"😿 Something went wrong."),(0,e.h)("div",null,"Check the JS console for more details."))}renderLoadingBar(){const o=this.getStyle();return(0,e.h)("div",{className:(0,t.css)(o.loading)})}renderContent(){const{viewMode:t,activeProfileState:o,error:i,loading:s,glCanvas:a}=this.props;if(i)return this.renderError();if(s)return this.renderLoadingBar();if(!o||!a)return this.renderLanding();switch(t){case p.ViewMode.CHRONO_FLAME_CHART:return(0,e.h)(n.ChronoFlamechartView,{activeProfileState:o,glCanvas:a});case p.ViewMode.LEFT_HEAVY_FLAME_GRAPH:return(0,e.h)(n.LeftHeavyFlamechartView,{activeProfileState:o,glCanvas:a});case p.ViewMode.SANDWICH_VIEW:return(0,e.h)(r.SandwichViewContainer,{activeProfileState:o,glCanvas:a})}}render(){const o=this.getStyle();return(0,e.h)("div",{onDrop:this.onDrop,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,className:(0,t.css)(o.root,this.props.dragActive&&o.dragTargetRoot)},(0,e.h)(C,{setGLCanvas:this.props.setGLCanvas,canvasContext:this.props.canvasContext,theme:this.props.theme}),(0,e.h)(a.Toolbar,Object.assign({saveFile:this.saveFile,browseForFile:this.browseForFile},this.props)),(0,e.h)("div",{className:(0,t.css)(o.contentContainer)},this.renderContent()),this.props.dragActive&&(0,e.h)("div",{className:(0,t.css)(o.dragTarget)}))}}exports.Application=P;const F=(0,c.withTheme)(e=>t.StyleSheet.create({glCanvasView:{position:"absolute",width:"100vw",height:"100vh",zIndex:-1,pointerEvents:"none"},error:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%"},loading:{height:3,marginBottom:-3,background:e.selectionPrimaryColor,transformOrigin:"0% 50%",animationName:[{from:{transform:"scaleX(0)"},to:{transform:"scaleX(1)"}}],animationTimingFunction:"cubic-bezier(0, 1, 0, 1)",animationDuration:"30s"},root:{width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",position:"relative",fontFamily:o.FontFamily.MONOSPACE,lineHeight:"20px",color:e.fgPrimaryColor},dragTargetRoot:{cursor:"copy"},dragTarget:{boxSizing:"border-box",position:"absolute",top:0,left:0,width:"100%",height:"100%",border:`5px dashed ${e.selectionPrimaryColor}`,pointerEvents:"none"},contentContainer:{position:"relative",display:"flex",overflow:"hidden",flexDirection:"column",flex:1},landingContainer:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},landingMessage:{maxWidth:600},landingP:{marginBottom:16},hide:{display:"none"},browseButtonContainer:{display:"flex",alignItems:"center",justifyContent:"center"},browseButton:{marginBottom:16,height:72,flex:1,maxWidth:256,textAlign:"center",fontSize:o.FontSize.BIG_BUTTON,lineHeight:"72px",background:e.selectionPrimaryColor,color:e.altFgPrimaryColor,transition:`all ${o.Duration.HOVER_CHANGE} ease-in`,":hover":{background:e.selectionSecondaryColor}},link:{color:e.selectionPrimaryColor,cursor:"pointer",textDecoration:"none",transition:`all ${o.Duration.HOVER_CHANGE} ease-in`,":hover":{color:e.selectionSecondaryColor}}})); -},{"preact":"aSor","aphrodite":"CxN7","./style":"hvr4","../lib/emscripten":"FbpF","./sandwich-view":"L8J2","../lib/file-format":"Xzb6","./flamechart-view-container":"PJJu","./toolbar":"BPHY","../lib/js-source-map":"bv0g","./themes/theme":"gzKG","../lib/view-mode":"dpTI","../app-state":"LDQe","../lib/preact-helpers":"Hete","_bundle_loader":"TUK3","../import":[["import.66b10bc4.js","uRa7"],"import.66b10bc4.js.map","uRa7"],"../lib/demangle-cpp":[["demangle-cpp.1768f4cc.js","bS28"],"demangle-cpp.1768f4cc.js.map","bS28"],"source-map":[["source-map.438fa06b.js","aRf0"],"source-map.438fa06b.js.map","aRf0"],"../../sample/profiles/stackcollapse/perf-vertx-stacks-01-collapsed-all.txt":"ThNa"}],"A6uO":[function(require,module,exports) { +},{"preact":"aSor","aphrodite":"CxN7","./style":"hvr4","../lib/emscripten":"FbpF","./sandwich-view":"L8J2","../lib/file-format":"Xzb6","./flamechart-view-container":"PJJu","./toolbar":"BPHY","../lib/js-source-map":"bv0g","./themes/theme":"gzKG","../lib/view-mode":"dpTI","../app-state":"LDQe","../lib/preact-helpers":"Hete","_bundle_loader":"TUK3","../import":[["import.7f8cb9f9.js","uRa7"],"import.7f8cb9f9.js.map","uRa7"],"../lib/demangle-cpp":[["demangle-cpp.1768f4cc.js","bS28"],"demangle-cpp.1768f4cc.js.map","bS28"],"source-map":[["source-map.438fa06b.js","aRf0"],"source-map.438fa06b.js.map","aRf0"],"../../sample/profiles/stackcollapse/perf-vertx-stacks-01-collapsed-all.txt":"ThNa"}],"A6uO":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApplicationContainer=void 0;var e=require("preact"),t=require("../app-state/getters"),o=require("preact/compat"),r=require("../app-state/active-profile-state"),a=require("./themes/theme"),i=require("../app-state"),s=require("../lib/atom"),n=require("./search-view"),m=require("./application");const u=(0,o.memo)(()=>{const u=(0,s.useAtom)(i.glCanvasAtom),l=(0,a.useTheme)(),p=(0,o.useMemo)(()=>u?(0,t.getCanvasContext)({theme:l,canvas:u}):null,[l,u]);return(0,e.h)(n.ProfileSearchContextProvider,null,(0,e.h)(m.Application,{activeProfileState:(0,r.useActiveProfileState)(),canvasContext:p,setGLCanvas:i.glCanvasAtom.set,setLoading:i.loadingAtom.set,setError:i.errorAtom.set,setProfileGroup:i.profileGroupAtom.setProfileGroup,setDragActive:i.dragActiveAtom.set,setViewMode:i.viewModeAtom.set,setFlattenRecursion:i.flattenRecursionAtom.set,setProfileIndexToView:i.profileGroupAtom.setProfileIndexToView,profileGroup:(0,s.useAtom)(i.profileGroupAtom),theme:l,flattenRecursion:(0,s.useAtom)(i.flattenRecursionAtom),viewMode:(0,s.useAtom)(i.viewModeAtom),hashParams:(0,s.useAtom)(i.hashParamsAtom),glCanvas:u,dragActive:(0,s.useAtom)(i.dragActiveAtom),loading:(0,s.useAtom)(i.loadingAtom),error:(0,s.useAtom)(i.errorAtom)}))});exports.ApplicationContainer=u; },{"preact":"aSor","../app-state/getters":"zEXv","preact/compat":"AQ6k","../app-state/active-profile-state":"MY42","./themes/theme":"gzKG","../app-state":"LDQe","../lib/atom":"QkVE","./search-view":"t9CM","./application":"wCGh"}],"K5F6":[function(require,module,exports) { "use strict";var e=require("preact"),o=require("./views/application-container"),d=require("./views/themes/theme");console.log(`speedscope v${require("../package.json").version}`),module.hot&&(module.hot.dispose(()=>{(0,e.render)((0,e.h)("div",null),document.body,document.body.lastElementChild||void 0)}),module.hot.accept()),(0,e.render)((0,e.h)(d.ThemeProvider,null,(0,e.h)(o.ApplicationContainer,null)),document.body,document.body.lastElementChild||void 0); @@ -190,4 +190,4 @@ module.exports=function(n){return new Promise(function(e,o){var r=document.creat },{}],0:[function(require,module,exports) { var b=require("TUK3");b.register("js",require("Yi9z")); },{}]},{},[0,"K5F6"], null) -//# sourceMappingURL=speedscope.2f0dbaca.js.map \ No newline at end of file +//# sourceMappingURL=speedscope.80eb88d2.js.map \ No newline at end of file