(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "./suggested-nodes-data", "./suggested-nodes-data"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.categoryList = void 0;
    exports.getSuggestedNodes = getSuggestedNodes;
    const suggested_nodes_data_1 = require("./suggested-nodes-data");
    var suggested_nodes_data_2 = require("./suggested-nodes-data");
    Object.defineProperty(exports, "categoryList", { enumerable: true, get: function () { return suggested_nodes_data_2.categoryList; } });
    function formatCategoryResult(nodeTypeParser, category) {
        const categoryData = suggested_nodes_data_1.suggestedNodesData[category];
        if (!categoryData) {
            return null;
        }
        const nodes = categoryData.nodes.map((node) => {
            const nodeType = nodeTypeParser.getLeanNodeType(node.name);
            if (nodeType) {
                return {
                    name: node.name,
                    displayName: nodeType.displayName,
                    description: nodeType.description,
                    note: node.note,
                };
            }
            return {
                name: node.name,
                displayName: '(not found)',
                description: '(not found)',
                note: node.note,
            };
        });
        return {
            category,
            patternHint: categoryData.patternHint,
            nodes,
        };
    }
    function formatOutput(results) {
        const lines = [];
        for (const result of results) {
            if (!result) {
                lines.push('Category not found\n');
                continue;
            }
            lines.push(`## ${result.category}`);
            lines.push(`patternHint: ${result.patternHint}`);
            lines.push('');
            lines.push('Suggested nodes:');
            for (const node of result.nodes) {
                lines.push(`- ${node.name}`);
                lines.push(`  displayName: ${node.displayName}`);
                lines.push(`  description: ${node.description}`);
                if (node.note) {
                    lines.push(`  note: ${node.note}`);
                }
            }
            lines.push('');
        }
        return lines.join('\n');
    }
    function getSuggestedNodes(nodeTypeParser, categories) {
        const results = [];
        for (const category of categories) {
            const result = formatCategoryResult(nodeTypeParser, category);
            if (result) {
                results.push(result);
            }
            else {
                results.push({
                    category,
                    patternHint: 'Category not found',
                    nodes: [],
                });
            }
        }
        return formatOutput(results);
    }
});
//# sourceMappingURL=suggested.js.map