/*
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 { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { IUnknownValuePlotting_$type } from "igniteui-react-core/ES5/IUnknownValuePlotting";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { UnknownValuePlotting_$type } from "igniteui-react-core/ES5/UnknownValuePlotting";
import { DependencyProperty } from "igniteui-react-core/ES5/DependencyProperty";
import { Type, typeCast, runOn, enumGetBox, markType } from "igniteui-react-core/ES5/type";
import { Path } from "igniteui-react-core/ES5/Path";
import { ScalerParams } from "./ScalerParams";
import { PropertyMetadata } from "igniteui-react-core/ES5/PropertyMetadata";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-react-core/ES5/Color";
/**
 * @hidden
 */
var AreaSeries = /** @class */ (function (_super) {
    tslib_1.__extends(AreaSeries, _super);
    function AreaSeries() {
        var _this = _super.call(this) || this;
        _this.qb = null;
        _this.qb = new CategoryLineRasterizer();
        _this.ab = AreaSeries.$;
        _this.pu = 0;
        return _this;
    }
    AreaSeries.prototype.bf = function () {
        return new AreaSeriesView(this);
    };
    AreaSeries.prototype.m9 = function () {
        return 1;
    };
    AreaSeries.prototype.im = function (a) {
        _super.prototype.im.call(this, a);
        this.qa = a;
    };
    AreaSeries.prototype.get_ck = function () {
        return true;
    };
    AreaSeries.prototype.preferredCategoryMode = function (a) {
        return this.pu;
    };
    AreaSeries.prototype.dg = function (a, b) {
        var c = this.le(this.lh(a), true, false);
        if (this.p1(a, c, b)) {
            return true;
        }
        if (this.df(a, b)) {
            return true;
        }
        if (this.lx(a, b)) {
            return true;
        }
        return false;
    };
    AreaSeries.prototype.hp = function (a, b) {
        _super.prototype.hp.call(this, a, b);
        var c = b;
        c.c7();
    };
    AreaSeries.prototype.oh = function (a, b) {
        var _this = this;
        _super.prototype.oh.call(this, a, b);
        var c = b.cn.d;
        var d = typeCast(AreaSeriesView.$, b);
        var e = a.f;
        var f = this.getEffectiveViewport1(d);
        this.m7.x(this, this.ns(), this.pr, runOn(this, this.mt), this.n0(b), this.n1(b));
        var g = false;
        var h = this.m7.c;
        if (h != null) {
            g = true;
        }
        if (g) {
            var i = new ScalerParams(0, b.bs, b.br, this.pr.b8, f);
            this.od(e, -1, this.valueColumn.count, this.pr, i, b.n);
        }
        var j = d.de;
        var k = d.df;
        var l = d.dh;
        var m = d.dj;
        this.m7.ae(j, true, false, true, true);
        this.m7.ae(k, true, false, true, true);
        this.m7.ae(l, false, true, false, false);
        this.m7.ae(m, false, true, false, false);
        if (b.cr(a)) {
            d.c9(e.count, e, true, c, this.er, function (n, o, p, q, r) { return _this.pb(n, a.f.count, b); }, this.unknownValuePlotting, e.count == 1 ? null : this.oq(e, e.count - 1, b.br, b.bs, true));
            b.cu(a);
        }
        var n = this.fetchYAxis();
        l._opacity = this.m7.i * this.d3;
        m._opacity = 0.5 * this.m7.i * this.d3;
    };
    AreaSeries.prototype.is = function (a, b, c, d) {
        _super.prototype.is.call(this, a, b, c, d);
        switch (b) {
            case AreaSeries.$$p[0]:
                this.m4.m = this.unknownValuePlotting == 0;
                this.i6(false);
                this.ic();
                break;
        }
    };
    Object.defineProperty(AreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.nv;
        },
        enumerable: true,
        configurable: true
    });
    AreaSeries.$t = markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    return AreaSeries;
}(HorizontalAnchoredCategorySeries));
export { AreaSeries };
Type.dep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::qd', [UnknownValuePlotting_$type, enumGetBox(UnknownValuePlotting_$type, 1)]]);
/**
 * @hidden
 */
var AreaSeriesView = /** @class */ (function (_super) {
    tslib_1.__extends(AreaSeriesView, _super);
    function AreaSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.c6 = null;
        _this.dg = new Path();
        _this.dk = new Path();
        _this.di = new Path();
        _this.dl = new Path();
        _this.da = new Path();
        _this.dc = new Path();
        _this.db = new Path();
        _this.dd = new Path();
        _this.c6 = a;
        return _this;
    }
    AreaSeriesView.prototype.ap = function () {
        _super.prototype.ap.call(this);
        if (!this.n) {
            this.e.bj = 1;
        }
    };
    Object.defineProperty(AreaSeriesView.prototype, "de", {
        get: function () {
            return this.dk;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "df", {
        get: function () {
            return this.dl;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "dh", {
        get: function () {
            return this.dg;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "dj", {
        get: function () {
            return this.di;
        },
        enumerable: true,
        configurable: true
    });
    AreaSeriesView.prototype.c7 = function () {
        this.dg.aj = null;
        this.di.aj = null;
        this.dk.aj = null;
        this.dl.aj = null;
        this.an();
    };
    AreaSeriesView.prototype.c8 = function (a, b, c, d, e, f, g) {
        this.c9(a, b, c, d, e, f, g, null);
    };
    AreaSeriesView.prototype.c9 = function (a, b, c, d, e, f, g, h) {
        this.c6.qb.a = typeCast(ISortingAxis_$type, this.cp.fetchXAxis()) !== null ? true : false;
        this.c6.qb.j(this.dg, this.dk, this.di, this.dl, a, b, c, d, e, f, g, h);
        this.an();
    };
    AreaSeriesView.prototype.a9 = function () {
        _super.prototype.a9.call(this);
        this.da.aj = this.dg.aj;
        this.dc.aj = this.dk.aj;
        this.db.aj = this.di.aj;
        this.dd.aj = this.dl.aj;
        var a = this.bl();
        this.da._fill = a;
        this.da._opacity = 1;
        this.db._fill = a;
        this.db._opacity = 1;
        this.dc._stroke = a;
        this.dc.ac = this.e.ev + 3;
        this.dd._stroke = a;
        this.dd.ac = this.e.ev + 3;
    };
    AreaSeriesView.prototype.a3 = function (a, b) {
        _super.prototype.a3.call(this, a, b);
        if (b) {
            a.s(this.da);
            a.s(this.db);
            a.s(this.dc);
            a.s(this.dd);
        }
        else {
            a.s(this.dg);
            a.s(this.di);
            a.s(this.dk);
            a.s(this.dl);
        }
    };
    AreaSeriesView.prototype.ai = function (a) {
        _super.prototype.ai.call(this, a);
        this.e.a2.exportPathData(a, this.dk, "lowerShape", ["Lower"]);
        this.e.a2.exportPathData(a, this.dl, "upperShape", ["Upper", "Main"]);
        this.e.a2.exportPathData(a, this.di, "translucentShape", ["Translucent"]);
        this.e.a2.exportPathData(a, this.dg, "fillShape", ["Fill"]);
    };
    AreaSeriesView.prototype.ac = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.k3 = a;
        this.e.es = 5;
        this.e.et = 1;
        this.e.eu = -3;
    };
    AreaSeriesView.$t = markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
}(AnchoredCategorySeriesView));
export { AreaSeriesView };
