rack-mini-profiler 3.1.1 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,9 @@
1
1
  parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"y1V0":[function(require,module,exports) {
2
2
  "use strict";function e(e){const t=[];return function e(r){t.push({id:r.id,callFrame:{columnNumber:0,functionName:r.functionName,lineNumber:r.lineNumber,scriptId:r.scriptId,url:r.url},hitCount:r.hitCount,children:r.children.map(e=>e.id)}),r.children.forEach(e)}(e),t}function t(e,t){return e.map((r,n)=>{return r-(0===n?1e6*t:e[n-1])})}function r(r){return{samples:r.samples,startTime:1e6*r.startTime,endTime:1e6*r.endTime,nodes:e(r.head),timeDeltas:t(r.timestamps,r.startTime)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.chromeTreeToNodes=r;
3
3
  },{}],"kWV1":[function(require,module,exports) {
4
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isChromeTimeline=i,exports.importFromChromeTimeline=l,exports.importFromChromeCPUProfile=u,exports.importFromOldV8CPUProfile=f;var e=require("../lib/profile"),t=require("../lib/utils"),r=require("../lib/value-formatters"),n=require("./v8cpuFormatter");function i(e){if(!Array.isArray(e))return!1;if(e.length<1)return!1;const t=e[0];return"pid"in t&&"tid"in t&&"ph"in t&&"cat"in t&&!!e.find(e=>"CpuProfile"===e.name||"Profile"===e.name||"ProfileChunk"===e.name)}function l(e,r){const n=new Map,i=new Map,l=new Map;(0,t.sortBy)(e,e=>e.ts);for(let t of e){if("CpuProfile"===t.name){const e=`${t.pid}:${t.tid}`,r=t.id||e;n.set(r,t.args.data.cpuProfile),i.set(r,e)}if("Profile"===t.name){const e=`${t.pid}:${t.tid}`;n.set(t.id||e,Object.assign({startTime:0,endTime:0,nodes:[],samples:[],timeDeltas:[]},t.args.data)),t.id&&i.set(t.id,`${t.pid}:${t.tid}`)}if("thread_name"===t.name&&l.set(`${t.pid}:${t.tid}`,t.args.name),"ProfileChunk"===t.name){const e=`${t.pid}:${t.tid}`,r=n.get(t.id||e);if(r){const e=t.args.data;e.cpuProfile&&(e.cpuProfile.nodes&&(r.nodes=r.nodes.concat(e.cpuProfile.nodes)),e.cpuProfile.samples&&(r.samples=r.samples.concat(e.cpuProfile.samples))),e.timeDeltas&&(r.timeDeltas=r.timeDeltas.concat(e.timeDeltas)),null!=e.startTime&&(r.startTime=e.startTime),null!=e.endTime&&(r.endTime=e.endTime)}else console.warn(`Ignoring ProfileChunk for undeclared Profile with id ${t.id||e}`)}}if(n.size>0){const e=[];let o=0;return(0,t.itForEach)(n.keys(),t=>{let s=null,a=i.get(t);a&&(s=l.get(a)||null);const m=u(n.get(t));s&&n.size>1?(m.setName(`${r} - ${s}`),"CrRendererMain"===s&&(o=e.length)):m.setName(`${r}`),e.push(m)}),{name:r,indexToView:o,profiles:e}}throw new Error("Could not find CPU profile in Timeline")}const o=new Map;function s(e){return(0,t.getOrInsert)(o,e,e=>{const t=e.functionName||"(anonymous)",r=e.url;let n=e.lineNumber;null!=n&&n++;let i=e.columnNumber;return null!=i&&i++,{key:`${t}:${r}:${n}:${i}`,name:t,file:r,line:n,col:i}})}function a(e){const{functionName:t,url:r}=e;return"native dummy.js"===r||("(root)"===t||"(idle)"===t)}function m(e){return"(garbage collector)"===e||"(program)"===e}function u(n){const i=new e.CallTreeProfileBuilder(n.endTime-n.startTime),l=new Map;for(let e of n.nodes)l.set(e.id,e);for(let e of n.nodes)if("number"==typeof e.parent&&(e.parent=l.get(e.parent)),e.children)for(let t of e.children){const r=l.get(t);r&&(r.parent=e)}const o=[],u=[];let f=n.timeDeltas[0],c=f,p=NaN;for(let e=0;e<n.samples.length;e++){const t=n.samples[e];if(t!=p&&(o.push(t),f<c?u.push(c):(u.push(f),c=f)),e===n.samples.length-1)isNaN(p)||(o.push(p),f<c?u.push(c):(u.push(f),c=f));else{f+=n.timeDeltas[e+1],p=t}}let d=[];for(let e=0;e<o.length;e++){const r=u[e],n=o[e];let f=l.get(n);if(!f)continue;let c=null;for(c=f;c&&-1===d.indexOf(c);c=m(c.callFrame.functionName)?(0,t.lastOf)(d):c.parent||null);for(;d.length>0&&(0,t.lastOf)(d)!=c;){const e=s(d.pop().callFrame);i.leaveFrame(e,r)}const p=[];for(let e=f;e&&e!=c&&!a(e.callFrame);e=m(e.callFrame.functionName)?(0,t.lastOf)(d):e.parent||null)p.push(e);p.reverse();for(let e of p)i.enterFrame(s(e.callFrame),r);d=d.concat(p)}for(let e=d.length-1;e>=0;e--)i.leaveFrame(s(d[e].callFrame),(0,t.lastOf)(u));return i.setValueFormatter(new r.TimeFormatter("microseconds")),i.build()}function f(e){return u((0,n.chromeTreeToNodes)(e))}
4
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isChromeTimeline=i,exports.isChromeTimelineObject=o,exports.importFromChromeTimeline=l,exports.importFromChromeCPUProfile=c,exports.importFromOldV8CPUProfile=f;var e=require("../lib/profile"),t=require("../lib/utils"),n=require("../lib/value-formatters"),r=require("./v8cpuFormatter");function i(e){if(!Array.isArray(e))return!1;if(e.length<1)return!1;const t=e[0];return"pid"in t&&"tid"in t&&"ph"in t&&"cat"in t&&!!e.find(e=>"CpuProfile"===e.name||"Profile"===e.name||"ProfileChunk"===e.name)}function o(e){return"traceEvents"in e&&i(e.traceEvents)}function l(e,n){const r=new Map,i=new Map,o=new Map;(0,t.sortBy)(e,e=>e.ts);for(let t of e){if("CpuProfile"===t.name){const e=`${t.pid}:${t.tid}`,n=t.id||e;r.set(n,t.args.data.cpuProfile),i.set(n,e)}if("Profile"===t.name){const e=`${t.pid}:${t.tid}`;r.set(t.id||e,Object.assign({startTime:0,endTime:0,nodes:[],samples:[],timeDeltas:[]},t.args.data)),t.id&&i.set(t.id,`${t.pid}:${t.tid}`)}if("thread_name"===t.name&&o.set(`${t.pid}:${t.tid}`,t.args.name),"ProfileChunk"===t.name){const e=`${t.pid}:${t.tid}`,n=r.get(t.id||e);if(n){const e=t.args.data;e.cpuProfile&&(e.cpuProfile.nodes&&(n.nodes=n.nodes.concat(e.cpuProfile.nodes)),e.cpuProfile.samples&&(n.samples=n.samples.concat(e.cpuProfile.samples))),e.timeDeltas&&(n.timeDeltas=n.timeDeltas.concat(e.timeDeltas)),null!=e.startTime&&(n.startTime=e.startTime),null!=e.endTime&&(n.endTime=e.endTime)}else console.warn(`Ignoring ProfileChunk for undeclared Profile with id ${t.id||e}`)}}if(r.size>0){const e=[];let l=0;return(0,t.itForEach)(r.keys(),t=>{let s=null,a=i.get(t);a&&(s=o.get(a)||null);const m=c(r.get(t));s&&r.size>1?(m.setName(`${n} - ${s}`),"CrRendererMain"===s&&(l=e.length)):m.setName(`${n}`),e.push(m)}),{name:n,indexToView:l,profiles:e}}throw new Error("Could not find CPU profile in Timeline")}const s=new Map;function a(e){return(0,t.getOrInsert)(s,e,e=>{const t=e.url;let n=e.lineNumber;null!=n&&n++;let r=e.columnNumber;null!=r&&r++;const i=e.functionName||(t?`(anonymous ${t.split("/").pop()}:${n})`:"(anonymous)");return{key:`${i}:${t}:${n}:${r}`,name:i,file:t,line:n,col:r}})}function m(e){const{functionName:t,url:n}=e;return"native dummy.js"===n||("(root)"===t||"(idle)"===t)}function u(e){return"(garbage collector)"===e||"(program)"===e}function c(r){const i=new e.CallTreeProfileBuilder(r.endTime-r.startTime),o=new Map;for(let e of r.nodes)o.set(e.id,e);for(let e of r.nodes)if("number"==typeof e.parent&&(e.parent=o.get(e.parent)),e.children)for(let t of e.children){const n=o.get(t);n&&(n.parent=e)}const l=[],s=[];let c=r.timeDeltas[0],f=c,p=NaN;for(let e=0;e<r.samples.length;e++){const t=r.samples[e];if(t!=p&&(l.push(t),c<f?s.push(f):(s.push(c),f=c)),e===r.samples.length-1)isNaN(p)||(l.push(p),c<f?s.push(f):(s.push(c),f=c));else{c+=r.timeDeltas[e+1],p=t}}let d=[];for(let e=0;e<l.length;e++){const n=s[e],r=l[e];let c=o.get(r);if(!c)continue;let f=null;for(f=c;f&&-1===d.indexOf(f);f=u(f.callFrame.functionName)?(0,t.lastOf)(d):f.parent||null);for(;d.length>0&&(0,t.lastOf)(d)!=f;){const e=a(d.pop().callFrame);i.leaveFrame(e,n)}const p=[];for(let e=c;e&&e!=f&&!m(e.callFrame);e=u(e.callFrame.functionName)?(0,t.lastOf)(d):e.parent||null)p.push(e);p.reverse();for(let e of p)i.enterFrame(a(e.callFrame),n);d=d.concat(p)}for(let e=d.length-1;e>=0;e--)i.leaveFrame(a(d[e].callFrame),(0,t.lastOf)(s));return i.setValueFormatter(new n.TimeFormatter("microseconds")),i.build()}function f(e){return c((0,r.chromeTreeToNodes)(e))}
5
5
  },{"../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4","./v8cpuFormatter":"y1V0"}],"I37H":[function(require,module,exports) {
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromStackprof=r;var e=require("../lib/profile"),t=require("../lib/value-formatters");function r(r){const o=r.raw_timestamp_deltas.reduce((e,t)=>e+t,0),a=new e.StackListProfileBuilder(o),{frames:l,raw:s,raw_timestamp_deltas:i}=r;let n=0,c=[];for(let e=0;e<s.length;){const t=s[e++];let r=[];for(let a=0;a<t;a++){const t=s[e++];r.push(Object.assign({key:t},l[t]))}1===r.length&&"(garbage collection)"===r[0].name&&(r=c.concat(r));const o=s[e++];let m=0;for(let e=0;e<o;e++)m+=i[n++];a.appendSampleWithWeight(r,m),c=r}return a.setValueFormatter(new t.TimeFormatter("microseconds")),a.build()}
6
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromStackprof=a;var e=require("../lib/profile"),t=require("../lib/value-formatters");function a(a){const{frames:r,mode:l,raw:o,raw_timestamp_deltas:n,interval:i}=a,s=new e.StackListProfileBuilder;s.setValueFormatter(new t.TimeFormatter("microseconds"));let c=0,m=[];for(let e=0;e<o.length;){const a=o[e++];let p=[];for(let t=0;t<a;t++){const t=o[e++];let a=r[t].name;null==a&&(a="(unknown)");const l=Object.assign(Object.assign({key:t},r[t]),{name:a});p.push(l)}1===p.length&&"(garbage collection)"===p[0].name&&(p=m.concat(p));const u=o[e++];switch(l){case"object":s.appendSampleWithWeight(p,u),s.setValueFormatter(new t.RawValueFormatter);break;case"cpu":s.appendSampleWithWeight(p,u*i);break;default:let e=0;for(let t=0;t<u;t++)e+=n[c++];s.appendSampleWithWeight(p,e)}m=p}return s.build()}
7
7
  },{"../lib/profile":"YG8z","../lib/value-formatters":"LsM4"}],"tbG5":[function(require,module,exports) {
8
8
  "use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function t(r,t){return Object.prototype.hasOwnProperty.call(r,t)}exports.assign=function(r){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var a in n)t(n,a)&&(r[a]=n[a])}}return r},exports.shrinkBuf=function(r,t){return r.length===t?r:r.subarray?r.subarray(0,t):(r.length=t,r)};var e={arraySet:function(r,t,e,n,a){if(t.subarray&&r.subarray)r.set(t.subarray(e,e+n),a);else for(var o=0;o<n;o++)r[a+o]=t[e+o]},flattenChunks:function(r){var t,e,n,a,o,s;for(n=0,t=0,e=r.length;t<e;t++)n+=r[t].length;for(s=new Uint8Array(n),a=0,t=0,e=r.length;t<e;t++)o=r[t],s.set(o,a),a+=o.length;return s}},n={arraySet:function(r,t,e,n,a){for(var o=0;o<n;o++)r[a+o]=t[e+o]},flattenChunks:function(r){return[].concat.apply([],r)}};exports.setTyped=function(r){r?(exports.Buf8=Uint8Array,exports.Buf16=Uint16Array,exports.Buf32=Int32Array,exports.assign(exports,e)):(exports.Buf8=Array,exports.Buf16=Array,exports.Buf32=Array,exports.assign(exports,n))},exports.setTyped(r);
9
9
  },{}],"sRJQ":[function(require,module,exports) {
@@ -36,22 +36,24 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcel
36
36
  "use strict";var t=require("./zlib/inflate"),i=require("./utils/common"),n=require("./utils/strings"),s=require("./zlib/constants"),r=require("./zlib/messages"),e=require("./zlib/zstream"),o=require("./zlib/gzheader"),u=Object.prototype.toString;function a(n){if(!(this instanceof a))return new a(n);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},n||{});var u=this.options;u.raw&&u.windowBits>=0&&u.windowBits<16&&(u.windowBits=-u.windowBits,0===u.windowBits&&(u.windowBits=-15)),!(u.windowBits>=0&&u.windowBits<16)||n&&n.windowBits||(u.windowBits+=32),u.windowBits>15&&u.windowBits<48&&0==(15&u.windowBits)&&(u.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new e,this.strm.avail_out=0;var h=t.inflateInit2(this.strm,u.windowBits);if(h!==s.Z_OK)throw new Error(r[h]);this.header=new o,t.inflateGetHeader(this.strm,this.header)}function h(t,i){var n=new a(i);if(n.push(t,!0),n.err)throw n.msg||r[n.err];return n.result}function _(t,i){return(i=i||{}).raw=!0,h(t,i)}a.prototype.push=function(r,e){var o,a,h,_,w,l,d=this.strm,f=this.options.chunkSize,p=this.options.dictionary,c=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof r?d.input=n.binstring2buf(r):"[object ArrayBuffer]"===u.call(r)?d.input=new Uint8Array(r):d.input=r,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(f),d.next_out=0,d.avail_out=f),(o=t.inflate(d,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(l="string"==typeof p?n.string2buf(p):"[object ArrayBuffer]"===u.call(p)?new Uint8Array(p):p,o=t.inflateSetDictionary(this.strm,l)),o===s.Z_BUF_ERROR&&!0===c&&(o=s.Z_OK,c=!1),o!==s.Z_STREAM_END&&o!==s.Z_OK)return this.onEnd(o),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&o!==s.Z_STREAM_END&&(0!==d.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(h=n.utf8border(d.output,d.next_out),_=d.next_out-h,w=n.buf2string(d.output,h),d.next_out=_,d.avail_out=f-_,_&&i.arraySet(d.output,d.output,h,_,0),this.onData(w)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(c=!0)}while((d.avail_in>0||0===d.avail_out)&&o!==s.Z_STREAM_END);return o===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(o=t.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),d.avail_out=0,!0)},a.prototype.onData=function(t){this.chunks.push(t)},a.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},exports.Inflate=a,exports.inflate=h,exports.inflateRaw=_,exports.ungzip=h;
37
37
  },{"./zlib/inflate":"GIDK","./utils/common":"tbG5","./utils/strings":"Q3ZD","./zlib/constants":"xUUw","./zlib/messages":"gMAY","./zlib/zstream":"bdtv","./zlib/gzheader":"WIli"}],"f4vO":[function(require,module,exports) {
38
38
  "use strict";var e=require("./lib/utils/common").assign,i=require("./lib/deflate"),r=require("./lib/inflate"),l=require("./lib/zlib/constants"),s={};e(s,i,r,l),module.exports=s;
39
- },{"./lib/utils/common":"tbG5","./lib/deflate":"nFS2","./lib/inflate":"faQk","./lib/zlib/constants":"xUUw"}],"QTYz":[function(require,module,exports) {
40
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MaybeCompressedDataReader=exports.TextProfileDataSource=void 0;var e=t(require("pako"));function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function t(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}var n=function(e,r,t,n){return new(t||(t=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(r){i(r)}}function a(e){try{u(n.throw(e))}catch(r){i(r)}}function u(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(s,a)}u((n=n.apply(e,r||[])).next())})};class o{constructor(e,r){this.fileName=e,this.contents=r}name(){return n(this,void 0,void 0,function*(){return this.fileName})}readAsArrayBuffer(){return n(this,void 0,void 0,function*(){return new ArrayBuffer(0)})}readAsText(){return n(this,void 0,void 0,function*(){return this.contents})}}exports.TextProfileDataSource=o;class i{constructor(r,t){this.namePromise=r,this.uncompressedData=t.then(r=>n(this,void 0,void 0,function*(){try{return e.inflate(new Uint8Array(r)).buffer}catch(t){return r}}))}name(){return n(this,void 0,void 0,function*(){return yield this.namePromise})}readAsArrayBuffer(){return n(this,void 0,void 0,function*(){return yield this.uncompressedData})}readAsText(){return n(this,void 0,void 0,function*(){const e=yield this.readAsArrayBuffer();let r="utf-8";const t=new Uint8Array(e);if(t.length>2&&(255===t[0]&&254===t[1]?r="utf-16le":254===t[0]&&255===t[1]&&(r="utf-16be")),"undefined"!=typeof TextDecoder){return new TextDecoder(r).decode(e)}{console.warn("This browser does not support TextDecoder. Decoding text as ASCII.");let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}})}static fromFile(e){const r=new Promise(r=>{const t=new FileReader;t.addEventListener("loadend",()=>{if(!(t.result instanceof ArrayBuffer))throw new Error("Expected reader.result to be an instance of ArrayBuffer");r(t.result)}),t.readAsArrayBuffer(e)});return new i(Promise.resolve(e.name),r)}static fromArrayBuffer(e,r){return new i(Promise.resolve(e),Promise.resolve(r))}}exports.MaybeCompressedDataReader=i;
41
- },{"pako":"f4vO"}],"G28U":[function(require,module,exports) {
42
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromInstrumentsDeepCopy=a,exports.importFromInstrumentsTrace=w,exports.importRunFromInstrumentsTrace=g,exports.importThreadFromInstrumentsTrace=b,exports.readInstrumentsKeyedArchive=y,exports.decodeUTF8=v,exports.UID=void 0;var e=require("../lib/profile"),t=require("../lib/utils"),r=require("../lib/value-formatters"),n=require("./utils"),s=function(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{l(n.next(e))}catch(t){i(t)}}function a(e){try{l(n.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function i(e){const t=e.split("\n").map(e=>e.split("\t")),r=t.shift();if(!r)return[];const n=new Map;for(let i=0;i<r.length;i++)n.set(i,r[i]);const s=[];for(let i of t){const e={};for(let t=0;t<i.length;t++)e[n.get(t)]=i[t];s.push(e)}return s}function o(e){if("Bytes Used"in e){const t=e["Bytes Used"],r=/\s*(\d+(?:[.]\d+)?) (\w+)\s+(?:\d+(?:[.]\d+))%/.exec(t);if(!r)return 0;const n=parseInt(r[1],10),s=r[2];switch(s){case"Bytes":return n;case"KB":return 1024*n;case"MB":return 1048576*n;case"GB":return 1073741824*n}throw new Error(`Unrecognized units ${s}`)}if("Weight"in e||"Running Time"in e){const t=e.Weight||e["Running Time"],r=/\s*(\d+(?:[.]\d+)?) ?(\w+)\s+(?:\d+(?:[.]\d+))%/.exec(t);if(!r)return 0;const n=parseInt(r[1],10),s=r[2];switch(s){case"ms":return n;case"s":case"min":return 1e3*n}throw new Error(`Unrecognized units ${s}`)}return-1}function a(t){const n=new e.CallTreeProfileBuilder,s=i(t),a=[];let l=0;for(let e of s){const t=e["Symbol Name"];if(!t)continue;const r=t.trim();let s=t.length-r.length;if(a.length-s<0)throw new Error("Invalid format");let i=[];for(;s<a.length;){const e=a.pop();i.push(e)}for(let e of i)l=Math.max(l,e.endValue),n.leaveFrame(e,l);const c={key:`${e["Source Path"]||""}:${r}`,name:r,file:e["Source Path"],endValue:l+o(e)};n.enterFrame(c,l),a.push(c)}for(;a.length>0;){const e=a.pop();l=Math.max(l,e.endValue),n.leaveFrame(e,l)}return"Bytes Used"in s[0]?n.setValueFormatter(new r.ByteFormatter):("Weight"in s[0]||"Running Time"in s[0])&&n.setValueFormatter(new r.TimeFormatter("milliseconds")),n.build()}function l(e){return s(this,void 0,void 0,function*(){const t={name:e.name,files:new Map,subdirectories:new Map},r=yield new Promise((t,r)=>{e.createReader().readEntries(e=>{t(e)},r)});for(let e of r)if(e.isDirectory){const r=yield l(e);t.subdirectories.set(r.name,r)}else{const r=yield new Promise((t,r)=>{e.file(t,r)});t.files.set(r.name,r)}return t})}function c(e){return n.MaybeCompressedDataReader.fromFile(e).readAsArrayBuffer()}function u(e){return n.MaybeCompressedDataReader.fromFile(e).readAsText()}function f(e,r){const n=(0,t.getOrThrow)(e.subdirectories,"corespace"),s=(0,t.getOrThrow)(n.subdirectories,`run${r}`);return(0,t.getOrThrow)(s.subdirectories,"core")}class h{constructor(e){this.bytePos=0,this.view=new DataView(e)}seek(e){this.bytePos=e}skip(e){this.bytePos+=e}hasMore(){return this.bytePos<this.view.byteLength}bytesLeft(){return this.view.byteLength-this.bytePos}readUint8(){return this.bytePos++,this.bytePos>this.view.byteLength?0:this.view.getUint8(this.bytePos-1)}readUint32(){return this.bytePos+=4,this.bytePos>this.view.byteLength?0:this.view.getUint32(this.bytePos-4,!0)}readUint48(){return this.bytePos+=6,this.bytePos>this.view.byteLength?0:this.view.getUint32(this.bytePos-6,!0)+this.view.getUint16(this.bytePos-2,!0)*Math.pow(2,32)}readUint64(){return this.bytePos+=8,this.bytePos>this.view.byteLength?0:this.view.getUint32(this.bytePos-8,!0)+this.view.getUint32(this.bytePos-4,!0)*Math.pow(2,32)}}function p(e){return s(this,void 0,void 0,function*(){const r=(0,t.getOrThrow)(e.subdirectories,"stores");for(let e of r.subdirectories.values()){const r=e.files.get("schema.xml");if(!r)continue;const n=yield u(r);if(!/name="time-profile"/.exec(n))continue;const s=new h(yield c((0,t.getOrThrow)(e.files,"bulkstore")));s.readUint32(),s.readUint32(),s.readUint32();const i=s.readUint32(),o=s.readUint32();s.seek(i);const a=[];for(;;){const e=s.readUint48();if(0===e)break;const t=s.readUint32();s.skip(o-6-4-4);const r=s.readUint32();a.push({timestamp:e,threadID:t,backtraceID:r})}return a}throw new Error("Could not find sample list")})}function d(e,r){return s(this,void 0,void 0,function*(){const e=(0,t.getOrThrow)(r.subdirectories,"uniquing"),n=(0,t.getOrThrow)(e.subdirectories,"arrayUniquer"),s=(0,t.getOrThrow)(n.files,"integeruniquer.index"),i=(0,t.getOrThrow)(n.files,"integeruniquer.data"),o=new h(yield c(s)),a=new h(yield c(i));o.seek(32);let l=[];for(;o.hasMore();){const e=o.readUint32()+1048576*o.readUint32();if(0===e)continue;a.seek(e);let t=a.readUint32(),r=[];for(;t--;)r.push(a.readUint64());l.push(r)}return l})}function m(e){return s(this,void 0,void 0,function*(){const r=(0,t.getOrThrow)(e.files,"form.template"),n=y(yield c(r)),s=n["com.apple.xray.owner.template.version"];let i=1;"com.apple.xray.owner.template"in n&&(i=n["com.apple.xray.owner.template"].get("_selectedRunNumber"));let o=n.$1;"stubInfoByUUID"in n&&(o=Array.from(n.stubInfoByUUID.keys())[0]);const a=n["com.apple.xray.run.data"],l=[];for(let e of a.runNumbers){const r=(0,t.getOrThrow)(a.runData,e),n=(0,t.getOrThrow)(r,"symbolsByPid"),s=new Map;for(let i of n.values()){for(let e of i.symbols){if(!e)continue;const{sourcePath:r,symbolName:n,addressToLine:i}=e;for(let e of i.keys())(0,t.getOrInsert)(s,e,()=>{const s=n||`0x${(0,t.zeroPad)(e.toString(16),16)}`,i={key:`${r}:${s}`,name:s};return r&&(i.file=r),i})}l.push({number:e,addressToFrameMap:s})}}return{version:s,instrument:o,selectedRunNumber:i,runs:l}})}function w(e){return s(this,void 0,void 0,function*(){const t=yield l(e),{version:r,runs:n,instrument:s,selectedRunNumber:i}=yield m(t);if("com.apple.xray.instrument-type.coresampler2"!==s)throw new Error(`The only supported instrument from .trace import is "com.apple.xray.instrument-type.coresampler2". Got ${s}`);console.log("version: ",r),console.log("Importing time profile");const o=[];let a=0;for(let l of n){const{addressToFrameMap:r,number:n}=l,s=yield g({fileName:e.name,tree:t,addressToFrameMap:r,runNumber:n});l.number===i&&(a=o.length+s.indexToView),o.push(...s.profiles)}return{name:e.name,indexToView:a,profiles:o}})}function g(e){return s(this,void 0,void 0,function*(){const{fileName:r,tree:n,addressToFrameMap:s,runNumber:i}=e,o=f(n,i);let a=yield p(o);const l=yield d(a,o),c=new Map;for(let e of a)c.set(e.threadID,(0,t.getOrElse)(c,e.threadID,()=>0)+1);const u=Array.from(c.entries());(0,t.sortBy)(u,e=>-e[1]);const h=u.map(e=>e[0]);return{name:r,indexToView:0,profiles:h.map(e=>b({threadID:e,fileName:r,arrays:l,addressToFrameMap:s,samples:a}))}})}function b(n){let{fileName:s,addressToFrameMap:i,arrays:o,threadID:a,samples:l}=n;const c=new Map;l=l.filter(e=>e.threadID===a);const u=new e.StackListProfileBuilder((0,t.lastOf)(l).timestamp);function f(e,r){const n=i.get(e);if(n)r.push(n);else if(e in o)for(let t of o[e])f(t,r);else{const n={key:e,name:`0x${(0,t.zeroPad)(e.toString(16),16)}`};i.set(e,n),r.push(n)}}u.setName(`${s} - thread ${a}`);let h=null;for(let e of l){const r=(0,t.getOrInsert)(c,e.backtraceID,e=>{const t=[];return f(e,t),t.reverse(),t});if(null===h&&(u.appendSampleWithWeight([],e.timestamp),h=e.timestamp),e.timestamp<h)throw new Error("Timestamps out of order!");u.appendSampleWithWeight(r,e.timestamp-h),h=e.timestamp}return u.setValueFormatter(new r.TimeFormatter("nanoseconds")),u.build()}function y(e){return T(I(new Uint8Array(e)),(e,t)=>{switch(e){case"NSTextStorage":case"NSParagraphStyle":case"NSFont":return null;case"PFTSymbolData":{const e=Object.create(null);e.symbolName=t.$0,e.sourcePath=t.$1,e.addressToLine=new Map;for(let r=3;;r+=2){const n=t["$"+r],s=t["$"+(r+1)];if(null==n||null==s)break;e.addressToLine.set(n,s)}return e}case"PFTOwnerData":{const e=Object.create(null);return e.ownerName=t.$0,e.ownerPath=t.$1,e}case"PFTPersistentSymbols":{const e=Object.create(null),r=t.$4;e.threadNames=t.$3,e.symbols=[];for(let n=1;n<r;n++)e.symbols.push(t["$"+(4+n)]);return e}case"XRRunListData":{const e=Object.create(null);return e.runNumbers=t.$0,e.runData=t.$1,e}case"XRIntKeyedDictionary":{const e=new Map,r=t.$0;for(let n=0;n<r;n++){const r=t["$"+(1+2*n)],s=t["$"+(2*n+1+1)];e.set(r,s)}return e}case"XRCore":{const e=Object.create(null);return e.number=t.$0,e.name=t.$1,e}}return t})}function v(e){let t=String.fromCharCode.apply(String,Array.from(e));return"\0"===t.slice(-1)&&(t=t.slice(0,-1)),decodeURIComponent(escape(t))}function U(e){return e instanceof Array}function S(e){return null!==e&&"object"==typeof e&&null===Object.getPrototypeOf(e)}function N(e,t){return t instanceof x?e[t.index]:t}function T(e,t=(e=>e)){if(1e5!==e.$version||"NSKeyedArchiver"!==e.$archiver||!S(e.$top)||!U(e.$objects))throw new Error("Invalid keyed archive");"$null"===e.$objects[0]&&(e.$objects[0]=null);for(let n=0;n<e.$objects.length;n++)e.$objects[n]=$(e.$objects,e.$objects[n],t);let r=t=>{if(t instanceof x)return e.$objects[t.index];if(U(t))for(let e=0;e<t.length;e++)t[e]=r(t[e]);else if(S(t))for(let e in t)t[e]=r(t[e]);else if(t instanceof Map){const e=new Map(t);t.clear();for(let[n,s]of e.entries())t.set(r(n),r(s))}return t};for(let n=0;n<e.$objects.length;n++)r(e.$objects[n]);return r(e.$top)}function $(e,t,r=(e=>e)){if(S(t)&&t.$class){let n=N(e,t.$class).$classname;switch(n){case"NSDecimalNumberPlaceholder":{let e=t["NS.length"],r=t["NS.exponent"],n=t["NS.mantissa.bo"],s=t["NS.negative"],i=new Uint16Array(new Uint8Array(t["NS.mantissa"]).buffer),o=0;for(let t=0;t<e;t++){let e=i[t];1!==n&&(e=(65280&e)>>8|(255&e)<<8),o+=e*Math.pow(65536,t)}return o*=Math.pow(10,r),s?-o:o}case"NSData":case"NSMutableData":return t["NS.bytes"]||t["NS.data"];case"NSString":case"NSMutableString":return t["NS.string"]?t["NS.string"]:t["NS.bytes"]?v(t["NS.bytes"]):(console.warn(`Unexpected ${n} format: `,t),null);case"NSArray":case"NSMutableArray":if("NS.objects"in t)return t["NS.objects"];let e=[];for(;;){let r="NS.object."+e.length;if(!(r in t))break;e.push(t[r])}return e;case"_NSKeyedCoderOldStyleArray":{const e=t["NS.count"];let r=[];for(let n=0;n<e;n++){const e=t["$"+n];r.push(e)}return r}case"NSDictionary":case"NSMutableDictionary":let s=new Map;if("NS.keys"in t&&"NS.objects"in t)for(let r=0;r<t["NS.keys"].length;r++)s.set(t["NS.keys"][r],t["NS.objects"][r]);else for(;;){let e="NS.key."+s.size,r="NS.object."+s.size;if(!(e in t&&r in t))break;s.set(t[e],t[r])}return s;default:const i=r(n,t);if(i!==t)return i}}return t}class x{constructor(e){this.index=e}}function I(e){for(let t=0;t<8;t++)if(e[t]!=="bplist00".charCodeAt(t))throw new Error("File is not a binary plist");return new P(new DataView(e.buffer,e.byteOffset,e.byteLength)).parseRoot()}exports.UID=x;class P{constructor(e){this.view=e,this.referenceSize=0,this.objects=[],this.offsetTable=[]}parseRoot(){let e=this.view.byteLength-32,t=this.view.getUint8(e+6);this.referenceSize=this.view.getUint8(e+7);let r=this.view.getUint32(e+12,!1),n=this.view.getUint32(e+20,!1),s=this.view.getUint32(e+28,!1);for(let i=0;i<r;i++)this.offsetTable.push(this.parseInteger(s,t)),s+=t;return this.parseObject(this.offsetTable[n])}parseLengthAndOffset(e,t){if(15!==t)return{length:t,offset:0};let r=this.view.getUint8(e++);if(16!=(240&r))throw new Error("Unexpected non-integer length at offset "+e);let n=1<<(15&r);return{length:this.parseInteger(e,n),offset:n+1}}parseSingleton(e,t){if(0===t)return null;if(8===t)return!1;if(9===t)return!0;throw new Error("Unexpected extra value "+t+" at offset "+e)}parseInteger(e,t){if(1===t)return this.view.getUint8(e);if(2===t)return this.view.getUint16(e,!1);if(4===t)return this.view.getUint32(e,!1);if(8===t)return Math.pow(2,32)*this.view.getUint32(e+0,!1)+Math.pow(2,0)*this.view.getUint32(e+4,!1);if(16===t)return Math.pow(2,96)*this.view.getUint32(e+0,!1)+Math.pow(2,64)*this.view.getUint32(e+4,!1)+Math.pow(2,32)*this.view.getUint32(e+8,!1)+Math.pow(2,0)*this.view.getUint32(e+12,!1);throw new Error("Unexpected integer of size "+t+" at offset "+e)}parseFloat(e,t){if(4===t)return this.view.getFloat32(e,!1);if(8===t)return this.view.getFloat64(e,!1);throw new Error("Unexpected float of size "+t+" at offset "+e)}parseDate(e,t){if(8!==t)throw new Error("Unexpected date of size "+t+" at offset "+e);let r=this.view.getFloat64(e,!1);return new Date(9783072e5+1e3*r)}parseData(e,t){let r=this.parseLengthAndOffset(e,t);return new Uint8Array(this.view.buffer,e+r.offset,r.length)}parseStringASCII(e,t){let r=this.parseLengthAndOffset(e,t),n="";e+=r.offset;for(let s=0;s<r.length;s++)n+=String.fromCharCode(this.view.getUint8(e++));return n}parseStringUTF16(e,t){let r=this.parseLengthAndOffset(e,t),n="";e+=r.offset;for(let s=0;s<r.length;s++)n+=String.fromCharCode(this.view.getUint16(e,!1)),e+=2;return n}parseUID(e,t){return new x(this.parseInteger(e,t))}parseArray(e,t){let r=this.parseLengthAndOffset(e,t),n=[],s=this.referenceSize;e+=r.offset;for(let i=0;i<r.length;i++)n.push(this.parseObject(this.offsetTable[this.parseInteger(e,s)])),e+=s;return n}parseDictionary(e,t){let r=this.parseLengthAndOffset(e,t),n=Object.create(null),s=this.referenceSize,i=e+r.offset,o=i+r.length*s;for(let a=0;a<r.length;a++){let e=this.parseObject(this.offsetTable[this.parseInteger(i,s)]),t=this.parseObject(this.offsetTable[this.parseInteger(o,s)]);if("string"!=typeof e)throw new Error("Unexpected non-string key at offset "+i);n[e]=t,i+=s,o+=s}return n}parseObject(e){let t=this.view.getUint8(e++),r=15&t;switch(t>>4){case 0:return this.parseSingleton(e,r);case 1:return this.parseInteger(e,1<<r);case 2:return this.parseFloat(e,1<<r);case 3:return this.parseDate(e,1<<r);case 4:return this.parseData(e,r);case 5:return this.parseStringASCII(e,r);case 6:return this.parseStringUTF16(e,r);case 8:return this.parseUID(e,r+1);case 10:return this.parseArray(e,r);case 13:return this.parseDictionary(e,r)}throw new Error("Unexpected marker "+t+" at offset "+--e)}}
39
+ },{"./lib/utils/common":"tbG5","./lib/deflate":"nFS2","./lib/inflate":"faQk","./lib/zlib/constants":"xUUw"}],"DstG":[function(require,module,exports) {
40
+ !function(e){var a=String.fromCharCode;function s(e,s,c){for(var n=e[s],r=1,i=0,t=0;t<s;t++)10===e[t]?(r++,i=0):i++;throw new SyntaxError(c||(s===e.length?"Unexpected end of input while parsing JSON":n>=32&&n<=126?"Unexpected character "+a(n)+" in JSON at position "+s+" (line "+r+", column "+i+")":"Unexpected byte 0x"+n.toString(16)+" in JSON at position "+s+" (line "+r+", column "+i+")"))}e.JSON_parse=function(e){if(!(e instanceof Uint8Array))throw new Error("JSON input must be a Uint8Array");for(var c,n=[],r=[],i=[],t=e.length,o=null,u=0,f=0;f<t;){var p=e[f++];if(!(p<=32)){var l=void 0;switch(2===u&&null===o&&34!==p&&125!==p&&s(e,--f),p){case 116:114===e[f++]&&117===e[f++]&&101===e[f++]||s(e,--f),l=!0;break;case 102:97===e[f++]&&108===e[f++]&&115===e[f++]&&101===e[f++]||s(e,--f),l=!1;break;case 110:117===e[f++]&&108===e[f++]&&108===e[f++]||s(e,--f),l=null;break;case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:var b=f;for(l=a(p),p=e[f];;){switch(p){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:l+=a(p),p=e[++f];continue}break}l=+l,isNaN(l)&&s(e,--b,"Invalid number");break;case 34:for(l="";f>=t&&s(e,t),34!==(p=e[f++]);)if(92===p)switch(e[f++]){case 34:l+='"';break;case 47:l+="/";break;case 92:l+="\\";break;case 98:l+="\b";break;case 102:l+="\f";break;case 110:l+="\n";break;case 114:l+="\r";break;case 116:l+="\t";break;case 117:for(var k=0,h=0;h<4;h++)k<<=4,(p=e[f++])>=48&&p<=57?k|=p-48:p>=97&&p<=102?k|=p+-87:p>=65&&p<=70?k|=p+-55:s(e,--f);l+=a(k);break;default:s(e,--f)}else if(p<=127)l+=a(p);else if(192==(224&p))l+=a((31&p)<<6|63&e[f++]);else if(224==(240&p))l+=a((15&p)<<12|(63&e[f++])<<6|63&e[f++]);else if(240==(248&p)){var d=(7&p)<<18|(63&e[f++])<<12|(63&e[f++])<<6|63&e[f++];d>65535&&(l+=a((d-=65536)>>10&1023|55296),d=56320|1023&d),l+=a(d)}l[0];break;case 91:l=[],n.push(o),r.push(c),i.push(u),o=null,c=l,u=1;continue;case 123:l={},n.push(o),r.push(c),i.push(u),o=null,c=l,u=2;continue;case 93:1!==u&&s(e,--f),l=c,o=n.pop(),c=r.pop(),u=i.pop();break;case 125:2!==u&&s(e,--f),l=c,o=n.pop(),c=r.pop(),u=i.pop();break;default:s(e,--f)}for(p=e[f];p<=32;)p=e[++f];switch(u){case 0:if(f===t)return l;break;case 1:if(c.push(l),44===p){f++;continue}if(93===p)continue;break;case 2:if(null===o){if(o=l,58===p){f++;continue}}else{if(c[o]=l,o=null,44===p){f++;continue}if(125===p)continue}}break}}s(e,f)}}("undefined"!=typeof exports?exports:this);
41
+ },{}],"QTYz":[function(require,module,exports) {
42
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.withMockedFileChunkSizeForTests=o,exports.MaybeCompressedDataReader=exports.TextProfileDataSource=exports.StringBackedTextFileContent=exports.BufferBackedTextFileContent=void 0;var e=n(require("pako")),t=require("uint8array-json-parser");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}var s=function(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{a(n.next(e))}catch(t){i(t)}}function u(e){try{a(n.throw(e))}catch(t){i(t)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,u)}a((n=n.apply(e,t||[])).next())})};let i=1<<27;function o(e,t){return s(this,void 0,void 0,function*(){const r=i;i=e;try{yield t()}finally{i=r}})}function u(e){return"["===(e=e.trim())[0]&&"]"!==(e=e.replace(/,\s*$/,""))[e.length-1]&&(e+="]"),JSON.parse(e)}function a(e){let r=0;for(let t=0;t<e.length;t++)if(!/\s/.exec(String.fromCharCode(e[t]))){r=t;break}if(e[r]==="[".charCodeAt(0)&&e[e.length-1]!=="]".charCodeAt(0)){let t=e.length;for(;t>0&&/\s/.exec(String.fromCharCode(e[t-1]));)t--;if(","===String.fromCharCode(e[t-1])&&t--,"]"!==String.fromCharCode(e[t-1])){const r=new Uint8Array(t+1);r.set(e.subarray(0,t)),r[t]="]".charCodeAt(0),e=r}}return(0,t.JSON_parse)(e)}class c{constructor(e){this.chunks=[];const t=this.byteArray=new Uint8Array(e);let r="utf-8";if(t.length>2&&(255===t[0]&&254===t[1]?r="utf-16le":254===t[0]&&255===t[1]&&(r="utf-16be")),"undefined"!=typeof TextDecoder){const t=new TextDecoder(r);for(let r=0;r<e.byteLength/i;r++){const n=r*i,s=new Uint8Array(e,n,Math.min(e.byteLength-n,i)),o=t.decode(s,{stream:!0});this.chunks.push(o)}}else{console.warn("This browser does not support TextDecoder. Decoding text as ASCII."),this.chunks.push("");for(let e=0;e<t.length;e++)this.chunks[this.chunks.length-1]+=String.fromCharCode(t[e]),this.chunks[this.chunks.length-1],this.chunks[this.chunks.length-1].length>=i&&this.chunks.push("")}}splitLines(){return{[Symbol.iterator]:function*(){let e="";for(let t of this.chunks){const r=t.split("\n");for(let t=0;t<r.length;t++)0===t?e+=r[t]:(yield e,e=r[t])}yield e}.bind(this)}}firstChunk(){return this.chunks[0]||""}parseAsJSON(){return 1===this.chunks.length?u(this.chunks[0]):a(this.byteArray)}}exports.BufferBackedTextFileContent=c;class f{constructor(e){this.s=e}splitLines(){return this.s.split("\n")}firstChunk(){return this.s}parseAsJSON(){return u(this.s)}}exports.StringBackedTextFileContent=f;class h{constructor(e,t){this.fileName=e,this.contents=t}name(){return s(this,void 0,void 0,function*(){return this.fileName})}readAsArrayBuffer(){return s(this,void 0,void 0,function*(){return new ArrayBuffer(0)})}readAsText(){return s(this,void 0,void 0,function*(){return new f(this.contents)})}}exports.TextProfileDataSource=h;class l{constructor(t,r){this.namePromise=t,this.uncompressedData=r.then(t=>s(this,void 0,void 0,function*(){try{return e.inflate(new Uint8Array(t)).buffer}catch(r){return t}}))}name(){return s(this,void 0,void 0,function*(){return yield this.namePromise})}readAsArrayBuffer(){return s(this,void 0,void 0,function*(){return yield this.uncompressedData})}readAsText(){return s(this,void 0,void 0,function*(){const e=yield this.readAsArrayBuffer();return new c(e)})}static fromFile(e){const t=new Promise(t=>{const r=new FileReader;r.addEventListener("loadend",()=>{if(!(r.result instanceof ArrayBuffer))throw new Error("Expected reader.result to be an instance of ArrayBuffer");t(r.result)}),r.readAsArrayBuffer(e)});return new l(Promise.resolve(e.name),t)}static fromArrayBuffer(e,t){return new l(Promise.resolve(e),Promise.resolve(t))}}exports.MaybeCompressedDataReader=l;
43
+ },{"pako":"f4vO","uint8array-json-parser":"DstG"}],"G28U":[function(require,module,exports) {
44
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromInstrumentsDeepCopy=a,exports.importFromInstrumentsTrace=w,exports.importRunFromInstrumentsTrace=g,exports.importThreadFromInstrumentsTrace=b,exports.readInstrumentsKeyedArchive=y,exports.decodeUTF8=v,exports.UID=void 0;var e=require("../lib/profile"),t=require("../lib/utils"),r=require("../lib/value-formatters"),n=require("./utils"),s=function(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{c(n.next(e))}catch(t){i(t)}}function a(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}c((n=n.apply(e,t||[])).next())})};function i(e){const t=[...e.splitLines()].map(e=>e.split("\t")),r=t.shift();if(!r)return[];const n=new Map;for(let i=0;i<r.length;i++)n.set(i,r[i]);const s=[];for(let i of t){const e={};for(let t=0;t<i.length;t++)e[n.get(t)]=i[t];s.push(e)}return s}function o(e){if("Bytes Used"in e){const t=e["Bytes Used"],r=/\s*(\d+(?:[.]\d+)?) (\w+)\s+(?:\d+(?:[.]\d+))%/.exec(t);if(!r)return 0;const n=parseInt(r[1],10),s=r[2];switch(s){case"Bytes":return n;case"KB":return 1024*n;case"MB":return 1048576*n;case"GB":return 1073741824*n}throw new Error(`Unrecognized units ${s}`)}if("Weight"in e||"Running Time"in e){const t=e.Weight||e["Running Time"],r=/\s*(\d+(?:[.]\d+)?) ?(\w+)\s+(?:\d+(?:[.]\d+))%/.exec(t);if(!r)return 0;const n=parseInt(r[1],10),s=r[2];switch(s){case"ms":return n;case"s":return 1e3*n;case"min":return 6e4*n;case"cycles":return n;case"Kc":return 1e3*n;case"Mc":return 1e6*n;case"Gc":return 1e9*n}throw new Error(`Unrecognized units ${s}`)}return-1}function a(t){const n=new e.CallTreeProfileBuilder,s=i(t),a=[];let c=0;for(let e of s){const t=e["Symbol Name"];if(!t)continue;const r=t.trim();let s=t.length-r.length;if(a.length-s<0)throw new Error("Invalid format");let i=[];for(;s<a.length;){const e=a.pop();i.push(e)}for(let e of i)c=Math.max(c,e.endValue),n.leaveFrame(e,c);const l={key:`${e["Source Path"]||""}:${r}`,name:r,file:e["Source Path"],endValue:c+o(e)};n.enterFrame(l,c),a.push(l)}for(;a.length>0;){const e=a.pop();c=Math.max(c,e.endValue),n.leaveFrame(e,c)}return"Bytes Used"in s[0]?n.setValueFormatter(new r.ByteFormatter):("Weight"in s[0]||"Running Time"in s[0])&&n.setValueFormatter(new r.TimeFormatter("milliseconds")),n.build()}function c(e){return s(this,void 0,void 0,function*(){const t={name:e.name,files:new Map,subdirectories:new Map},r=yield new Promise((t,r)=>{e.createReader().readEntries(e=>{t(e)},r)});for(let e of r)if(e.isDirectory){const r=yield c(e);t.subdirectories.set(r.name,r)}else{const r=yield new Promise((t,r)=>{e.file(t,r)});t.files.set(r.name,r)}return t})}function l(e){return n.MaybeCompressedDataReader.fromFile(e).readAsArrayBuffer()}function u(e){return n.MaybeCompressedDataReader.fromFile(e).readAsText()}function f(e,r){const n=(0,t.getOrThrow)(e.subdirectories,"corespace"),s=(0,t.getOrThrow)(n.subdirectories,`run${r}`);return(0,t.getOrThrow)(s.subdirectories,"core")}class h{constructor(e){this.bytePos=0,this.view=new DataView(e)}seek(e){this.bytePos=e}skip(e){this.bytePos+=e}hasMore(){return this.bytePos<this.view.byteLength}bytesLeft(){return this.view.byteLength-this.bytePos}readUint8(){return this.bytePos++,this.bytePos>this.view.byteLength?0:this.view.getUint8(this.bytePos-1)}readUint32(){return this.bytePos+=4,this.bytePos>this.view.byteLength?0:this.view.getUint32(this.bytePos-4,!0)}readUint48(){return this.bytePos+=6,this.bytePos>this.view.byteLength?0:this.view.getUint32(this.bytePos-6,!0)+this.view.getUint16(this.bytePos-2,!0)*Math.pow(2,32)}readUint64(){return this.bytePos+=8,this.bytePos>this.view.byteLength?0:this.view.getUint32(this.bytePos-8,!0)+this.view.getUint32(this.bytePos-4,!0)*Math.pow(2,32)}}function p(e){return s(this,void 0,void 0,function*(){const r=(0,t.getOrThrow)(e.subdirectories,"stores");for(let e of r.subdirectories.values()){const r=e.files.get("schema.xml");if(!r)continue;const n=yield u(r);if(!/name="time-profile"/.exec(n.firstChunk()))continue;const s=new h(yield l((0,t.getOrThrow)(e.files,"bulkstore")));s.readUint32(),s.readUint32(),s.readUint32();const i=s.readUint32(),o=s.readUint32();s.seek(i);const a=[];for(;;){const e=s.readUint48();if(0===e)break;const t=s.readUint32();s.skip(o-6-4-4);const r=s.readUint32();a.push({timestamp:e,threadID:t,backtraceID:r})}return a}throw new Error("Could not find sample list")})}function d(e,r){return s(this,void 0,void 0,function*(){const e=(0,t.getOrThrow)(r.subdirectories,"uniquing"),n=(0,t.getOrThrow)(e.subdirectories,"arrayUniquer"),s=(0,t.getOrThrow)(n.files,"integeruniquer.index"),i=(0,t.getOrThrow)(n.files,"integeruniquer.data"),o=new h(yield l(s)),a=new h(yield l(i));o.seek(32);let c=[];for(;o.hasMore();){const e=o.readUint32()+1048576*o.readUint32();if(0===e)continue;a.seek(e);let t=a.readUint32(),r=[];for(;t--;)r.push(a.readUint64());c.push(r)}return c})}function m(e){return s(this,void 0,void 0,function*(){const r=(0,t.getOrThrow)(e.files,"form.template"),n=y(yield l(r)),s=n["com.apple.xray.owner.template.version"];let i=1;"com.apple.xray.owner.template"in n&&(i=n["com.apple.xray.owner.template"].get("_selectedRunNumber"));let o=n.$1;"stubInfoByUUID"in n&&(o=Array.from(n.stubInfoByUUID.keys())[0]);const a=n["com.apple.xray.run.data"],c=[];for(let e of a.runNumbers){const r=(0,t.getOrThrow)(a.runData,e),n=(0,t.getOrThrow)(r,"symbolsByPid"),s=new Map;for(let i of n.values()){for(let e of i.symbols){if(!e)continue;const{sourcePath:r,symbolName:n,addressToLine:i}=e;for(let e of i.keys())(0,t.getOrInsert)(s,e,()=>{const s=n||`0x${(0,t.zeroPad)(e.toString(16),16)}`,i={key:`${r}:${s}`,name:s};return r&&(i.file=r),i})}c.push({number:e,addressToFrameMap:s})}}return{version:s,instrument:o,selectedRunNumber:i,runs:c}})}function w(e){return s(this,void 0,void 0,function*(){const t=yield c(e),{version:r,runs:n,instrument:s,selectedRunNumber:i}=yield m(t);if("com.apple.xray.instrument-type.coresampler2"!==s)throw new Error(`The only supported instrument from .trace import is "com.apple.xray.instrument-type.coresampler2". Got ${s}`);console.log("version: ",r),console.log("Importing time profile");const o=[];let a=0;for(let c of n){const{addressToFrameMap:r,number:n}=c,s=yield g({fileName:e.name,tree:t,addressToFrameMap:r,runNumber:n});c.number===i&&(a=o.length+s.indexToView),o.push(...s.profiles)}return{name:e.name,indexToView:a,profiles:o}})}function g(e){return s(this,void 0,void 0,function*(){const{fileName:r,tree:n,addressToFrameMap:s,runNumber:i}=e,o=f(n,i);let a=yield p(o);const c=yield d(a,o),l=new Map;for(let e of a)l.set(e.threadID,(0,t.getOrElse)(l,e.threadID,()=>0)+1);const u=Array.from(l.entries());(0,t.sortBy)(u,e=>-e[1]);const h=u.map(e=>e[0]);return{name:r,indexToView:0,profiles:h.map(e=>b({threadID:e,fileName:r,arrays:c,addressToFrameMap:s,samples:a}))}})}function b(n){let{fileName:s,addressToFrameMap:i,arrays:o,threadID:a,samples:c}=n;const l=new Map;c=c.filter(e=>e.threadID===a);const u=new e.StackListProfileBuilder((0,t.lastOf)(c).timestamp);function f(e,r){const n=i.get(e);if(n)r.push(n);else if(e in o)for(let t of o[e])f(t,r);else{const n={key:e,name:`0x${(0,t.zeroPad)(e.toString(16),16)}`};i.set(e,n),r.push(n)}}u.setName(`${s} - thread ${a}`);let h=null;for(let e of c){const r=(0,t.getOrInsert)(l,e.backtraceID,e=>{const t=[];return f(e,t),t.reverse(),t});if(null===h&&(u.appendSampleWithWeight([],e.timestamp),h=e.timestamp),e.timestamp<h)throw new Error("Timestamps out of order!");u.appendSampleWithWeight(r,e.timestamp-h),h=e.timestamp}return u.setValueFormatter(new r.TimeFormatter("nanoseconds")),u.build()}function y(e){return T(I(new Uint8Array(e)),(e,t)=>{switch(e){case"NSTextStorage":case"NSParagraphStyle":case"NSFont":return null;case"PFTSymbolData":{const e=Object.create(null);e.symbolName=t.$0,e.sourcePath=t.$1,e.addressToLine=new Map;for(let r=3;;r+=2){const n=t["$"+r],s=t["$"+(r+1)];if(null==n||null==s)break;e.addressToLine.set(n,s)}return e}case"PFTOwnerData":{const e=Object.create(null);return e.ownerName=t.$0,e.ownerPath=t.$1,e}case"PFTPersistentSymbols":{const e=Object.create(null),r=t.$4;e.threadNames=t.$3,e.symbols=[];for(let n=1;n<r;n++)e.symbols.push(t["$"+(4+n)]);return e}case"XRRunListData":{const e=Object.create(null);return e.runNumbers=t.$0,e.runData=t.$1,e}case"XRIntKeyedDictionary":{const e=new Map,r=t.$0;for(let n=0;n<r;n++){const r=t["$"+(1+2*n)],s=t["$"+(2*n+1+1)];e.set(r,s)}return e}case"XRCore":{const e=Object.create(null);return e.number=t.$0,e.name=t.$1,e}}return t})}function v(e){let t=String.fromCharCode.apply(String,Array.from(e));return"\0"===t.slice(-1)&&(t=t.slice(0,-1)),decodeURIComponent(escape(t))}function U(e){return e instanceof Array}function S(e){return null!==e&&"object"==typeof e&&null===Object.getPrototypeOf(e)}function N(e,t){return t instanceof x?e[t.index]:t}function T(e,t=(e=>e)){if(1e5!==e.$version||"NSKeyedArchiver"!==e.$archiver||!S(e.$top)||!U(e.$objects))throw new Error("Invalid keyed archive");"$null"===e.$objects[0]&&(e.$objects[0]=null);for(let n=0;n<e.$objects.length;n++)e.$objects[n]=$(e.$objects,e.$objects[n],t);let r=t=>{if(t instanceof x)return e.$objects[t.index];if(U(t))for(let e=0;e<t.length;e++)t[e]=r(t[e]);else if(S(t))for(let e in t)t[e]=r(t[e]);else if(t instanceof Map){const e=new Map(t);t.clear();for(let[n,s]of e.entries())t.set(r(n),r(s))}return t};for(let n=0;n<e.$objects.length;n++)r(e.$objects[n]);return r(e.$top)}function $(e,t,r=(e=>e)){if(S(t)&&t.$class){let n=N(e,t.$class).$classname;switch(n){case"NSDecimalNumberPlaceholder":{let e=t["NS.length"],r=t["NS.exponent"],n=t["NS.mantissa.bo"],s=t["NS.negative"],i=new Uint16Array(new Uint8Array(t["NS.mantissa"]).buffer),o=0;for(let t=0;t<e;t++){let e=i[t];1!==n&&(e=(65280&e)>>8|(255&e)<<8),o+=e*Math.pow(65536,t)}return o*=Math.pow(10,r),s?-o:o}case"NSData":case"NSMutableData":return t["NS.bytes"]||t["NS.data"];case"NSString":case"NSMutableString":return t["NS.string"]?t["NS.string"]:t["NS.bytes"]?v(t["NS.bytes"]):(console.warn(`Unexpected ${n} format: `,t),null);case"NSArray":case"NSMutableArray":if("NS.objects"in t)return t["NS.objects"];let e=[];for(;;){let r="NS.object."+e.length;if(!(r in t))break;e.push(t[r])}return e;case"_NSKeyedCoderOldStyleArray":{const e=t["NS.count"];let r=[];for(let n=0;n<e;n++){const e=t["$"+n];r.push(e)}return r}case"NSDictionary":case"NSMutableDictionary":let s=new Map;if("NS.keys"in t&&"NS.objects"in t)for(let r=0;r<t["NS.keys"].length;r++)s.set(t["NS.keys"][r],t["NS.objects"][r]);else for(;;){let e="NS.key."+s.size,r="NS.object."+s.size;if(!(e in t&&r in t))break;s.set(t[e],t[r])}return s;default:const i=r(n,t);if(i!==t)return i}}return t}class x{constructor(e){this.index=e}}function I(e){for(let t=0;t<8;t++)if(e[t]!=="bplist00".charCodeAt(t))throw new Error("File is not a binary plist");return new M(new DataView(e.buffer,e.byteOffset,e.byteLength)).parseRoot()}exports.UID=x;class M{constructor(e){this.view=e,this.referenceSize=0,this.objects=[],this.offsetTable=[]}parseRoot(){let e=this.view.byteLength-32,t=this.view.getUint8(e+6);this.referenceSize=this.view.getUint8(e+7);let r=this.view.getUint32(e+12,!1),n=this.view.getUint32(e+20,!1),s=this.view.getUint32(e+28,!1);for(let i=0;i<r;i++)this.offsetTable.push(this.parseInteger(s,t)),s+=t;return this.parseObject(this.offsetTable[n])}parseLengthAndOffset(e,t){if(15!==t)return{length:t,offset:0};let r=this.view.getUint8(e++);if(16!=(240&r))throw new Error("Unexpected non-integer length at offset "+e);let n=1<<(15&r);return{length:this.parseInteger(e,n),offset:n+1}}parseSingleton(e,t){if(0===t)return null;if(8===t)return!1;if(9===t)return!0;throw new Error("Unexpected extra value "+t+" at offset "+e)}parseInteger(e,t){if(1===t)return this.view.getUint8(e);if(2===t)return this.view.getUint16(e,!1);if(4===t)return this.view.getUint32(e,!1);if(8===t)return Math.pow(2,32)*this.view.getUint32(e+0,!1)+Math.pow(2,0)*this.view.getUint32(e+4,!1);if(16===t)return Math.pow(2,96)*this.view.getUint32(e+0,!1)+Math.pow(2,64)*this.view.getUint32(e+4,!1)+Math.pow(2,32)*this.view.getUint32(e+8,!1)+Math.pow(2,0)*this.view.getUint32(e+12,!1);throw new Error("Unexpected integer of size "+t+" at offset "+e)}parseFloat(e,t){if(4===t)return this.view.getFloat32(e,!1);if(8===t)return this.view.getFloat64(e,!1);throw new Error("Unexpected float of size "+t+" at offset "+e)}parseDate(e,t){if(8!==t)throw new Error("Unexpected date of size "+t+" at offset "+e);let r=this.view.getFloat64(e,!1);return new Date(9783072e5+1e3*r)}parseData(e,t){let r=this.parseLengthAndOffset(e,t);return new Uint8Array(this.view.buffer,e+r.offset,r.length)}parseStringASCII(e,t){let r=this.parseLengthAndOffset(e,t),n="";e+=r.offset;for(let s=0;s<r.length;s++)n+=String.fromCharCode(this.view.getUint8(e++));return n}parseStringUTF16(e,t){let r=this.parseLengthAndOffset(e,t),n="";e+=r.offset;for(let s=0;s<r.length;s++)n+=String.fromCharCode(this.view.getUint16(e,!1)),e+=2;return n}parseUID(e,t){return new x(this.parseInteger(e,t))}parseArray(e,t){let r=this.parseLengthAndOffset(e,t),n=[],s=this.referenceSize;e+=r.offset;for(let i=0;i<r.length;i++)n.push(this.parseObject(this.offsetTable[this.parseInteger(e,s)])),e+=s;return n}parseDictionary(e,t){let r=this.parseLengthAndOffset(e,t),n=Object.create(null),s=this.referenceSize,i=e+r.offset,o=i+r.length*s;for(let a=0;a<r.length;a++){let e=this.parseObject(this.offsetTable[this.parseInteger(i,s)]),t=this.parseObject(this.offsetTable[this.parseInteger(o,s)]);if("string"!=typeof e)throw new Error("Unexpected non-string key at offset "+i);n[e]=t,i+=s,o+=s}return n}parseObject(e){let t=this.view.getUint8(e++),r=15&t;switch(t>>4){case 0:return this.parseSingleton(e,r);case 1:return this.parseInteger(e,1<<r);case 2:return this.parseFloat(e,1<<r);case 3:return this.parseDate(e,1<<r);case 4:return this.parseData(e,r);case 5:return this.parseStringASCII(e,r);case 6:return this.parseStringUTF16(e,r);case 8:return this.parseUID(e,r+1);case 10:return this.parseArray(e,r);case 13:return this.parseDictionary(e,r)}throw new Error("Unexpected marker "+t+" at offset "+--e)}}
43
45
  },{"../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4","./utils":"QTYz"}],"flbo":[function(require,module,exports) {
44
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromBGFlameGraph=t;var e=require("../lib/profile");function r(e){const r=[];return e.replace(/^(.*) (\d+)$/gm,(e,t,i)=>(r.push({stack:t.split(";").map(e=>({key:e,name:e})),duration:parseInt(i,10)}),e)),r}function t(t){const i=r(t),n=i.reduce((e,r)=>e+r.duration,0),o=new e.StackListProfileBuilder(n);if(0===i.length)return null;for(let e of i)o.appendSampleWithWeight(e.stack,e.duration);return o.build()}
46
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromBGFlameGraph=r;var e=require("../lib/profile");function t(e){const t=[];for(const r of e.splitLines()){const e=/^(.*) (\d+)$/gm.exec(r);if(!e)continue;const n=e[1],i=e[2];t.push({stack:n.split(";").map(e=>({key:e,name:e})),duration:parseInt(i,10)})}return t}function r(r){const n=t(r),i=n.reduce((e,t)=>e+t.duration,0),o=new e.StackListProfileBuilder(i);if(0===n.length)return null;for(let e of n)o.appendSampleWithWeight(e.stack,e.duration);return o.build()}
45
47
  },{"../lib/profile":"YG8z"}],"uNW1":[function(require,module,exports) {
46
48
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromFirefox=l;var e=require("../lib/profile"),t=require("../lib/utils"),r=require("../lib/value-formatters");function l(l){const n=l.profile,s=1===n.threads.length?n.threads[0]:n.threads.filter(e=>"GeckoMain"===e.name)[0],a=new Map;function o(e){let r=e[0];const l=[];for(;null!=r;){const e=s.stackTable.data[r],[t,n]=e;l.push(n),r=t}return l.reverse(),l.map(e=>{const r=s.frameTable.data[e],l=s.stringTable[r[0]],n=/(.*)\s+\((.*?)(?::(\d+))?(?::(\d+))?\)$/.exec(l);return n?n[2].startsWith("resource:")||"self-hosted"===n[2]||n[2].startsWith("self-hosted:")?null:(0,t.getOrInsert)(a,l,()=>({key:l,name:n[1],file:n[2],line:n[3]?parseInt(n[3]):void 0,col:n[4]?parseInt(n[4])+1:void 0})):null}).filter(e=>null!=e)}const i=new e.CallTreeProfileBuilder(l.duration);let u=[];for(let e of s.samples.data){const t=o(e),r=e[1];let l=-1;for(let e=0;e<Math.min(t.length,u.length)&&u[e]===t[e];e++)l=e;for(let e=u.length-1;e>l;e--)i.leaveFrame(u[e],r);for(let e=l+1;e<t.length;e++)i.enterFrame(t[e],r);u=t}return i.setValueFormatter(new r.TimeFormatter("milliseconds")),i.build()}
47
49
  },{"../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4"}],"QV03":[function(require,module,exports) {
48
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromV8ProfLog=n;var e=require("../lib/profile"),t=require("../lib/utils"),r=require("../lib/value-formatters");function a(e,t){if(!e||!e.type)return{key:"(unknown type)",name:"(unknown type)"};let r=e.name;switch(e.type){case"CPP":{const e=r.match(/[tT] ([^(<]*)/);e&&(r=`(c++) ${e[1]}`);break}case"SHARED_LIB":r="(LIB) "+r;break;case"JS":{const e=r.match(/([a-zA-Z0-9\._\-$]*) ([a-zA-Z0-9\.\-_\/$]*):(\d+):(\d+)/);if(e)return{key:r,name:e[1].length>0?e[1]:"(anonymous)",file:e[2].length>0?e[2]:"(unknown file)",line:parseInt(e[3],10),col:parseInt(e[4],10)};break}case"CODE":switch(e.kind){case"LoadIC":case"StoreIC":case"KeyedStoreIC":case"KeyedLoadIC":case"LoadGlobalIC":case"Handler":r="(IC) "+r;break;case"BytecodeHandler":r="(bytecode) ~"+r;break;case"Stub":r="(stub) "+r;break;case"Builtin":r="(builtin) "+r;break;case"RegExp":r="(regexp) "+r}break;default:r=`(${e.type}) ${r}`}return{key:r,name:r}}function n(n){const s=new e.StackListProfileBuilder,o=new Map;let c=0;(0,t.sortBy)(n.ticks,e=>e.tm);for(let e of n.ticks){const r=[];for(let s=e.s.length-2;s>=0;s-=2){const c=e.s[s];-1!==c&&(c>n.code.length?r.push({key:c,name:`0x${c.toString(16)}`}):r.push((i=c,(0,t.getOrInsert)(o,i,e=>a(n.code[e],n)))))}s.appendSampleWithWeight(r,e.tm-c),c=e.tm}var i;return s.setValueFormatter(new r.TimeFormatter("microseconds")),s.build()}
50
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromV8ProfLog=n;var e=require("../lib/profile"),t=require("../lib/utils"),r=require("../lib/value-formatters");function a(e,t){if(!e||!e.type)return{key:"(unknown type)",name:"(unknown type)"};let r=e.name;switch(e.type){case"CPP":{const e=r.match(/[tT] ([^(<]*)/);e&&(r=`(c++) ${e[1]}`);break}case"SHARED_LIB":r="(LIB) "+r;break;case"JS":{const e=r.match(/([a-zA-Z0-9\._\-$]*) ([a-zA-Z0-9\.\-_\/$]*):(\d+):(\d+)/);if(e){const t=e[2],a=parseInt(e[3],10),n=parseInt(e[4],10);return{key:r,name:e[1].length>0?e[1]:t?`(anonymous ${t.split("/").pop()}:${a})`:"(anonymous)",file:t.length>0?t:"(unknown file)",line:a,col:n}}break}case"CODE":switch(e.kind){case"LoadIC":case"StoreIC":case"KeyedStoreIC":case"KeyedLoadIC":case"LoadGlobalIC":case"Handler":r="(IC) "+r;break;case"BytecodeHandler":r="(bytecode) ~"+r;break;case"Stub":r="(stub) "+r;break;case"Builtin":r="(builtin) "+r;break;case"RegExp":r="(regexp) "+r}break;default:r=`(${e.type}) ${r}`}return{key:r,name:r}}function n(n){const o=new e.StackListProfileBuilder,s=new Map;let c=0;(0,t.sortBy)(n.ticks,e=>e.tm);for(let e of n.ticks){const r=[];for(let o=e.s.length-2;o>=0;o-=2){const c=e.s[o];-1!==c&&(c>n.code.length?r.push({key:c,name:`0x${c.toString(16)}`}):r.push((i=c,(0,t.getOrInsert)(s,i,e=>a(n.code[e],n)))))}o.appendSampleWithWeight(r,e.tm-c),c=e.tm}var i;return o.setValueFormatter(new r.TimeFormatter("microseconds")),o.build()}
49
51
  },{"../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4"}],"f2sa":[function(require,module,exports) {
50
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromLinuxPerf=r;var e=require("../lib/profile"),t=require("../lib/utils"),n=require("../lib/value-formatters");function s(e){const t=e.split("\n").filter(e=>!/^\s*#/.exec(e)),n={command:null,processID:null,threadID:null,time:null,eventType:"",stack:[]},s=t.shift();if(!s)return null;const r=/^(\S.+?)\s+(\d+)(?:\/?(\d+))?\s+/.exec(s);if(!r)return null;n.command=r[1],r[3]?(n.processID=parseInt(r[2],10),n.threadID=parseInt(r[3],10)):n.threadID=parseInt(r[2],10);const l=/\s+(\d+\.\d+):\s+/.exec(s);l&&(n.time=parseFloat(l[1]));const i=/(\S+):\s*$/.exec(s);i&&(n.eventType=i[1]);for(let o of t){const e=/^\s*(\w+)\s*(.+) \((\S*)\)/.exec(o);if(!e)continue;let[,t,s,r]=e;s=s.replace(/\+0x[\da-f]+$/,""),n.stack.push({address:`0x${t}`,symbolName:s,file:r})}return n.stack.reverse(),n}function r(r){const l=new Map;let i=null;const o=r.split("\n\n").map(s);for(let s of o){if(null==s)continue;if(null!=i&&i!=s.eventType)continue;if(null==s.time)continue;i=s.eventType;let r=[];s.command&&r.push(s.command),s.processID&&r.push(`pid: ${s.processID}`),s.threadID&&r.push(`tid: ${s.threadID}`);const o=r.join(" ");(0,t.getOrInsert)(l,o,()=>{const t=new e.StackListProfileBuilder;return t.setName(o),t.setValueFormatter(new n.TimeFormatter("seconds")),t}).appendSampleWithTimestamp(s.stack.map(({symbolName:e,file:t})=>({key:`${e} (${t})`,name:"[unknown]"===e?`??? (${t})`:e,file:t})),s.time)}return 0===l.size?null:{name:1===l.size?Array.from(l.keys())[0]:"",indexToView:0,profiles:Array.from((0,t.itMap)(l.values(),e=>e.build()))}}
52
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromLinuxPerf=l;var e=require("../lib/profile"),t=require("../lib/utils"),n=require("../lib/value-formatters");function*r(e){let t=[];for(let n of e.splitLines())""===n?(yield s(t),t=[]):t.push(n);t.length>0&&(yield s(t))}function s(e){const t=e.filter(e=>!/^\s*#/.exec(e)),n={command:null,processID:null,threadID:null,time:null,eventType:"",stack:[]},r=t.shift();if(!r)return null;const s=/^(\S.+?)\s+(\d+)(?:\/?(\d+))?\s+/.exec(r);if(!s)return null;n.command=s[1],s[3]?(n.processID=parseInt(s[2],10),n.threadID=parseInt(s[3],10)):n.threadID=parseInt(s[2],10);const l=/\s+(\d+\.\d+):\s+/.exec(r);l&&(n.time=parseFloat(l[1]));const i=/(\S+):\s*$/.exec(r);i&&(n.eventType=i[1]);for(let o of t){const e=/^\s*(\w+)\s*(.+) \((\S*)\)/.exec(o);if(!e)continue;let[,t,r,s]=e;r=r.replace(/\+0x[\da-f]+$/,""),n.stack.push({address:`0x${t}`,symbolName:r,file:s})}return n.stack.reverse(),n}function l(s){const l=new Map;let i=null;for(let o of r(s)){if(null==o)continue;if(null!=i&&i!=o.eventType)continue;if(null==o.time)continue;i=o.eventType;let r=[];o.command&&r.push(o.command),o.processID&&r.push(`pid: ${o.processID}`),o.threadID&&r.push(`tid: ${o.threadID}`);const s=r.join(" ");(0,t.getOrInsert)(l,s,()=>{const t=new e.StackListProfileBuilder;return t.setName(s),t.setValueFormatter(new n.TimeFormatter("seconds")),t}).appendSampleWithTimestamp(o.stack.map(({symbolName:e,file:t})=>({key:`${e} (${t})`,name:"[unknown]"===e?`??? (${t})`:e,file:t})),o.time)}return 0===l.size?null:{name:1===l.size?Array.from(l.keys())[0]:"",indexToView:0,profiles:Array.from((0,t.itMap)(l.values(),e=>e.build()))}}
51
53
  },{"../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4"}],"jm73":[function(require,module,exports) {
52
54
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromHaskell=l;var e=require("../lib/profile"),r=require("../lib/value-formatters");function t(e,r,l,o,i){if(0===e.ticks&&0===e.entries&&0===e.alloc&&0===e.children.length)return r;let a=r,s=o.get(e.id);l.enterFrame(s,a);for(let n of e.children)a=t(n,a,l,o,i);return a+=i(e),l.leaveFrame(s,a),a}function l(l){const o=new Map;for(let e of l.cost_centres){const r={key:e.id,name:`${e.module}.${e.label}`};e.src_loc.startsWith("<")||(r.file=e.src_loc),o.set(e.id,r)}const i=new e.CallTreeProfileBuilder(l.total_ticks);t(l.profile,0,i,o,e=>e.ticks),i.setValueFormatter(new r.TimeFormatter("milliseconds")),i.setName(`${l.program} time`);const a=new e.CallTreeProfileBuilder(l.total_ticks);return t(l.profile,0,a,o,e=>e.alloc),a.setValueFormatter(new r.ByteFormatter),a.setName(`${l.program} allocation`),{name:l.program,indexToView:0,profiles:[i.build(),a.build()]}}
53
55
  },{"../lib/profile":"YG8z","../lib/value-formatters":"LsM4"}],"jP3w":[function(require,module,exports) {
54
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromSafari=i;var e=require("../lib/profile"),r=require("../lib/value-formatters");function t(e){return e.map(({name:e,url:r,line:t,column:i})=>({key:`${e}:${r}:${t}:${i}`,file:r,line:t,col:i,name:e||"(anonymous)"})).reverse()}function i(i){1!==i.version&&console.warn(`Unknown Safari profile version ${i.version}... Might be incompatible.`);const{recording:n}=i,{sampleStackTraces:a,sampleDurations:o}=n,s=a.length;if(s<1)return console.warn("Empty profile"),null;const l=a[s-1].timestamp-a[0].timestamp+o[0],m=new e.StackListProfileBuilder(l);let p=Number.MAX_VALUE;return a.forEach((e,r)=>{const i=e.timestamp,n=o[r],a=i-n-p;a>.002&&m.appendSampleWithWeight([],a),m.appendSampleWithWeight(t(e.stackFrames),n),p=i}),m.setValueFormatter(new r.TimeFormatter("seconds")),m.setName(n.displayName),m.build()}
56
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromSafari=i;var e=require("../lib/profile"),r=require("../lib/value-formatters");function t(e){return e.map(({name:e,url:r,line:t,column:i})=>({key:`${e}:${r}:${t}:${i}`,file:r,line:t,col:i,name:e||(r?`(anonymous ${r.split("/").pop()}:${t})`:"(anonymous)")})).reverse()}function i(i){1!==i.version&&console.warn(`Unknown Safari profile version ${i.version}... Might be incompatible.`);const{recording:n}=i,{sampleStackTraces:a,sampleDurations:o}=n,s=a.length;if(s<1)return console.warn("Empty profile"),null;const l=a[s-1].timestamp-a[0].timestamp+o[0],m=new e.StackListProfileBuilder(l);let p=Number.MAX_VALUE;return a.forEach((e,r)=>{const i=e.timestamp,n=o[r],a=i-n-p;a>.002&&m.appendSampleWithWeight([],a),m.appendSampleWithWeight(t(e.stackFrames),n),p=i}),m.setValueFormatter(new r.TimeFormatter("seconds")),m.setName(n.displayName),m.build()}
55
57
  },{"../lib/profile":"YG8z","../lib/value-formatters":"LsM4"}],"oU4k":[function(require,module,exports) {
56
58
  "use strict";function n(n,e){for(var r=new Array(arguments.length-1),t=0,l=2,o=!0;l<arguments.length;)r[t++]=arguments[l++];return new Promise(function(l,u){r[t]=function(n){if(o)if(o=!1,n)u(n);else{for(var e=new Array(arguments.length-1),r=0;r<e.length;)e[r++]=arguments[r];l.apply(null,e)}};try{n.apply(e||null,r)}catch(a){o&&(o=!1,u(a))}})}module.exports=n;
57
59
  },{}],"SASd":[function(require,module,exports) {
@@ -103,13 +105,19 @@ var e=arguments[3],r=require("buffer").Buffer,t=exports;function n(e,r,t){for(va
103
105
  "use strict";module.exports=require("./src/index-minimal");
104
106
  },{"./src/index-minimal":"qETn"}],"YdJi":[function(require,module,exports) {
105
107
  "use strict";var e=require("protobufjs/minimal"),n=e.Reader,t=e.Writer,o=e.util,r=e.roots.default||(e.roots.default={});r.perftools=function(){var i,l={};return l.profiles=((i={}).Profile=function(){function i(e){if(this.sampleType=[],this.sample=[],this.mapping=[],this.location=[],this.function=[],this.stringTable=[],this.comment=[],e)for(var n=Object.keys(e),t=0;t<n.length;++t)null!=e[n[t]]&&(this[n[t]]=e[n[t]])}return i.prototype.sampleType=o.emptyArray,i.prototype.sample=o.emptyArray,i.prototype.mapping=o.emptyArray,i.prototype.location=o.emptyArray,i.prototype.function=o.emptyArray,i.prototype.stringTable=o.emptyArray,i.prototype.dropFrames=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.keepFrames=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.timeNanos=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.durationNanos=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.periodType=null,i.prototype.period=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.comment=o.emptyArray,i.prototype.defaultSampleType=o.Long?o.Long.fromBits(0,0,!1):0,i.create=function(e){return new i(e)},i.encode=function(e,n){if(n||(n=t.create()),null!=e.sampleType&&e.sampleType.length)for(var o=0;o<e.sampleType.length;++o)r.perftools.profiles.ValueType.encode(e.sampleType[o],n.uint32(10).fork()).ldelim();if(null!=e.sample&&e.sample.length)for(o=0;o<e.sample.length;++o)r.perftools.profiles.Sample.encode(e.sample[o],n.uint32(18).fork()).ldelim();if(null!=e.mapping&&e.mapping.length)for(o=0;o<e.mapping.length;++o)r.perftools.profiles.Mapping.encode(e.mapping[o],n.uint32(26).fork()).ldelim();if(null!=e.location&&e.location.length)for(o=0;o<e.location.length;++o)r.perftools.profiles.Location.encode(e.location[o],n.uint32(34).fork()).ldelim();if(null!=e.function&&e.function.length)for(o=0;o<e.function.length;++o)r.perftools.profiles.Function.encode(e.function[o],n.uint32(42).fork()).ldelim();if(null!=e.stringTable&&e.stringTable.length)for(o=0;o<e.stringTable.length;++o)n.uint32(50).string(e.stringTable[o]);if(null!=e.dropFrames&&e.hasOwnProperty("dropFrames")&&n.uint32(56).int64(e.dropFrames),null!=e.keepFrames&&e.hasOwnProperty("keepFrames")&&n.uint32(64).int64(e.keepFrames),null!=e.timeNanos&&e.hasOwnProperty("timeNanos")&&n.uint32(72).int64(e.timeNanos),null!=e.durationNanos&&e.hasOwnProperty("durationNanos")&&n.uint32(80).int64(e.durationNanos),null!=e.periodType&&e.hasOwnProperty("periodType")&&r.perftools.profiles.ValueType.encode(e.periodType,n.uint32(90).fork()).ldelim(),null!=e.period&&e.hasOwnProperty("period")&&n.uint32(96).int64(e.period),null!=e.comment&&e.comment.length){for(n.uint32(106).fork(),o=0;o<e.comment.length;++o)n.int64(e.comment[o]);n.ldelim()}return null!=e.defaultSampleType&&e.hasOwnProperty("defaultSampleType")&&n.uint32(112).int64(e.defaultSampleType),n},i.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},i.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,i=new r.perftools.profiles.Profile;e.pos<o;){var l=e.uint32();switch(l>>>3){case 1:i.sampleType&&i.sampleType.length||(i.sampleType=[]),i.sampleType.push(r.perftools.profiles.ValueType.decode(e,e.uint32()));break;case 2:i.sample&&i.sample.length||(i.sample=[]),i.sample.push(r.perftools.profiles.Sample.decode(e,e.uint32()));break;case 3:i.mapping&&i.mapping.length||(i.mapping=[]),i.mapping.push(r.perftools.profiles.Mapping.decode(e,e.uint32()));break;case 4:i.location&&i.location.length||(i.location=[]),i.location.push(r.perftools.profiles.Location.decode(e,e.uint32()));break;case 5:i.function&&i.function.length||(i.function=[]),i.function.push(r.perftools.profiles.Function.decode(e,e.uint32()));break;case 6:i.stringTable&&i.stringTable.length||(i.stringTable=[]),i.stringTable.push(e.string());break;case 7:i.dropFrames=e.int64();break;case 8:i.keepFrames=e.int64();break;case 9:i.timeNanos=e.int64();break;case 10:i.durationNanos=e.int64();break;case 11:i.periodType=r.perftools.profiles.ValueType.decode(e,e.uint32());break;case 12:i.period=e.int64();break;case 13:if(i.comment&&i.comment.length||(i.comment=[]),2==(7&l))for(var s=e.uint32()+e.pos;e.pos<s;)i.comment.push(e.int64());else i.comment.push(e.int64());break;case 14:i.defaultSampleType=e.int64();break;default:e.skipType(7&l)}}return i},i.decodeDelimited=function(e){return e instanceof n||(e=new n(e)),this.decode(e,e.uint32())},i.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sampleType&&e.hasOwnProperty("sampleType")){if(!Array.isArray(e.sampleType))return"sampleType: array expected";for(var n=0;n<e.sampleType.length;++n)if(t=r.perftools.profiles.ValueType.verify(e.sampleType[n]))return"sampleType."+t}if(null!=e.sample&&e.hasOwnProperty("sample")){if(!Array.isArray(e.sample))return"sample: array expected";for(n=0;n<e.sample.length;++n)if(t=r.perftools.profiles.Sample.verify(e.sample[n]))return"sample."+t}if(null!=e.mapping&&e.hasOwnProperty("mapping")){if(!Array.isArray(e.mapping))return"mapping: array expected";for(n=0;n<e.mapping.length;++n)if(t=r.perftools.profiles.Mapping.verify(e.mapping[n]))return"mapping."+t}if(null!=e.location&&e.hasOwnProperty("location")){if(!Array.isArray(e.location))return"location: array expected";for(n=0;n<e.location.length;++n)if(t=r.perftools.profiles.Location.verify(e.location[n]))return"location."+t}if(null!=e.function&&e.hasOwnProperty("function")){if(!Array.isArray(e.function))return"function: array expected";for(n=0;n<e.function.length;++n)if(t=r.perftools.profiles.Function.verify(e.function[n]))return"function."+t}if(null!=e.stringTable&&e.hasOwnProperty("stringTable")){if(!Array.isArray(e.stringTable))return"stringTable: array expected";for(n=0;n<e.stringTable.length;++n)if(!o.isString(e.stringTable[n]))return"stringTable: string[] expected"}if(null!=e.dropFrames&&e.hasOwnProperty("dropFrames")&&!(o.isInteger(e.dropFrames)||e.dropFrames&&o.isInteger(e.dropFrames.low)&&o.isInteger(e.dropFrames.high)))return"dropFrames: integer|Long expected";if(null!=e.keepFrames&&e.hasOwnProperty("keepFrames")&&!(o.isInteger(e.keepFrames)||e.keepFrames&&o.isInteger(e.keepFrames.low)&&o.isInteger(e.keepFrames.high)))return"keepFrames: integer|Long expected";if(null!=e.timeNanos&&e.hasOwnProperty("timeNanos")&&!(o.isInteger(e.timeNanos)||e.timeNanos&&o.isInteger(e.timeNanos.low)&&o.isInteger(e.timeNanos.high)))return"timeNanos: integer|Long expected";if(null!=e.durationNanos&&e.hasOwnProperty("durationNanos")&&!(o.isInteger(e.durationNanos)||e.durationNanos&&o.isInteger(e.durationNanos.low)&&o.isInteger(e.durationNanos.high)))return"durationNanos: integer|Long expected";var t;if(null!=e.periodType&&e.hasOwnProperty("periodType")&&(t=r.perftools.profiles.ValueType.verify(e.periodType)))return"periodType."+t;if(null!=e.period&&e.hasOwnProperty("period")&&!(o.isInteger(e.period)||e.period&&o.isInteger(e.period.low)&&o.isInteger(e.period.high)))return"period: integer|Long expected";if(null!=e.comment&&e.hasOwnProperty("comment")){if(!Array.isArray(e.comment))return"comment: array expected";for(n=0;n<e.comment.length;++n)if(!(o.isInteger(e.comment[n])||e.comment[n]&&o.isInteger(e.comment[n].low)&&o.isInteger(e.comment[n].high)))return"comment: integer|Long[] expected"}return null!=e.defaultSampleType&&e.hasOwnProperty("defaultSampleType")&&!(o.isInteger(e.defaultSampleType)||e.defaultSampleType&&o.isInteger(e.defaultSampleType.low)&&o.isInteger(e.defaultSampleType.high))?"defaultSampleType: integer|Long expected":null},i.fromObject=function(e){if(e instanceof r.perftools.profiles.Profile)return e;var n=new r.perftools.profiles.Profile;if(e.sampleType){if(!Array.isArray(e.sampleType))throw TypeError(".perftools.profiles.Profile.sampleType: array expected");n.sampleType=[];for(var t=0;t<e.sampleType.length;++t){if("object"!=typeof e.sampleType[t])throw TypeError(".perftools.profiles.Profile.sampleType: object expected");n.sampleType[t]=r.perftools.profiles.ValueType.fromObject(e.sampleType[t])}}if(e.sample){if(!Array.isArray(e.sample))throw TypeError(".perftools.profiles.Profile.sample: array expected");for(n.sample=[],t=0;t<e.sample.length;++t){if("object"!=typeof e.sample[t])throw TypeError(".perftools.profiles.Profile.sample: object expected");n.sample[t]=r.perftools.profiles.Sample.fromObject(e.sample[t])}}if(e.mapping){if(!Array.isArray(e.mapping))throw TypeError(".perftools.profiles.Profile.mapping: array expected");for(n.mapping=[],t=0;t<e.mapping.length;++t){if("object"!=typeof e.mapping[t])throw TypeError(".perftools.profiles.Profile.mapping: object expected");n.mapping[t]=r.perftools.profiles.Mapping.fromObject(e.mapping[t])}}if(e.location){if(!Array.isArray(e.location))throw TypeError(".perftools.profiles.Profile.location: array expected");for(n.location=[],t=0;t<e.location.length;++t){if("object"!=typeof e.location[t])throw TypeError(".perftools.profiles.Profile.location: object expected");n.location[t]=r.perftools.profiles.Location.fromObject(e.location[t])}}if(e.function){if(!Array.isArray(e.function))throw TypeError(".perftools.profiles.Profile.function: array expected");for(n.function=[],t=0;t<e.function.length;++t){if("object"!=typeof e.function[t])throw TypeError(".perftools.profiles.Profile.function: object expected");n.function[t]=r.perftools.profiles.Function.fromObject(e.function[t])}}if(e.stringTable){if(!Array.isArray(e.stringTable))throw TypeError(".perftools.profiles.Profile.stringTable: array expected");for(n.stringTable=[],t=0;t<e.stringTable.length;++t)n.stringTable[t]=String(e.stringTable[t])}if(null!=e.dropFrames&&(o.Long?(n.dropFrames=o.Long.fromValue(e.dropFrames)).unsigned=!1:"string"==typeof e.dropFrames?n.dropFrames=parseInt(e.dropFrames,10):"number"==typeof e.dropFrames?n.dropFrames=e.dropFrames:"object"==typeof e.dropFrames&&(n.dropFrames=new o.LongBits(e.dropFrames.low>>>0,e.dropFrames.high>>>0).toNumber())),null!=e.keepFrames&&(o.Long?(n.keepFrames=o.Long.fromValue(e.keepFrames)).unsigned=!1:"string"==typeof e.keepFrames?n.keepFrames=parseInt(e.keepFrames,10):"number"==typeof e.keepFrames?n.keepFrames=e.keepFrames:"object"==typeof e.keepFrames&&(n.keepFrames=new o.LongBits(e.keepFrames.low>>>0,e.keepFrames.high>>>0).toNumber())),null!=e.timeNanos&&(o.Long?(n.timeNanos=o.Long.fromValue(e.timeNanos)).unsigned=!1:"string"==typeof e.timeNanos?n.timeNanos=parseInt(e.timeNanos,10):"number"==typeof e.timeNanos?n.timeNanos=e.timeNanos:"object"==typeof e.timeNanos&&(n.timeNanos=new o.LongBits(e.timeNanos.low>>>0,e.timeNanos.high>>>0).toNumber())),null!=e.durationNanos&&(o.Long?(n.durationNanos=o.Long.fromValue(e.durationNanos)).unsigned=!1:"string"==typeof e.durationNanos?n.durationNanos=parseInt(e.durationNanos,10):"number"==typeof e.durationNanos?n.durationNanos=e.durationNanos:"object"==typeof e.durationNanos&&(n.durationNanos=new o.LongBits(e.durationNanos.low>>>0,e.durationNanos.high>>>0).toNumber())),null!=e.periodType){if("object"!=typeof e.periodType)throw TypeError(".perftools.profiles.Profile.periodType: object expected");n.periodType=r.perftools.profiles.ValueType.fromObject(e.periodType)}if(null!=e.period&&(o.Long?(n.period=o.Long.fromValue(e.period)).unsigned=!1:"string"==typeof e.period?n.period=parseInt(e.period,10):"number"==typeof e.period?n.period=e.period:"object"==typeof e.period&&(n.period=new o.LongBits(e.period.low>>>0,e.period.high>>>0).toNumber())),e.comment){if(!Array.isArray(e.comment))throw TypeError(".perftools.profiles.Profile.comment: array expected");for(n.comment=[],t=0;t<e.comment.length;++t)o.Long?(n.comment[t]=o.Long.fromValue(e.comment[t])).unsigned=!1:"string"==typeof e.comment[t]?n.comment[t]=parseInt(e.comment[t],10):"number"==typeof e.comment[t]?n.comment[t]=e.comment[t]:"object"==typeof e.comment[t]&&(n.comment[t]=new o.LongBits(e.comment[t].low>>>0,e.comment[t].high>>>0).toNumber())}return null!=e.defaultSampleType&&(o.Long?(n.defaultSampleType=o.Long.fromValue(e.defaultSampleType)).unsigned=!1:"string"==typeof e.defaultSampleType?n.defaultSampleType=parseInt(e.defaultSampleType,10):"number"==typeof e.defaultSampleType?n.defaultSampleType=e.defaultSampleType:"object"==typeof e.defaultSampleType&&(n.defaultSampleType=new o.LongBits(e.defaultSampleType.low>>>0,e.defaultSampleType.high>>>0).toNumber())),n},i.toObject=function(e,n){n||(n={});var t={};if((n.arrays||n.defaults)&&(t.sampleType=[],t.sample=[],t.mapping=[],t.location=[],t.function=[],t.stringTable=[],t.comment=[]),n.defaults){if(o.Long){var i=new o.Long(0,0,!1);t.dropFrames=n.longs===String?i.toString():n.longs===Number?i.toNumber():i}else t.dropFrames=n.longs===String?"0":0;o.Long?(i=new o.Long(0,0,!1),t.keepFrames=n.longs===String?i.toString():n.longs===Number?i.toNumber():i):t.keepFrames=n.longs===String?"0":0,o.Long?(i=new o.Long(0,0,!1),t.timeNanos=n.longs===String?i.toString():n.longs===Number?i.toNumber():i):t.timeNanos=n.longs===String?"0":0,o.Long?(i=new o.Long(0,0,!1),t.durationNanos=n.longs===String?i.toString():n.longs===Number?i.toNumber():i):t.durationNanos=n.longs===String?"0":0,t.periodType=null,o.Long?(i=new o.Long(0,0,!1),t.period=n.longs===String?i.toString():n.longs===Number?i.toNumber():i):t.period=n.longs===String?"0":0,o.Long?(i=new o.Long(0,0,!1),t.defaultSampleType=n.longs===String?i.toString():n.longs===Number?i.toNumber():i):t.defaultSampleType=n.longs===String?"0":0}if(e.sampleType&&e.sampleType.length){t.sampleType=[];for(var l=0;l<e.sampleType.length;++l)t.sampleType[l]=r.perftools.profiles.ValueType.toObject(e.sampleType[l],n)}if(e.sample&&e.sample.length)for(t.sample=[],l=0;l<e.sample.length;++l)t.sample[l]=r.perftools.profiles.Sample.toObject(e.sample[l],n);if(e.mapping&&e.mapping.length)for(t.mapping=[],l=0;l<e.mapping.length;++l)t.mapping[l]=r.perftools.profiles.Mapping.toObject(e.mapping[l],n);if(e.location&&e.location.length)for(t.location=[],l=0;l<e.location.length;++l)t.location[l]=r.perftools.profiles.Location.toObject(e.location[l],n);if(e.function&&e.function.length)for(t.function=[],l=0;l<e.function.length;++l)t.function[l]=r.perftools.profiles.Function.toObject(e.function[l],n);if(e.stringTable&&e.stringTable.length)for(t.stringTable=[],l=0;l<e.stringTable.length;++l)t.stringTable[l]=e.stringTable[l];if(null!=e.dropFrames&&e.hasOwnProperty("dropFrames")&&("number"==typeof e.dropFrames?t.dropFrames=n.longs===String?String(e.dropFrames):e.dropFrames:t.dropFrames=n.longs===String?o.Long.prototype.toString.call(e.dropFrames):n.longs===Number?new o.LongBits(e.dropFrames.low>>>0,e.dropFrames.high>>>0).toNumber():e.dropFrames),null!=e.keepFrames&&e.hasOwnProperty("keepFrames")&&("number"==typeof e.keepFrames?t.keepFrames=n.longs===String?String(e.keepFrames):e.keepFrames:t.keepFrames=n.longs===String?o.Long.prototype.toString.call(e.keepFrames):n.longs===Number?new o.LongBits(e.keepFrames.low>>>0,e.keepFrames.high>>>0).toNumber():e.keepFrames),null!=e.timeNanos&&e.hasOwnProperty("timeNanos")&&("number"==typeof e.timeNanos?t.timeNanos=n.longs===String?String(e.timeNanos):e.timeNanos:t.timeNanos=n.longs===String?o.Long.prototype.toString.call(e.timeNanos):n.longs===Number?new o.LongBits(e.timeNanos.low>>>0,e.timeNanos.high>>>0).toNumber():e.timeNanos),null!=e.durationNanos&&e.hasOwnProperty("durationNanos")&&("number"==typeof e.durationNanos?t.durationNanos=n.longs===String?String(e.durationNanos):e.durationNanos:t.durationNanos=n.longs===String?o.Long.prototype.toString.call(e.durationNanos):n.longs===Number?new o.LongBits(e.durationNanos.low>>>0,e.durationNanos.high>>>0).toNumber():e.durationNanos),null!=e.periodType&&e.hasOwnProperty("periodType")&&(t.periodType=r.perftools.profiles.ValueType.toObject(e.periodType,n)),null!=e.period&&e.hasOwnProperty("period")&&("number"==typeof e.period?t.period=n.longs===String?String(e.period):e.period:t.period=n.longs===String?o.Long.prototype.toString.call(e.period):n.longs===Number?new o.LongBits(e.period.low>>>0,e.period.high>>>0).toNumber():e.period),e.comment&&e.comment.length)for(t.comment=[],l=0;l<e.comment.length;++l)"number"==typeof e.comment[l]?t.comment[l]=n.longs===String?String(e.comment[l]):e.comment[l]:t.comment[l]=n.longs===String?o.Long.prototype.toString.call(e.comment[l]):n.longs===Number?new o.LongBits(e.comment[l].low>>>0,e.comment[l].high>>>0).toNumber():e.comment[l];return null!=e.defaultSampleType&&e.hasOwnProperty("defaultSampleType")&&("number"==typeof e.defaultSampleType?t.defaultSampleType=n.longs===String?String(e.defaultSampleType):e.defaultSampleType:t.defaultSampleType=n.longs===String?o.Long.prototype.toString.call(e.defaultSampleType):n.longs===Number?new o.LongBits(e.defaultSampleType.low>>>0,e.defaultSampleType.high>>>0).toNumber():e.defaultSampleType),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),i.ValueType=function(){function i(e){if(e)for(var n=Object.keys(e),t=0;t<n.length;++t)null!=e[n[t]]&&(this[n[t]]=e[n[t]])}return i.prototype.type=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.unit=o.Long?o.Long.fromBits(0,0,!1):0,i.create=function(e){return new i(e)},i.encode=function(e,n){return n||(n=t.create()),null!=e.type&&e.hasOwnProperty("type")&&n.uint32(8).int64(e.type),null!=e.unit&&e.hasOwnProperty("unit")&&n.uint32(16).int64(e.unit),n},i.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},i.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,i=new r.perftools.profiles.ValueType;e.pos<o;){var l=e.uint32();switch(l>>>3){case 1:i.type=e.int64();break;case 2:i.unit=e.int64();break;default:e.skipType(7&l)}}return i},i.decodeDelimited=function(e){return e instanceof n||(e=new n(e)),this.decode(e,e.uint32())},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!(o.isInteger(e.type)||e.type&&o.isInteger(e.type.low)&&o.isInteger(e.type.high))?"type: integer|Long expected":null!=e.unit&&e.hasOwnProperty("unit")&&!(o.isInteger(e.unit)||e.unit&&o.isInteger(e.unit.low)&&o.isInteger(e.unit.high))?"unit: integer|Long expected":null},i.fromObject=function(e){if(e instanceof r.perftools.profiles.ValueType)return e;var n=new r.perftools.profiles.ValueType;return null!=e.type&&(o.Long?(n.type=o.Long.fromValue(e.type)).unsigned=!1:"string"==typeof e.type?n.type=parseInt(e.type,10):"number"==typeof e.type?n.type=e.type:"object"==typeof e.type&&(n.type=new o.LongBits(e.type.low>>>0,e.type.high>>>0).toNumber())),null!=e.unit&&(o.Long?(n.unit=o.Long.fromValue(e.unit)).unsigned=!1:"string"==typeof e.unit?n.unit=parseInt(e.unit,10):"number"==typeof e.unit?n.unit=e.unit:"object"==typeof e.unit&&(n.unit=new o.LongBits(e.unit.low>>>0,e.unit.high>>>0).toNumber())),n},i.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if(o.Long){var r=new o.Long(0,0,!1);t.type=n.longs===String?r.toString():n.longs===Number?r.toNumber():r}else t.type=n.longs===String?"0":0;o.Long?(r=new o.Long(0,0,!1),t.unit=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.unit=n.longs===String?"0":0}return null!=e.type&&e.hasOwnProperty("type")&&("number"==typeof e.type?t.type=n.longs===String?String(e.type):e.type:t.type=n.longs===String?o.Long.prototype.toString.call(e.type):n.longs===Number?new o.LongBits(e.type.low>>>0,e.type.high>>>0).toNumber():e.type),null!=e.unit&&e.hasOwnProperty("unit")&&("number"==typeof e.unit?t.unit=n.longs===String?String(e.unit):e.unit:t.unit=n.longs===String?o.Long.prototype.toString.call(e.unit):n.longs===Number?new o.LongBits(e.unit.low>>>0,e.unit.high>>>0).toNumber():e.unit),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),i.Sample=function(){function i(e){if(this.locationId=[],this.value=[],this.label=[],e)for(var n=Object.keys(e),t=0;t<n.length;++t)null!=e[n[t]]&&(this[n[t]]=e[n[t]])}return i.prototype.locationId=o.emptyArray,i.prototype.value=o.emptyArray,i.prototype.label=o.emptyArray,i.create=function(e){return new i(e)},i.encode=function(e,n){if(n||(n=t.create()),null!=e.locationId&&e.locationId.length){n.uint32(10).fork();for(var o=0;o<e.locationId.length;++o)n.uint64(e.locationId[o]);n.ldelim()}if(null!=e.value&&e.value.length){for(n.uint32(18).fork(),o=0;o<e.value.length;++o)n.int64(e.value[o]);n.ldelim()}if(null!=e.label&&e.label.length)for(o=0;o<e.label.length;++o)r.perftools.profiles.Label.encode(e.label[o],n.uint32(26).fork()).ldelim();return n},i.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},i.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,i=new r.perftools.profiles.Sample;e.pos<o;){var l=e.uint32();switch(l>>>3){case 1:if(i.locationId&&i.locationId.length||(i.locationId=[]),2==(7&l))for(var s=e.uint32()+e.pos;e.pos<s;)i.locationId.push(e.uint64());else i.locationId.push(e.uint64());break;case 2:if(i.value&&i.value.length||(i.value=[]),2==(7&l))for(s=e.uint32()+e.pos;e.pos<s;)i.value.push(e.int64());else i.value.push(e.int64());break;case 3:i.label&&i.label.length||(i.label=[]),i.label.push(r.perftools.profiles.Label.decode(e,e.uint32()));break;default:e.skipType(7&l)}}return i},i.decodeDelimited=function(e){return e instanceof n||(e=new n(e)),this.decode(e,e.uint32())},i.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.locationId&&e.hasOwnProperty("locationId")){if(!Array.isArray(e.locationId))return"locationId: array expected";for(var n=0;n<e.locationId.length;++n)if(!(o.isInteger(e.locationId[n])||e.locationId[n]&&o.isInteger(e.locationId[n].low)&&o.isInteger(e.locationId[n].high)))return"locationId: integer|Long[] expected"}if(null!=e.value&&e.hasOwnProperty("value")){if(!Array.isArray(e.value))return"value: array expected";for(n=0;n<e.value.length;++n)if(!(o.isInteger(e.value[n])||e.value[n]&&o.isInteger(e.value[n].low)&&o.isInteger(e.value[n].high)))return"value: integer|Long[] expected"}if(null!=e.label&&e.hasOwnProperty("label")){if(!Array.isArray(e.label))return"label: array expected";for(n=0;n<e.label.length;++n){var t=r.perftools.profiles.Label.verify(e.label[n]);if(t)return"label."+t}}return null},i.fromObject=function(e){if(e instanceof r.perftools.profiles.Sample)return e;var n=new r.perftools.profiles.Sample;if(e.locationId){if(!Array.isArray(e.locationId))throw TypeError(".perftools.profiles.Sample.locationId: array expected");n.locationId=[];for(var t=0;t<e.locationId.length;++t)o.Long?(n.locationId[t]=o.Long.fromValue(e.locationId[t])).unsigned=!0:"string"==typeof e.locationId[t]?n.locationId[t]=parseInt(e.locationId[t],10):"number"==typeof e.locationId[t]?n.locationId[t]=e.locationId[t]:"object"==typeof e.locationId[t]&&(n.locationId[t]=new o.LongBits(e.locationId[t].low>>>0,e.locationId[t].high>>>0).toNumber(!0))}if(e.value){if(!Array.isArray(e.value))throw TypeError(".perftools.profiles.Sample.value: array expected");for(n.value=[],t=0;t<e.value.length;++t)o.Long?(n.value[t]=o.Long.fromValue(e.value[t])).unsigned=!1:"string"==typeof e.value[t]?n.value[t]=parseInt(e.value[t],10):"number"==typeof e.value[t]?n.value[t]=e.value[t]:"object"==typeof e.value[t]&&(n.value[t]=new o.LongBits(e.value[t].low>>>0,e.value[t].high>>>0).toNumber())}if(e.label){if(!Array.isArray(e.label))throw TypeError(".perftools.profiles.Sample.label: array expected");for(n.label=[],t=0;t<e.label.length;++t){if("object"!=typeof e.label[t])throw TypeError(".perftools.profiles.Sample.label: object expected");n.label[t]=r.perftools.profiles.Label.fromObject(e.label[t])}}return n},i.toObject=function(e,n){n||(n={});var t={};if((n.arrays||n.defaults)&&(t.locationId=[],t.value=[],t.label=[]),e.locationId&&e.locationId.length){t.locationId=[];for(var i=0;i<e.locationId.length;++i)"number"==typeof e.locationId[i]?t.locationId[i]=n.longs===String?String(e.locationId[i]):e.locationId[i]:t.locationId[i]=n.longs===String?o.Long.prototype.toString.call(e.locationId[i]):n.longs===Number?new o.LongBits(e.locationId[i].low>>>0,e.locationId[i].high>>>0).toNumber(!0):e.locationId[i]}if(e.value&&e.value.length)for(t.value=[],i=0;i<e.value.length;++i)"number"==typeof e.value[i]?t.value[i]=n.longs===String?String(e.value[i]):e.value[i]:t.value[i]=n.longs===String?o.Long.prototype.toString.call(e.value[i]):n.longs===Number?new o.LongBits(e.value[i].low>>>0,e.value[i].high>>>0).toNumber():e.value[i];if(e.label&&e.label.length)for(t.label=[],i=0;i<e.label.length;++i)t.label[i]=r.perftools.profiles.Label.toObject(e.label[i],n);return t},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),i.Label=function(){function i(e){if(e)for(var n=Object.keys(e),t=0;t<n.length;++t)null!=e[n[t]]&&(this[n[t]]=e[n[t]])}return i.prototype.key=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.str=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.num=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.numUnit=o.Long?o.Long.fromBits(0,0,!1):0,i.create=function(e){return new i(e)},i.encode=function(e,n){return n||(n=t.create()),null!=e.key&&e.hasOwnProperty("key")&&n.uint32(8).int64(e.key),null!=e.str&&e.hasOwnProperty("str")&&n.uint32(16).int64(e.str),null!=e.num&&e.hasOwnProperty("num")&&n.uint32(24).int64(e.num),null!=e.numUnit&&e.hasOwnProperty("numUnit")&&n.uint32(32).int64(e.numUnit),n},i.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},i.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,i=new r.perftools.profiles.Label;e.pos<o;){var l=e.uint32();switch(l>>>3){case 1:i.key=e.int64();break;case 2:i.str=e.int64();break;case 3:i.num=e.int64();break;case 4:i.numUnit=e.int64();break;default:e.skipType(7&l)}}return i},i.decodeDelimited=function(e){return e instanceof n||(e=new n(e)),this.decode(e,e.uint32())},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!(o.isInteger(e.key)||e.key&&o.isInteger(e.key.low)&&o.isInteger(e.key.high))?"key: integer|Long expected":null!=e.str&&e.hasOwnProperty("str")&&!(o.isInteger(e.str)||e.str&&o.isInteger(e.str.low)&&o.isInteger(e.str.high))?"str: integer|Long expected":null!=e.num&&e.hasOwnProperty("num")&&!(o.isInteger(e.num)||e.num&&o.isInteger(e.num.low)&&o.isInteger(e.num.high))?"num: integer|Long expected":null!=e.numUnit&&e.hasOwnProperty("numUnit")&&!(o.isInteger(e.numUnit)||e.numUnit&&o.isInteger(e.numUnit.low)&&o.isInteger(e.numUnit.high))?"numUnit: integer|Long expected":null},i.fromObject=function(e){if(e instanceof r.perftools.profiles.Label)return e;var n=new r.perftools.profiles.Label;return null!=e.key&&(o.Long?(n.key=o.Long.fromValue(e.key)).unsigned=!1:"string"==typeof e.key?n.key=parseInt(e.key,10):"number"==typeof e.key?n.key=e.key:"object"==typeof e.key&&(n.key=new o.LongBits(e.key.low>>>0,e.key.high>>>0).toNumber())),null!=e.str&&(o.Long?(n.str=o.Long.fromValue(e.str)).unsigned=!1:"string"==typeof e.str?n.str=parseInt(e.str,10):"number"==typeof e.str?n.str=e.str:"object"==typeof e.str&&(n.str=new o.LongBits(e.str.low>>>0,e.str.high>>>0).toNumber())),null!=e.num&&(o.Long?(n.num=o.Long.fromValue(e.num)).unsigned=!1:"string"==typeof e.num?n.num=parseInt(e.num,10):"number"==typeof e.num?n.num=e.num:"object"==typeof e.num&&(n.num=new o.LongBits(e.num.low>>>0,e.num.high>>>0).toNumber())),null!=e.numUnit&&(o.Long?(n.numUnit=o.Long.fromValue(e.numUnit)).unsigned=!1:"string"==typeof e.numUnit?n.numUnit=parseInt(e.numUnit,10):"number"==typeof e.numUnit?n.numUnit=e.numUnit:"object"==typeof e.numUnit&&(n.numUnit=new o.LongBits(e.numUnit.low>>>0,e.numUnit.high>>>0).toNumber())),n},i.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if(o.Long){var r=new o.Long(0,0,!1);t.key=n.longs===String?r.toString():n.longs===Number?r.toNumber():r}else t.key=n.longs===String?"0":0;o.Long?(r=new o.Long(0,0,!1),t.str=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.str=n.longs===String?"0":0,o.Long?(r=new o.Long(0,0,!1),t.num=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.num=n.longs===String?"0":0,o.Long?(r=new o.Long(0,0,!1),t.numUnit=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.numUnit=n.longs===String?"0":0}return null!=e.key&&e.hasOwnProperty("key")&&("number"==typeof e.key?t.key=n.longs===String?String(e.key):e.key:t.key=n.longs===String?o.Long.prototype.toString.call(e.key):n.longs===Number?new o.LongBits(e.key.low>>>0,e.key.high>>>0).toNumber():e.key),null!=e.str&&e.hasOwnProperty("str")&&("number"==typeof e.str?t.str=n.longs===String?String(e.str):e.str:t.str=n.longs===String?o.Long.prototype.toString.call(e.str):n.longs===Number?new o.LongBits(e.str.low>>>0,e.str.high>>>0).toNumber():e.str),null!=e.num&&e.hasOwnProperty("num")&&("number"==typeof e.num?t.num=n.longs===String?String(e.num):e.num:t.num=n.longs===String?o.Long.prototype.toString.call(e.num):n.longs===Number?new o.LongBits(e.num.low>>>0,e.num.high>>>0).toNumber():e.num),null!=e.numUnit&&e.hasOwnProperty("numUnit")&&("number"==typeof e.numUnit?t.numUnit=n.longs===String?String(e.numUnit):e.numUnit:t.numUnit=n.longs===String?o.Long.prototype.toString.call(e.numUnit):n.longs===Number?new o.LongBits(e.numUnit.low>>>0,e.numUnit.high>>>0).toNumber():e.numUnit),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),i.Mapping=function(){function i(e){if(e)for(var n=Object.keys(e),t=0;t<n.length;++t)null!=e[n[t]]&&(this[n[t]]=e[n[t]])}return i.prototype.id=o.Long?o.Long.fromBits(0,0,!0):0,i.prototype.memoryStart=o.Long?o.Long.fromBits(0,0,!0):0,i.prototype.memoryLimit=o.Long?o.Long.fromBits(0,0,!0):0,i.prototype.fileOffset=o.Long?o.Long.fromBits(0,0,!0):0,i.prototype.filename=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.buildId=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.hasFunctions=!1,i.prototype.hasFilenames=!1,i.prototype.hasLineNumbers=!1,i.prototype.hasInlineFrames=!1,i.create=function(e){return new i(e)},i.encode=function(e,n){return n||(n=t.create()),null!=e.id&&e.hasOwnProperty("id")&&n.uint32(8).uint64(e.id),null!=e.memoryStart&&e.hasOwnProperty("memoryStart")&&n.uint32(16).uint64(e.memoryStart),null!=e.memoryLimit&&e.hasOwnProperty("memoryLimit")&&n.uint32(24).uint64(e.memoryLimit),null!=e.fileOffset&&e.hasOwnProperty("fileOffset")&&n.uint32(32).uint64(e.fileOffset),null!=e.filename&&e.hasOwnProperty("filename")&&n.uint32(40).int64(e.filename),null!=e.buildId&&e.hasOwnProperty("buildId")&&n.uint32(48).int64(e.buildId),null!=e.hasFunctions&&e.hasOwnProperty("hasFunctions")&&n.uint32(56).bool(e.hasFunctions),null!=e.hasFilenames&&e.hasOwnProperty("hasFilenames")&&n.uint32(64).bool(e.hasFilenames),null!=e.hasLineNumbers&&e.hasOwnProperty("hasLineNumbers")&&n.uint32(72).bool(e.hasLineNumbers),null!=e.hasInlineFrames&&e.hasOwnProperty("hasInlineFrames")&&n.uint32(80).bool(e.hasInlineFrames),n},i.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},i.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,i=new r.perftools.profiles.Mapping;e.pos<o;){var l=e.uint32();switch(l>>>3){case 1:i.id=e.uint64();break;case 2:i.memoryStart=e.uint64();break;case 3:i.memoryLimit=e.uint64();break;case 4:i.fileOffset=e.uint64();break;case 5:i.filename=e.int64();break;case 6:i.buildId=e.int64();break;case 7:i.hasFunctions=e.bool();break;case 8:i.hasFilenames=e.bool();break;case 9:i.hasLineNumbers=e.bool();break;case 10:i.hasInlineFrames=e.bool();break;default:e.skipType(7&l)}}return i},i.decodeDelimited=function(e){return e instanceof n||(e=new n(e)),this.decode(e,e.uint32())},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!(o.isInteger(e.id)||e.id&&o.isInteger(e.id.low)&&o.isInteger(e.id.high))?"id: integer|Long expected":null!=e.memoryStart&&e.hasOwnProperty("memoryStart")&&!(o.isInteger(e.memoryStart)||e.memoryStart&&o.isInteger(e.memoryStart.low)&&o.isInteger(e.memoryStart.high))?"memoryStart: integer|Long expected":null!=e.memoryLimit&&e.hasOwnProperty("memoryLimit")&&!(o.isInteger(e.memoryLimit)||e.memoryLimit&&o.isInteger(e.memoryLimit.low)&&o.isInteger(e.memoryLimit.high))?"memoryLimit: integer|Long expected":null!=e.fileOffset&&e.hasOwnProperty("fileOffset")&&!(o.isInteger(e.fileOffset)||e.fileOffset&&o.isInteger(e.fileOffset.low)&&o.isInteger(e.fileOffset.high))?"fileOffset: integer|Long expected":null!=e.filename&&e.hasOwnProperty("filename")&&!(o.isInteger(e.filename)||e.filename&&o.isInteger(e.filename.low)&&o.isInteger(e.filename.high))?"filename: integer|Long expected":null!=e.buildId&&e.hasOwnProperty("buildId")&&!(o.isInteger(e.buildId)||e.buildId&&o.isInteger(e.buildId.low)&&o.isInteger(e.buildId.high))?"buildId: integer|Long expected":null!=e.hasFunctions&&e.hasOwnProperty("hasFunctions")&&"boolean"!=typeof e.hasFunctions?"hasFunctions: boolean expected":null!=e.hasFilenames&&e.hasOwnProperty("hasFilenames")&&"boolean"!=typeof e.hasFilenames?"hasFilenames: boolean expected":null!=e.hasLineNumbers&&e.hasOwnProperty("hasLineNumbers")&&"boolean"!=typeof e.hasLineNumbers?"hasLineNumbers: boolean expected":null!=e.hasInlineFrames&&e.hasOwnProperty("hasInlineFrames")&&"boolean"!=typeof e.hasInlineFrames?"hasInlineFrames: boolean expected":null},i.fromObject=function(e){if(e instanceof r.perftools.profiles.Mapping)return e;var n=new r.perftools.profiles.Mapping;return null!=e.id&&(o.Long?(n.id=o.Long.fromValue(e.id)).unsigned=!0:"string"==typeof e.id?n.id=parseInt(e.id,10):"number"==typeof e.id?n.id=e.id:"object"==typeof e.id&&(n.id=new o.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber(!0))),null!=e.memoryStart&&(o.Long?(n.memoryStart=o.Long.fromValue(e.memoryStart)).unsigned=!0:"string"==typeof e.memoryStart?n.memoryStart=parseInt(e.memoryStart,10):"number"==typeof e.memoryStart?n.memoryStart=e.memoryStart:"object"==typeof e.memoryStart&&(n.memoryStart=new o.LongBits(e.memoryStart.low>>>0,e.memoryStart.high>>>0).toNumber(!0))),null!=e.memoryLimit&&(o.Long?(n.memoryLimit=o.Long.fromValue(e.memoryLimit)).unsigned=!0:"string"==typeof e.memoryLimit?n.memoryLimit=parseInt(e.memoryLimit,10):"number"==typeof e.memoryLimit?n.memoryLimit=e.memoryLimit:"object"==typeof e.memoryLimit&&(n.memoryLimit=new o.LongBits(e.memoryLimit.low>>>0,e.memoryLimit.high>>>0).toNumber(!0))),null!=e.fileOffset&&(o.Long?(n.fileOffset=o.Long.fromValue(e.fileOffset)).unsigned=!0:"string"==typeof e.fileOffset?n.fileOffset=parseInt(e.fileOffset,10):"number"==typeof e.fileOffset?n.fileOffset=e.fileOffset:"object"==typeof e.fileOffset&&(n.fileOffset=new o.LongBits(e.fileOffset.low>>>0,e.fileOffset.high>>>0).toNumber(!0))),null!=e.filename&&(o.Long?(n.filename=o.Long.fromValue(e.filename)).unsigned=!1:"string"==typeof e.filename?n.filename=parseInt(e.filename,10):"number"==typeof e.filename?n.filename=e.filename:"object"==typeof e.filename&&(n.filename=new o.LongBits(e.filename.low>>>0,e.filename.high>>>0).toNumber())),null!=e.buildId&&(o.Long?(n.buildId=o.Long.fromValue(e.buildId)).unsigned=!1:"string"==typeof e.buildId?n.buildId=parseInt(e.buildId,10):"number"==typeof e.buildId?n.buildId=e.buildId:"object"==typeof e.buildId&&(n.buildId=new o.LongBits(e.buildId.low>>>0,e.buildId.high>>>0).toNumber())),null!=e.hasFunctions&&(n.hasFunctions=Boolean(e.hasFunctions)),null!=e.hasFilenames&&(n.hasFilenames=Boolean(e.hasFilenames)),null!=e.hasLineNumbers&&(n.hasLineNumbers=Boolean(e.hasLineNumbers)),null!=e.hasInlineFrames&&(n.hasInlineFrames=Boolean(e.hasInlineFrames)),n},i.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if(o.Long){var r=new o.Long(0,0,!0);t.id=n.longs===String?r.toString():n.longs===Number?r.toNumber():r}else t.id=n.longs===String?"0":0;o.Long?(r=new o.Long(0,0,!0),t.memoryStart=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.memoryStart=n.longs===String?"0":0,o.Long?(r=new o.Long(0,0,!0),t.memoryLimit=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.memoryLimit=n.longs===String?"0":0,o.Long?(r=new o.Long(0,0,!0),t.fileOffset=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.fileOffset=n.longs===String?"0":0,o.Long?(r=new o.Long(0,0,!1),t.filename=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.filename=n.longs===String?"0":0,o.Long?(r=new o.Long(0,0,!1),t.buildId=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.buildId=n.longs===String?"0":0,t.hasFunctions=!1,t.hasFilenames=!1,t.hasLineNumbers=!1,t.hasInlineFrames=!1}return null!=e.id&&e.hasOwnProperty("id")&&("number"==typeof e.id?t.id=n.longs===String?String(e.id):e.id:t.id=n.longs===String?o.Long.prototype.toString.call(e.id):n.longs===Number?new o.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber(!0):e.id),null!=e.memoryStart&&e.hasOwnProperty("memoryStart")&&("number"==typeof e.memoryStart?t.memoryStart=n.longs===String?String(e.memoryStart):e.memoryStart:t.memoryStart=n.longs===String?o.Long.prototype.toString.call(e.memoryStart):n.longs===Number?new o.LongBits(e.memoryStart.low>>>0,e.memoryStart.high>>>0).toNumber(!0):e.memoryStart),null!=e.memoryLimit&&e.hasOwnProperty("memoryLimit")&&("number"==typeof e.memoryLimit?t.memoryLimit=n.longs===String?String(e.memoryLimit):e.memoryLimit:t.memoryLimit=n.longs===String?o.Long.prototype.toString.call(e.memoryLimit):n.longs===Number?new o.LongBits(e.memoryLimit.low>>>0,e.memoryLimit.high>>>0).toNumber(!0):e.memoryLimit),null!=e.fileOffset&&e.hasOwnProperty("fileOffset")&&("number"==typeof e.fileOffset?t.fileOffset=n.longs===String?String(e.fileOffset):e.fileOffset:t.fileOffset=n.longs===String?o.Long.prototype.toString.call(e.fileOffset):n.longs===Number?new o.LongBits(e.fileOffset.low>>>0,e.fileOffset.high>>>0).toNumber(!0):e.fileOffset),null!=e.filename&&e.hasOwnProperty("filename")&&("number"==typeof e.filename?t.filename=n.longs===String?String(e.filename):e.filename:t.filename=n.longs===String?o.Long.prototype.toString.call(e.filename):n.longs===Number?new o.LongBits(e.filename.low>>>0,e.filename.high>>>0).toNumber():e.filename),null!=e.buildId&&e.hasOwnProperty("buildId")&&("number"==typeof e.buildId?t.buildId=n.longs===String?String(e.buildId):e.buildId:t.buildId=n.longs===String?o.Long.prototype.toString.call(e.buildId):n.longs===Number?new o.LongBits(e.buildId.low>>>0,e.buildId.high>>>0).toNumber():e.buildId),null!=e.hasFunctions&&e.hasOwnProperty("hasFunctions")&&(t.hasFunctions=e.hasFunctions),null!=e.hasFilenames&&e.hasOwnProperty("hasFilenames")&&(t.hasFilenames=e.hasFilenames),null!=e.hasLineNumbers&&e.hasOwnProperty("hasLineNumbers")&&(t.hasLineNumbers=e.hasLineNumbers),null!=e.hasInlineFrames&&e.hasOwnProperty("hasInlineFrames")&&(t.hasInlineFrames=e.hasInlineFrames),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),i.Location=function(){function i(e){if(this.line=[],e)for(var n=Object.keys(e),t=0;t<n.length;++t)null!=e[n[t]]&&(this[n[t]]=e[n[t]])}return i.prototype.id=o.Long?o.Long.fromBits(0,0,!0):0,i.prototype.mappingId=o.Long?o.Long.fromBits(0,0,!0):0,i.prototype.address=o.Long?o.Long.fromBits(0,0,!0):0,i.prototype.line=o.emptyArray,i.prototype.isFolded=!1,i.create=function(e){return new i(e)},i.encode=function(e,n){if(n||(n=t.create()),null!=e.id&&e.hasOwnProperty("id")&&n.uint32(8).uint64(e.id),null!=e.mappingId&&e.hasOwnProperty("mappingId")&&n.uint32(16).uint64(e.mappingId),null!=e.address&&e.hasOwnProperty("address")&&n.uint32(24).uint64(e.address),null!=e.line&&e.line.length)for(var o=0;o<e.line.length;++o)r.perftools.profiles.Line.encode(e.line[o],n.uint32(34).fork()).ldelim();return null!=e.isFolded&&e.hasOwnProperty("isFolded")&&n.uint32(40).bool(e.isFolded),n},i.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},i.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,i=new r.perftools.profiles.Location;e.pos<o;){var l=e.uint32();switch(l>>>3){case 1:i.id=e.uint64();break;case 2:i.mappingId=e.uint64();break;case 3:i.address=e.uint64();break;case 4:i.line&&i.line.length||(i.line=[]),i.line.push(r.perftools.profiles.Line.decode(e,e.uint32()));break;case 5:i.isFolded=e.bool();break;default:e.skipType(7&l)}}return i},i.decodeDelimited=function(e){return e instanceof n||(e=new n(e)),this.decode(e,e.uint32())},i.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!(o.isInteger(e.id)||e.id&&o.isInteger(e.id.low)&&o.isInteger(e.id.high)))return"id: integer|Long expected";if(null!=e.mappingId&&e.hasOwnProperty("mappingId")&&!(o.isInteger(e.mappingId)||e.mappingId&&o.isInteger(e.mappingId.low)&&o.isInteger(e.mappingId.high)))return"mappingId: integer|Long expected";if(null!=e.address&&e.hasOwnProperty("address")&&!(o.isInteger(e.address)||e.address&&o.isInteger(e.address.low)&&o.isInteger(e.address.high)))return"address: integer|Long expected";if(null!=e.line&&e.hasOwnProperty("line")){if(!Array.isArray(e.line))return"line: array expected";for(var n=0;n<e.line.length;++n){var t=r.perftools.profiles.Line.verify(e.line[n]);if(t)return"line."+t}}return null!=e.isFolded&&e.hasOwnProperty("isFolded")&&"boolean"!=typeof e.isFolded?"isFolded: boolean expected":null},i.fromObject=function(e){if(e instanceof r.perftools.profiles.Location)return e;var n=new r.perftools.profiles.Location;if(null!=e.id&&(o.Long?(n.id=o.Long.fromValue(e.id)).unsigned=!0:"string"==typeof e.id?n.id=parseInt(e.id,10):"number"==typeof e.id?n.id=e.id:"object"==typeof e.id&&(n.id=new o.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber(!0))),null!=e.mappingId&&(o.Long?(n.mappingId=o.Long.fromValue(e.mappingId)).unsigned=!0:"string"==typeof e.mappingId?n.mappingId=parseInt(e.mappingId,10):"number"==typeof e.mappingId?n.mappingId=e.mappingId:"object"==typeof e.mappingId&&(n.mappingId=new o.LongBits(e.mappingId.low>>>0,e.mappingId.high>>>0).toNumber(!0))),null!=e.address&&(o.Long?(n.address=o.Long.fromValue(e.address)).unsigned=!0:"string"==typeof e.address?n.address=parseInt(e.address,10):"number"==typeof e.address?n.address=e.address:"object"==typeof e.address&&(n.address=new o.LongBits(e.address.low>>>0,e.address.high>>>0).toNumber(!0))),e.line){if(!Array.isArray(e.line))throw TypeError(".perftools.profiles.Location.line: array expected");n.line=[];for(var t=0;t<e.line.length;++t){if("object"!=typeof e.line[t])throw TypeError(".perftools.profiles.Location.line: object expected");n.line[t]=r.perftools.profiles.Line.fromObject(e.line[t])}}return null!=e.isFolded&&(n.isFolded=Boolean(e.isFolded)),n},i.toObject=function(e,n){n||(n={});var t={};if((n.arrays||n.defaults)&&(t.line=[]),n.defaults){if(o.Long){var i=new o.Long(0,0,!0);t.id=n.longs===String?i.toString():n.longs===Number?i.toNumber():i}else t.id=n.longs===String?"0":0;o.Long?(i=new o.Long(0,0,!0),t.mappingId=n.longs===String?i.toString():n.longs===Number?i.toNumber():i):t.mappingId=n.longs===String?"0":0,o.Long?(i=new o.Long(0,0,!0),t.address=n.longs===String?i.toString():n.longs===Number?i.toNumber():i):t.address=n.longs===String?"0":0,t.isFolded=!1}if(null!=e.id&&e.hasOwnProperty("id")&&("number"==typeof e.id?t.id=n.longs===String?String(e.id):e.id:t.id=n.longs===String?o.Long.prototype.toString.call(e.id):n.longs===Number?new o.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber(!0):e.id),null!=e.mappingId&&e.hasOwnProperty("mappingId")&&("number"==typeof e.mappingId?t.mappingId=n.longs===String?String(e.mappingId):e.mappingId:t.mappingId=n.longs===String?o.Long.prototype.toString.call(e.mappingId):n.longs===Number?new o.LongBits(e.mappingId.low>>>0,e.mappingId.high>>>0).toNumber(!0):e.mappingId),null!=e.address&&e.hasOwnProperty("address")&&("number"==typeof e.address?t.address=n.longs===String?String(e.address):e.address:t.address=n.longs===String?o.Long.prototype.toString.call(e.address):n.longs===Number?new o.LongBits(e.address.low>>>0,e.address.high>>>0).toNumber(!0):e.address),e.line&&e.line.length){t.line=[];for(var l=0;l<e.line.length;++l)t.line[l]=r.perftools.profiles.Line.toObject(e.line[l],n)}return null!=e.isFolded&&e.hasOwnProperty("isFolded")&&(t.isFolded=e.isFolded),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),i.Line=function(){function i(e){if(e)for(var n=Object.keys(e),t=0;t<n.length;++t)null!=e[n[t]]&&(this[n[t]]=e[n[t]])}return i.prototype.functionId=o.Long?o.Long.fromBits(0,0,!0):0,i.prototype.line=o.Long?o.Long.fromBits(0,0,!1):0,i.create=function(e){return new i(e)},i.encode=function(e,n){return n||(n=t.create()),null!=e.functionId&&e.hasOwnProperty("functionId")&&n.uint32(8).uint64(e.functionId),null!=e.line&&e.hasOwnProperty("line")&&n.uint32(16).int64(e.line),n},i.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},i.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,i=new r.perftools.profiles.Line;e.pos<o;){var l=e.uint32();switch(l>>>3){case 1:i.functionId=e.uint64();break;case 2:i.line=e.int64();break;default:e.skipType(7&l)}}return i},i.decodeDelimited=function(e){return e instanceof n||(e=new n(e)),this.decode(e,e.uint32())},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.functionId&&e.hasOwnProperty("functionId")&&!(o.isInteger(e.functionId)||e.functionId&&o.isInteger(e.functionId.low)&&o.isInteger(e.functionId.high))?"functionId: integer|Long expected":null!=e.line&&e.hasOwnProperty("line")&&!(o.isInteger(e.line)||e.line&&o.isInteger(e.line.low)&&o.isInteger(e.line.high))?"line: integer|Long expected":null},i.fromObject=function(e){if(e instanceof r.perftools.profiles.Line)return e;var n=new r.perftools.profiles.Line;return null!=e.functionId&&(o.Long?(n.functionId=o.Long.fromValue(e.functionId)).unsigned=!0:"string"==typeof e.functionId?n.functionId=parseInt(e.functionId,10):"number"==typeof e.functionId?n.functionId=e.functionId:"object"==typeof e.functionId&&(n.functionId=new o.LongBits(e.functionId.low>>>0,e.functionId.high>>>0).toNumber(!0))),null!=e.line&&(o.Long?(n.line=o.Long.fromValue(e.line)).unsigned=!1:"string"==typeof e.line?n.line=parseInt(e.line,10):"number"==typeof e.line?n.line=e.line:"object"==typeof e.line&&(n.line=new o.LongBits(e.line.low>>>0,e.line.high>>>0).toNumber())),n},i.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if(o.Long){var r=new o.Long(0,0,!0);t.functionId=n.longs===String?r.toString():n.longs===Number?r.toNumber():r}else t.functionId=n.longs===String?"0":0;o.Long?(r=new o.Long(0,0,!1),t.line=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.line=n.longs===String?"0":0}return null!=e.functionId&&e.hasOwnProperty("functionId")&&("number"==typeof e.functionId?t.functionId=n.longs===String?String(e.functionId):e.functionId:t.functionId=n.longs===String?o.Long.prototype.toString.call(e.functionId):n.longs===Number?new o.LongBits(e.functionId.low>>>0,e.functionId.high>>>0).toNumber(!0):e.functionId),null!=e.line&&e.hasOwnProperty("line")&&("number"==typeof e.line?t.line=n.longs===String?String(e.line):e.line:t.line=n.longs===String?o.Long.prototype.toString.call(e.line):n.longs===Number?new o.LongBits(e.line.low>>>0,e.line.high>>>0).toNumber():e.line),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),i.Function=function(){function i(e){if(e)for(var n=Object.keys(e),t=0;t<n.length;++t)null!=e[n[t]]&&(this[n[t]]=e[n[t]])}return i.prototype.id=o.Long?o.Long.fromBits(0,0,!0):0,i.prototype.name=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.systemName=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.filename=o.Long?o.Long.fromBits(0,0,!1):0,i.prototype.startLine=o.Long?o.Long.fromBits(0,0,!1):0,i.create=function(e){return new i(e)},i.encode=function(e,n){return n||(n=t.create()),null!=e.id&&e.hasOwnProperty("id")&&n.uint32(8).uint64(e.id),null!=e.name&&e.hasOwnProperty("name")&&n.uint32(16).int64(e.name),null!=e.systemName&&e.hasOwnProperty("systemName")&&n.uint32(24).int64(e.systemName),null!=e.filename&&e.hasOwnProperty("filename")&&n.uint32(32).int64(e.filename),null!=e.startLine&&e.hasOwnProperty("startLine")&&n.uint32(40).int64(e.startLine),n},i.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},i.decode=function(e,t){e instanceof n||(e=n.create(e));for(var o=void 0===t?e.len:e.pos+t,i=new r.perftools.profiles.Function;e.pos<o;){var l=e.uint32();switch(l>>>3){case 1:i.id=e.uint64();break;case 2:i.name=e.int64();break;case 3:i.systemName=e.int64();break;case 4:i.filename=e.int64();break;case 5:i.startLine=e.int64();break;default:e.skipType(7&l)}}return i},i.decodeDelimited=function(e){return e instanceof n||(e=new n(e)),this.decode(e,e.uint32())},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!(o.isInteger(e.id)||e.id&&o.isInteger(e.id.low)&&o.isInteger(e.id.high))?"id: integer|Long expected":null!=e.name&&e.hasOwnProperty("name")&&!(o.isInteger(e.name)||e.name&&o.isInteger(e.name.low)&&o.isInteger(e.name.high))?"name: integer|Long expected":null!=e.systemName&&e.hasOwnProperty("systemName")&&!(o.isInteger(e.systemName)||e.systemName&&o.isInteger(e.systemName.low)&&o.isInteger(e.systemName.high))?"systemName: integer|Long expected":null!=e.filename&&e.hasOwnProperty("filename")&&!(o.isInteger(e.filename)||e.filename&&o.isInteger(e.filename.low)&&o.isInteger(e.filename.high))?"filename: integer|Long expected":null!=e.startLine&&e.hasOwnProperty("startLine")&&!(o.isInteger(e.startLine)||e.startLine&&o.isInteger(e.startLine.low)&&o.isInteger(e.startLine.high))?"startLine: integer|Long expected":null},i.fromObject=function(e){if(e instanceof r.perftools.profiles.Function)return e;var n=new r.perftools.profiles.Function;return null!=e.id&&(o.Long?(n.id=o.Long.fromValue(e.id)).unsigned=!0:"string"==typeof e.id?n.id=parseInt(e.id,10):"number"==typeof e.id?n.id=e.id:"object"==typeof e.id&&(n.id=new o.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber(!0))),null!=e.name&&(o.Long?(n.name=o.Long.fromValue(e.name)).unsigned=!1:"string"==typeof e.name?n.name=parseInt(e.name,10):"number"==typeof e.name?n.name=e.name:"object"==typeof e.name&&(n.name=new o.LongBits(e.name.low>>>0,e.name.high>>>0).toNumber())),null!=e.systemName&&(o.Long?(n.systemName=o.Long.fromValue(e.systemName)).unsigned=!1:"string"==typeof e.systemName?n.systemName=parseInt(e.systemName,10):"number"==typeof e.systemName?n.systemName=e.systemName:"object"==typeof e.systemName&&(n.systemName=new o.LongBits(e.systemName.low>>>0,e.systemName.high>>>0).toNumber())),null!=e.filename&&(o.Long?(n.filename=o.Long.fromValue(e.filename)).unsigned=!1:"string"==typeof e.filename?n.filename=parseInt(e.filename,10):"number"==typeof e.filename?n.filename=e.filename:"object"==typeof e.filename&&(n.filename=new o.LongBits(e.filename.low>>>0,e.filename.high>>>0).toNumber())),null!=e.startLine&&(o.Long?(n.startLine=o.Long.fromValue(e.startLine)).unsigned=!1:"string"==typeof e.startLine?n.startLine=parseInt(e.startLine,10):"number"==typeof e.startLine?n.startLine=e.startLine:"object"==typeof e.startLine&&(n.startLine=new o.LongBits(e.startLine.low>>>0,e.startLine.high>>>0).toNumber())),n},i.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if(o.Long){var r=new o.Long(0,0,!0);t.id=n.longs===String?r.toString():n.longs===Number?r.toNumber():r}else t.id=n.longs===String?"0":0;o.Long?(r=new o.Long(0,0,!1),t.name=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.name=n.longs===String?"0":0,o.Long?(r=new o.Long(0,0,!1),t.systemName=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.systemName=n.longs===String?"0":0,o.Long?(r=new o.Long(0,0,!1),t.filename=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.filename=n.longs===String?"0":0,o.Long?(r=new o.Long(0,0,!1),t.startLine=n.longs===String?r.toString():n.longs===Number?r.toNumber():r):t.startLine=n.longs===String?"0":0}return null!=e.id&&e.hasOwnProperty("id")&&("number"==typeof e.id?t.id=n.longs===String?String(e.id):e.id:t.id=n.longs===String?o.Long.prototype.toString.call(e.id):n.longs===Number?new o.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber(!0):e.id),null!=e.name&&e.hasOwnProperty("name")&&("number"==typeof e.name?t.name=n.longs===String?String(e.name):e.name:t.name=n.longs===String?o.Long.prototype.toString.call(e.name):n.longs===Number?new o.LongBits(e.name.low>>>0,e.name.high>>>0).toNumber():e.name),null!=e.systemName&&e.hasOwnProperty("systemName")&&("number"==typeof e.systemName?t.systemName=n.longs===String?String(e.systemName):e.systemName:t.systemName=n.longs===String?o.Long.prototype.toString.call(e.systemName):n.longs===Number?new o.LongBits(e.systemName.low>>>0,e.systemName.high>>>0).toNumber():e.systemName),null!=e.filename&&e.hasOwnProperty("filename")&&("number"==typeof e.filename?t.filename=n.longs===String?String(e.filename):e.filename:t.filename=n.longs===String?o.Long.prototype.toString.call(e.filename):n.longs===Number?new o.LongBits(e.filename.low>>>0,e.filename.high>>>0).toNumber():e.filename),null!=e.startLine&&e.hasOwnProperty("startLine")&&("number"==typeof e.startLine?t.startLine=n.longs===String?String(e.startLine):e.startLine:t.startLine=n.longs===String?o.Long.prototype.toString.call(e.startLine):n.longs===Number?new o.LongBits(e.startLine.low>>>0,e.startLine.high>>>0).toNumber():e.startLine),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),i),l}(),module.exports=r;
