exports.id = 15;
exports.ids = [15];
exports.modules = {

/***/ 31462:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AllPackagesWildcard = exports.PackageManager = exports.PackageType = exports.DependencyType = exports.Lockfile = exports.Theme = void 0;
var Theme;
(function (Theme) {
    Theme["Dark"] = "dark";
    Theme["Light"] = "light";
    Theme["System"] = "system";
})(Theme = exports.Theme || (exports.Theme = {}));
var Lockfile;
(function (Lockfile) {
    Lockfile["NPM_LOCKFILE"] = "package-lock.json";
    Lockfile["YARN_LOCKFILE"] = "yarn.lock";
    Lockfile["PNPM_LOCKFILE"] = "pnpm-lock.yaml";
})(Lockfile = exports.Lockfile || (exports.Lockfile = {}));
var DependencyType;
(function (DependencyType) {
    DependencyType["PEER"] = "peer";
    DependencyType["DEVELOPMENT"] = "development";
    DependencyType["PRODUCTION"] = "production";
})(DependencyType = exports.DependencyType || (exports.DependencyType = {}));
var PackageType;
(function (PackageType) {
    PackageType["NODE"] = "node";
    PackageType["REACT"] = "react";
    PackageType["NEXT"] = "next";
})(PackageType = exports.PackageType || (exports.PackageType = {}));
var PackageManager;
(function (PackageManager) {
    PackageManager["PNPM"] = "pnpm";
    PackageManager["YARN"] = "yarn";
    PackageManager["NPM"] = "npm";
})(PackageManager = exports.PackageManager || (exports.PackageManager = {}));
exports.AllPackagesWildcard = '*';


/***/ }),

/***/ 82872:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.formatPackageName = void 0;
const formatPackageName = (name, options) => {
    const { stripScope = false } = options;
    if (!name) {
        return name;
    }
    if (name.includes('/') && stripScope) {
        return name.split('/')[1];
    }
    return name;
};
exports.formatPackageName = formatPackageName;


/***/ }),

/***/ 8159:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.formatTagName = void 0;
const slugify_tag_name_1 = __webpack_require__(99780);
const formatTagName = (tagName) => {
    return `#${(0, slugify_tag_name_1.slugifyTagName)(tagName)}`;
};
exports.formatTagName = formatTagName;


/***/ }),

/***/ 87552:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
__exportStar(__webpack_require__(31462), exports);
__exportStar(__webpack_require__(77013), exports);
__exportStar(__webpack_require__(99780), exports);
__exportStar(__webpack_require__(8159), exports);
__exportStar(__webpack_require__(82872), exports);


/***/ }),

/***/ 77013:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.slugifyPackageName = void 0;
const slugify_1 = __importDefault(__webpack_require__(35550));
/**
 * Takes a package name and converts it into a URL-friendly slug.
 * Replaces slashes (/) with hyphens (-) and removes any non-URL-safe characters.
 *
 * @param packageName - The package name to be slugified.
 * @returns The slugified package name.
 */
const slugifyPackageName = (packageName) => {
    const replacementRegex = /\//g;
    if (!packageName) {
        return '';
    }
    const packageNameWithoutScopeSlash = packageName.replace(replacementRegex, '-');
    return (0, slugify_1.default)(packageNameWithoutScopeSlash, { strict: true, lower: true });
};
exports.slugifyPackageName = slugifyPackageName;


/***/ }),

/***/ 99780:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.slugifyTagName = void 0;
const slugify_1 = __importDefault(__webpack_require__(35550));
/**
 * Takes a tag name and converts it into a URL-friendly slug.
 * Replaces slashes (/) with hyphens (-) and removes any non-URL-safe characters.
 *
 * @param packageName - The package name to be slugified.
 * @returns The slugified package name.
 */
const slugifyTagName = (tagName) => {
    if (!tagName) {
        return '';
    }
    return (0, slugify_1.default)(tagName, {
        strict: true,
        lower: true,
    });
};
exports.slugifyTagName = slugifyTagName;


/***/ }),

