/*
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 { __extends } from "tslib";
import { DataAnnotationPointLayer } from "./DataAnnotationPointLayer";
import { markType } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { DataAnnotationInfo } from "./DataAnnotationInfo";
import { isNaN_ } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
var DataAnnotationRectLayer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataAnnotationRectLayer, _super);
    function DataAnnotationRectLayer() {
        var _this = _super.call(this) || this;
        _this.ab = DataAnnotationRectLayer.$;
        return _this;
    }
    DataAnnotationRectLayer.prototype.bk = function () {
        return new DataAnnotationRectLayer();
    };
    DataAnnotationRectLayer.prototype.aek = function (a) {
        var _this = this;
        if (!this.acs(a)) {
            return;
        }
        var b = this.ac2._inner[a];
        b.c = new List$1(DataAnnotationInfo.$, 0);
        b.b = new List$1(DataAnnotationInfo.$, 0);
        b.centerLabelX = this.ado(a, this.agv);
        b.centerLabelY = this.ado(a, this.agw);
        b.startLabelX = this.ado(a, this.ag1);
        b.startLabelY = this.ado(a, this.ag2);
        b.endLabelX = this.ado(a, this.agx);
        b.endLabelY = this.ado(a, this.agy);
        b.shapeStartX = this.ac7(a, this.ag3);
        b.shapeStartY = this.ac7(a, this.ag4);
        b.shapeEndX = this.ac7(a, this.agz);
        b.shapeEndY = this.ac7(a, this.ag0);
        if (isNaN_(b.shapeStartX)) {
            b.shapeStartX = b.shapeEndX;
        }
        if (isNaN_(b.shapeStartY)) {
            b.shapeStartY = b.shapeEndY;
        }
        if (isNaN_(b.shapeEndX)) {
            b.shapeEndX = b.shapeStartX;
        }
        if (isNaN_(b.shapeEndY)) {
            b.shapeEndY = b.shapeStartY;
        }
        b.shapeCenterX = b.shapeStartX + ((b.shapeEndX - b.shapeStartX) / 2);
        b.shapeCenterY = b.shapeStartY + ((b.shapeEndY - b.shapeStartY) / 2);
        b.c.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.textColor = _this.age;
            $ret.background = _this.agc;
            $ret.borderColor = _this.agd;
            $ret.j = b.shapeStartX;
            $ret.k = b.shapeStartY;
            $ret.dataLabelX = b.startLabelX;
            $ret.dataLabelY = b.startLabelY;
            $ret.dataValueX = b.shapeStartX;
            $ret.dataValueY = b.shapeStartY;
            $ret.a = _this.agj;
            $ret.b = _this.agk;
            return $ret;
        })()));
        b.c.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.j = b.shapeStartX;
            $ret.k = b.shapeEndY;
            return $ret;
        })()));
        b.c.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.textColor = _this.agb;
            $ret.background = _this.af9;
            $ret.borderColor = _this.aga;
            $ret.j = b.shapeEndX;
            $ret.k = b.shapeEndY;
            $ret.dataLabelX = b.endLabelX;
            $ret.dataLabelY = b.endLabelY;
            $ret.dataValueX = b.shapeEndX;
            $ret.dataValueY = b.shapeEndY;
            $ret.a = _this.agh;
            $ret.b = _this.agi;
            return $ret;
        })()));
        b.c.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.j = b.shapeEndX;
            $ret.k = b.shapeStartY;
            return $ret;
        })()));
        var c = this.agf;
        if (c == 0) {
            if (stringIsNullOrEmpty(b.centerLabelX)) {
                c = 6;
            }
        }
        var d = this.agg;
        if (d == 0) {
            if (stringIsNullOrEmpty(b.centerLabelY)) {
                d = 6;
            }
        }
        b.b.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.textColor = _this.af8;
            $ret.background = _this.af6;
            $ret.borderColor = _this.af7;
            $ret.j = b.shapeCenterX;
            $ret.k = b.shapeCenterY;
            $ret.dataLabelX = b.centerLabelX;
            $ret.dataLabelY = b.centerLabelY;
            $ret.dataValueX = b.shapeCenterX;
            $ret.dataValueY = b.shapeCenterY;
            $ret.a = c;
            $ret.b = d;
            return $ret;
        })()));
    };
    DataAnnotationRectLayer.$t = markType(DataAnnotationRectLayer, 'DataAnnotationRectLayer', DataAnnotationPointLayer.$);
    return DataAnnotationRectLayer;
}(DataAnnotationPointLayer));
export { DataAnnotationRectLayer };
