export class ProfileNode{constructor(t){this.callFrame=t,this.callUID=`${t.functionName}@${t.scriptId}:${t.lineNumber}:${t.columnNumber}`,this.self=0,this.total=0,this.id=0,this.parent=null,this.children=[],this.depth,this.deoptReason}get functionName(){return this.callFrame.functionName}get scriptId(){return this.callFrame.scriptId}get url(){return this.callFrame.url}get lineNumber(){return this.callFrame.lineNumber}get columnNumber(){return this.callFrame.columnNumber}}export class ProfileTreeModel{constructor(t){this._target=t||null,this.root,this.total,this.maxDepth}initialize(t){this.root=t,this._assignDepthsAndParents(),this.total=this._calculateTotals(this.root)}_assignDepthsAndParents(){const t=this.root;t.depth=-1,t.parent=null,this.maxDepth=0;const e=[t];for(;e.length;){const t=e.pop(),r=t.depth+1;r>this.maxDepth&&(this.maxDepth=r);const s=t.children;for(const l of s)l.depth=r,l.parent=t,l.children.length&&e.push(l)}}_calculateTotals(t){const e=[t],r=[];for(;e.length;){const t=e.pop();t.total=t.self,r.push(t),e.push(...t.children)}for(;r.length>1;){const t=r.pop();t.parent&&(t.parent.total+=t.total)}return t.total}target(){return this._target}}