/***/ 46650:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.hide = exports.hideDependencies = exports.hideDependents = exports.hideAll = exports.showAll = exports.focus = exports.setInitialElements = exports.showDependants = exports.showDependencies = exports.show = void 0;
function withSerialization(fn) {
    return (args) => {
        const result = fn(args);
        return result.jsons();
    };
}
exports.show = withSerialization(({ traversalGraph, renderGraph, selector, }) => {
    const matchingNodes = traversalGraph.nodes().filter(selector);
    const existingNodes = renderGraph.nodes();
    const nodesToRender = existingNodes.union(matchingNodes);
    const edgesToRender = nodesToRender.nodes().edgesTo(nodesToRender.nodes());
    const elementsToRender = nodesToRender.union(edgesToRender);
    return elementsToRender;
});
exports.showDependencies = withSerialization(({ traversalGraph, renderGraph, id, }) => {
    const node = traversalGraph.$id(id);
    const nodeAndDependants = node.union(node.outgoers());
    const elementsToRender = renderGraph.elements().union(nodeAndDependants);
    return elementsToRender;
});
exports.showDependants = withSerialization(({ traversalGraph, renderGraph, id, }) => {
    const node = traversalGraph.$id(id);
    const nodeAndDependants = node.union(node.incomers());
    const nodesToRender = nodeAndDependants.nodes();
    const edgesToRender = nodesToRender.edgesTo(nodesToRender);
    const elementsToRender = renderGraph
        .elements()
        .union(nodesToRender)
        .union(edgesToRender);
    return elementsToRender;
});
exports.setInitialElements = withSerialization(({ renderGraph }) => {
    return renderGraph.elements();
});
exports.focus = withSerialization(({ traversalGraph, selector, }) => {
    const nodesToRender = traversalGraph.nodes().filter(selector);
    const edgesToRender = nodesToRender.edgesTo(nodesToRender);
    return traversalGraph
        .collection()
        .union(nodesToRender)
        .union(edgesToRender);
});
exports.showAll = withSerialization(({ traversalGraph }) => {
    return traversalGraph.elements();
});
exports.hideAll = withSerialization(({ traversalGraph }) => {
    return traversalGraph.collection();
});
exports.hideDependents = withSerialization(({ traversalGraph, renderGraph, id, }) => {
    const successorsOfNode = renderGraph.$id(id).successors();
    const successorsOfDirectDependents = traversalGraph
        .$id(id)
        .incomers()
        .successors();
    if (successorsOfDirectDependents.length) {
        return traversalGraph
            .collection()
            .union(traversalGraph.$id(id))
            .union(successorsOfNode)
            .intersection(successorsOfDirectDependents);
    }
    else {
        return renderGraph.elements();
    }
});
exports.hideDependencies = withSerialization(({ traversalGraph, renderGraph, id, }) => {
    const elementsToHide = traversalGraph.$id(id).successors();
    return renderGraph.elements().difference(elementsToHide);
});
exports.hide = withSerialization(({ traversalGraph, renderGraph, selector, }) => {
    const elementsToHide = traversalGraph.collection();
    const nodesToHide = traversalGraph.nodes().filter(selector);
    const edgesForElements = nodesToHide.connectedEdges();
    elementsToHide.merge(nodesToHide).merge(edgesForElements);
    return renderGraph.elements().difference(elementsToHide);
});


/***/ }),

/***/ 55286:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.bindRenderGraphEvents = exports.handleEdgeMouseout = exports.handleEdgeMouseover = exports.handleNodeMouseout = exports.handleNodeMouseover = void 0;
const utils_core_1 = __webpack_require__(87552);
/**********************************
 *            NODES               *
 **********************************/
