import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { BaseExpression } from "../../BaseExpression";
import { ExpressionValue } from "../../ExpressionValue";
import { ExpressionValueRenderer } from "../../ExpressionValueRenderer";
import { BracketedDiv, ExpressionPiece } from "../../ExpressionStyles";
import { NumberDataDefinition } from "../../../Common/Data/Definitions/NumberDataDefinition";
export class MaxExpression extends BaseExpression {
    constructor() {
        super();
        this.__type = "Max";
        this.expressionValueType = new NumberDataDefinition();
        let dd = new NumberDataDefinition();
        dd.list = true;
        this.value1 = ExpressionValue.createExpressionValue(this, "maxValue", dd);
    }
    render() {
        return (_jsxs(ExpressionPiece, { children: ["max", _jsx(BracketedDiv, { children: _jsx(ExpressionValueRenderer, { el: this.value1 }, void 0) }, void 0)] }, void 0));
    }
    evaluate(data, testContext) {
        return Math.max(...this.value1.evaluate(data, testContext));
    }
}
//# sourceMappingURL=MaxExpression.js.map