"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeCreationPanel = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("@chakra-ui/react");
const icons_1 = require("@chakra-ui/icons");
const NODE_TYPES = [
    {
        type: 'agent',
        label: 'AI Agent',
        icon: icons_1.ChatIcon,
        description: 'Add an AI agent node for task execution',
        category: 'core',
    },
    {
        type: 'condition',
        label: 'Condition',
        icon: icons_1.RepeatIcon,
        description: 'Add a conditional branch in the workflow',
        category: 'core',
    },
    {
        type: 'action',
        label: 'Action',
        icon: icons_1.SettingsIcon,
        description: 'Add a custom action node',
        category: 'core',
    },
    {
        type: 'delay',
        label: 'Delay',
        icon: icons_1.TimeIcon,
        description: 'Add a time delay between steps',
        category: 'core',
    },
    {
        type: 'error',
        label: 'Error Handler',
        icon: icons_1.WarningIcon,
        description: 'Add error handling logic',
        category: 'core',
    },
    {
        type: 'security',
        label: 'Security Check',
        icon: icons_1.ShieldIcon,
        description: 'Add CrowdStrike security validation',
        category: 'security',
    },
    {
        type: 'auth',
        label: 'Auth Gate',
        icon: icons_1.LockIcon,
        description: 'Add authentication check',
        category: 'security',
    },
    {
        type: 'admin',
        label: 'Admin Action',
        icon: icons_1.UserIcon,
        description: 'Add admin-only operation',
        category: 'admin',
    },
];
const CATEGORIES = [
    { id: 'core', label: 'Core Nodes' },
    { id: 'security', label: 'Security Nodes' },
    { id: 'admin', label: 'Admin Nodes' },
];
const NodeCreationPanel = ({ onNodeCreate, disabled = false, }) => {
    const bgColor = (0, react_1.useColorModeValue)('white', 'gray.800');
    const borderColor = (0, react_1.useColorModeValue)('gray.200', 'gray.700');
    const hoverBg = (0, react_1.useColorModeValue)('gray.50', 'gray.700');
    return ((0, jsx_runtime_1.jsx)(react_1.VStack, { spacing: 4, p: 4, bg: bgColor, borderWidth: "1px", borderColor: borderColor, borderRadius: "md", width: "240px", align: "stretch", children: CATEGORIES.map((category) => ((0, jsx_runtime_1.jsxs)(react_1.Box, { children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", fontWeight: "medium", color: "gray.500", mb: 2, px: 2, children: category.label }), (0, jsx_runtime_1.jsx)(react_1.VStack, { spacing: 2, align: "stretch", children: NODE_TYPES.filter((node) => node.category === category.id).map((node) => ((0, jsx_runtime_1.jsx)(react_1.Tooltip, { label: node.description, placement: "right", hasArrow: true, children: (0, jsx_runtime_1.jsx)(react_1.Button, { leftIcon: (0, jsx_runtime_1.jsx)(node.icon, {}), size: "sm", variant: "ghost", justifyContent: "flex-start", onClick: () => onNodeCreate(node.type), isDisabled: disabled, _hover: {
                                bg: hoverBg,
                            }, px: 2, children: node.label }) }, node.type))) }), category.id !== CATEGORIES[CATEGORIES.length - 1].id && ((0, jsx_runtime_1.jsx)(react_1.Divider, { my: 4 }))] }, category.id))) }));
};
exports.NodeCreationPanel = NodeCreationPanel;
exports.default = exports.NodeCreationPanel;
//# sourceMappingURL=NodeCreationPanel.js.map