106
- },{"protobufjs/minimal":"Myh2"}],"VmHy":[function(require,module,exports) {
107
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importAsPprofProfile=r;var e=require("./profile.proto.js"),n=require("../lib/profile"),t=require("../lib/utils"),l=require("../lib/value-formatters");function r(r){if(0===r.byteLength)return null;let o;try{o=e.perftools.profiles.Profile.decode(new Uint8Array(r))}catch(b){return null}function i(e){return"number"==typeof e?e:e.low}function u(e){return o.stringTable[i(e)]||null}const s=new Map;function a(e){const{name:n,filename:t,startLine:l}=e,r=null!=n&&u(n)||"(unknown)",o=null!=t?u(t):null,i=null!=l?+l:null,s={key:`${r}:${o}:${i}`,name:r};return null!=o&&(s.file=o),null!=i&&(s.line=i),s}for(let e of o.function)if(e.id){const n=a(e);null!=n&&s.set(i(e.id),n)}function c(e){const{line:n}=e;if(null==n)return null;const l=(0,t.lastOf)(n);return null==l?null:l.functionId&&s.get(i(l.functionId))||null}const f=new Map;for(let e of o.location)if(null!=e.id){const n=c(e);n&&f.set(i(e.id),n)}const p=o.sampleType.map(e=>({type:e.type&&u(e.type)||"samples",unit:e.unit&&u(e.unit)||"count"})),d=o.defaultSampleType?+o.defaultSampleType:p.length-1,m=p[d],y=new n.StackListProfileBuilder;switch(m.unit){case"nanoseconds":case"microseconds":case"milliseconds":case"seconds":y.setValueFormatter(new l.TimeFormatter(m.unit));break;case"bytes":y.setValueFormatter(new l.ByteFormatter)}for(let e of o.sample){const n=e.locationId?e.locationId.map(e=>f.get(i(e))):[];n.reverse();const t=e.value[d];y.appendSampleWithWeight(n.filter(e=>null!=e),+t)}return y.build()}
108
- },{"./profile.proto.js":"YdJi","../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4"}],"bNW7":[function(require,module,exports) {
109
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromChromeHeapProfile=o;var e=require("../lib/profile"),r=require("../lib/utils"),t=require("../lib/value-formatters");const n=new Map;function i(e){return(0,r.getOrInsert)(n,e,e=>{const r=e.functionName||"(anonymous)",t=e.url,n=e.lineNumber,i=e.columnNumber;return{key:`${r}:${t}:${n}:${i}`,name:r,file:t,line:n,col:i}})}function o(r){const n=new Map;let o=0;const l=(e,r)=>{e.id=o++,n.set(e.id,e),r&&(e.parent=r.id),e.children.forEach(r=>l(r,e))};l(r.head);const u=e=>{if(0===e.children.length)return e.selfSize||0;const r=e.children.reduce((e,r)=>e+=u(r),e.selfSize);return e.totalSize=r,r},a=u(r.head),s=[];for(let e of n.values()){let r=[];for(r.push(e);void 0!==e.parent;){const t=n.get(e.parent);if(void 0===t)break;r.unshift(t),e=t}s.push(r)}const c=new e.StackListProfileBuilder(a);for(let e of s){const r=e[e.length-1];c.appendSampleWithWeight(e.map(e=>i(e.callFrame)),r.selfSize)}return c.setValueFormatter(new t.ByteFormatter),c.build()}
108
+ },{"protobufjs/minimal":"Myh2"}],"YvD4":[function(require,module,exports) {
109
+ module.exports=t;var i=null;try{i=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(L){}function t(i,t,n){this.low=0|i,this.high=0|t,this.unsigned=!!n}function n(i){return!0===(i&&i.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0}),t.isLong=n;var h={},s={};function e(i,t){var n,e,r;return t?(r=0<=(i>>>=0)&&i<256)&&(e=s[i])?e:(n=u(i,(0|i)<0?-1:0,!0),r&&(s[i]=n),n):(r=-128<=(i|=0)&&i<128)&&(e=h[i])?e:(n=u(i,i<0?-1:0,!1),r&&(h[i]=n),n)}function r(i,t){if(isNaN(i))return t?N:m;if(t){if(i<0)return N;if(i>=c)return p}else{if(i<=-w)return _;if(i+1>=w)return q}return i<0?r(-i,t).neg():u(i%d|0,i/d|0,t)}function u(i,n,h){return new t(i,n,h)}t.fromInt=e,t.fromNumber=r,t.fromBits=u;var o=Math.pow;function g(i,t,n){if(0===i.length)throw Error("empty string");if("NaN"===i||"Infinity"===i||"+Infinity"===i||"-Infinity"===i)return m;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var h;if((h=i.indexOf("-"))>0)throw Error("interior hyphen");if(0===h)return g(i.substring(1),t,n).neg();for(var s=r(o(n,8)),e=m,u=0;u<i.length;u+=8){var f=Math.min(8,i.length-u),l=parseInt(i.substring(u,u+f),n);if(f<8){var a=r(o(n,f));e=e.mul(a).add(r(l))}else e=(e=e.mul(s)).add(r(l))}return e.unsigned=t,e}function f(i,t){return"number"==typeof i?r(i,t):"string"==typeof i?g(i,t):u(i.low,i.high,"boolean"==typeof t?t:i.unsigned)}t.fromString=g,t.fromValue=f;var l=65536,a=1<<24,d=l*l,c=d*d,w=c/2,v=e(a),m=e(0);t.ZERO=m;var N=e(0,!0);t.UZERO=N;var E=e(1);t.ONE=E;var y=e(1,!0);t.UONE=y;var b=e(-1);t.NEG_ONE=b;var q=u(-1,2147483647,!1);t.MAX_VALUE=q;var p=u(-1,-1,!0);t.MAX_UNSIGNED_VALUE=p;var _=u(0,-2147483648,!1);t.MIN_VALUE=_;var B=t.prototype;B.toInt=function(){return this.unsigned?this.low>>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},B.toString=function(i){if((i=i||10)<2||36<i)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(_)){var t=r(i),n=this.div(t),h=n.mul(t).sub(this);return n.toString(i)+h.toInt().toString(i)}return"-"+this.neg().toString(i)}for(var s=r(o(i,6),this.unsigned),e=this,u="";;){var g=e.div(s),f=(e.sub(g.mul(s)).toInt()>>>0).toString(i);if((e=g).isZero())return f+u;for(;f.length<6;)f="0"+f;u=""+f+u}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var i=0!=this.high?this.high:this.low,t=31;t>0&&0==(i&1<<t);t--);return 0!=this.high?t+33:t+1},B.isZero=function(){return 0===this.high&&0===this.low},B.eqz=B.isZero,B.isNegative=function(){return!this.unsigned&&this.high<0},B.isPositive=function(){return this.unsigned||this.high>=0},B.isOdd=function(){return 1==(1&this.low)},B.isEven=function(){return 0==(1&this.low)},B.equals=function(i){return n(i)||(i=f(i)),(this.unsigned===i.unsigned||this.high>>>31!=1||i.high>>>31!=1)&&(this.high===i.high&&this.low===i.low)},B.eq=B.equals,B.notEquals=function(i){return!this.eq(i)},B.neq=B.notEquals,B.ne=B.notEquals,B.lessThan=function(i){return this.comp(i)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(i){return this.comp(i)<=0},B.lte=B.lessThanOrEqual,B.le=B.lessThanOrEqual,B.greaterThan=function(i){return this.comp(i)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(i){return this.comp(i)>=0},B.gte=B.greaterThanOrEqual,B.ge=B.greaterThanOrEqual,B.compare=function(i){if(n(i)||(i=f(i)),this.eq(i))return 0;var t=this.isNegative(),h=i.isNegative();return t&&!h?-1:!t&&h?1:this.unsigned?i.high>>>0>this.high>>>0||i.high===this.high&&i.low>>>0>this.low>>>0?-1:1:this.sub(i).isNegative()?-1:1},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(E)},B.neg=B.negate,B.add=function(i){n(i)||(i=f(i));var t=this.high>>>16,h=65535&this.high,s=this.low>>>16,e=65535&this.low,r=i.high>>>16,o=65535&i.high,g=i.low>>>16,l=0,a=0,d=0,c=0;return d+=(c+=e+(65535&i.low))>>>16,a+=(d+=s+g)>>>16,l+=(a+=h+o)>>>16,l+=t+r,u((d&=65535)<<16|(c&=65535),(l&=65535)<<16|(a&=65535),this.unsigned)},B.subtract=function(i){return n(i)||(i=f(i)),this.add(i.neg())},B.sub=B.subtract,B.multiply=function(t){if(this.isZero())return m;if(n(t)||(t=f(t)),i)return u(i.mul(this.low,this.high,t.low,t.high),i.get_high(),this.unsigned);if(t.isZero())return m;if(this.eq(_))return t.isOdd()?_:m;if(t.eq(_))return this.isOdd()?_:m;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(v)&&t.lt(v))return r(this.toNumber()*t.toNumber(),this.unsigned);var h=this.high>>>16,s=65535&this.high,e=this.low>>>16,o=65535&this.low,g=t.high>>>16,l=65535&t.high,a=t.low>>>16,d=65535&t.low,c=0,w=0,N=0,E=0;return N+=(E+=o*d)>>>16,w+=(N+=e*d)>>>16,N&=65535,w+=(N+=o*a)>>>16,c+=(w+=s*d)>>>16,w&=65535,c+=(w+=e*a)>>>16,w&=65535,c+=(w+=o*l)>>>16,c+=h*d+s*a+e*l+o*g,u((N&=65535)<<16|(E&=65535),(c&=65535)<<16|(w&=65535),this.unsigned)},B.mul=B.multiply,B.divide=function(t){if(n(t)||(t=f(t)),t.isZero())throw Error("division by zero");var h,s,e;if(i)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?i.div_u:i.div_s)(this.low,this.high,t.low,t.high),i.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?N:m;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return N;if(t.gt(this.shru(1)))return y;e=N}else{if(this.eq(_))return t.eq(E)||t.eq(b)?_:t.eq(_)?E:(h=this.shr(1).div(t).shl(1)).eq(m)?t.isNegative()?E:b:(s=this.sub(t.mul(h)),e=h.add(s.div(t)));if(t.eq(_))return this.unsigned?N:m;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();e=m}for(s=this;s.gte(t);){h=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var g=Math.ceil(Math.log(h)/Math.LN2),l=g<=48?1:o(2,g-48),a=r(h),d=a.mul(t);d.isNegative()||d.gt(s);)d=(a=r(h-=l,this.unsigned)).mul(t);a.isZero()&&(a=E),e=e.add(a),s=s.sub(d)}return e},B.div=B.divide,B.modulo=function(t){return n(t)||(t=f(t)),i?u((this.unsigned?i.rem_u:i.rem_s)(this.low,this.high,t.low,t.high),i.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},B.mod=B.modulo,B.rem=B.modulo,B.not=function(){return u(~this.low,~this.high,this.unsigned)},B.and=function(i){return n(i)||(i=f(i)),u(this.low&i.low,this.high&i.high,this.unsigned)},B.or=function(i){return n(i)||(i=f(i)),u(this.low|i.low,this.high|i.high,this.unsigned)},B.xor=function(i){return n(i)||(i=f(i)),u(this.low^i.low,this.high^i.high,this.unsigned)},B.shiftLeft=function(i){return n(i)&&(i=i.toInt()),0==(i&=63)?this:i<32?u(this.low<<i,this.high<<i|this.low>>>32-i,this.unsigned):u(0,this.low<<i-32,this.unsigned)},B.shl=B.shiftLeft,B.shiftRight=function(i){return n(i)&&(i=i.toInt()),0==(i&=63)?this:i<32?u(this.low>>>i|this.high<<32-i,this.high>>i,this.unsigned):u(this.high>>i-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(i){if(n(i)&&(i=i.toInt()),0===(i&=63))return this;var t=this.high;return i<32?u(this.low>>>i|t<<32-i,t>>>i,this.unsigned):u(32===i?t:t>>>i-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.shr_u=B.shiftRightUnsigned,B.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},B.toBytes=function(i){return i?this.toBytesLE():this.toBytesBE()},B.toBytesLE=function(){var i=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&i,i>>>8&255,i>>>16&255,i>>>24]},B.toBytesBE=function(){var i=this.high,t=this.low;return[i>>>24,i>>>16&255,i>>>8&255,255&i,t>>>24,t>>>16&255,t>>>8&255,255&t]},t.fromBytes=function(i,n,h){return h?t.fromBytesLE(i,n):t.fromBytesBE(i,n)},t.fromBytesLE=function(i,n){return new t(i[0]|i[1]<<8|i[2]<<16|i[3]<<24,i[4]|i[5]<<8|i[6]<<16|i[7]<<24,n)},t.fromBytesBE=function(i,n){return new t(i[4]<<24|i[5]<<16|i[6]<<8|i[7],i[0]<<24|i[1]<<16|i[2]<<8|i[3],n)};
110
+ },{}],"VmHy":[function(require,module,exports) {
111
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importAsPprofProfile=u;var e=require("./profile.proto.js"),n=require("../lib/profile"),t=require("../lib/utils"),l=require("../lib/value-formatters"),r=i(require("long"));function i(e){return e&&e.__esModule?e:{default:e}}function o(e){const n=e.defaultSampleType,t=e.sampleType,l=t.length-1;if(!n||!+n)return l;const r=t.findIndex(e=>e.type===n);return-1===r?l:r}function u(i){if(0===i.byteLength)return null;let u;try{u=e.perftools.profiles.Profile.decode(new Uint8Array(i))}catch(g){return null}function s(e){return"number"==typeof e?e:e.low}function a(e){return u.stringTable[s(e)]||null}const c=new Map;function f(e){const{name:n,filename:t,startLine:l}=e,r=null!=n&&a(n)||"(unknown)",i=null!=t?a(t):null,o=null!=l?+l:null,u={key:`${r}:${i}:${o}`,name:r};return null!=i&&(u.file=i),null!=o&&(u.line=o),u}for(let e of u.function)if(e.id){const n=f(e);null!=n&&c.set(s(e.id),n)}function p(e){const{line:n}=e;if(null==n)return null;const l=(0,t.lastOf)(n);if(null==l)return null;if(l.functionId){let e=c.get(s(l.functionId));const n=l.line instanceof r.default?l.line.toNumber():l.line;return n&&n>0&&null!=e&&(e.line=n),e||null}return null}const d=new Map;for(let e of u.location)if(null!=e.id){const n=p(e);n&&d.set(s(e.id),n)}const m=u.sampleType.map(e=>({type:e.type&&a(e.type)||"samples",unit:e.unit&&a(e.unit)||"count"})),y=o(u),b=m[y],w=new n.StackListProfileBuilder;switch(b.unit){case"nanoseconds":case"microseconds":case"milliseconds":case"seconds":w.setValueFormatter(new l.TimeFormatter(b.unit));break;case"bytes":w.setValueFormatter(new l.ByteFormatter)}for(let e of u.sample){const n=e.locationId?e.locationId.map(e=>d.get(s(e))):[];n.reverse();const t=e.value[y];w.appendSampleWithWeight(n.filter(e=>null!=e),+t)}return w.build()}
112
+ },{"./profile.proto.js":"YdJi","../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4","long":"YvD4"}],"bNW7":[function(require,module,exports) {
113
+ "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()}
110
114
  },{"../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4"}],"KFvE":[function(require,module,exports) {
111
115
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isTraceEventFormatted=m,exports.importTraceEvents=g;var e=require("../lib/utils"),t=require("../lib/profile"),n=require("../lib/value-formatters");function r(t,n){return`${(0,e.zeroPad)(""+t,10)}:${(0,e.zeroPad)(""+n,10)}`}function s(t){const n=new Map;for(let s of t){(0,e.getOrInsert)(n,r(s.pid,s.tid),()=>[]).push(s)}return n}function o(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 s<o?"B":o<s?"E":n.name===r.name?"B":"E"}function a(e){const t=[],n=[];if(e.length>0){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.ts<t.ts)return-1;if(e.ts>t.ts)return 1;const n=s(e),r=s(t);return n>r?-1:n<r?1:0});for(let a of r){const e=s(a);t.push(Object.assign(Object.assign({},a),{ph:"B"})),n.push(Object.assign(Object.assign({},a),{ph:"E",ts:a.ts+e}))}function o(e,t){return e.ts<t.ts?-1:e.ts>t.ts?1:0}return t.sort(o),n.sort(o),[t,n]}function i(e){const t=[];for(let n of e)switch(n.ph){case"B":case"E":case"X":t.push(n)}return t}function u(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 c(e){const t=new Map;for(let n of e)"M"===n.ph&&"thread_name"===n.name&&n.args&&n.args.name&&t.set(r(n.pid,n.tid),n.args.name);return t}function f(e){let t=`${e.name||"(unnamed)"}`;return e.args&&(t+=` ${JSON.stringify(e.args)}`),t}function l(e){const t=f(e);return{name:t,key:t}}function h(f){const h=s(i(f)),d=u(f),p=c(f),m=[];return h.forEach(s=>{if(0===s.length)return;const{pid:i,tid:u}=s[0],c=new t.CallTreeProfileBuilder;c.setValueFormatter(new n.TimeFormatter("microseconds"));const f=d.get(i),h=p.get(r(i,u));null!=f&&null!=h?c.setName(`${f} (pid ${i}), ${h} (tid ${u})`):null!=f?c.setName(`${f} (pid ${i}, tid ${u})`):null!=h?c.setName(`${h} (pid ${i}, tid ${u})`):c.setName(`pid ${i}, tid ${u}`);const[g,$]=a(s),k=[],b=e=>{k.push(e),c.enterFrame(l(e),e.ts)},w=t=>{const n=(0,e.lastOf)(k);if(null==n)return void console.warn(`Tried to end frame "${l(t).key}", but the stack was empty. Doing nothing instead.`);const r=l(t),s=l(n);t.name===n.name?(r.key!==s.key&&console.warn(`ts=${t.ts}: Tried to end "${r.key}" when "${s.key}" was on the top of the stack. Ending ${s.key} instead.`),k.pop(),c.leaveFrame(s,t.ts)):console.warn(`ts=${t.ts}: Tried to end "${r.key}" when "${s.key}" was on the top of the stack. Doing nothing instead.`)};for(;g.length>0||$.length>0;){const t=o(g,$);switch(t){case"B":b(g.shift());break;case"E":{const t=(0,e.lastOf)(k);if(null!=t){const e=l(t);let n=!1;for(let t=1;t<$.length;t++){const r=$[t];if(r.ts>$[0].ts)break;const s=l(r);if(e.key===s.key){const e=$[0];$[0]=$[t],$[t]=e,n=!0;break}}if(!n)for(let r=1;r<$.length;r++){const e=$[r];if(e.ts>$[0].ts)break;if(e.name===t.name){const e=$[0];$[0]=$[r],$[r]=e,n=!0;break}}}w($.shift());break}default:return t}}for(let e=k.length-1;e>=0;e--){const t=l(k[e]);console.warn(`Frame "${t.key}" was still open at end of profile. Closing automatically.`),c.leaveFrame(t,c.getTotalWeight())}m.push([r(i,u),c.build()])}),(0,e.sortBy)(m,e=>e[0]),{name:"",indexToView:0,profiles:m.map(e=>e[1])}}function d(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 p(e){return"traceEvents"in e&&d(e.traceEvents)}function m(e){return p(e)||d(e)}function g(e){if(p(e))return h(e.traceEvents);if(d(e))return h(e);return e}
112
- },{"../lib/utils":"ucYa","../lib/profile":"YG8z","../lib/value-formatters":"LsM4"}],"uRa7":[function(require,module,exports) {
113
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importProfileGroupFromText=h,exports.importProfileGroupFromBase64=F,exports.importProfilesFromFile=y,exports.importProfilesFromArrayBuffer=I,exports.importFromFileSystemDirectoryEntry=C;var e=require("./chrome"),r=require("./stackprof"),o=require("./instruments"),i=require("./bg-flamegraph"),t=require("./firefox"),n=require("../lib/file-format"),s=require("./v8proflog"),p=require("./linux-tools-perf"),l=require("./haskell"),m=require("./safari"),a=require("./utils"),f=require("./pprof"),u=require("../lib/utils"),c=require("./v8heapalloc"),d=require("./trace-event"),g=function(e,r,o,i){return new(o||(o=Promise))(function(t,n){function s(e){try{l(i.next(e))}catch(r){n(r)}}function p(e){try{l(i.throw(e))}catch(r){n(r)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof o?r:new o(function(e){e(r)})).then(s,p)}l((i=i.apply(e,r||[])).next())})};function h(e,r){return g(this,void 0,void 0,function*(){return yield P(new a.TextProfileDataSource(e,r))})}function F(e,r){return g(this,void 0,void 0,function*(){return yield P(a.MaybeCompressedDataReader.fromArrayBuffer(e,(0,u.decodeBase64)(r).buffer))})}function y(e){return g(this,void 0,void 0,function*(){return P(a.MaybeCompressedDataReader.fromFile(e))})}function I(e,r){return g(this,void 0,void 0,function*(){return P(a.MaybeCompressedDataReader.fromArrayBuffer(e,r))})}function P(e){return g(this,void 0,void 0,function*(){const r=yield e.name(),o=yield S(e);if(o){o.name||(o.name=r);for(let e of o.profiles)e&&!e.getName()&&e.setName(r);return o}return null})}function v(e){return e?{name:e.getName(),indexToView:0,profiles:[e]}:null}function x(e){return"["===(e=e.trim())[0]&&"]"!==(e=e.replace(/,\s*$/,""))[e.length-1]&&(e+="]"),e}function S(a){return g(this,void 0,void 0,function*(){const u=yield a.name(),g=yield a.readAsArrayBuffer();{const e=(0,f.importAsPprofProfile)(g);if(e)return console.log("Importing as protobuf encoded pprof file"),v(e)}const h=yield a.readAsText();if(u.endsWith(".speedscope.json"))return console.log("Importing as speedscope json file"),(0,n.importSpeedscopeProfiles)(JSON.parse(h));if(u.endsWith(".chrome.json")||/Profile-\d{8}T\d{6}/.exec(u))return console.log("Importing as Chrome Timeline"),(0,e.importFromChromeTimeline)(JSON.parse(h),u);if(u.endsWith(".stackprof.json"))return console.log("Importing as stackprof profile"),v((0,r.importFromStackprof)(JSON.parse(h)));if(u.endsWith(".instruments.txt"))return console.log("Importing as Instruments.app deep copy"),v((0,o.importFromInstrumentsDeepCopy)(h));if(u.endsWith(".linux-perf.txt"))return console.log("Importing as output of linux perf script"),(0,p.importFromLinuxPerf)(h);if(u.endsWith(".collapsedstack.txt"))return console.log("Importing as collapsed stack format"),v((0,i.importFromBGFlameGraph)(h));if(u.endsWith(".v8log.json"))return console.log("Importing as --prof-process v8 log"),v((0,s.importFromV8ProfLog)(JSON.parse(h)));if(u.endsWith(".heapprofile"))return console.log("Importing as Chrome Heap Profile"),v((0,c.importFromChromeHeapProfile)(JSON.parse(h)));if(u.endsWith("-recording.json"))return console.log("Importing as Safari profile"),v((0,m.importFromSafari)(JSON.parse(h)));let F;try{F=JSON.parse(x(h))}catch(y){}if(F){if("https://www.speedscope.app/file-format-schema.json"===F.$schema)return console.log("Importing as speedscope json file"),(0,n.importSpeedscopeProfiles)(JSON.parse(h));if(F.systemHost&&"Firefox"==F.systemHost.name)return console.log("Importing as Firefox profile"),v((0,t.importFromFirefox)(F));if((0,e.isChromeTimeline)(F))return console.log("Importing as Chrome Timeline"),(0,e.importFromChromeTimeline)(F,u);if("nodes"in F&&"samples"in F&&"timeDeltas"in F)return console.log("Importing as Chrome CPU Profile"),v((0,e.importFromChromeCPUProfile)(F));if((0,d.isTraceEventFormatted)(F))return console.log("Importing as Trace Event Format profile"),(0,d.importTraceEvents)(F);if("head"in F&&"samples"in F&&"timestamps"in F)return console.log("Importing as Chrome CPU Profile (old format)"),v((0,e.importFromOldV8CPUProfile)(F));if("mode"in F&&"frames"in F&&"raw_timestamp_deltas"in F)return console.log("Importing as stackprof profile"),v((0,r.importFromStackprof)(F));if("code"in F&&"functions"in F&&"ticks"in F)return console.log("Importing as --prof-process v8 log"),v((0,s.importFromV8ProfLog)(F));if("head"in F&&"selfSize"in F.head)return console.log("Importing as Chrome Heap Profile"),v((0,c.importFromChromeHeapProfile)(JSON.parse(h)));if("rts_arguments"in F&&"initial_capabilities"in F)return console.log("Importing as Haskell GHC JSON Profile"),(0,l.importFromHaskell)(F);if("recording"in F&&"sampleStackTraces"in F.recording)return console.log("Importing as Safari profile"),v((0,m.importFromSafari)(JSON.parse(h)))}else{if(/^[\w \t\(\)]*\tSymbol Name/.exec(h))return console.log("Importing as Instruments.app deep copy"),v((0,o.importFromInstrumentsDeepCopy)(h));const e=h.split(/\n/).length;if(e>=1&&e===h.split(/ \d+\r?\n/).length)return console.log("Importing as collapsed stack format"),v((0,i.importFromBGFlameGraph)(h));const r=(0,p.importFromLinuxPerf)(h);if(r)return console.log("Importing from linux perf script output"),r}return null})}function C(e){return g(this,void 0,void 0,function*(){return(0,o.importFromInstrumentsTrace)(e)})}
114
- },{"./chrome":"kWV1","./stackprof":"I37H","./instruments":"G28U","./bg-flamegraph":"flbo","./firefox":"uNW1","../lib/file-format":"Xzb6","./v8proflog":"QV03","./linux-tools-perf":"f2sa","./haskell":"jm73","./safari":"jP3w","./utils":"QTYz","./pprof":"VmHy","../lib/utils":"ucYa","./v8heapalloc":"bNW7","./trace-event":"KFvE"}]},{},[], null)
115
- //# sourceMappingURL=import.cf0fa83f.js.map
116
+ },{"../lib/utils":"ucYa","../lib/profile":"YG8z","../lib/value-formatters":"LsM4"}],"TZYa":[function(require,module,exports) {
117
+ "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.lineNum<this.lines.length;){const e=this.lines[this.lineNum++];if(!/^\s*#/.exec(e)&&!(/^\s*$/.exec(e)||this.parseHeaderLine(e)||this.parseAssignmentLine(e)||this.parseCostLine(e,"self")))throw new Error(`Unrecognized line "${e}" on line ${this.lineNum}`)}return this.callGraphs?{name:this.importedFileName,indexToView:0,profiles:this.callGraphs.map(e=>e.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;n<i.length;n++){const t=i[n];if(0===t.length)return!1;if("*"===t||"-"===t[0]||"+"===t[1]){if(this.prevCostLineNumbers.length<=n)throw new Error(`Line ${this.lineNum} has a subposition on column ${n} but `+`previous cost line has only ${this.prevCostLineNumbers.length} `+`columns. Line contents: ${e}`);const i=this.prevCostLineNumbers[n];if("*"===t)s.push(i);else{const r=parseInt(t);if(isNaN(r))throw new Error(`Line ${this.lineNum} has a subposition on column ${n} but `+`the offset is not a number. Line contents: ${e}`);s.push(i+r)}}else{const e=parseInt(t);if(isNaN(e))return!1;s.push(e)}}if(0==s.length)return!1;if(!this.callGraphs)throw new Error(`Encountered a cost line on line ${this.lineNum} before event specification was provided.`);for(let n=0;n<this.callGraphs.length;n++)"self"===t?this.callGraphs[n].addSelfWeight(this.frameInfo(),s[1+n]):"child"===t&&this.callGraphs[n].addChildWithTotalWeight(this.frameInfo(),this.calleeFrameInfo(),s[1+n]||0);return this.prevCostLineNumbers=s,!0}}function r(e,t){return new n(e,t).parse()}
118
+ },{"../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4"}],"duFC":[function(require,module,exports) {
119
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importFromPapyrus=r;var e=require("../lib/profile"),t=require("../lib/utils"),n=require("../lib/value-formatters");function r(r){const a=new e.CallTreeProfileBuilder;a.setValueFormatter(new n.TimeFormatter("milliseconds"));const l=[...r.splitLines()].filter(e=>!/^$|^Log closed$|log opened/.exec(e));let s=-1;const o=I(l[0]);if(null===o)throw Error;s=o.at;const i=(0,t.lastOf)(l);if(null===i)throw Error;const c=I(i);if(null===c)throw Error;const u=c.at,f=new t.KeyedSet,h=[];let m,p=0,v=-1;function d(t,n,r){function l(t,n){h.push(n),a.enterFrame(e.Frame.getOrInsert(f,{name:n,key:n}),t),p=t}v>-1&&(v=-1,m===r&&v>=p&&d(t,v,`QUEUE ${r}`));const s=`STACK ${t}`;[...h].reverse().find(e=>e.startsWith("STACK "))!==s&&(1===h.length&&g(p),l(n,s)),l(n,r)}function g(n){const r=h.pop();if(void 0===r)throw Error("Tried to leave frame when nothing was on stack.");a.leaveFrame(e.Frame.getOrInsert(f,{name:r,key:r}),n);let l=(0,t.lastOf)(h);null!==l&&l.startsWith("QUEUE ")&&(g(n),l=(0,t.lastOf)(h)),h.length>1&&null!==l&&l.startsWith("STACK ")&&g(n),p=n}function w(e,n,r){(0,t.lastOf)(h)===r?g(n):0===p?(console.log(`Tried to leave frame "${r}" which was never entered. Assuming it has been running since the start.`),d(e,0,r),g(n)):console.log(`Tried to leave frame "${r}" which was never entered. Other events have happened since the start, ignoring line.`)}function I(e){if(void 0===e)throw Error("Probably tried to import empty file.");const t=e.split(":");return t.length<3?null:-1!==s?{at:parseInt(t[0])-s,event:t[1],stackInt:parseInt(t[2]),name:t[5]}:{at:parseInt(t[0]),event:t[1],stackInt:parseInt(t[2]),name:t[5]}}for(l.forEach((e,t,n)=>{const r=I(e);if(null!==r)if("PUSH"===r.event){d(r.stackInt,r.at,r.name);let e=I(n[t+=1]);for(;null!==e&&e.at===r.at;)e.name===r.name&&e.stackInt===r.stackInt&&"POP"===e.event?(w(e.stackInt,e.at,e.name),n.splice(t,1),e=null):(t+=1)<n.length&&(e=I(n[t]))}else if("POP"===r.event)w(r.stackInt,r.at,r.name);else if("QUEUE_PUSH"===r.event)return m=r.name.replace(/\?/g,""),void(v=r.at)});h.length>0;)g(u);return a.build()}
120
+ },{"../lib/profile":"YG8z","../lib/utils":"ucYa","../lib/value-formatters":"LsM4"}],"uRa7":[function(require,module,exports) {
121
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importProfileGroupFromText=C,exports.importProfileGroupFromBase64=I,exports.importProfilesFromFile=x,exports.importProfilesFromArrayBuffer=y,exports.importFromFileSystemDirectoryEntry=T;var r=require("./chrome"),e=require("./stackprof"),o=require("./instruments"),i=require("./bg-flamegraph"),t=require("./firefox"),n=require("../lib/file-format"),s=require("./v8proflog"),l=require("./linux-tools-perf"),m=require("./haskell"),p=require("./safari"),a=require("./utils"),f=require("./pprof"),c=require("../lib/utils"),u=require("./v8heapalloc"),d=require("./trace-event"),g=require("./callgrind"),h=require("./papyrus"),F=function(r,e,o,i){return new(o||(o=Promise))(function(t,n){function s(r){try{m(i.next(r))}catch(e){n(e)}}function l(r){try{m(i.throw(r))}catch(e){n(e)}}function m(r){var e;r.done?t(r.value):(e=r.value,e instanceof o?e:new o(function(r){r(e)})).then(s,l)}m((i=i.apply(r,e||[])).next())})};function C(r,e){return F(this,void 0,void 0,function*(){return yield P(new a.TextProfileDataSource(r,e))})}function I(r,e){return F(this,void 0,void 0,function*(){return yield P(a.MaybeCompressedDataReader.fromArrayBuffer(r,(0,c.decodeBase64)(e).buffer))})}function x(r){return F(this,void 0,void 0,function*(){return P(a.MaybeCompressedDataReader.fromFile(r))})}function y(r,e){return F(this,void 0,void 0,function*(){return P(a.MaybeCompressedDataReader.fromArrayBuffer(r,e))})}function P(r){return F(this,void 0,void 0,function*(){const e=yield r.name(),o=yield S(r);if(o){o.name||(o.name=e);for(let r of o.profiles)r&&!r.getName()&&r.setName(e);return o}return null})}function v(r){return r?{name:r.getName(),indexToView:0,profiles:[r]}:null}function S(a){return F(this,void 0,void 0,function*(){const c=yield a.name(),F=yield a.readAsArrayBuffer();{const r=(0,f.importAsPprofProfile)(F);if(r)return console.log("Importing as protobuf encoded pprof file"),v(r)}const C=yield a.readAsText();if(c.endsWith(".speedscope.json"))return console.log("Importing as speedscope json file"),(0,n.importSpeedscopeProfiles)(C.parseAsJSON());if(/Trace-\d{8}T\d{6}/.exec(c))return console.log("Importing as Chrome Timeline Object"),(0,r.importFromChromeTimeline)(C.parseAsJSON().traceEvents,c);if(c.endsWith(".chrome.json")||/Profile-\d{8}T\d{6}/.exec(c))return console.log("Importing as Chrome Timeline"),(0,r.importFromChromeTimeline)(C.parseAsJSON(),c);if(c.endsWith(".stackprof.json"))return console.log("Importing as stackprof profile"),v((0,e.importFromStackprof)(C.parseAsJSON()));if(c.endsWith(".instruments.txt"))return console.log("Importing as Instruments.app deep copy"),v((0,o.importFromInstrumentsDeepCopy)(C));if(c.endsWith(".linux-perf.txt"))return console.log("Importing as output of linux perf script"),(0,l.importFromLinuxPerf)(C);if(c.endsWith(".collapsedstack.txt"))return console.log("Importing as collapsed stack format"),v((0,i.importFromBGFlameGraph)(C));if(c.endsWith(".v8log.json"))return console.log("Importing as --prof-process v8 log"),v((0,s.importFromV8ProfLog)(C.parseAsJSON()));if(c.endsWith(".heapprofile"))return console.log("Importing as Chrome Heap Profile"),v((0,u.importFromChromeHeapProfile)(C.parseAsJSON()));if(c.endsWith("-recording.json"))return console.log("Importing as Safari profile"),v((0,p.importFromSafari)(C.parseAsJSON()));if(c.startsWith("callgrind."))return console.log("Importing as Callgrind profile"),(0,g.importFromCallgrind)(C,c);let I;try{I=C.parseAsJSON()}catch(x){}if(I){if("https://www.speedscope.app/file-format-schema.json"===I.$schema)return console.log("Importing as speedscope json file"),(0,n.importSpeedscopeProfiles)(I);if(I.systemHost&&"Firefox"==I.systemHost.name)return console.log("Importing as Firefox profile"),v((0,t.importFromFirefox)(I));if((0,r.isChromeTimeline)(I))return console.log("Importing as Chrome Timeline"),(0,r.importFromChromeTimeline)(I,c);if((0,r.isChromeTimelineObject)(I))return console.log("Importing as Chrome Timeline Object"),(0,r.importFromChromeTimeline)(I.traceEvents,c);if("nodes"in I&&"samples"in I&&"timeDeltas"in I)return console.log("Importing as Chrome CPU Profile"),v((0,r.importFromChromeCPUProfile)(I));if((0,d.isTraceEventFormatted)(I))return console.log("Importing as Trace Event Format profile"),(0,d.importTraceEvents)(I);if("head"in I&&"samples"in I&&"timestamps"in I)return console.log("Importing as Chrome CPU Profile (old format)"),v((0,r.importFromOldV8CPUProfile)(I));if("mode"in I&&"frames"in I&&"raw_timestamp_deltas"in I)return console.log("Importing as stackprof profile"),v((0,e.importFromStackprof)(I));if("code"in I&&"functions"in I&&"ticks"in I)return console.log("Importing as --prof-process v8 log"),v((0,s.importFromV8ProfLog)(I));if("head"in I&&"selfSize"in I.head)return console.log("Importing as Chrome Heap Profile"),v((0,u.importFromChromeHeapProfile)(I));if("rts_arguments"in I&&"initial_capabilities"in I)return console.log("Importing as Haskell GHC JSON Profile"),(0,m.importFromHaskell)(I);if("recording"in I&&"sampleStackTraces"in I.recording)return console.log("Importing as Safari profile"),v((0,p.importFromSafari)(I))}else{if(/^# callgrind format/.exec(C.firstChunk())||/^events:/m.exec(C.firstChunk())&&/^fn=/m.exec(C.firstChunk()))return console.log("Importing as Callgrind profile"),(0,g.importFromCallgrind)(C,c);if(/^[\w \t\(\)]*\tSymbol Name/.exec(C.firstChunk()))return console.log("Importing as Instruments.app deep copy"),v((0,o.importFromInstrumentsDeepCopy)(C));if(/^(Stack_|Script_|Obj_)\S+ log opened \(PC\)\n/.exec(C.firstChunk()))return console.log("Importing as Papyrus profile"),v((0,h.importFromPapyrus)(C));const r=(0,l.importFromLinuxPerf)(C);if(r)return console.log("Importing from linux perf script output"),r;const e=(0,i.importFromBGFlameGraph)(C);if(e)return console.log("Importing as collapsed stack format"),v(e)}return null})}function T(r){return F(this,void 0,void 0,function*(){return(0,o.importFromInstrumentsTrace)(r)})}
122
+ },{"./chrome":"kWV1","./stackprof":"I37H","./instruments":"G28U","./bg-flamegraph":"flbo","./firefox":"uNW1","../lib/file-format":"Xzb6","./v8proflog":"QV03","./linux-tools-perf":"f2sa","./haskell":"jm73","./safari":"jP3w","./utils":"QTYz","./pprof":"VmHy","../lib/utils":"ucYa","./v8heapalloc":"bNW7","./trace-event":"KFvE","./callgrind":"TZYa","./papyrus":"duFC"}]},{},[], null)
123
+ //# sourceMappingURL=import.8ae8aa3d.js.map
@@ -1,2 +1,2 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>speedscope</title><link href="fonts/source-code-pro-regular.css" rel="stylesheet"><script></script><link rel="stylesheet" href="reset.8c46b7a1.css"><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.bc503437.png"><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.f74b3187.png"></head><body> <script src="speedscope.44364064.js"></script>
1
+ <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>speedscope</title><link href="fonts/source-code-pro-regular.css" rel="stylesheet"><script></script><link rel="stylesheet" href="reset.8c46b7a1.css"><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.bc503437.png"><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.f74b3187.png"></head><body> <script src="speedscope.f27db165.js"></script>
2
2
  </body></html>
@@ -1,3 +1,3 @@
1
- speedscope@1.12.1
2
- Thu Nov 12 02:36:50 PST 2020
3
- 6a979bb568f548dd347dba5b18e69e4401a2dda3
1
+ speedscope@1.16.0
2
+ Sun Jul 16 03:04:48 PDT 2023
3
+ 650e505b55536373d42f9de22c812f87acc42d05