"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    CanvasIcon: ()=>icon_registry_CanvasIcon,
    getIcon: ()=>getIcon,
    NodeIcon: ()=>NodeIcon
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const external_lucide_react_namespaceObject = require("lucide-react");
const external_react_namespaceObject = require("react");
const index_cjs_namespaceObject = require("../icons/index.cjs");
const iconRegistry = {
    agent: ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.AgentProject, {
            w: w ?? 29,
            h: h ?? 28
        }),
    'autonomous-agent': ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.AutonomousAgentIcon, {
            w: w ?? 29,
            h: h ?? 28
        }),
    'conversational-agent': ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ConversationalAgentIcon, {
            w: w ?? 29,
            h: h ?? 28
        }),
    'coded-agent': ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.CodedAgentIcon, {
            w: w ?? 29,
            h: h ?? 28
        }),
    connector: ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ConnectorBuilderProject, {
            w: w ?? 29,
            h: h ?? 28
        }),
    'data-tools': ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.DataAndTools, {
            w: w ?? 29,
            h: h ?? 28
        }),
    'control-flow': ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ControlFlowIcon, {
            w: w ?? 29,
            h: h ?? 28
        }),
    'human-task': ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.WebAppProject, {
            w: w ?? 29,
            h: h ?? 28
        }),
    rpa: ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.RpaProject, {
            w: w ?? 29,
            h: h ?? 28
        }),
    api: ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ApiProject, {
            w: w ?? 29,
            h: h ?? 28
        }),
    'agentic-process': ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.BusinessProcessProject, {
            w: w ?? 29,
            h: h ?? 28
        }),
    'flow-project': ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.FlowProject, {
            w: w ?? 29,
            h: h ?? 28
        }),
    'case-management': ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.CaseManagementProject, {
            w: w ?? 29,
            h: h ?? 28
        }),
    decision: ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.DecisionIcon, {
            w: w ?? 24,
            h: h ?? 24
        }),
    switch: ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.SwitchIcon, {
            w: w ?? 24,
            h: h ?? 24
        }),
    uipath: ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.UiPathIcon, {
            w: w ?? 24,
            h: h ?? 24
        }),
    'agent-diagram': ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.AgentDiagramIcon, {
            w: w ?? 24,
            h: h ?? 24
        }),
    function: ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.FunctionProject, {
            w: w ?? 29,
            h: h ?? 28
        })
};
function kebabToPascal(str) {
    return str.split('-').map((word)=>word.charAt(0).toUpperCase() + word.slice(1)).join('');
}
function isValidUrl(input) {
    let url;
    try {
        url = new URL(input);
    } catch (_) {
        return false;
    }
    return 'http:' === url.protocol || 'https:' === url.protocol;
}
function getIcon(iconId) {
    if (!iconId) {
        const BoxIcon = external_lucide_react_namespaceObject.icons.Box;
        return ({ w, h, color })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BoxIcon, {
                width: w ?? 24,
                height: h ?? 24,
                color: color
            });
    }
    if (isValidUrl(iconId)) return ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
            src: iconId,
            alt: "icon",
            style: {
                width: w,
                height: h
            }
        });
    const icon = iconRegistry[iconId];
    if (icon) return icon;
    const pascalCaseId = kebabToPascal(iconId);
    const LucideIcon = external_lucide_react_namespaceObject.icons[pascalCaseId];
    if (LucideIcon) return ({ w, h, color, fill })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(LucideIcon, {
            width: w ?? 24,
            height: h ?? 24,
            color: color,
            ...fill?.length && {
                fill
            }
        });
    const BoxIcon = external_lucide_react_namespaceObject.icons.Box;
    return ({ w, h, color })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BoxIcon, {
            width: w ?? 24,
            height: h ?? 24,
            color: color
        });
}
const icon_registry_CanvasIcon = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ icon, size = 16, color, fill }) {
    const Icon = (0, external_react_namespaceObject.useMemo)(()=>icon ? getIcon(icon) : null, [
        icon
    ]);
    if (!Icon) return null;
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {
        w: size,
        h: size,
        color: color,
        fill: fill
    });
});
const NodeIcon = icon_registry_CanvasIcon;
exports.CanvasIcon = __webpack_exports__.CanvasIcon;
exports.NodeIcon = __webpack_exports__.NodeIcon;
exports.getIcon = __webpack_exports__.getIcon;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "CanvasIcon",
    "NodeIcon",
    "getIcon"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
