function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
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 _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
import { genStyleHooks, resetComponent } from "../../Hooks/useStyle";
var genStyle = function genStyle(token) {
    var _obj, _obj1;
    return _define_property({}, "".concat(token.componentCls), (_obj1 = {
        maxWidth: '100%',
        display: 'flex',
        minWidth: '0px',
        flexDirection: 'column',
        flexWrap: 'nowrap',
        overflow: 'auto',
        gap: '8px',
        borderRadius: 'inherit',
        padding: '2px',
        position: 'relative',
        transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
        '&-left': {
            flexDirection: 'row'
        },
        '&-right': {
            flexDirection: 'row-reverse'
        },
        '&-vertical': {
            display: 'flex',
            flexWrap: 'wrap',
            alignItems: 'flex-start',
            gap: 4,
            padding: 2,
            maxWidth: 'calc(285px * 3 + 4px * 2)',
            '& > :only-child': {
                marginTop: 8,
                padding: 2
            }
        },
        '&::-webkit-scrollbar': {
            width: 6
        },
        '&-collapse-button': {
            width: '68px',
            height: '32px',
            display: 'flex',
            flexDirection: 'row',
            alignItems: 'center',
            padding: '4px 8px',
            cursor: 'pointer',
            gap: 4,
            float: 'right',
            borderRadius: '18px',
            opacity: 1,
            boxSizing: 'border-box',
            color: 'var(--color-gray-a9)',
            fontSize: 'var(--font-size-base)',
            boxShadow: 'var(--shadow-control-base)',
            border: 'var(--color-gray-border-light)',
            '&:hover': {
                background: 'var(--color-gray-bg-page)',
                transform: 'scale(1.05)'
            },
            '&-icon': {
                transform: 'rotate(-90deg)',
                transition: 'all 0.5s cubic-bezier(0.4, 0, 0.2, 1)',
                color: 'var(--color-gray-a9)',
                '&-collapse': {
                    transform: 'rotate(90deg)'
                }
            }
        }
    }, _define_property(_obj1, "".concat(token.antCls, "-image-mask"), {
        borderRadius: 'var(--radius-card-base)'
    }), _define_property(_obj1, "img", {
        objectFit: 'cover'
    }), _define_property(_obj1, '&-image', {
        opacity: 1,
        background: 'var(--color-gray-bg-card-white)',
        boxSizing: 'border-box',
        boxShadow: 'var(--shadow-control-base)',
        borderRadius: 'var(--radius-card-base)',
        border: 'none',
        overflow: 'hidden',
        img: {
            maxWidth: '100%',
            maxHeight: '100%',
            borderRadius: 'inherit',
            transition: 'transform 0.3s'
        },
        '&:hover': {
            overflow: 'hidden',
            img: {
                transform: 'scale(1.1)',
                transition: 'transform 0.3s'
            }
        }
    }), _define_property(_obj1, '&-video-row', {
        display: 'flex',
        flexWrap: 'wrap',
        gap: 8,
        width: 'fit-content',
        '&-right': {
            alignSelf: 'flex-end'
        }
    }), _define_property(_obj1, '&-video-thumb', {
        position: 'relative',
        cursor: 'pointer',
        opacity: 1,
        background: 'var(--color-gray-bg-card-white)',
        boxSizing: 'border-box',
        boxShadow: 'var(--shadow-control-base)',
        borderRadius: 'var(--radius-card-base)',
        border: 'none',
        overflow: 'hidden',
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        '&:hover': {
            boxShadow: 'var(--shadow-control-lg)',
            '& video': {
                transform: 'scale(1.05)'
            }
        },
        '& video': {
            transition: 'transform 0.3s'
        }
    }), _define_property(_obj1, '&-video-play-overlay', {
        position: 'absolute',
        inset: 0,
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        background: 'rgba(0, 0, 0, 0.35)',
        borderRadius: 'inherit',
        pointerEvents: 'none',
        opacity: 0.9,
        '& svg': {
            width: 48,
            height: 48,
            color: 'var(--color-gray-bg-card-white)'
        }
    }), _define_property(_obj1, '&-image-list-view', {
        background: 'var(--color-gray-bg-tip)',
        padding: '4px',
        borderRadius: 'var(--radius-card-base)'
    }), _define_property(_obj1, '&-more-file-container', {
        width: '285px',
        height: '56px',
        borderRadius: 'var(--radius-card-base)',
        background: 'var(--color-gray-bg-card-white)',
        boxShadow: 'var(--shadow-control-base)',
        margin: 0,
        display: 'flex',
        alignItems: 'center',
        gap: '8px',
        cursor: 'pointer',
        justifyContent: 'center',
        '&:hover': {
            boxShadow: 'var(--shadow-control-lg)'
        }
    }), _define_property(_obj1, '&-more-file-icon', {
        width: '16px',
        height: '16px'
    }), _define_property(_obj1, '&-more-file-name', {
        font: 'var(--font-size-h6)',
        color: 'var(--color-gray-text-secondary)'
    }), _define_property(_obj1, '&-title', {
        width: '100%',
        color: 'var(--color-gray-text-light)',
        font: 'var(--font-text-body-sm)',
        lineHeight: '20px',
        marginBottom: 2
    }), _define_property(_obj1, '&-item', {
        width: '285px',
        height: '56px',
        borderRadius: 'var(--radius-card-base)',
        opacity: 1,
        background: 'var(--color-gray-bg-card-white)',
        boxSizing: 'border-box',
        boxShadow: 'var(--shadow-control-base)',
        padding: '8px',
        display: 'flex',
        flexDirection: 'row',
        alignItems: 'center',
        cursor: 'pointer',
        gap: '4px',
        position: 'relative',
        '&:hover': {
            boxShadow: 'var(--shadow-control-lg)'
        },
        '&-action-bar': {
            position: 'absolute',
            right: 8,
            top: 8,
            display: 'flex',
            gap: 2
        },
        '&-action-btn': {
            width: 36,
            height: 36,
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            position: 'relative',
            borderRadius: 'var(--radius-control-base)',
            background: 'var(--color-gray-control-fill-secondary)',
            backdropFilter: 'blur(40px)',
            cursor: 'pointer',
            '&:hover': {
                background: 'var(--color-gray-a4)'
            }
        },
        '&-more-custom': {
            position: 'absolute',
            inset: 0,
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            background: 'transparent'
        },
        '&-file-icon': {
            width: '40px',
            height: '40px',
            opacity: 1,
            overflow: 'hidden',
            '&-img': {
                width: '40px',
                height: '40px',
                opacity: 1,
                background: 'var(--color-gray-bg-card-white)',
                boxSizing: 'border-box',
                boxShadow: 'var(--shadow-control-base)',
                borderRadius: 'var(--radius-base, 4px)',
                border: 'none',
                overflow: 'hidden',
                img: {
                    maxWidth: '100%',
                    maxHeight: '100%',
                    borderRadius: 'inherit',
                    transition: 'transform 0.3s'
                },
                '&:hover': {
                    overflow: 'hidden',
                    img: {
                        transform: 'scale(1.1)',
                        transition: 'transform 0.3s'
                    }
                }
            },
            '> svg': {
                width: '40px',
                height: '40px'
            }
        },
        '&-file-info': {
            display: 'flex',
            flexDirection: 'column',
            justifyContent: 'space-between',
            gap: 2
        },
        '&-file-name': {
            color: 'var(--color-gray-text-default)',
            fontSize: 'var(--font-text-h6-base)',
            width: '150px',
            alignItems: 'center',
            lineHeight: '18px',
            fontFamily: token.fontFamily,
            gap: -1,
            display: 'flex',
            overflow: 'hidden',
            '&-text': {
                maxWidth: '150px',
                whiteSpace: 'nowrap !important',
                wordWrap: 'normal',
                wordBreak: 'keep-all',
                width: '100%',
                overflow: 'hidden',
                display: 'inline-block',
                textOverflow: 'ellipsis',
                height: 18,
                lineHeight: 1,
                verticalAlign: 'top'
            }
        },
        '&-file-name-extension-container': {
            display: 'flex',
            alignItems: 'center',
            gap: 2,
            color: 'var(--color-gray-text-light)',
            fontSize: '12px'
        },
        '&-separator': {
            margin: '0 4px'
        },
        '&-file-size': {
            color: 'var(--color-gray-text-light)',
            fontSize: '12px'
        }
    }), _define_property(_obj1, '&-item-meta-placeholder', (_obj = {
        background: 'var(--color-fill-quaternary, rgba(0,0,0,0.04))'
    }, _define_property(_obj, "".concat(token.componentCls, "-item-file-name-text"), {
        color: 'var(--color-text-tertiary, rgba(0,0,0,0.45))'
    }), _define_property(_obj, "".concat(token.componentCls, "-item-file-size"), {
        color: 'var(--color-text-tertiary, rgba(0,0,0,0.45))'
    }), _define_property(_obj, "".concat(token.componentCls, "-item-file-name-extension-container"), {
        color: 'var(--color-text-tertiary, rgba(0,0,0,0.45))'
    }), _obj)), // 列表入场淡入（替代 framer-motion variants opacity 动画）
    // 原 staggerChildren 因子项不是 motion.* 实际未生效，故仅做整体 fade
    _define_property(_obj1, '&-motion-fade-in', {
        animationName: "".concat(token.componentCls, "-fileViewFadeIn"),
        animationDuration: '0.3s',
        animationTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)',
        animationFillMode: 'both'
    }), // 单个文件项入场：从右侧 20px 滑入并淡入（替代 motion variants x:20→0, opacity:0→1）
    _define_property(_obj1, '&-item-motion-slide-in', {
        animationName: "".concat(token.componentCls, "-fileItemSlideInRight"),
        animationDuration: '0.25s',
        animationTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)',
        animationFillMode: 'both'
    }), _define_property(_obj1, "@keyframes ".concat(token.componentCls, "-fileViewFadeIn"), {
        from: {
            opacity: 0
        },
        to: {
            opacity: 1
        }
    }), _define_property(_obj1, "@keyframes ".concat(token.componentCls, "-fileItemSlideInRight"), {
        from: {
            transform: 'translateX(20px)',
            opacity: 0
        },
        to: {
            transform: 'translateX(0)',
            opacity: 1
        }
    }), _obj1));
};
/**
 * Probubble
 * @param prefixCls
 * @returns
 */ var useGenStyle = genStyleHooks('FileMapView', function(token, info) {
    return [
        resetComponent(token),
        genStyle(token, info)
    ];
});
export function useStyle(prefixCls) {
    var _useGenStyle = _sliced_to_array(useGenStyle(prefixCls !== null && prefixCls !== void 0 ? prefixCls : 'md-md-editor-file-view'), 2), wrapSSR = _useGenStyle[0], hashId = _useGenStyle[1];
    return {
        wrapSSR: wrapSSR,
        hashId: hashId
    };
}
