Rocky_Mountain_Vending/.pnpm-store/v10/files/e3/41e40f4f17b16e1d015ed4621b3f90c74881bbc6cac10b7b91021762411218d83e9bb8e0946fc6b5e4f61ebc53db1f09932fbcd7e9f702426f56694edb782d
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

91 lines
No EOL
2.5 KiB
Text

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export class ProfileNode {
callFrame;
callUID;
self;
total;
id;
parent;
children;
functionName;
depth;
deoptReason;
constructor(callFrame) {
this.callFrame = callFrame;
this.callUID = `${callFrame.functionName}@${callFrame.scriptId}:${callFrame.lineNumber}:${callFrame.columnNumber}`;
this.self = 0;
this.total = 0;
this.id = 0;
this.functionName = callFrame.functionName;
this.parent = null;
this.children = [];
}
get scriptId() {
return String(this.callFrame.scriptId);
}
get url() {
return this.callFrame.url;
}
get lineNumber() {
return this.callFrame.lineNumber;
}
get columnNumber() {
return this.callFrame.columnNumber;
}
setFunctionName(name) {
if (name === null) {
return;
}
this.functionName = name;
}
}
export class ProfileTreeModel {
root;
total;
maxDepth;
initialize(root) {
this.root = root;
this.assignDepthsAndParents();
this.total = this.calculateTotals(this.root);
}
assignDepthsAndParents() {
const root = this.root;
root.depth = -1;
root.parent = null;
this.maxDepth = 0;
const nodesToTraverse = [root];
while (nodesToTraverse.length) {
const parent = nodesToTraverse.pop();
const depth = parent.depth + 1;
if (depth > this.maxDepth) {
this.maxDepth = depth;
}
const children = parent.children;
for (const child of children) {
child.depth = depth;
child.parent = parent;
nodesToTraverse.push(child);
}
}
}
calculateTotals(root) {
const nodesToTraverse = [root];
const dfsList = [];
while (nodesToTraverse.length) {
const node = nodesToTraverse.pop();
node.total = node.self;
dfsList.push(node);
nodesToTraverse.push(...node.children);
}
while (dfsList.length > 1) {
const node = dfsList.pop();
if (node.parent) {
node.parent.total += node.total;
}
}
return root.total;
}
}
//# sourceMappingURL=ProfileTreeModel.js.map