/*
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 { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { IUnknownValuePlotting_$type } from "igniteui-react-core";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { UnknownValuePlotting_$type } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { typeCast, runOn, enumGetBox, markType, markDep } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { PropertyMetadata } from "igniteui-react-core";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { Defaults } from "./Defaults";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Color } from "igniteui-react-core";
/**
 * @hidden
 */
var AreaSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AreaSeries, _super);
    function AreaSeries() {
        var _this = _super.call(this) || this;
        _this.zf = null;
        _this.zf = new CategoryLineRasterizer();
        _this.ab = AreaSeries.$;
        _this.yy = 0;
        return _this;
    }
    AreaSeries.prototype.cg = function () {
        return new AreaSeriesView(this);
    };
    AreaSeries.prototype.vw = function () {
        return 1;
    };
    AreaSeries.prototype.cm = function () {
        if (this.cn == 0) {
            return 2;
        }
        return _super.prototype.cm.call(this);
    };
    AreaSeries.prototype.o0 = function (a) {
        _super.prototype.o0.call(this, a);
        this.ze = a;
    };
    AreaSeries.prototype.get_d9 = function () {
        return true;
    };
    AreaSeries.prototype.get_d8 = function () {
        return true;
    };
    AreaSeries.prototype.preferredCategoryMode = function (a) {
        return this.yy;
    };
    AreaSeries.prototype.f4 = function (a, b) {
        var c = this.th(this.tm(a), true, false);
        if (this.y5(a, c, b)) {
            return true;
        }
        if (this.f3(a, b)) {
            return true;
        }
        if (this.ud(a, b)) {
            return true;
        }
        return false;
    };
    AreaSeries.prototype.nj = function (a, b) {
        _super.prototype.nj.call(this, a, b);
        var c = b;
        c.de();
    };
    AreaSeries.prototype.w5 = function (a, b) {
        var _this = this;
        _super.prototype.w5.call(this, a, b);
        var c = b.cu.d;
        var d = typeCast(AreaSeriesView.$, b);
        var e = a.f;
        var f = this.getEffectiveViewport1(d);
        this.vu.a2(this, this.we(), runOn(this, this.vf), this.wn(b), this.wo(b));
        var g = false;
        var h = this.vu.b;
        if (h != null) {
            g = true;
        }
        if (g) {
            var i = new ScalerParams(0, b.by, b.bx, this.yv.ch, f);
            this.w1(e, -1, this.valueColumn.count, this.yv, i, b.q);
        }
        var j = d.dq;
        var k = d.dr;
        var l = d.ds;
        var m = d.dt;
        this.vu.ad(j, true, false, true, true);
        this.vu.ad(k, true, false, true, true);
        this.vu.ad(l, false, true, false, false);
        this.vu.ad(m, false, true, false, false);
        if (b.cy(a)) {
            d.dg(e.count, e, true, c, this.hj, function (n, o, p, q, r) { return _this.yb(n, a.f.count, b); }, this.unknownValuePlotting, e.count == 1 ? null : this.xe(e, e.count - 1, b.bx, b.by, true));
            b.c1(a);
        }
        var n = this.fetchYAxis();
        l._opacity = this.vu.j * this.hf;
        m._opacity = 0.5 * this.vu.j * this.hf;
    };
    AreaSeries.prototype.o8 = function (a, b, c, d) {
        _super.prototype.o8.call(this, a, b, c, d);
        switch (b) {
            case AreaSeries.$$p[0]:
                this.vr.m = this.unknownValuePlotting == 0;
                this.pp(false);
                this.ol();
                break;
        }
    };
    Object.defineProperty(AreaSeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.wi;
        },
        enumerable: false,
        configurable: true
    });
    AreaSeries.$t = markType(AreaSeries, 'AreaSeries', HorizontalAnchoredCategorySeries.$, [IUnknownValuePlotting_$type]);
    AreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, AreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting::zh', [UnknownValuePlotting_$type, enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return AreaSeries;
}(HorizontalAnchoredCategorySeries));
export { AreaSeries };
/**
 * @hidden
 */
var AreaSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AreaSeriesView, _super);
    function AreaSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.dd = null;
        _this.dl = new Path();
        _this.dn = new Path();
        _this.dm = new Path();
        _this.dp = new Path();
        _this.dh = new Path();
        _this.dj = new Path();
        _this.di = new Path();
        _this.dk = new Path();
        _this.dd = a;
        return _this;
    }
    AreaSeriesView.prototype.au = function () {
        _super.prototype.au.call(this);
        if (!this.q) {
            this.dd.ua = Defaults.e;
        }
    };
    Object.defineProperty(AreaSeriesView.prototype, "dq", {
        get: function () {
            return this.dn;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "dr", {
        get: function () {
            return this.dp;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "ds", {
        get: function () {
            return this.dl;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AreaSeriesView.prototype, "dt", {
        get: function () {
            return this.dm;
        },
        enumerable: false,
        configurable: true
    });
    AreaSeriesView.prototype.de = function () {
        this.dl.an = null;
        this.dm.an = null;
        this.dn.an = null;
        this.dp.an = null;
        this.as();
    };
    AreaSeriesView.prototype.df = function (a, b, c, d, e, f, g) {
        this.dg(a, b, c, d, e, f, g, null);
    };
    AreaSeriesView.prototype.dg = function (a, b, c, d, e, f, g, h) {
        this.dd.zf.a = typeCast(ISortingAxis_$type, this.cw.fetchXAxis()) !== null ? true : false;
        this.dd.zf.j(this.dl, this.dn, this.dm, this.dp, a, b, c, d, e, f, g, h);
        this.as();
    };
    AreaSeriesView.prototype.be = function () {
        _super.prototype.be.call(this);
        this.dh.an = this.dl.an;
        this.dj.an = this.dn.an;
        this.di.an = this.dm.an;
        this.dk.an = this.dp.an;
        var a = this.br();
        this.dh._fill = a;
        this.dh._opacity = 1;
        this.di._fill = a;
        this.di._opacity = 1;
        this.dj._stroke = a;
        this.dj.ad = this.e.hk + 3;
        this.dk._stroke = a;
        this.dk.ad = this.e.hk + 3;
    };
    AreaSeriesView.prototype.a8 = function (a, b) {
        _super.prototype.a8.call(this, a, b);
        if (b) {
            a.t(this.dh);
            a.t(this.di);
            a.t(this.dj);
            a.t(this.dk);
        }
        else {
            a.t(this.dl);
            a.t(this.dm);
            a.t(this.dn);
            a.t(this.dp);
        }
    };
    AreaSeriesView.prototype.an = function (a) {
        _super.prototype.an.call(this, a);
        this.e.a9.exportPathData(a, this.dn, "lowerShape", ["Lower"]);
        this.e.a9.exportPathData(a, this.dp, "upperShape", ["Upper", "Main"]);
        this.e.a9.exportPathData(a, this.dm, "translucentShape", ["Translucent"]);
        this.e.a9.exportPathData(a, this.dl, "fillShape", ["Fill"]);
    };
    AreaSeriesView.prototype.af = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.s6 = a;
        this.e.ir = 5;
        this.e.is = 1;
        this.e.it = -3;
    };
    AreaSeriesView.$t = markType(AreaSeriesView, 'AreaSeriesView', AnchoredCategorySeriesView.$);
    return AreaSeriesView;
}(AnchoredCategorySeriesView));
export { AreaSeriesView };
