function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import { Keyframes } from "@ant-design/cssinjs";
import { useEditorStyleRegister } from "../../Hooks/useStyle";
var fadeInUp = new Keyframes('fadeInUp', {
    from: {
        opacity: 0,
        transform: 'translateY(8px)'
    },
    to: {
        opacity: 1,
        transform: 'translateY(0)'
    }
});
var genStyle = function genStyle(token) {
    var componentCls = token.componentCls;
    var _obj, _obj1, _obj2;
    return _define_property({}, componentCls, {
        '&-suggestion': (_obj1 = {
            '&:hover': {
                borderRadius: 'var(--radius-control-base)',
                background: 'var(--color-gray-control-fill-hover)'
            }
        }, _define_property(_obj1, "".concat(componentCls, "-suggestion-content"), (_obj = {
            display: 'flex',
            alignItems: 'center',
            gap: '4px',
            width: '100%',
            overflow: 'hidden'
        }, _define_property(_obj, "".concat(componentCls, "-suggestion-icon"), {
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            width: '24px',
            height: '24px',
            padding: 'var(--padding-1x)',
            borderRadius: '200px',
            border: '1px solid var(--color-gray-border-dark)',
            color: 'var(--color-gray-text-secondary)'
        }), _define_property(_obj, "".concat(componentCls, "-suggestion-text"), {
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            whiteSpace: 'nowrap',
            font: 'var(--font-text-body-sm)',
            letterSpacing: 'var(--letter-spacing-body-sm, normal)',
            color: 'var(--color-gray-text-secondary)'
        }), _obj)), _define_property(_obj1, '.ant-tag', {
            marginInlineEnd: '0'
        }), _obj1),
        '&-header': _define_property({
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'space-between',
            height: '48px',
            width: 'calc(100% - 20px)',
            padding: '8px',
            margin: '4px',
            '.ant-tag': {
                marginInlineEnd: '0'
            }
        }, "".concat(componentCls, "-header-left"), _define_property({
            display: 'flex',
            alignItems: 'center',
            gap: '4px',
            overflow: 'hidden',
            flex: 1,
            minWidth: 0
        }, "".concat(componentCls, "-header-title"), {
            flex: 1,
            minWidth: 0,
            marginRight: '4px',
            fontWeight: 500,
            fontSize: '14px',
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            whiteSpace: 'nowrap',
            color: 'var(--color-gray-text-default)'
        })),
        '&-header-wrapper': {
            marginLeft: '-12px',
            marginRight: '-12px'
        },
        '&-result-item': (_obj2 = {
            width: '100%',
            overflow: 'hidden',
            padding: '4px',
            animationName: fadeInUp,
            animationDuration: '0.3s',
            animationTimingFunction: 'ease-out',
            animationFillMode: 'both',
            '&:hover': {
                borderRadius: '12px',
                background: 'var(--color-gray-control-fill-hover)'
            }
        }, _define_property(_obj2, "".concat(componentCls, "-result-item-title"), {
            fontSize: '12px',
            color: 'var(--color-gray-text-default)',
            display: 'block',
            maxWidth: '100%',
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            whiteSpace: 'nowrap'
        }), _define_property(_obj2, "".concat(componentCls, "-result-item-title-wrapper"), {
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            whiteSpace: 'nowrap',
            fontSize: '14px',
            color: 'var(--color-gray-text-default)'
        }), _define_property(_obj2, "".concat(componentCls, "-result-item-site-text"), {
            font: 'var(--font-text-paragraph-sm)',
            letterSpacing: 'var(--letter-spacing-paragraph-sm, normal)',
            color: 'var(--color-gray-text-light)'
        }), _define_property(_obj2, "".concat(componentCls, "-result-item-site"), {
            display: 'flex',
            alignItems: 'center',
            gap: '4px',
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            whiteSpace: 'nowrap',
            fontSize: '12px',
            cursor: 'pointer'
        }), _obj2)
    });
};
export function useBrowserStyle(prefixCls) {
    return useEditorStyleRegister('WorkspaceBrowser', function(token) {
        var browserToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(browserToken)
        ];
    });
}