const handleNodeMouseover = ({ target, renderGraph, }) => {
    const neighborhood = target.closedNeighborhood();
    renderGraph
        ?.elements()
        .difference(neighborhood)
        .filter((ele) => {
        return !ele.selected();
    })
        .addClass('dim');
    const forceEdgeColor = renderGraph.scratch('forceEdgeColor');
    if (!forceEdgeColor) {
        target.connectedEdges().map((element) => {
            const type = element.data('type');
            element.addClass(type);
        });
    }
    target.addClass('hover');
};
exports.handleNodeMouseover = handleNodeMouseover;
const handleNodeMouseout = ({ target, renderGraph, }) => {
    const neighborhood = target.neighborhood();
    const focusedElements = renderGraph.collection([neighborhood, target]);
    renderGraph?.elements().difference(focusedElements).removeClass('dim');
    const forceEdgeColor = renderGraph.scratch('forceEdgeColor');
    if (!forceEdgeColor) {
        target.connectedEdges().map((element) => {
            element.removeClass([
                utils_core_1.DependencyType.PRODUCTION,
                utils_core_1.DependencyType.DEVELOPMENT,
                utils_core_1.DependencyType.PEER,
            ]);
        });
    }
    target.removeClass('hover');
};
exports.handleNodeMouseout = handleNodeMouseout;
/**********************************
 *            EDGES               *
 **********************************/
const handleEdgeMouseover = ({ target, renderGraph, violations = [], }) => {
    const forceEdgeColor = renderGraph.scratch('forceEdgeColor');
    target.addClass('hover');
    if (forceEdgeColor)
        return;
    const type = target.data('type');
    const sourcePackageName = target.source().id();
    const targetPackageName = target.target().id();
    const hasViolation = violations.some((violation) => {
        return (violation.sourcePackageName === sourcePackageName &&
            violation.targetPackageName === targetPackageName);
    });
    if (!hasViolation) {
        target.addClass(type);
    }
};
exports.handleEdgeMouseover = handleEdgeMouseover;
const handleEdgeMouseout = ({ target, renderGraph, }) => {
    const forceEdgeColor = renderGraph.scratch('forceEdgeColor');
    target.removeClass('hover');
    if (forceEdgeColor)
        return;
    target.removeClass([
        utils_core_1.DependencyType.PRODUCTION,
        utils_core_1.DependencyType.DEVELOPMENT,
        utils_core_1.DependencyType.PEER,
    ]);
};
exports.handleEdgeMouseout = handleEdgeMouseout;
/**********************************
 *         GENERAL               *
 **********************************/
const bindRenderGraphEvents = (args) => {
    const { renderGraph } = args;
    renderGraph
        .nodes()
        .on('mouseover', (event) => (0, exports.handleNodeMouseover)({ ...args, target: event.target }));
    renderGraph
        .nodes()
        .on('mouseout', (event) => (0, exports.handleNodeMouseout)({ ...args, target: event.target }));
    renderGraph
        .edges()
        .on('mouseover', (event) => (0, exports.handleEdgeMouseover)({ ...args, target: event.target }));
    renderGraph
        .edges()
        .on('mouseout', (event) => (0, exports.handleEdgeMouseout)({ ...args, target: event.target }));
};
exports.bindRenderGraphEvents = bindRenderGraphEvents;


/***/ }),

/***/ 24076:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.dependenciesKeys = exports.packagesKeys = exports.codeownersKeys = exports.constraintsKeys = exports.projectConfigKeys = exports.tagsKeys = exports.violationsKeys = exports.documentsKeys = exports.metadataKey = void 0;
exports.metadataKey = 'metadata';
exports.documentsKeys = [exports.metadataKey, 'documents'];
exports.violationsKeys = [exports.metadataKey, 'violations'];
exports.tagsKeys = [exports.metadataKey, 'tags'];
exports.projectConfigKeys = [exports.metadataKey, 'projectConfig'];
exports.constraintsKeys = [exports.metadataKey, 'constraints'];
exports.codeownersKeys = [exports.metadataKey, 'codeowners'];
exports.packagesKeys = [exports.metadataKey, 'packages'];
exports.dependenciesKeys = [exports.metadataKey, 'dependencies'];


/***/ }),

/***/ 83604:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.createRenderGraph = void 0;
const cytoscape_1 = __importDefault(__webpack_require__(7905));
const cytoscape_dagre_1 = __importDefault(__webpack_require__(93472));
const node_1 = __webpack_require__(76556);
const edge_1 = __webpack_require__(54154);
const cytoscape_popper_1 = __importDefault(__webpack_require__(93256));
cytoscape_1.default.use(cytoscape_dagre_1.default);
cytoscape_1.default.use(cytoscape_popper_1.default);
/**
 * Calculates the minZoom value based on the length of the elements array.
 */
