/*
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 { CategorySeries } from "./CategorySeries";
import { IIsCategoryBased_$type } from "./IIsCategoryBased";
import { IHasSingleValueCategory_$type } from "./IHasSingleValueCategory";
import { IHasCategoryTrendline_$type } from "./IHasCategoryTrendline";
import { ITrendLineSeries_$type } from "./ITrendLineSeries";
import { IAnchoredCategorySeriesInteractionManager_$type } from "./IAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-angular-core";
import { Point_$type, enumGetBox, typeCast, markType, markDep } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { Series } from "./Series";
import { TrendLineType_$type } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { PenLineCap_$type } from "igniteui-angular-core";
import { DoubleCollection } from "igniteui-angular-core";
import { CategoryFrame } from "./CategoryFrame";
import { ICategoryScaler_$type } from "./ICategoryScaler";
import { IScaler_$type } from "./IScaler";
import { CategorySeriesView } from "./CategorySeriesView";
import { CategorySeriesMarkerCollisionAvoidance_$type } from "./CategorySeriesMarkerCollisionAvoidance";
import { ConsolidatedItemHitTestBehavior_$type } from "./ConsolidatedItemHitTestBehavior";
import { CategoryFramePreparer } from "./CategoryFramePreparer";
import { DataLegendSeriesValueInfo } from "igniteui-angular-core";
import { DataLegendSeriesContext } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { ISortingAxis_$type } from "./ISortingAxis";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { NumericAxisBase } from "./NumericAxisBase";
import { CategoryBucketCalculator } from "./CategoryBucketCalculator";
import { AxisRange } from "./AxisRange";
import { NumericYAxis } from "./NumericYAxis";
import { ScalerParams } from "./ScalerParams";
import { CategoryMarkerManager } from "./CategoryMarkerManager";
import { CollisionAvoider } from "./CollisionAvoider";
import { NonCollisionAvoider } from "./NonCollisionAvoider";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { PropertyMetadata } from "igniteui-angular-core";
import { truncate, isNaN_, isInfinity } from "igniteui-angular-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
/**
 * @hidden
 */
var AnchoredCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AnchoredCategorySeries, _super);
    function AnchoredCategorySeries() {
        var _this = _super.call(this) || this;
        _this.tt = null;
        _this.ty = false;
        _this.tv = null;
        _this.tq = null;
        _this.t4 = null;
        _this.tx = true;
        _this.tz = 0;
        _this.t0 = 0;
        _this.r2 = new CategoryFramePreparer(1, _this, _this.r6, _this, _this, _this.r6.cr);
        return _this;
    }
    Object.defineProperty(AnchoredCategorySeries.prototype, "tu", {
        get: function () {
            var _this = this;
            if (this.tt == null) {
                this.tt = DVContainer.instance.createInstance(IAnchoredCategorySeriesInteractionManager_$type, function () { return _this.co.n; });
            }
            return this.tt;
        },
        enumerable: false,
        configurable: true
    });
    AnchoredCategorySeries.prototype.getHostReferenceValue = function () {
        return this.gg();
    };
    AnchoredCategorySeries.prototype.i4 = function () {
        return AnchoredCategorySeries.$$p[4];
    };
    AnchoredCategorySeries.prototype.by = function () {
        var a = new AnchoredCategorySeriesView(this);
        return a;
    };
    AnchoredCategorySeries.prototype.l4 = function (a) {
        _super.prototype.l4.call(this, a);
        this.tp = a;
    };
    AnchoredCategorySeries.prototype.h1 = function (a, b) {
        var c = this.jv(b);
        if (c == AnchoredCategorySeries.$$p[4]) {
            return this.h2(a, b, this.uc);
        }
        return _super.prototype.h1.call(this, a, b);
    };
    Object.defineProperty(AnchoredCategorySeries.prototype, "valueColumn", {
        get: function () {
            return this.tv;
        },
        set: function (a) {
            if (this.tv != a) {
                var b = this.tv;
                this.tv = a;
                if (!this.ty) {
                    this.raisePropertyChanged("ValueColumn", b, this.tv);
                }
            }
        },
        enumerable: false,
        configurable: true
    });
    AnchoredCategorySeries.prototype.getDataLegendSeriesContextAt = function (a, b) {
        var c = new DataLegendSeriesValueInfo();
        c.a = 0;
        c.l = this.gn({ $type: Point_$type, x: a, y: b }, false, false);
        c.q = this.uc != null ? this.uc : "Value";
        c.p = "Value";
        c.r = this.t8 != null ? this.t8 : "V:";
        c.s = this.ua != null ? this.ua : "";
        var d = new DataLegendSeriesContext();
        d.f = ((function () {
            var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
            $ret.add(c);
            return $ret;
        })());
        d.b = this.aw();
        return d;
    };
    Object.defineProperty(AnchoredCategorySeries.prototype, "ux", {
        get: function () {
            return this.c(AnchoredCategorySeries.uk);
        },
        set: function (a) {
            this.h(AnchoredCategorySeries.uk, a);
        },
        enumerable: false,
        configurable: true
    });
    AnchoredCategorySeries.prototype.eq = function (a) {
        var b = new Rect(0, 0, 0, 1, 1);
        var c = this.fetchXAxis();
        var d = this.fetchYAxis();
        var e = this.p1(this.b1);
        var f = c != null ? this.r2.r(typeCast(ICategoryScaler_$type, c), b, b, e) : 0;
        return this.tu.c$a(this, this.valueColumn, c, d, f, a);
    };
    AnchoredCategorySeries.prototype.tm = function (a, b, c) {
        if (b < a || a < 0 || a > this.valueColumn.count || b < 0 || b > this.valueColumn.count || c == null) {
            return null;
        }
        var d = new Array((b - a) + 1);
        var e = c.cm;
        var f = null;
        if (e) {
            f = c.i$b;
        }
        for (var g = a; g <= b; g++) {
            var h = g;
            if (e) {
                h = f._inner[h];
            }
            d[g - a] = this.cl.item(g);
        }
        return d;
    };
    AnchoredCategorySeries.prototype.l9 = function (a, b, c, d) {
        _super.prototype.l9.call(this, a, b, c, d);
        if (this.tp.c3 && this.tp.c2.g$b(a, b, c, d)) {
            this.mn(false);
            this.lu();
        }
        switch (b) {
            case "FastItemsSource":
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    c.deregisterColumn(this.valueColumn);
                    this.valueColumn = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    this.valueColumn = this.ci(this.uc);
                }
                var e = typeCast(NumericAxisBase.$, this.fetchYAxis());
                if (e != null && !e.c0()) {
                    this.tp.cr.g(this.fx);
                    this.mn(false);
                }
                break;
            case AnchoredCategorySeries.$$p[4]:
                if (this.cl != null) {
                    this.cl.deregisterColumn(this.valueColumn);
                    this.valueColumn = this.ci(this.uc);
                }
                this.t4 = this.uc;
                break;
            case "ValueColumn":
                if (this.tp.c3) {
                    this.tp.c2.g$i();
                }
                var f = typeCast(NumericAxisBase.$, this.fetchYAxis());
                if (f != null && !f.c0()) {
                    this.tp.cr.g(this.fx);
                    this.mn(false);
                }
                this.uj();
                this.m7();
                break;
            case "TrendLineBrush":
                this.m1();
                break;
            case "ErrorBarSettings":
                this.mn(false);
                break;
            case "TrendLineType":
                this.lu();
                break;
            case AnchoredCategorySeries.$$p[1]:
                this.mn(false);
                break;
        }
    };
    AnchoredCategorySeries.prototype.aq = function (a) {
        if (this.valueColumn == null || this.valueColumn.count == 0) {
            return null;
        }
        if (a == this.fetchXAxis()) {
            return new AxisRange(0, this.valueColumn.count - 1);
        }
        if (a == this.fetchYAxis()) {
            return new AxisRange(this.valueColumn.minimum, this.valueColumn.maximum);
        }
        return null;
    };
    AnchoredCategorySeries.prototype.k5 = function (a, b, c, d) {
        switch (a) {
            case 4:
            case 1:
            case 0:
                this.tp.cr.g(this.fx);
                break;
        }
        if (this.tp.c3) {
            this.tp.c2.g$e(a, b, c, d);
        }
        this.uj();
        this.m7();
        if (a == 0 || a == 2 || a == 3 || a == 4) {
            this.tx = true;
        }
        else if (a == 1) {
            for (var e = b; e < b + c; e++) {
                this.tz += this.valueColumn.item(e);
            }
            this.t0 = this.tz / this.valueColumn.count;
        }
    };
    AnchoredCategorySeries.prototype.sw = function () {
        return this.t1(this.r6);
    };
    AnchoredCategorySeries.prototype.t1 = function (a) {
        var b = 0;
        var c = a.bv;
        var d = a.bu;
        var e = this.getEffectiveViewport1(a);
        var f = typeCast(NumericYAxis.$, this.fetchYAxis());
        if (!c.isEmpty && !d.isEmpty && f != null) {
            var g = new ScalerParams(0, c, d, f.cg, e);
            if (f.co) {
                g.b = this.gg();
            }
            b = f.ei(f.l6, g);
        }
        return b;
    };
    AnchoredCategorySeries.prototype.uh = function (a, b, c) {
        var d = this.t1(c);
        if (a.count > 0) {
            var e = d;
            a.add({ $type: Point_$type, x: a._inner[a.count - 1].x, y: e });
            a.add({ $type: Point_$type, x: a._inner[0].x, y: e });
        }
    };
    AnchoredCategorySeries.prototype.tn = function (a, b, c, d) {
        return this.to(a, b, c, d, false);
    };
    AnchoredCategorySeries.prototype.to = function (a, b, c, d, e) {
        return CategorySeries.rr(a, b, c, d, e);
    };
    AnchoredCategorySeries.prototype.fd = function (a, b, c) {
        var d = _super.prototype.fd.call(this, a, b, c);
        var e = c;
        if (this.valueColumn == null || this.valueColumn.count == 0 || e.cr.d < 1) {
            d = false;
        }
        return d;
    };
    AnchoredCategorySeries.prototype.k2 = function (a, b) {
        _super.prototype.k2.call(this, a, b);
        var c = b;
        c.cx();
        if (c.c3) {
            c.c2.g$d();
        }
    };
    AnchoredCategorySeries.prototype.tc = function (a, b) {
        _super.prototype.tc.call(this, a, b);
        this.r3(b).d(a, b);
    };
    AnchoredCategorySeries.prototype.tf = function (a, b) {
        _super.prototype.tf.call(this, a, b);
        var c = typeCast(AnchoredCategorySeriesView.$, b);
        c.b3 = true;
        if (c.c3) {
            c.c2.g$g(a.p);
        }
        if (this.qn()) {
            CategoryMarkerManager.e(this, a.m, b.cu, this.qp);
            this.s9(b, a);
            b.cm();
        }
        this.ue(a, b);
    };
    AnchoredCategorySeries.prototype.mm = function (a, b, c, d, e) {
        _super.prototype.mm.call(this, a, b, c, d, e);
        var f = this.a7.a$h.item(d);
        var g = f;
        g.cr.g(this.fx);
        f.a1(c);
        if (this.cy(g)) {
            return;
        }
        if (this.tq == null) {
            this.tq = new CategoryFrame(3);
        }
        this.tq.u();
        this.tc(this.tq, g);
        this.tf(this.tq, g);
    };
    AnchoredCategorySeries.prototype.ue = function (a, b) {
    };
    AnchoredCategorySeries.prototype.m1 = function () {
        _super.prototype.m1.call(this);
        if (this.index < 0) {
            return;
        }
        this.tp.c7();
        if (this.trendLineBrush != null) {
            this.tp.c5();
        }
        else {
            this.tp.c4();
        }
    };
    AnchoredCategorySeries.prototype.h4 = function (a, b) {
        if (this.tp.c3 && a == this.tp.c2.g$j) {
            return null;
        }
        return _super.prototype.h4.call(this, a, b);
    };
    Object.defineProperty(AnchoredCategorySeries.prototype, "currentCategoryMode", {
        get: function () {
            return this.preferredCategoryMode(typeCast(CategoryAxisBase.$, this.rw()));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AnchoredCategorySeries.prototype, "scaler", {
        get: function () {
            return typeCast(ICategoryScaler_$type, this.rw());
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AnchoredCategorySeries.prototype, "yScaler", {
        get: function () {
            return typeCast(IScaler_$type, this.sh());
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AnchoredCategorySeries.prototype, "bucketizer", {
        get: function () {
            return this.tp.cr;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AnchoredCategorySeries.prototype, "currentMode2Index", {
        get: function () {
            return this.s0();
        },
        enumerable: false,
        configurable: true
    });
    AnchoredCategorySeries.prototype.provideCollisionDetector = function () {
        if (this.tr == 1) {
            return new CollisionAvoider();
        }
        return NonCollisionAvoider.b;
    };
    Object.defineProperty(AnchoredCategorySeries.prototype, "trendlinePreparer", {
        get: function () {
            return this.tp.c3 ? this.tp.c2 : null;
        },
        enumerable: false,
        configurable: true
    });
    AnchoredCategorySeries.prototype.lc = function (a) {
        _super.prototype.lc.call(this, a);
        if (this.tp.c3) {
            this.a9.exportTrendlineData(this, a, this.tp.c2.g$j);
        }
    };
    AnchoredCategorySeries.prototype.hy = function (a) {
        var _this = this;
        var b = this.fetchXAxis();
        var c = this.fetchYAxis();
        return this.tu.c$b(this, a, this.sx(this.b1), this.valueColumn, b, c, this.ts == 1, function (d) { return _super.prototype.hy.call(_this, d); });
    };
    Object.defineProperty(AnchoredCategorySeries.prototype, "mayContainUnknowns", {
        get: function () {
            return this.valueColumn == null || this.valueColumn.mayContainUnknowns;
        },
        enumerable: false,
        configurable: true
    });
    AnchoredCategorySeries.prototype.gg = function () {
        return Series.gh(this.valueColumn, typeCast(ISortingAxis_$type, this.fetchXAxis()));
    };
    AnchoredCategorySeries.prototype.get_t3 = function () {
        return 0;
    };
    Object.defineProperty(AnchoredCategorySeries.prototype, "t3", {
        get: function () {
            return this.get_t3();
        },
        enumerable: false,
        configurable: true
    });
    AnchoredCategorySeries.prototype.ar = function (a) {
        if (a.isEmpty && this.ce != null) {
            a = this.ce.ta;
        }
        if (this.valueColumn == null) {
            return null;
        }
        var b = this.pz(this.b1);
        var c = this.rw();
        var d = new ScalerParams(0, a, this.ce.tp, c.cg, this.getEffectiveViewport());
        var e = (c.el(b.left, d));
        var f = (c.el(b.right, d));
        if (c.cg) {
            var g = e;
            e = f;
            f = g;
        }
        e -= this.t3;
        f += this.t3;
        var h = null;
        if (c.cm) {
            h = c;
            e = h.i$f(e);
            f = h.i$f(f);
        }
        else {
            e = Math.floor(e);
            f = Math.ceil(f);
        }
        if (isNaN_(e) || isNaN_(f)) {
            return null;
        }
        e = Math.max(0, Math.min(this.valueColumn.count - 1, e));
        f = Math.max(0, Math.min(this.valueColumn.count - 1, f));
        var i = 1.7976931348623157E+308;
        var j = -1.7976931348623157E+308;
        if (truncate(e) <= truncate(f)) {
            for (var k = truncate(e); k <= truncate(f); k++) {
                var l = k;
                if (h != null) {
                    l = h.i$b._inner[k];
                }
                var m = this.valueColumn.item(l);
                if (this.valueColumn.mayContainUnknowns) {
                    if (isInfinity(m) || isNaN_(m)) {
                        continue;
                    }
                }
                i = Math.min(i, m);
                j = Math.max(j, m);
            }
        }
        var n = new AxisRange(i, j);
        n = this.ap(n, this.sh(), a);
        return n;
    };
    AnchoredCategorySeries.prototype.uj = function () {
        this.f5 = this.valueColumn == null || this.valueColumn.count == 0 ? NaN : this.valueColumn.item(this.valueColumn.count - 1);
    };
    AnchoredCategorySeries.prototype.ui = function () {
        if (this.tx) {
            this.tz = 0;
            for (var a = 0; a < this.valueColumn.count; a++) {
                this.tz += this.valueColumn.item(a);
            }
            this.t0 = this.tz / this.valueColumn.count;
            this.tx = false;
        }
    };
    AnchoredCategorySeries.prototype.gq = function (a, b) {
        if (b == null || !b.ci) {
            return NaN;
        }
        var c = this.sh();
        if (b != c) {
            return NaN;
        }
        var d = this.am(a);
        if (c.co) {
            return d[1];
        }
        else {
            return d[0];
        }
    };
    AnchoredCategorySeries.prototype.am = function (a) {
        var b = NaN;
        switch (a) {
            case 5:
            case 2:
                b = this.valueColumn.maximum;
                break;
            case 4:
            case 1:
                b = this.valueColumn.minimum;
                break;
            case 6:
            case 3:
                if (this.tx) {
                    this.ui();
                }
                b = this.t0;
                break;
        }
        var c = this.sh();
        if (c.co) {
            return [NaN, b];
        }
        else {
            return [b, NaN];
        }
    };
    AnchoredCategorySeries.prototype.pv = function (a) {
        var b = NaN;
        switch (a) {
            case 5:
            case 2:
                b = this.valueColumn.maximum;
                break;
            case 4:
            case 1:
                b = this.valueColumn.minimum;
                break;
            case 6:
            case 3:
                if (this.tx) {
                    this.ui();
                }
                b = this.t0;
                break;
        }
        if (isNaN_(b)) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        var c = this.sh();
        var d = this.getEffectiveViewport1(this.b1);
        var e = new ScalerParams(0, this.b1.bv, this.b1.bu, c.cg, d);
        if (c.co) {
            e.b = this.gg();
        }
        e.c = d;
        if (c.co) {
            return { $type: Point_$type, x: NaN, y: c.ei(b, e) };
        }
        else {
            return { $type: Point_$type, x: c.ei(b, e), y: NaN };
        }
    };
    AnchoredCategorySeries.prototype.pw = function (a) {
        var b = this.sh();
        var c = this.getEffectiveViewport1(this.b1);
        var d = new ScalerParams(0, this.b1.bv, this.b1.bu, b.cg, c);
        if (b.co) {
            d.b = this.gg();
        }
        d.c = c;
        if (b.co) {
            return { $type: Point_$type, x: NaN, y: b.ei(a[1], d) };
        }
        else {
            return { $type: Point_$type, x: b.ei(a[0], d), y: NaN };
        }
    };
    Object.defineProperty(AnchoredCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.ss;
        },
        enumerable: false,
        configurable: true
    });
    AnchoredCategorySeries.$t = markType(AnchoredCategorySeries, 'AnchoredCategorySeries', CategorySeries.$, [IIsCategoryBased_$type, IHasSingleValueCategory_$type, IHasCategoryTrendline_$type, ITrendLineSeries_$type]);
    AnchoredCategorySeries.uk = DependencyProperty.i("ActualTrendLineBrush", Brush.$, AnchoredCategorySeries.$, new PropertyMetadata(2, null, function (a, b) { return a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue); }));
    AnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, AnchoredCategorySeries, 'raisePropertyChanged', ['ConsolidatedItemHitTestBehavior:ts:ul', [ConsolidatedItemHitTestBehavior_$type, enumGetBox(ConsolidatedItemHitTestBehavior_$type, 0)], 'MarkerCollisionAvoidance:tr:um', [CategorySeriesMarkerCollisionAvoidance_$type, enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, 1)], 'ValueMemberAsLegendLabel:t8:uu', [2, null], 'ValueMemberAsLegendUnit:ua:uv', [2, null], 'ValueMemberPath:uc:uw', [2, null], 'TrendLineType::us', [TrendLineType_$type, enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness::ur', [1, 1.5], 'TrendLinePeriod::uq', [1, 7], 'TrendLineBrush::un', [Brush.$, null], 'TrendLineZIndex:t2:ut', [1, 1001], 'TrendLineDashArray:uy:uo', [DoubleCollection.$], 'TrendLineDashCap:uz:up', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)]]);
    return AnchoredCategorySeries;
}(CategorySeries));
export { AnchoredCategorySeries };
/**
 * @hidden
 */
var AnchoredCategoryBucketCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AnchoredCategoryBucketCalculator, _super);
    function AnchoredCategoryBucketCalculator(a) {
        var _this = _super.call(this, a) || this;
        _this.i = null;
        _this.h = null;
        _this.j = 0;
        _this.i = a;
        return _this;
    }
    AnchoredCategoryBucketCalculator.prototype.getBucketWithoutUnknowns = function (a) {
        var b = this.h;
        var c = this.j;
        var d = a * this.d;
        var e = d + this.d - 1;
        var f = c - 1;
        d = d < f ? d : f;
        e = e < f ? e : f;
        var g = 1.7976931348623157E+308;
        var h = -1.7976931348623157E+308;
        var i = true;
        for (var j = d; j <= e; ++j) {
            var k = b[j];
            g = g < k ? g : k;
            h = h > k ? h : k;
            i = false;
        }
        if (!i) {
            return [0.5 * (d + e), g, h];
        }
        return [0.5 * (d + e), NaN, NaN];
    };
    AnchoredCategoryBucketCalculator.prototype.getBucket = function (a) {
        var b = this.h;
        var c = this.j;
        var d = a * this.d;
        var e = d + this.d - 1;
        var f = c - 1;
        d = d < f ? d : f;
        e = e < f ? e : f;
        var g = 0;
        var h = 0;
        var i = true;
        for (var j = d; j <= e; ++j) {
            var k = b[j];
            if (!i) {
                if (!isNaN_(k)) {
                    g = g < k ? g : k;
                    h = h > k ? h : k;
                }
            }
            else {
                if (!isNaN_(k)) {
                    g = k;
                    h = k;
                    i = false;
                }
            }
        }
        if (!i) {
            return [0.5 * (d + e), g, h];
        }
        return [0.5 * (d + e), NaN, NaN];
    };
    AnchoredCategoryBucketCalculator.prototype.cacheValues = function () {
        this.j = this.i.c0.valueColumn.count;
        this.h = this.i.c0.valueColumn.asArray();
    };
    AnchoredCategoryBucketCalculator.prototype.unCacheValues = function () {
        this.h = null;
    };
    AnchoredCategoryBucketCalculator.$t = markType(AnchoredCategoryBucketCalculator, 'AnchoredCategoryBucketCalculator', CategoryBucketCalculator.$);
    return AnchoredCategoryBucketCalculator;
}(CategoryBucketCalculator));
export { AnchoredCategoryBucketCalculator };
/**
 * @hidden
 */
var AnchoredCategorySeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AnchoredCategorySeriesView, _super);
    function AnchoredCategorySeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.c0 = null;
        _this.c1 = null;
        _this.c0 = a;
        return _this;
    }
    Object.defineProperty(AnchoredCategorySeriesView.prototype, "c2", {
        get: function () {
            if (this.c1 == null) {
                this.c1 = CategoryTrendLineManagerFactory.a(this.c1, this.e.as(), this.e.nf, this.e, this.e.co);
            }
            return this.c1;
        },
        set: function (a) {
            this.c1 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AnchoredCategorySeriesView.prototype, "c3", {
        get: function () {
            return this.c1 != null;
        },
        enumerable: false,
        configurable: true
    });
    AnchoredCategorySeriesView.prototype.c7 = function () {
        this.c0.ux = null;
    };
    AnchoredCategorySeriesView.prototype.c5 = function () {
        this.c0.ux = this.c0.trendLineBrush;
    };
    AnchoredCategorySeriesView.prototype.c4 = function () {
        this.c0.ux = this.c0.o5;
    };
    AnchoredCategorySeriesView.prototype.cs = function () {
        return new AnchoredCategoryBucketCalculator(this);
    };
    AnchoredCategorySeriesView.prototype.c6 = function () {
        this.cr.cacheValues();
    };
    AnchoredCategorySeriesView.prototype.c8 = function () {
        this.cr.unCacheValues();
    };
    AnchoredCategorySeriesView.prototype.c9 = function (a) {
        var b = this.cu.item(a);
        return this.cp(b);
    };
    AnchoredCategorySeriesView.prototype.a5 = function (a, b) {
        if (a.d) {
            if (this.c0.trendLineType != 0 && !b) {
                var c = this.c2.g$j;
                c.ad = this.c0.trendLineThickness;
                c._stroke = this.c0.ux;
                c.ai = this.c0.uy;
                c.aj = this.c0.uz;
                a.v(c);
            }
        }
        _super.prototype.a5.call(this, a, b);
    };
    AnchoredCategorySeriesView.prototype.getDefaultTooltipTemplate = function () {
        return this.c0.tu.c$c(this.e, this.c0.uc);
    };
    AnchoredCategorySeriesView.$t = markType(AnchoredCategorySeriesView, 'AnchoredCategorySeriesView', CategorySeriesView.$);
    return AnchoredCategorySeriesView;
}(CategorySeriesView));
export { AnchoredCategorySeriesView };
