import { createIconRegistry } from "@stack-scribe/core";
import { NodeTypeSchema, nodeTypeToIcon } from "./catalog.js";
import { awsGroupIconDefinitions } from "./group-icons.js";
import { listNodeTypeAliases, normalizeNodeTypeInput, resolveNodeType, } from "./node-resolver.js";
export const AWS_ICON_PACK_ID = "aws";
export const AWS_ICON_PACK_NAME = "AWS";
export const AWS_ICON_PACK_VERSION = "0.1.0";
export const AwsNodeTypeSchema = NodeTypeSchema;
export const awsNodeTypeToIcon = nodeTypeToIcon;
function inferIconKind(assetPath) {
    const [folder] = assetPath.split("/");
    switch (folder) {
        case "architecture":
        case "resource":
        case "category":
        case "group":
            return folder;
        default:
            return "generic";
    }
}
function createAwsTypeDefinitions() {
    return Object.entries(awsNodeTypeToIcon).map(([type, assetPath]) => {
        const segments = type.split(".");
        const definition = {
            type,
            assetPath,
            kind: inferIconKind(assetPath),
        };
        if (segments[1]) {
            definition.category = segments[1];
        }
        return definition;
    });
}
export const awsIconPack = {
    id: AWS_ICON_PACK_ID,
    name: AWS_ICON_PACK_NAME,
    version: AWS_ICON_PACK_VERSION,
    types: createAwsTypeDefinitions(),
    aliases: listNodeTypeAliases(),
    groupIcons: awsGroupIconDefinitions,
};
export function createAwsIconRegistry() {
    return createIconRegistry([awsIconPack]);
}
export { awsGroupIconDefinitions };
export { listNodeTypeAliases as listAwsNodeTypeAliases, normalizeNodeTypeInput as normalizeAwsNodeTypeInput, resolveNodeType as resolveAwsNodeType, };
//# sourceMappingURL=index.js.map