const brush_brush = (spec, context)=>{
    const result = {
        ...spec
    };
    const { advancedVSeed, vseed } = context;
    const { brush = {}, chartType } = vseed;
    const theme = advancedVSeed.config?.[chartType]?.brush ?? {};
    const enable = brush.enable ?? theme?.enable;
    if (false === enable) return result;
    result.brush = {
        visible: true,
        removeOnClick: brush.removeOnClick,
        brushMode: brush?.brushMode || 'single',
        brushType: brush?.brushType || 'rect',
        inBrush: {
            opacity: theme.inBrushStyle?.opacity,
            stroke: theme.inBrushStyle?.stroke,
            lineWidth: theme.inBrushStyle?.lineWidth
        },
        outOfBrush: {
            opacity: theme.outOfBrushStyle?.opacity,
            stroke: theme.outOfBrushStyle?.stroke,
            lineWidth: theme.outOfBrushStyle?.lineWidth
        }
    };
    if (result.label && false !== result.label.visible) {
        if (!result.label.state) result.label.state = {};
        result.label.state.outOfBrush = {
            opacity: result.brush.outOfBrush.opacity
        };
        result.label.state.inBrush = {
            opacity: result.brush.inBrush.opacity
        };
    }
    return result;
};
export { brush_brush as brush };

//# sourceMappingURL=brush.js.map