const calculateMinZoom = (elementsLength) => {
    const minZoomBase = 0.1; // Change this value to set the minimum zoom level when the array is empty
    const minZoomFactor = 0.000115; // Change this value to control the rate at which minZoom decreases as the array length increases
    return minZoomBase - elementsLength * minZoomFactor;
};
/**
 * Creates and renders a graph.
 */
const createRenderGraph = ({ container, elements, }) => {
    const renderGraph = (0, cytoscape_1.default)({
        container,
        style: [...node_1.nodeStyles, ...edge_1.edgeStyles],
        autoungrabify: true,
        maxZoom: 2,
        minZoom: calculateMinZoom(elements.length),
        elements,
    });
    return renderGraph;
};
exports.createRenderGraph = createRenderGraph;


/***/ }),

/***/ 74458:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.createTraversalGraph = void 0;
const cytoscape_1 = __importDefault(__webpack_require__(7905));
const createTraversalGraph = ({ elements, }) => (0, cytoscape_1.default)({
    headless: true,
    elements,
});
exports.createTraversalGraph = createTraversalGraph;


/***/ }),

/***/ 73353:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getElementDefinitions = void 0;
const utils_core_1 = __webpack_require__(87552);
const node_1 = __webpack_require__(76556);
const nodeImage = ' ';
const reactLogo = 'PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCAzNiAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzBfMykiPgo8cGF0aCBkPSJNMTggMjEuMTA1NUMxOS43NzIxIDIxLjEwNTUgMjEuMjA4NyAxOS43MTUxIDIxLjIwODcgMThDMjEuMjA4NyAxNi4yODQ5IDE5Ljc3MjEgMTQuODk0NSAxOCAxNC44OTQ1QzE2LjIyNzkgMTQuODk0NSAxNC43OTEzIDE2LjI4NDkgMTQuNzkxMyAxOEMxNC43OTEzIDE5LjcxNTEgMTYuMjI3OSAyMS4xMDU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sbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K';
const ImageByPrimaryDependency = {
    [utils_core_1.PackageType.REACT]: reactLogo,
    [utils_core_1.PackageType.NODE]: nodeImage,
    [utils_core_1.PackageType.NEXT]: nextLogo,
};
const getNodeSize = ({ context, name, }) => {
    if (!context)
        return;
    context.font = `normal ${node_1.fontWeight} ${node_1.fontSize}px ${node_1.fontFamily}`;
    const paddingY = 24;
    const paddingX = 24;
    const iconWidth = 50;
    const labelWidth = context.measureText(name).width;
    const paddedLabelWidth = labelWidth + paddingX * 2 + iconWidth;
    const paddedLabelHeight = node_1.fontSize + paddingY * 2;
    return {
        width: Math.ceil(paddedLabelWidth),
        height: Math.ceil(paddedLabelHeight),
    };
};
const getElementDefinitions = ({ dependencies, packages, }) => {
    if (typeof document === 'undefined')
        return [];
    try {
        const canvas = document.createElement('canvas');
        const context = canvas.getContext('2d');
        const nodes = packages.map((package_) => {
            const dimensions = getNodeSize({ context, name: package_.name });
            const image = ImageByPrimaryDependency[package_.type] ?? nodeImage;
            const imageData = 'data:image/svg+xml;base64,' + image;
            return {
                data: {
                    ...package_,
                    id: package_.name,
                    image: imageData,
                    ...dimensions,
                },
            };
        });
        const edges = dependencies.map((dep) => {
            return {
                data: {
                    ...dep,
                    id: `${dep.source}->${dep.target}`,
                },
            };
        });
        return [...nodes, ...edges];
    }
    catch (error) {
        console.error(error);
        return [];
    }
};
exports.getElementDefinitions = getElementDefinitions;


/***/ }),

