import { jsx as _jsx } from "react/jsx-runtime";
/*
 * Copyright (c) 2023-2025 Datalayer, Inc.
 * Distributed under the terms of the Modified BSD License.
 */
import BoringAvatars from 'boring-avatars';
// export const getRandomBoringAvatarVariant = () => VARIANTS[Math.floor(Math.random() * VARIANTS.length)] as VariantType;
const getRandomBoringAvatarVariant = () => 'bauhaus';
const RANDOM_BORING_AVATOR_VARIANT = getRandomBoringAvatarVariant();
const DEFAULT_COLORS = [
    '#000000',
    '#146A7C',
    '#16A085',
    '#1ABC9C',
    '#2ECC71',
    '#59595C',
    '#92A1C6',
    '#C20D90',
    '#C271B4',
    '#F0AB3D',
];
export const BoringAvatar = ({ displayName = '', variant, size = 40, square = false, style, colors, }) => {
    const resolvedVariant = variant ?? RANDOM_BORING_AVATOR_VARIANT;
    const safeName = String(displayName ?? '');
    const resolvedColors = colors ?? DEFAULT_COLORS;
    try {
        return (_jsx("span", { style: { ...(style || {}) }, children: _jsx(BoringAvatars, { size: size, name: safeName, variant: resolvedVariant, square: square, colors: resolvedColors }) }));
    }
    catch (error) {
        console.error('BoringAvatar error:', error);
        return (_jsx("span", { style: {
                display: 'inline-block',
                width: `${size}px`,
                height: `${size}px`,
                borderRadius: square ? '4px' : '50%',
                backgroundColor: '#59595C',
                ...(style || {}),
            } }));
    }
};
export default BoringAvatar;
