/*
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 { DependencyProperty } from "igniteui-angular-core";
import { typeCast, markType, markDep } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { DataAnnotationInfo } from "./DataAnnotationInfo";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
var DataAnnotationBandLayer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataAnnotationBandLayer, _super);
    function DataAnnotationBandLayer() {
        var _this = _super.call(this) || this;
        _this.ail = null;
        _this.ab = DataAnnotationBandLayer.$;
        return _this;
    }
    DataAnnotationBandLayer.prototype.bk = function () {
        return new DataAnnotationBandLayer();
    };
    DataAnnotationBandLayer.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);
        var c = this.ac7(a, this.aim);
        if (isNaN_(c)) {
            c = this.acu ? 0.2 : 20;
        }
        var d = c / 2;
        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.j = b.ab.x;
            $ret.k = b.ab.y + d;
            return $ret;
        })()));
        b.c.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.j = b.ab.x;
            $ret.k = b.ab.y - d;
            return $ret;
        })()));
        b.c.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.j = b.aa.x;
            $ret.k = b.aa.y - d;
            return $ret;
        })()));
        b.c.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.j = b.aa.x;
            $ret.k = b.aa.y + d;
            return $ret;
        })()));
        b.b.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.textColor = _this.age;
            $ret.background = _this.agc;
            $ret.borderColor = _this.agd;
            $ret.j = b.ab.x;
            $ret.k = b.ab.y;
            $ret.dataLabelX = b.startLabelX;
            $ret.dataLabelY = b.startLabelY;
            $ret.dataValueX = b.ab.x;
            $ret.dataValueY = b.ab.y;
            $ret.a = _this.agj;
            $ret.b = _this.agk;
            return $ret;
        })()));
        b.b.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.textColor = _this.agb;
            $ret.background = _this.af9;
            $ret.borderColor = _this.aga;
            $ret.j = b.aa.x;
            $ret.k = b.aa.y;
            $ret.dataLabelX = b.endLabelX;
            $ret.dataLabelY = b.endLabelY;
            $ret.dataValueX = b.aa.x;
            $ret.dataValueY = b.aa.y;
            $ret.a = _this.agh;
            $ret.b = _this.agi;
            return $ret;
        })()));
        var e = this.agf;
        if (e == 0) {
            if (stringIsNullOrEmpty(b.centerLabelX)) {
                e = 6;
            }
        }
        var f = this.agg;
        if (f == 0) {
            if (stringIsNullOrEmpty(b.centerLabelY)) {
                f = 6;
            }
        }
        b.b.add(((function () {
            var $ret = new DataAnnotationInfo();
            $ret.textColor = _this.af8;
            $ret.background = _this.af6;
            $ret.borderColor = _this.af7;
            $ret.j = b.z.x;
            $ret.k = b.z.y;
            $ret.dataLabelX = b.centerLabelX;
            $ret.dataLabelY = b.centerLabelY;
            $ret.dataValueX = b.z.x;
            $ret.dataValueY = b.z.y;
            $ret.a = e;
            $ret.b = f;
            return $ret;
        })()));
    };
    DataAnnotationBandLayer.prototype.rg = function (a, b, c, d) {
        _super.prototype.rg.call(this, a, b, c, d);
        switch (b) {
            case "BreadthAnnotationColumn":
                this.abj();
                break;
            case DataAnnotationBandLayer.$$p[0]:
                if (this.dp != null) {
                    this.dp.deregisterColumn(this.aim);
                    this.aim = this.dl(this.ain);
                }
                break;
        }
    };
    DataAnnotationBandLayer.prototype.aem = function (a, b) {
        _super.prototype.aem.call(this, a, b);
        if (typeCast(IFastItemsSource_$type, a) != null) {
            a.deregisterColumn(this.aim);
            this.aim = null;
        }
        if (typeCast(IFastItemsSource_$type, b) != null) {
            this.aim = this.dl(this.ain);
        }
    };
    Object.defineProperty(DataAnnotationBandLayer.prototype, "aim", {
        get: function () {
            return this.ail;
        },
        set: function (a) {
            if (this.ail != a) {
                var b = this.ail;
                this.ail = a;
                this.raisePropertyChanged("BreadthAnnotationColumn", b, this.ail);
            }
        },
        enumerable: false,
        configurable: true
    });
    DataAnnotationBandLayer.$t = markType(DataAnnotationBandLayer, 'DataAnnotationBandLayer', DataAnnotationPointLayer.$);
    DataAnnotationBandLayer.$$p = markDep(DependencyProperty, PropertyMetadata, DataAnnotationBandLayer, 'raisePropertyChanged', ['AnnotationBreadthMemberPath:ain:aiq', [2, null]]);
    return DataAnnotationBandLayer;
}(DataAnnotationPointLayer));
export { DataAnnotationBandLayer };