/***/ 97595:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getElementDefinitionsWithUpdatedLayout = void 0;
const cytoscape_1 = __importDefault(__webpack_require__(7905));
const layout_options_1 = __webpack_require__(47602);
const cytoscape_dagre_1 = __importDefault(__webpack_require__(93472));
const node_1 = __webpack_require__(76556);
const edge_1 = __webpack_require__(54154);
cytoscape_1.default.use(cytoscape_dagre_1.default);
const getElementDefinitionsWithUpdatedLayout = async ({ elements, }) => {
    const graph = (0, cytoscape_1.default)({
        styleEnabled: true,
        style: [...node_1.nodeStyles, ...edge_1.edgeStyles],
        elements,
    });
    graph.layout(layout_options_1.layoutOptions).run();
    return graph.elements().jsons();
};
exports.getElementDefinitionsWithUpdatedLayout = getElementDefinitionsWithUpdatedLayout;


/***/ }),

/***/ 34015:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
__exportStar(__webpack_require__(83604), exports);
__exportStar(__webpack_require__(73353), exports);
__exportStar(__webpack_require__(97595), exports);
__exportStar(__webpack_require__(30063), exports);
__exportStar(__webpack_require__(74458), exports);
__exportStar(__webpack_require__(46650), exports);
__exportStar(__webpack_require__(24076), exports);


/***/ }),

/***/ 47602:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.layoutOptions = void 0;
exports.layoutOptions = {
    name: 'dagre',
    animate: false,
    rankSep: 240,
    nodeSep: 140,
    nodeDimensionsIncludeLabels: true,
};


/***/ }),

/***/ 30063:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

'use client';
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.updateGraphElements = void 0;
const bind_render_graph_events_1 = __webpack_require__(55286);
const with_timing_1 = __webpack_require__(92730);
const utils_core_1 = __webpack_require__(87552);
const updateStyles = ({ graph, theme, forceEdgeColor, violations = [], }) => {
    graph.elements().removeClass(['dark', 'light']).addClass(theme);
    graph.edges().forEach((edge) => {
        const edgeData = edge.data();
        const violationForEdge = edgeData
            ? violations.find((violation) => {
                const source = edge.source().data();
                const target = edge.target().data();
                return (violation.sourcePackageName === source.name &&
                    violation.targetPackageName === target.name);
            })
            : null;
        if (forceEdgeColor) {
            edge.addClass(edgeData.type);
            edge.addClass('focus');
        }
        else {
            edge.removeClass([
                utils_core_1.DependencyType.DEVELOPMENT,
                utils_core_1.DependencyType.PEER,
                utils_core_1.DependencyType.PRODUCTION,
            ]);
            edge.removeClass('focus');
        }
        if (violationForEdge) {
            edge.removeClass([
                utils_core_1.DependencyType.DEVELOPMENT,
                utils_core_1.DependencyType.PEER,
                utils_core_1.DependencyType.PRODUCTION,
            ]);
            edge.removeClass('focus');
            edge.addClass('violation');
        }
    });
};
const updateGraphElements = (0, with_timing_1.withTiming)('updateGraphElements', async ({ renderGraph, traversalGraph, theme, forceEdgeColor, violations, elements, }) => {
    // Clear the graph
    renderGraph.json({ elements });
    updateStyles({ graph: renderGraph, theme, forceEdgeColor, violations });
    renderGraph.fit(undefined, 24);
    // Bind graph events, these events are all fired by the Cytoscape library
    (0, bind_render_graph_events_1.bindRenderGraphEvents)({
        renderGraph,
        theme,
        traversalGraph,
        violations,
    });
});
exports.updateGraphElements = updateGraphElements;


/***/ }),

