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;
    return _define_property({}, token.componentCls, (_obj = {
        display: 'flex',
        flexDirection: 'row',
        height: '100%',
        minHeight: 600,
        backgroundColor: 'transparent',
        overflow: 'hidden',
        border: 'none',
        boxSizing: 'border-box',
        margin: token.marginXXS,
        '*': {
            boxSizing: 'border-box'
        }
    }, // 主体内容区域
    _define_property(_obj, "".concat(token.componentCls, "-body"), {
        display: 'flex',
        flex: 1,
        minWidth: 0,
        boxShadow: token.boxShadowTertiary,
        borderRadius: token.borderRadiusLG,
        overflow: 'hidden',
        border: "1px solid ".concat(token.colorBorderSecondary)
    }), // 左侧栏基础样式（宽度/padding 由 inline style 控制，避免与 class 打架）
    _define_property(_obj, "".concat(token.componentCls, "-sidebar-left"), {
        display: 'flex',
        flexDirection: 'column',
        backgroundColor: token.colorBgLayout,
        borderInlineEnd: "1px solid ".concat(token.colorBorderSecondary),
        overflow: 'hidden',
        boxSizing: 'border-box'
    }), // 右侧栏包装器
    _define_property(_obj, "".concat(token.componentCls, "-sidebar-wrapper-right"), {
        display: 'flex',
        alignItems: 'stretch',
        height: '100%'
    }), // 右侧栏（宽度/padding/opacity 同样交由 inline style 控制）
    _define_property(_obj, "".concat(token.componentCls, "-sidebar-right"), {
        borderInlineEnd: 'none',
        height: '100%'
    }), // 折叠态：仅保留无法用 inline style 表达的子元素隐藏（避免折叠瞬间内容溢出）
    _define_property(_obj, "".concat(token.componentCls, "-sidebar-right-collapsed"), _define_property({}, "".concat(token.componentCls, "-sidebar-content"), {
        display: 'none'
    })), // 拖拽手柄
    _define_property(_obj, "".concat(token.componentCls, "-resize-handle"), {
        width: 6,
        cursor: 'col-resize',
        backgroundColor: 'transparent',
        position: 'relative',
        zIndex: 10,
        flexShrink: 0,
        marginInline: 1,
        // 键盘聚焦时给出可视化反馈（a11y 必要项）
        '&:focus-visible': {
            outline: "2px solid ".concat(token.colorPrimaryBorderHover),
            outlineOffset: -2
        },
        '&::before': {
            content: '""',
            position: 'absolute',
            insetInlineStart: '50%',
            top: 0,
            bottom: 0,
            width: 6,
            backgroundColor: 'transparent',
            transform: 'translateX(-50%)',
            // 拆成 transitionProperty/Duration/TimingFunction 三段式，
            // 避免某些 IDE 对简写串的属性名归属告警。
            transitionProperty: 'background-color',
            transitionDuration: token.motionDurationMid,
            transitionTimingFunction: token.motionEaseInOut
        },
        '&:hover::before': {
            backgroundColor: token.colorPrimaryBorderHover
        }
    }), // 侧边栏内容
    _define_property(_obj, "".concat(token.componentCls, "-sidebar-content"), {
        flex: 1,
        display: 'flex',
        flexDirection: 'column',
        overflow: 'hidden',
        width: '100%',
        height: '100%'
    }), // 主内容区域：用 flex 自适应分配 LayoutHeader 与正文，
    // 避免历史上 height: calc(100% - 48px) 在没有 header 时少 48px 的问题。
    //
    // 圆角策略：
    // - 默认仅设置「右上、右下」圆角（左上/左下交给左侧栏来呈现）；
    // - 当 -main 是 -body 的第一个直接子元素时（未传 left），
    //   补齐左上/左下圆角，避免与外层 -body 的圆角错位形成尖角；
    // - 当左侧栏处于折叠态（width:0 不可见）时，-main 视觉上是最左可见块，
    //   同样需要补齐左上/左下圆角；此时通过相邻兄弟选择器命中。
    _define_property(_obj, "".concat(token.componentCls, "-main"), _define_property({
        flex: 1,
        minWidth: 0,
        display: 'flex',
        flexDirection: 'column',
        backgroundColor: token.colorBgLayout,
        borderStartStartRadius: 0,
        borderEndStartRadius: 0,
        borderStartEndRadius: token.borderRadiusLG,
        borderEndEndRadius: token.borderRadiusLG,
        overflow: 'hidden',
        '&:first-child': {
            borderStartStartRadius: token.borderRadiusLG,
            borderEndStartRadius: token.borderRadiusLG
        }
    }, "".concat(token.componentCls, "-main-content"), {
        flex: 1,
        minHeight: 0,
        overflow: 'auto',
        // 与 LayoutHeader 同款浅灰底色，避免 header / messages 区域颜色断层。
        background: 'var(--color-gray-bg-page-light)'
    })), // 左栏折叠时，紧随其后的 -main 视觉上成为最左可见块，
    // 此时需要补齐左上/左下圆角，避免顶部/底部出现直角缺口。
    _define_property(_obj, "".concat(token.componentCls, "-sidebar-left-collapsed + ").concat(token.componentCls, "-main"), {
        borderStartStartRadius: token.borderRadiusLG,
        borderEndStartRadius: token.borderRadiusLG
    }), _obj));
};
export var useAgenticLayoutStyle = function useAgenticLayoutStyle(prefixCls) {
    return useEditorStyleRegister('agentic-layout', function(token) {
        var agenticLayoutToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(agenticLayoutToken)
        ];
    });
};
