/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { CanvasGridCellBase } from "./CanvasGridCellBase";
import { TextBlock } from "igniteui-webcomponents-core";
import { Brush } from "igniteui-webcomponents-core";
import { FontUtil } from "igniteui-webcomponents-core";
import { markType } from "igniteui-webcomponents-core";
import { intDivide } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
var CanvasSummaryCell = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(CanvasSummaryCell, _super);
    function CanvasSummaryCell(a) {
        var _this = _super.call(this, a) || this;
        _this.db = null;
        _this.dg = new TextBlock();
        _this.c7 = 0;
        _this.c8 = 0;
        _this.c6 = 0;
        _this.c3 = null;
        _this.da = 0;
        _this.c4 = false;
        _this.c5 = true;
        _this.c9 = 0;
        _this.ce(2);
        return _this;
    }
    CanvasSummaryCell.prototype.cn = function (a) {
        _super.prototype.cn.call(this, a);
        this.bf = intDivide(a, 2);
        this.c5 = true;
    };
    CanvasSummaryCell.prototype.de = function (a) {
        this.c3 = a;
        this.c4 = true;
        this.y = true;
        this.c5 = true;
    };
    CanvasSummaryCell.prototype.dc = function (a) {
        this.db = a;
        this.dg.ak = this.db;
        this.y = true;
        this.c5 = true;
    };
    CanvasSummaryCell.prototype.dd = function (a) {
        this.y = true;
        this.dg.am = ((function () {
            var $ret = new Brush();
            $ret.color = a;
            return $ret;
        })());
    };
    CanvasSummaryCell.prototype.df = function (a) {
        if (this.dg.ak == null) {
            return;
        }
        if (a == null) {
            return;
        }
        if (this.c4 || (this.c3 != null && this.c3.g != this.da)) {
            this.c4 = false;
            this.da = this.c3.g;
            a.ac(this.c3);
            this.c6 = FontUtil.getCurrentFontHeight(this.bl, this.c3);
        }
        var b = this.bj;
        var c = this.a8;
        b -= (this.a5 + this.ba + this.a6 + this.bb);
        c -= (this.a7 + this.bc + this.a4 + this.a9);
        b = Math.max(b, 0);
        c = Math.max(c, 0);
        this.c9 = this.bi(this.dg, this.db, b / 2, a);
        this.c7 = this.ba + this.a5;
        this.c8 = this.bc + this.a7 + ((c / 2) - (this.c6 / 2));
    };
    CanvasSummaryCell.prototype.b5 = function (a) {
        if (this.dg.ak != null) {
            if (this.c5) {
                this.df(a);
                this.c5 = false;
            }
            this.dg.n = this.c7;
            this.dg.o = this.c8;
            a.w(this.dg);
        }
        _super.prototype.b5.call(this, a);
    };
    CanvasSummaryCell.prototype.get_aa = function () {
        return false;
    };
    CanvasSummaryCell.$t = markType(CanvasSummaryCell, 'CanvasSummaryCell', CanvasGridCellBase.$);
    return CanvasSummaryCell;
}(CanvasGridCellBase));
export { CanvasSummaryCell };
//# sourceMappingURL=CanvasSummaryCell.js.map