/***/ 54154:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.edgeStyles = void 0;
const utils_core_1 = __webpack_require__(87552);
const colors = {
    light: {
        default: '#e4e4e7',
        development: '#0284c7',
        peer: '#0284c7',
        production: '#059669',
        violation: '#FF0000',
    },
    dark: {
        default: '#27272a',
        development: '#0284c7',
        peer: '#0284c7',
        production: '#059669',
        violation: '#FF0000',
    },
};
exports.edgeStyles = [
    {
        selector: 'edge',
        style: {
            width: 3,
            'target-arrow-color': colors.light.default,
            'target-arrow-shape': 'triangle',
            'curve-style': 'unbundled-bezier',
            'source-endpoint': '0% 50%',
            'target-endpoint': '0% -50%',
            'arrow-scale': 1.3,
            'line-color': colors.light.default,
        },
    },
    {
        selector: 'edge.dark',
        style: {
            'line-color': colors.dark.default,
            'target-arrow-color': colors.dark.default,
        },
    },
    {
        selector: `edge.${utils_core_1.DependencyType.PRODUCTION}`,
        style: {
            'line-color': colors.light.production,
            'target-arrow-color': colors.light.production,
            'overlay-color': colors.light.production,
            width: 3,
        },
    },
    {
        selector: `edge.${utils_core_1.DependencyType.DEVELOPMENT}`,
        style: {
            'line-color': colors.light.development,
            'target-arrow-color': colors.light.development,
            'overlay-color': colors.light.development,
            width: 3,
        },
    },
    {
        selector: `edge.${utils_core_1.DependencyType.PEER}`,
        style: {
            'line-color': colors.light.peer,
            'target-arrow-color': colors.light.peer,
            'overlay-color': colors.light.peer,
            width: 3,
        },
    },
    {
        selector: `edge.dark.${utils_core_1.DependencyType.PRODUCTION}`,
        style: {
            'line-color': colors.dark.production,
            'target-arrow-color': colors.dark.production,
            'overlay-color': colors.dark.production,
            width: 3,
        },
    },
    {
        selector: `edge.dark.${utils_core_1.DependencyType.DEVELOPMENT}`,
        style: {
            'line-color': colors.dark.development,
            'target-arrow-color': colors.dark.development,
            'overlay-color': colors.dark.development,
            width: 3,
        },
    },
    {
        selector: `edge.dark.${utils_core_1.DependencyType.PEER}`,
        style: {
            'line-color': colors.dark.peer,
            'target-arrow-color': colors.dark.peer,
            'overlay-color': colors.dark.peer,
            width: 3,
        },
    },
    {
        selector: 'edge.violation',
        style: {
            'line-color': colors.dark.violation,
            'target-arrow-color': colors.dark.violation,
            'overlay-color': colors.dark.violation,
            'z-index': 10,
        },
    },
    {
        selector: 'edge.dim',
        style: {
            'z-index': 0,
            opacity: 0.1,
        },
    },
    {
        selector: 'edge.dark.dim',
        style: {
            'z-index': 0,
            opacity: 0.2,
        },
    },
    {
        selector: 'edge.hover',
        style: {
            'z-index': 100,
            'overlay-padding': 8,
            'overlay-opacity': 0.35,
        },
    },
];


/***/ }),

/***/ 76556:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.nodeStyles = exports.fontWeight = exports.fontFamily = exports.fontSize = void 0;
exports.fontSize = 24;
exports.fontFamily = 'Fira Code';
exports.fontWeight = 600;
exports.nodeStyles = [
    {
        selector: 'node',
        style: {
            label: 'data(id)',
            width: 'data(width)',
            height: 'data(height)',
            shape: 'roundrectangle',
            'text-margin-x': 20,
            'background-height': 42,
            'background-width': 42,
            'background-position-x': '24px',
            'background-position-y': '16px',
            'background-image': 'data(image)',
            'font-size': exports.fontSize,
            'font-family': exports.fontFamily,
            'font-weight': exports.fontWeight,
            'background-color': '#f4f4f5',
            color: '#27272a',
            'border-width': 1,
            'border-style': 'solid',
            'border-color': '#e4e4e7',
            'text-halign': 'center',
            'text-valign': 'center',
            'overlay-opacity': 0,
        },
    },
    {
        selector: 'node.dim',
        style: {
            opacity: 0.2,
        },
    },
    {
        selector: 'node.hover',
        style: {
            'background-color': '#09090b',
            color: '#FFF',
            'border-color': '#09090b',
        },
    },
    {
        selector: 'node.dark',
        style: {
            'background-color': '#27272a',
            'border-color': '#3f3f46',
            color: '#fff',
        },
    },
];


/***/ }),

/***/ 92730:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.withTiming = void 0;
function withTiming(name, function_) {
    return (...arguments_) => {
        const startTime = Date.now();
        const result = function_(...arguments_);
        const endTime = Date.now();
        const duration = (endTime - startTime) / 1000;
        console.log({ seconds: duration.toFixed(2) }, `${name} executed`);
        return result;
    };
}
exports.withTiming = withTiming;


/***/ })

};
;