/*
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 { TrendLineManagerBase$1 } from "./TrendLineManagerBase$1";
import { IPreparesCategoryTrendline_$type } from "./IPreparesCategoryTrendline";
import { Number_$type, typeCast, markType } from "igniteui-react-core/ES5/type";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { ScalerParams } from "./ScalerParams";
import { Series } from "./Series";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
var CategoryTrendLineManagerBase = /** @class */ (function (_super) {
    tslib_1.__extends(CategoryTrendLineManagerBase, _super);
    function CategoryTrendLineManagerBase() {
        return _super.call(this, Number_$type) || this;
    }
    CategoryTrendLineManagerBase.prototype.get_g$a = function () {
        return 0;
    };
    Object.defineProperty(CategoryTrendLineManagerBase.prototype, "g$a", {
        get: function () {
            return this.get_g$a();
        },
        enumerable: true,
        configurable: true
    });
    CategoryTrendLineManagerBase.prototype.prepareLine = function (a, b, c, d) {
        var e = b.k;
        var f = new ScalerParams(0, b.m, b.l, b.b.j$a, e);
        var g = new ScalerParams(0, b.m, b.l, b.c.j$a, e);
        if (typeCast(Series.$, a) !== null) {
            g.b = a.ed();
        }
        var h = c.f;
        if (b.d != null && b.d.i$b != null) {
            h = new SafeSortedReadOnlyDoubleCollection(0, h, b.d.i$b);
        }
        var i = ((function () {
            var $ret = new TrendResolutionParams();
            $ret.c = b.h;
            $ret.d = b.i;
            $ret.e = b.j;
            $ret.a = d;
            $ret.b = b.g;
            $ret.f = b.l;
            return $ret;
        })());
        if (a.trendLineType != 0) {
            if (a.isVertical) {
                this.prepareLineCore(b.a.p, a.trendLineType, h, a.trendLinePeriod, function (j) { return b.c.j$b(j, g); }, function (j) { return b.b.j$b(j, f); }, i);
            }
            else {
                this.prepareLineCore(b.a.p, a.trendLineType, h, a.trendLinePeriod, function (j) { return b.b.j$b(j, f); }, function (j) { return b.c.j$b(j, g); }, i);
            }
        }
    };
    CategoryTrendLineManagerBase.$t = markType(CategoryTrendLineManagerBase, 'CategoryTrendLineManagerBase', TrendLineManagerBase$1.$.specialize(Number_$type), [IPreparesCategoryTrendline_$type]);
    return CategoryTrendLineManagerBase;
}(TrendLineManagerBase$1));
export { CategoryTrendLineManagerBase };
