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 { useEditorStyleRegister } from "../Hooks/useStyle";
var genStyle = function genStyle(token) {
    var _obj, _obj1;
    return _obj1 = {}, _define_property(_obj1, token.componentCls, (_obj = {
        // position:relative，在流内正常占位，由父容器负责整体定位。
        // 不使用 position:fixed，避免脱离文档流导致隐藏时 presence 高度塌陷。
        position: 'relative',
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center',
        width: 32,
        height: 32,
        color: 'var(--color-gray-text-secondary)',
        fontSize: 16,
        background: 'var(--color-gray-bg-card-white)',
        border: 'none',
        boxShadow: 'var(--shadow-control-base)',
        borderRadius: '50%',
        cursor: 'pointer',
        transition: 'all 0.2s ease-in-out'
    }, _define_property(_obj, '&-content', {
        display: 'flex',
        flexDirection: 'column',
        justifyContent: 'center',
        alignItems: 'center',
        textAlign: 'center',
        overflow: 'hidden'
    }), _define_property(_obj, '&:hover', {
        boxShadow: 'var(--shadow-control-lg)'
    }), _define_property(_obj, '&:active', {
        boxShadow: 'var(--shadow-control-base)',
        transform: 'scale(0.95)'
    }), _obj)), // presence wrapper：始终保留在 DOM 中，固定 32×32 尺寸以保持占位空间。
    // 仅通过 opacity + pointer-events 切换显隐，隐藏时内部按钮不可交互但占位不变。
    _define_property(_obj1, "".concat(token.componentCls, "-presence"), {
        width: 32,
        height: 32,
        flexShrink: 0,
        transition: 'opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1)',
        '&[data-state="enter"]': {
            opacity: 1
        },
        '&[data-state="exit"]': {
            opacity: 0,
            pointerEvents: 'none'
        }
    }), _obj1;
};
export var prefixCls = 'back-to';
export function useStyle(prefixCls) {
    return useEditorStyleRegister('back-to', function(token) {
        var backToToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(backToToken)
        ];
    });
}
