import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
import * as __WEBPACK_EXTERNAL_MODULE__preloaded_mjs__ from "./preloaded.mjs";
let IconFont;
const Icon_rslib_entry_icons = new Map();
function registerIcon(type) {
    let icon = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : IconFont;
    Icon_rslib_entry_icons.set(type.toLowerCase(), icon);
}
function hasIcon(type) {
    if (!type) return false;
    return Icon_rslib_entry_icons.has(type.toLowerCase());
}
function registerIcons(components) {
    Object.keys(components).forEach((type)=>{
        registerIcon(type, components[type]);
    });
}
Object.keys(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__).forEach((name)=>{
    if (name.endsWith('Outlined')) registerIcon(name, __WEBPACK_EXTERNAL_MODULE__ant_design_icons__[name]);
});
const Icon = (props)=>{
    const { type = '', component, ...restProps } = props;
    if (component) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__["default"], {
        component: component,
        ...restProps
    });
    if (type && Icon_rslib_entry_icons.has(type.toLowerCase())) {
        const IconComponent = Icon_rslib_entry_icons.get(type.toLowerCase());
        return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(IconComponent, {
            ...restProps
        });
    }
    if (type && IconFont) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(IconFont, {
        type: type,
        ...restProps
    });
    return null;
};
Icon.createFromIconfontCN = (options)=>{
    IconFont = (0, __WEBPACK_EXTERNAL_MODULE__ant_design_icons__.createFromIconfontCN)(options);
};
Icon.register = (icons)=>{
    registerIcons(icons);
};
for(const name in __WEBPACK_EXTERNAL_MODULE__preloaded_mjs__){
    const PreloadedIcon = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(Icon, {
            component: __WEBPACK_EXTERNAL_MODULE__preloaded_mjs__[name],
            ...props
        });
    Icon.register({
        [name]: PreloadedIcon
    });
}
const Icon_rslib_entry_ = Icon;
export { Icon, Icon_rslib_entry_ as default, hasIcon, Icon_rslib_entry_icons as icons, registerIcon, registerIcons };
