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 { resetComponent, useEditorStyleRegister } from "../../../../Hooks/useStyle";
export var JINJA_PANEL_PREFIX_CLS = 'agentic-md-editor-jinja-panel';
var genJinjaPanelStyle = function genJinjaPanelStyle(token) {
    return _define_property({}, token.componentCls, {
        boxSizing: 'border-box',
        display: 'flex',
        flexDirection: 'column',
        width: 360,
        height: 200,
        maxHeight: 320,
        minWidth: 240,
        overflow: 'hidden',
        borderRadius: 'var(--radius-control-sm, var(--ant-border-radius-sm))',
        backgroundColor: 'var(--color-gray-bg-page-light, var(--ant-color-bg-container))',
        boxShadow: 'var(--shadow-control-lg, var(--ant-box-shadow))',
        '&-content': {
            display: 'flex',
            flexDirection: 'column',
            flex: 1,
            overflow: 'hidden',
            padding: 4
        },
        '&-header': {
            padding: '6px 12px',
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'space-between',
            flexShrink: 0
        },
        '&-header-actions': {
            display: 'flex',
            alignItems: 'center',
            gap: 8
        },
        '&-close': {
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            padding: 4,
            margin: -4,
            border: 'none',
            background: 'transparent',
            cursor: 'pointer',
            color: 'var(--color-gray-text-light, var(--ant-color-text-secondary))',
            borderRadius: token.borderRadiusSM,
            '&:hover': {
                color: 'var(--color-gray-text-default, var(--ant-color-text))',
                backgroundColor: token.colorFillTertiary
            }
        },
        '&-title': {
            font: 'var(--font-text-body-emphasized-sm)',
            letterSpacing: 'var(--letter-spacing-body-emphasized-sm, normal)',
            color: 'var(--color-gray-text-light, var(--ant-color-text-secondary))'
        },
        '&-doc-link': {
            display: 'flex',
            cursor: 'pointer',
            alignItems: 'center',
            gap: 4,
            font: 'var(--font-text-body-emphasized-sm)',
            letterSpacing: 'var(--letter-spacing-body-emphasized-sm, normal)',
            color: 'var(--color-primary-text-default, var(--ant-color-link))'
        },
        '&-list-box': {
            flex: 1,
            overflowY: 'auto',
            padding: '4px 0'
        },
        '&-item': {
            display: 'flex',
            borderRadius: token.borderRadiusSM,
            flexDirection: 'row',
            alignItems: 'center',
            gap: 8,
            padding: '8px 12px',
            cursor: 'pointer',
            '&:hover': {
                backgroundColor: token.colorFillTertiary
            }
        },
        '&-item-active': {
            backgroundColor: token.controlItemBgHover
        },
        '&-item-title': {
            flexShrink: 0,
            font: 'var(--font-text-body-base)',
            letterSpacing: 'var(--letter-spacing-body-base, normal)',
            color: 'var(--color-gray-text-default, var(--ant-color-text))'
        },
        '&-item-desc': {
            flex: 1,
            minWidth: 0,
            font: 'var(--font-text-body-sm)',
            letterSpacing: 'var(--letter-spacing-body-sm, normal)',
            color: 'var(--color-gray-text-light, var(--ant-color-text-secondary))'
        }
    });
};
export function useJinjaTemplatePanelStyle(prefixCls) {
    var componentCls = '.' + (prefixCls || JINJA_PANEL_PREFIX_CLS);
    return useEditorStyleRegister('JinjaTemplatePanel-' + (prefixCls || JINJA_PANEL_PREFIX_CLS), function(token) {
        var editorToken = _object_spread_props(_object_spread({}, token), {
            componentCls: componentCls
        });
        return [
            resetComponent(editorToken),
            genJinjaPanelStyle(editorToken)
        ];
    });
}
