/*
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, __generator, __values } from "tslib";
import { EventArgs, Base, markType, typeCast, Point_$type, String_$type, runOn, Number_$type, enumGetBox, fromEnum, toEnum, Date_$type, markDep, Delegate_$type } from "igniteui-angular-core";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-angular-core";
import { IFastItemColumn$1_$type } from "igniteui-angular-core";
import { Series } from "./Series";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-angular-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "./HighlightingInfo";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { CategoryFrame } from "./CategoryFrame";
import { CategoryMode_$type } from "./CategoryMode";
import { ITimeRangeSelectorAxis_$type } from "./ITimeRangeSelectorAxis";
import { FastReflectionHelper } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { FinancialValueList } from "./FinancialValueList";
import { CategoryXAxis } from "./CategoryXAxis";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
import { SafeReadOnlyDoubleCollection } from "./SafeReadOnlyDoubleCollection";
import { SafeEnumerable } from "./SafeEnumerable";
import { CalculatedColumn } from "./CalculatedColumn";
import { TrendCalculators } from "igniteui-angular-core";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
import { dateToStringFormat } from "igniteui-angular-core";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-angular-core";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
var FinancialEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialEventArgs, _super);
    function FinancialEventArgs(a, b, c, d, e) {
        var _this = _super.call(this) || this;
        _this._position = 0;
        _this._count = 0;
        _this._dataSource = null;
        _this._supportingCalculations = null;
        _this._basedOn = null;
        _this.position = a;
        _this.count = b;
        _this.dataSource = c;
        _this.supportingCalculations = d;
        if (c != null) {
            c.series = e;
        }
        return _this;
    }
    Object.defineProperty(FinancialEventArgs.prototype, "position", {
        get: function () {
            return this._position;
        },
        set: function (a) {
            this._position = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "dataSource", {
        get: function () {
            return this._dataSource;
        },
        set: function (a) {
            this._dataSource = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "supportingCalculations", {
        get: function () {
            return this._supportingCalculations;
        },
        set: function (a) {
            this._supportingCalculations = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "basedOn", {
        get: function () {
            return this._basedOn;
        },
        set: function (a) {
            this._basedOn = a;
        },
        enumerable: false,
        configurable: true
    });
    FinancialEventArgs.$t = markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
    return FinancialEventArgs;
}(EventArgs));
export { FinancialEventArgs };
/**
 * @hidden
 */
var FinancialBucketCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialBucketCalculator, _super);
    function FinancialBucketCalculator(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.c = 0;
        _this.d = 0;
        _this.b = 0;
        if (a == null) {
            throw new ArgumentNullException(0, "view");
        }
        _this.a = a;
        _this.c = -1;
        _this.d = _this.d;
        _this.b = 0;
        return _this;
    }
    FinancialBucketCalculator.prototype.getBucket = function (a) {
        return null;
    };
    FinancialBucketCalculator.prototype.getBucketWithoutUnknowns = function (a) {
        return this.getBucket(a);
    };
    FinancialBucketCalculator.prototype.getErrorBucket = function (a, b) {
        return NaN;
    };
    FinancialBucketCalculator.prototype.getBucketInfo = function (a, b, c, d) {
        a = this.c;
        b = this.d;
        c = this.b;
        d = this.a.bz.ft;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    };
    FinancialBucketCalculator.prototype.e = function (a) {
        var b = this.a.bv;
        var c = this.a.bu;
        var d = this.a.bu;
        if (this.a.bz != null) {
            d = this.a.bz.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.bz.qb == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.bz.qb != null) ? this.a.bz.qb.cg : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.bz.pq(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.bz.qb);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.bz.qb.el(g.left, f));
            var j = Math.ceil(this.a.bz.qb.el(g.right, f));
            if (this.a.bz.qb.cg) {
                j = Math.ceil(this.a.bz.qb.el(g.left, f));
                i = Math.floor(this.a.bz.qb.el(g.right, f));
            }
            var k = Math.floor((j - i + 1) * a / g.width);
            this.b = truncate(Math.max(1, k));
            this.c = truncate(Math.floor(i / this.b));
            this.d = truncate(Math.ceil(j / this.b));
        }
        else {
            this.c = h.i$e(b, c, d, g);
            this.d = h.i$g(b, c, d, g);
            this.b = 1;
        }
    };
    FinancialBucketCalculator.prototype.cacheValues = function () {
    };
    FinancialBucketCalculator.prototype.unCacheValues = function () {
    };
    FinancialBucketCalculator.$t = markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
    return FinancialBucketCalculator;
}(Base));
export { FinancialBucketCalculator };
/**
 * @hidden
 */
var FinancialSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialSeries, _super);
    function FinancialSeries() {
        var _this = _super.call(this) || this;
        _this.q2 = null;
        _this.q0 = null;
        _this.q1 = null;
        _this.qz = null;
        _this.q3 = null;
        _this.rc = false;
        _this.assigningCategoryStyle = null;
        _this.qk = null;
        _this.rm = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.rn = new Dictionary$2(String_$type, String_$type, 0);
        _this.rb = false;
        _this.qv = null;
        _this.qf = null;
        _this.qh = null;
        _this.qd = null;
        _this.qn = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.ra = false;
        _this.rz = null;
        _this.rx = null;
        _this.ry = null;
        _this.rw = null;
        _this.r0 = null;
        _this.qg = null;
        _this.qc = null;
        _this.qi = 0;
        _this.qw = null;
        _this.qy = null;
        _this.qk = new CategorySeriesRenderManager();
        _this.rc = false;
        _this.qn = new CategoryTransitionSourceFramePreparer();
        _this.qg = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.qj = 0;
        return _this;
    }
    FinancialSeries.prototype.ly = function (a) {
        _super.prototype.ly.call(this, a);
        this.qs = a;
    };
    FinancialSeries.prototype.get_dp = function () {
        return true;
    };
    FinancialSeries.prototype.ag = function () {
        return [this.qb, this.qx];
    };
    FinancialSeries.prototype.hw = function (a, b) {
        var c = this.jq(b);
        if (c == FinancialSeries.$$p[6]) {
            return this.hx(a, b, this.sr);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.hx(a, b, this.si);
        }
        if (c == FinancialSeries.$$p[4]) {
            return this.hx(a, b, this.sn);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.hx(a, b, this.sf);
        }
        if (c == FinancialSeries.$$p[8]) {
            return this.hx(a, b, this.sv);
        }
        return _super.prototype.hw.call(this, a, b);
    };
    FinancialSeries.prototype.sb = function () {
        return 2;
    };
    FinancialSeries.prototype.r9 = function () {
        return 4;
    };
    FinancialSeries.prototype.ah = function (a) {
        var b = this.aj(this.qb, this.qd.f, this.r8(this.b0), this.sa(this.b0), this.po(a), true);
        if (b == null) {
            return null;
        }
        var c = b[0];
        var d = b[1];
        var e = new Array(1);
        var f = new Array(2);
        var g = this.sb();
        f[0] = { $type: Point_$type, x: c[0], y: c[g] };
        f[1] = { $type: Point_$type, x: d[0], y: d[g] };
        e[0] = f;
        return e;
    };
    FinancialSeries.prototype.ai = function (a) {
        var b = this.aj(this.qb, this.qd.f, this.r8(this.b0), this.sa(this.b0), this.po(a), true);
        if (b == null) {
            return null;
        }
        var c = b[0];
        var d = b[1];
        var e = new Array(1);
        var f = new Array(2);
        f[0] = { $type: Point_$type, x: c[0], y: c[1] };
        f[1] = { $type: Point_$type, x: d[0], y: d[1] };
        e[0] = f;
        return e;
    };
    FinancialSeries.prototype.o8 = function () {
        return this.th;
    };
    FinancialSeries.prototype.o9 = function () {
        return this.th;
    };
    FinancialSeries.prototype.ku = function () {
        _super.prototype.ku.call(this);
        this.qb = null;
        this.qx = null;
    };
    FinancialSeries.prototype.get_c6 = function () {
        return true;
    };
    FinancialSeries.prototype.get_ej = function () {
        return this.qx != null && this.qx.cg;
    };
    Object.defineProperty(FinancialSeries.prototype, "q7", {
        get: function () {
            return this.q2;
        },
        set: function (a) {
            if (this.q2 != a) {
                var b = this.q2;
                this.q2 = a;
                this.raisePropertyChanged("OpenColumn", b, this.q2);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "q5", {
        get: function () {
            return this.q0;
        },
        set: function (a) {
            if (this.q0 != a) {
                var b = this.q0;
                this.q0 = a;
                this.raisePropertyChanged("HighColumn", b, this.q0);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "q6", {
        get: function () {
            return this.q1;
        },
        set: function (a) {
            if (this.q1 != a) {
                var b = this.q1;
                this.q1 = a;
                this.raisePropertyChanged("LowColumn", b, this.q1);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "q4", {
        get: function () {
            return this.qz;
        },
        set: function (a) {
            if (this.qz != a) {
                var b = this.qz;
                this.qz = a;
                this.raisePropertyChanged("CloseColumn", b, this.qz);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "q9", {
        get: function () {
            return this.q3;
        },
        set: function (a) {
            if (this.q3 != a) {
                var b = this.q3;
                this.q3 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.q3);
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.rj = function () {
        return (this.assigningCategoryStyle != null && this.rc) || this.bk != 1;
    };
    FinancialSeries.prototype.s3 = function (a) {
        if (this.assigningCategoryStyle != null && this.rc) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.s1 = function (a, b, c, d, e, f) {
        var g = this.bk != 1;
        this.qk.a1(this.qk.b, d.cm, a, b, c, d, e, f, false);
        this.qk.ab(this.fr);
        var h = this.qk.aw;
        var i = null;
        var j = this.ck;
        if (g && this.cd != null) {
            i = this.cd.a3.getHighlightingInfo(this, j, h.o, h.n, false);
            h.b = i;
        }
        h.f = f;
        this.s3(h);
        this.qk.z(this, i, f, g, b < 0);
    };
    FinancialSeries.prototype.r1 = function (a) {
        return this.f7(a, this.qb);
    };
    FinancialSeries.prototype.hj = function (a, b) {
        return this.hk(a, b, this.qb, runOn(this, this.r1), new FinancialValueList(this.q7, this.q5, this.q6, this.q4, this.q9));
    };
    FinancialSeries.prototype.hh = function (a, b) {
        return this.hi(a, b, this.qb, runOn(this, this.r1), new FinancialValueList(this.q7, this.q5, this.q6, this.q4, this.q9));
    };
    FinancialSeries.prototype.f3 = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.qb.le;
        return this.f4(a, b, this.qb, d, e, f, runOn(this, this.r1));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.qb.getCategorySize(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
    };
    FinancialSeries.prototype.pl = function (a, b, c) {
        return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, null, null, null);
    };
    FinancialSeries.prototype.gj = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r2(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
        return this.gl(new FinancialValueList(this.q7, this.q5, this.q6, this.q4, this.q9), a, this.qb, f, e, runOn(this, this.r1), b, c);
    };
    FinancialSeries.prototype.gf = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r2(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
        return this.gl(this.q5, a, this.qb, f, e, runOn(this, this.r1), b, c);
    };
    FinancialSeries.prototype.gh = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r2(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
        return this.gl(this.q6, a, this.qb, f, e, runOn(this, this.r1), b, c);
    };
    FinancialSeries.prototype.r3 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r2(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
        return this.gl(this.q4, a, this.qb, f, e, runOn(this, this.r1), b, c);
    };
    FinancialSeries.prototype.r4 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r2(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
        return this.gl(this.q7, a, this.qb, f, e, runOn(this, this.r1), b, c);
    };
    FinancialSeries.prototype.r5 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.b0);
        var e = this.r2(this.b0.bv, this.b0.bu, d);
        var f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qb.cg, d);
        return this.gl(this.q9, a, this.qb, f, e, runOn(this, this.r1), b, c);
    };
    FinancialSeries.prototype.ph = function (a, b, c) {
        var _this = this;
        return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, runOn(this, this.gf), function (d, e) { return _this.hk(d, e, _this.qb, runOn(_this, _this.r1), _this.q5); }, function (d, e) { return _this.hi(d, e, _this.qb, runOn(_this, _this.r1), _this.q5); });
    };
    FinancialSeries.prototype.pj = function (a, b, c) {
        var _this = this;
        return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, runOn(this, this.gh), function (d, e) { return _this.hk(d, e, _this.qb, runOn(_this, _this.r1), _this.q6); }, function (d, e) { return _this.hi(d, e, _this.qb, runOn(_this, _this.r1), _this.q6); });
    };
    FinancialSeries.prototype.tj = function (a, b, c) {
        var _this = this;
        return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, runOn(this, this.r4), function (d, e) { return _this.hk(d, e, _this.qb, runOn(_this, _this.r1), _this.q7); }, function (d, e) { return _this.hi(d, e, _this.qb, runOn(_this, _this.r1), _this.q7); });
    };
    FinancialSeries.prototype.ti = function (a, b, c) {
        var _this = this;
        return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, runOn(this, this.r3), function (d, e) { return _this.hk(d, e, _this.qb, runOn(_this, _this.r1), _this.q4); }, function (d, e) { return _this.hi(d, e, _this.qb, runOn(_this, _this.r1), _this.q4); });
    };
    FinancialSeries.prototype.tk = function (a, b, c) {
        var _this = this;
        return this.pn(a, b, c, this.r2(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.qx, this.qb, runOn(this, this.r5), function (d, e) { return _this.hk(d, e, _this.qb, runOn(_this, _this.r1), _this.q9); }, function (d, e) { return _this.hi(d, e, _this.qb, runOn(_this, _this.r1), _this.q9); });
    };
    FinancialSeries.prototype.le = function () {
        _super.prototype.le.call(this);
        if (this.qb != null) {
            this.qb.h7(false);
        }
        if (this.qx != null) {
            this.qx.h7(false);
        }
    };
    FinancialSeries.prototype.m5 = function (a, b) {
        this.qs.bx.e(this.ft);
        this.mh(false);
    };
    FinancialSeries.prototype.m4 = function (a, b) {
        if (this.e0 && this.g0 < 0.05) {
            this.e1 = true;
        }
        this.qs.bx.e(this.ft);
        this.mh(false);
    };
    FinancialSeries.prototype.q8 = function (a, b, c) {
        var d = this.ch(b);
        this.rm.addItem(d, b);
        this.rn.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.s0 = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.rm.item(b);
        this.rn.removeItem(c);
        this.rm.removeItem(b);
    };
    FinancialSeries.prototype.l3 = function (a, b, c, d) {
        _super.prototype.l3.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.b8 != null && this.cd != null) {
                    this.qs.bx.e(this.ft);
                    this.mh(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.qb != null) {
                        this.qb.bz(this);
                    }
                    if (this.qx != null) {
                        this.qx.bz(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.qb != null) {
                        this.qb.cs(this);
                    }
                    if (this.qx != null) {
                        this.qx.cs(this);
                    }
                }
                this.qs.bx.e(this.ft);
                this.mh(false);
                break;
            case "FastItemsSource":
                this.rb = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.s0(typeCast(IFastItemsSource_$type, c), this.q7);
                    this.s0(typeCast(IFastItemsSource_$type, c), this.q5);
                    this.s0(typeCast(IFastItemsSource_$type, c), this.q6);
                    this.s0(typeCast(IFastItemsSource_$type, c), this.q4);
                    this.s0(typeCast(IFastItemsSource_$type, c), this.q9);
                    this.q7 = null;
                    this.q5 = null;
                    this.q6 = null;
                    this.q4 = null;
                    this.q9 = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.sr) == false) {
                        this.q7 = this.q8(typeCast(IFastItemsSource_$type, d), this.sr, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.si) == false) {
                        this.q5 = this.q8(typeCast(IFastItemsSource_$type, d), this.si, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.sn) == false) {
                        this.q6 = this.q8(typeCast(IFastItemsSource_$type, d), this.sn, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.sf) == false) {
                        this.q4 = this.q8(typeCast(IFastItemsSource_$type, d), this.sf, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.sv) == false) {
                        this.q9 = this.q8(typeCast(IFastItemsSource_$type, d), this.sv, "VolumeColumn");
                    }
                }
                this.rb = false;
                if (this.qx != null && !this.qx.c0()) {
                    this.qs.bx.e(this.ft);
                    this.mh(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.ck != null) {
                    this.s0(this.ck, this.q7);
                    this.q7 = this.q8(this.ck, this.sr, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.qx != null && !this.qx.c0() && !this.rb) {
                    this.qs.bx.e(this.ft);
                    this.mh(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.ck != null) {
                    this.s0(this.ck, this.q5);
                    this.q5 = this.q8(this.ck, this.si, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.qx != null && !this.qx.c0() && !this.rb) {
                    this.qs.bx.e(this.ft);
                    this.mh(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.ck != null) {
                    this.s0(this.ck, this.q6);
                    this.q6 = this.q8(this.ck, this.sn, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.qx != null && !this.qx.c0() && !this.rb) {
                    this.qs.bx.e(this.ft);
                    this.mh(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.ck != null) {
                    this.s0(this.ck, this.q4);
                    this.q4 = this.q8(this.ck, this.sf, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.qx != null && !this.qx.c0() && !this.rb) {
                    this.qs.bx.e(this.ft);
                    this.mh(false);
                }
                this.s5();
                break;
            case FinancialSeries.$$p[8]:
                if (this.ck != null) {
                    this.s0(this.ck, this.q9);
                    this.q9 = this.q8(this.ck, this.sv, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.qx != null && !this.qx.c0() && !this.rb) {
                    this.qs.bx.e(this.ft);
                    this.mh(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bz(this);
                }
                if (d != null) {
                    d.cs(this);
                }
                this.qs.bx.e(this.ft);
                this.mh(false);
                this.lo();
                this.qw = typeCast(ITimeRangeSelectorAxis_$type, this.qb);
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bz(this);
                }
                if (d != null) {
                    d.cs(this);
                }
                this.qs.bx.e(this.ft);
                if (this.qx != null) {
                    this.qx.c0();
                }
                {
                    this.mh(false);
                }
                this.lo();
                break;
            case "TransitionProgress":
                this.qh.c(this.g0, this.qf, this.qd);
                if (this.cx(this.b0)) {
                    return;
                }
                if (this.g0 == 1) {
                    this.qd.v();
                    this.s4(this.qd, this.qs);
                    if (this.e0) {
                        this.e0 = false;
                        this.ky();
                        this.ce.r = truncate(this.gm());
                        this.ce.b = this.cf;
                    }
                }
                else {
                    this.s4(this.qh, this.qs);
                }
                if (this.cd != null) {
                    this.cd.nn(this);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.mh(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.rc = this.rf();
                this.mh(false);
                break;
            case "CategoryMode":
                if (this.qb != null) {
                    this.qb.l4(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.re = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.rd = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.cd) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.p4 = function (a, b, c) {
        if (b < a || a < 0 || a > this.ck.count || b < 0 || b > this.ck.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.ck.item(g);
        }
        return d;
    };
    FinancialSeries.prototype.r8 = function (a) {
        return a.bx.b;
    };
    FinancialSeries.prototype.sa = function (a) {
        return a.bx.c;
    };
    FinancialSeries.prototype.p3 = function (a, b) {
        return this.p4(a, b, this.qx);
    };
    FinancialSeries.prototype.get_dx = function () {
        return true;
    };
    FinancialSeries.prototype.kv = function () {
        _super.prototype.kv.call(this);
        this.qv = null;
    };
    FinancialSeries.prototype.aw = function (a, b, c) {
        if (this.c2 && this.ef(this.bk) && !c) {
            var d = this.qu(a, b, this.qv);
            this.qv = d;
            return d;
        }
        else {
            var e = this.qt(a, b, this.qv);
            this.qv = e;
            return e;
        }
    };
    FinancialSeries.prototype.sc = function (a) {
        var b = this.qe();
        var c = this.b0.bu;
        var d = this.b0.bv;
        var e = this.qb;
        var f = 0;
        if (e.co) {
            var g = (a.y - d.top) / d.height;
            f = g * c.height + c.top;
        }
        else {
            var h = (a.x - d.left) / d.width;
            f = h * c.width + c.left;
        }
        var i = b.f.count;
        var j = 0;
        for (j = 0; j < i; j++) {
            var k = b.f._inner[j];
            var l = null;
            if (j < i - 1) {
                l = b.f._inner[j + 1];
            }
            if (k[0] <= f && l == null || l[0] >= f) {
                if (l != null) {
                    if (Math.abs(k[0] - f) < Math.abs(l[0] - f)) {
                        return j;
                    }
                    else {
                        return j + 1;
                    }
                }
                else {
                    return j;
                }
            }
        }
        return j;
    };
    FinancialSeries.prototype.qu = function (a, b, c) {
        var d = this.ck.count;
        var e = this.qs.bx.c;
        var f = this.qs.bx.d;
        var g = this.qs.bx.b;
        var h = this.qb;
        var i = -1;
        var j = -1;
        if (h.cm) {
            var k = this.qe();
            var l = this.sc(b);
            i = l;
            j = l;
        }
        else {
            var m = this.hd(b);
            i = truncate(Math.floor((intDivide(m, g)))) * g;
            j = i + (g - 1);
        }
        if (c != null && c.h == i && c.g == j) {
            return c;
        }
        var n = new HighlightingInfo();
        n.b = this;
        n.h = i;
        n.g = j;
        return n;
    };
    FinancialSeries.prototype.qt = function (a, b, c) {
        var d = new HighlightingInfo();
        d.b = this;
        d.h = 0;
        d.g = this.ck.count - 1;
        d.d = true;
        if (c != null && c.h == d.h && c.g == d.g) {
            return c;
        }
        return d;
    };
    FinancialSeries.prototype.rf = function () {
        return this.rh;
    };
    FinancialSeries.prototype.f5 = function (a) {
        var b = this.b0.bv;
        var c = this.b0.bu;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.qb != null) {
            var e = this.getEffectiveViewport1(this.b0);
            var f = new ScalerParams(0, b, c, this.qb.cg, e);
            var g = this.pq(this.b0);
            var h = this.qb.el(g.left, f);
            var i = this.qb.el(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.qb.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.hd = function (a) {
        return truncate(Math.round(this.f5(a)));
    };
    FinancialSeries.prototype.get_d9 = function () {
        return typeCast(ISortingAxis_$type, this.qb) !== null;
    };
    FinancialSeries.prototype.ar = function () {
        return this.qb;
    };
    FinancialSeries.prototype.hf = function (a) {
        var b = this.b0.bv;
        var c = this.b0.bu;
        var d = this.getEffectiveViewport1(this.b0);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        var e = new Rect(0, 0, 0, 1, 1);
        var f = new ScalerParams(0, b, c, this.qb.cg, d);
        var g = typeCast(ISortingAxis_$type, this.qb);
        var h = this.pq(this.b0);
        var i = h.left;
        var j = h.right;
        var k = this.pg(a).x;
        var l = this.qb.el(k, f);
        var m = this.qb.el(i, f);
        var n = this.qb.el(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.ht = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.qb) !== null) {
            b = this.hf(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.hd(a);
        }
        return b >= 0 && this.ck != null && b < this.ck.count ? this.ck.item(b) : null;
    };
    FinancialSeries.prototype.qe = function () {
        var a = this.qd;
        if (this.cv()) {
            if (this.ce.g) {
                this.ce.t();
            }
            a = this.qh;
        }
        return a;
    };
    FinancialSeries.prototype.r2 = function (a, b, c) {
        if (this.qb == null) {
            return 0;
        }
        return this.qb.k4(a, b, c, this.index);
    };
    FinancialSeries.prototype.eq = function () {
        return this.ri;
    };
    FinancialSeries.prototype.ql = function () {
        return 11;
    };
    FinancialSeries.prototype.b9 = function () {
        return 3;
    };
    FinancialSeries.prototype.s4 = function (a, b) {
        this.pp = a.aa;
        b.au();
    };
    FinancialSeries.prototype.s2 = function (a, b) {
        a.u();
    };
    FinancialSeries.prototype.e9 = function (a, b, c) {
        var d = _super.prototype.e9.call(this, a, b, c);
        var e = c;
        if (this.ck == null || this.ck.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.qb == null || this.qx == null || e.bx.b < 1 || this.qb.bh == null || this.qx.bh == null || this.qx.lv == this.qx.lu || this.qb.itemsSource == null || this.qb.le < 1) {
            e.bx.b = 0;
            d = false;
        }
        return d;
    };
    FinancialSeries.prototype.getViewInfo = function (a, b) {
        b = this.b0.bv;
        a = this.b0.bu;
        return {
            p0: a,
            p1: b
        };
    };
    FinancialSeries.prototype.r6 = function (a) {
        var b = 0;
        var c = a.bv;
        var d = a.bu;
        var e = this.getEffectiveViewport1(this.b0);
        if (!c.isEmpty && !d.isEmpty && this.qx != null) {
            var f = new ScalerParams(0, c, d, this.qx.cg, e);
            f.b = this.gc();
            b = this.qx.ei(this.qx.l5, f);
        }
        return b;
    };
    FinancialSeries.prototype.ky = function () {
        _super.prototype.ky.call(this);
        this.qf.v();
        this.qd.v();
        this.qh.v();
    };
    FinancialSeries.prototype.mi = function (a) {
        var _this = this;
        _super.prototype.mi.call(this, a);
        this.qs.bx.e(this.ft);
        if (this.cx(this.b0)) {
            return;
        }
        if (this.es) {
            if (this.cv()) {
                this.s4(this.qh, this.qs);
            }
            else {
                this.s4(this.qd, this.qs);
            }
            return;
        }
        if (this.eo(a)) {
            var b = this.qf;
            if (this.cv()) {
                if (this.ce.g) {
                    this.ce.t();
                }
                this.qf = this.qh;
                this.qh = b;
            }
            else {
                this.qf = this.qd;
                this.qd = b;
            }
            this.s2(this.qd, this.qs);
            if (this.e2) {
                this.ce.w();
                this.ce.r = truncate(this.gn());
                this.ce.b = this.cg != null ? this.cg : this.cf;
                this.qn.p(this.qf, this.qd, this.isVertical, this.qb, this.qx, this.qm, this.ql(), this.ca, this.b9(), function () { return _this.r6(_this.qs); }, this.qs.bu);
            }
            this.kt();
            this.mq();
            if (this.e2) {
                this.e1 = false;
                this.e0 = true;
            }
        }
        else {
            this.s2(this.qd, this.qs);
            this.s4(this.qd, this.qs);
        }
    };
    FinancialSeries.prototype.rk = function (a) {
        var e_1, _a;
        try {
            for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                switch (b) {
                    case "HighColumn":
                        if (this.q5 == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.q6 == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.q7 == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.q4 == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.q9 == null) {
                            return false;
                        }
                        break;
                }
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
        return true;
    };
    Object.defineProperty(FinancialSeries.prototype, "rl", {
        get: function () {
            return this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.rg = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.sz = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "rt", {
        get: function () {
            return this.rq();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._rq = function () {
        var a, b, _a, _b, c, e_2_1, d, e, f, g, h;
        var e_2, _c;
        return __generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    a = false;
                    if (!this.rg())
                        return [3 /*break*/, 8];
                    b = this.qo(0, this.ck.count);
                    this.sz(new FinancialEventArgs(0, this.ck.count, b, this.qp(b), this));
                    if (!(b.typicalColumn != null))
                        return [3 /*break*/, 8];
                    a = true;
                    _d.label = 1;
                case 1:
                    _d.trys.push([1, 6, 7, 8]);
                    _a = __values(fromEnum(b.typicalColumn)), _b = _a.next();
                    _d.label = 2;
                case 2:
                    if (!!_b.done)
                        return [3 /*break*/, 5];
                    c = _b.value;
                    return [4 /*yield*/, c];
                case 3:
                    _d.sent();
                    _d.label = 4;
                case 4:
                    _b = _a.next();
                    return [3 /*break*/, 2];
                case 5: return [3 /*break*/, 8];
                case 6:
                    e_2_1 = _d.sent();
                    e_2 = { error: e_2_1 };
                    return [3 /*break*/, 8];
                case 7:
                    try {
                        if (_b && !_b.done && (_c = _a.return))
                            _c.call(_a);
                    }
                    finally {
                        if (e_2)
                            throw e_2.error;
                    }
                    return [7 /*endfinally*/];
                case 8:
                    if (!!a)
                        return [3 /*break*/, 17];
                    if (!(this.rl && this.qb.i$b != null))
                        return [3 /*break*/, 13];
                    d = this.ck.count;
                    e = this.qb.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d))
                        return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.q5.item(e.item(f)) + this.q6.item(e.item(f)) + this.q4.item(e.item(f))) / 3];
                case 10:
                    _d.sent();
                    _d.label = 11;
                case 11:
                    ++f;
                    return [3 /*break*/, 9];
                case 12: return [3 /*break*/, 17];
                case 13:
                    g = this.ck.count;
                    h = 0;
                    _d.label = 14;
                case 14:
                    if (!(h < g))
                        return [3 /*break*/, 17];
                    return [4 /*yield*/, (this.q5.item(h) + this.q6.item(h) + this.q4.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.rq = function () {
        var _this = this;
        return toEnum(function () { return _this._rq(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "rs", {
        get: function () {
            return this.rp();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._rp = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.rl && this.qb.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.q5.count;
                    b = this.qb.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.r7(this.q5.item(b.item(0)) - this.q6.item(b.item(0)))];
                case 1:
                    _a.sent();
                    _a.label = 2;
                case 2:
                    c = 1;
                    _a.label = 3;
                case 3:
                    if (!(c < a))
                        return [3 /*break*/, 6];
                    return [4 /*yield*/, Math.max(this.r7(this.q5.item(b.item(c)) - this.q6.item(b.item(c))), Math.max(this.r7(Math.abs(this.q5.item(b.item(c)) - this.q4.item(b.item(c - 1)))), this.r7(Math.abs(this.q6.item(b.item(c)) - this.q4.item(b.item(c - 1))))))];
                case 4:
                    _a.sent();
                    _a.label = 5;
                case 5:
                    ++c;
                    return [3 /*break*/, 3];
                case 6: return [3 /*break*/, 13];
                case 7:
                    d = this.q5.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.r7(this.q5.item(0) - this.q6.item(0))];
                case 8:
                    _a.sent();
                    _a.label = 9;
                case 9:
                    e = 1;
                    _a.label = 10;
                case 10:
                    if (!(e < d))
                        return [3 /*break*/, 13];
                    return [4 /*yield*/, Math.max(this.r7(this.q5.item(e) - this.q6.item(e)), Math.max(this.r7(Math.abs(this.q5.item(e) - this.q4.item(e - 1))), this.r7(Math.abs(this.q6.item(e) - this.q4.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.rp = function () {
        var _this = this;
        return toEnum(function () { return _this._rp(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "rr", {
        get: function () {
            return this.ro();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._ro = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.rl && this.qb.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.q6.count;
                    b = this.qb.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.r7(this.q6.item(b.item(0)))];
                case 1:
                    _a.sent();
                    _a.label = 2;
                case 2:
                    c = 1;
                    _a.label = 3;
                case 3:
                    if (!(c < a))
                        return [3 /*break*/, 6];
                    return [4 /*yield*/, Math.min(this.r7(this.q6.item(b.item(c))), this.r7(this.q4.item(b.item(c - 1))))];
                case 4:
                    _a.sent();
                    _a.label = 5;
                case 5:
                    c++;
                    return [3 /*break*/, 3];
                case 6: return [3 /*break*/, 13];
                case 7:
                    d = this.q6.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.r7(this.q6.item(0))];
                case 8:
                    _a.sent();
                    _a.label = 9;
                case 9:
                    e = 1;
                    _a.label = 10;
                case 10:
                    if (!(e < d))
                        return [3 /*break*/, 13];
                    return [4 /*yield*/, Math.min(this.r7(this.q6.item(e)), this.r7(this.q4.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.ro = function () {
        var _this = this;
        return toEnum(function () { return _this._ro(); });
    };
    FinancialSeries.prototype.rv = function (a) {
        if (a == null) {
            return null;
        }
        if (this.rl && this.qb.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.qb.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.ru = function () {
        var a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.ck != null && !this.ra) {
            this.ra = true;
            var b = this.qo(0, this.ck.count);
            this.ra = false;
            var c = new FinancialEventArgs(0, this.ck.count, b, this.qp(b), this);
            this.typicalBasedOn(this, c);
            if (c.basedOn != null && c.basedOn.count > 0) {
                return c.basedOn;
            }
        }
        return a;
    };
    FinancialSeries.prototype.getOpenColumnAsArray = function () {
        if (this.q7 == null) {
            return null;
        }
        if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
            if (this.rz != null) {
                return this.rz.asArray();
            }
            var a = new List$1(Number_$type, 2, this.q7.count);
            var b = this.qb.i$b;
            var c = this.q7.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.rz = a;
            return this.rz.asArray();
        }
        else {
            return this.q7.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.q5 == null) {
            return null;
        }
        if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
            if (this.rx != null) {
                return this.rx.asArray();
            }
            var a = new List$1(Number_$type, 2, this.q5.count);
            var b = this.qb.i$b;
            var c = this.q5.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.rx = a;
            return this.rx.asArray();
        }
        else {
            return this.q5.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.q6 == null) {
            return null;
        }
        if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
            if (this.ry != null) {
                return this.ry.asArray();
            }
            var a = new List$1(Number_$type, 2, this.q6.count);
            var b = this.qb.i$b;
            var c = this.q6.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.ry = a;
            return this.ry.asArray();
        }
        else {
            return this.q6.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.q4 == null) {
            return null;
        }
        if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
            if (this.rw != null) {
                return this.rw.asArray();
            }
            var a = new List$1(Number_$type, 2, this.q4.count);
            var b = this.qb.i$b;
            var c = this.q4.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.rw = a;
            return this.rw.asArray();
        }
        else {
            return this.q4.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.q9 == null) {
            return null;
        }
        if (this.qb != null && typeCast(ISortingAxis_$type, this.qb) !== null) {
            if (this.r0 != null) {
                return this.r0.asArray();
            }
            var a = new List$1(Number_$type, 2, this.q9.count);
            var b = this.qb.i$b;
            var c = this.q9.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.r0 = a;
            return this.r0.asArray();
        }
        else {
            return this.q9.asArray();
        }
    };
    FinancialSeries.prototype.k0 = function (a, b, c, d) {
        _super.prototype.k0.call(this, a, b, c, d);
        if (this.qb == null || !(typeCast(ISortingAxis_$type, this.qb) !== null)) {
            return;
        }
        var e = this.qb.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.rz != null) {
                        this.rz.insert(f, this.q7.item(g));
                    }
                    if (this.rx != null) {
                        this.rx.insert(f, this.q5.item(g));
                    }
                    if (this.ry != null) {
                        this.ry.insert(f, this.q6.item(g));
                    }
                    if (this.rw != null) {
                        this.rw.insert(f, this.q4.item(g));
                    }
                    if (this.r0 != null) {
                        this.r0.insert(f, this.q9.item(g));
                    }
                }
                break;
            case 0:
                if (this.rz != null) {
                    this.rz.v(b, c);
                }
                if (this.rx != null) {
                    this.rx.v(b, c);
                }
                if (this.ry != null) {
                    this.ry.v(b, c);
                }
                if (this.rw != null) {
                    this.rw.v(b, c);
                }
                if (this.r0 != null) {
                    this.r0.v(b, c);
                }
                break;
            case 4:
                if (this.rz != null) {
                    this.rz = new List$1(Number_$type, 0);
                }
                if (this.rx != null) {
                    this.rx = new List$1(Number_$type, 0);
                }
                if (this.ry != null) {
                    this.ry = new List$1(Number_$type, 0);
                }
                if (this.rw != null) {
                    this.rw = new List$1(Number_$type, 0);
                }
                if (this.r0 != null) {
                    this.r0 = new List$1(Number_$type, 0);
                }
                break;
            case 3:
            case 2:
                for (var h = b; h < c; h++) {
                    var i = e._inner[h];
                    if (this.rz != null) {
                        this.rz._inner[h] = this.q7.item(i);
                    }
                    if (this.rx != null) {
                        this.rx._inner[h] = this.q5.item(i);
                    }
                    if (this.ry != null) {
                        this.ry._inner[h] = this.q6.item(i);
                    }
                    if (this.rw != null) {
                        this.rw._inner[h] = this.q4.item(i);
                    }
                    if (this.r0 != null) {
                        this.r0._inner[h] = this.q9.item(i);
                    }
                }
                break;
        }
        this.s5();
        this.m1();
    };
    FinancialSeries.prototype.qo = function (a, b) {
        var _this = this;
        var c = this.rv(this.q7);
        var d = this.rv(this.q4);
        var e = this.rv(this.q5);
        var f = this.rv(this.q6);
        var g = this.rv(this.q9);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.rt), _this.ru());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.rs), ((function () {
                var $ret = new List$1(String_$type, 0);
                $ret.add("HighColumn");
                $ret.add("LowColumn");
                $ret.add("CloseColumn");
                return $ret;
            })()));
            $ret.trueLow = new CalculatedColumn(1, new SafeEnumerable(_this.rr), ((function () {
                var $ret = new List$1(String_$type, 0);
                $ret.add("LowColumn");
                $ret.add("CloseColumn");
                return $ret;
            })()));
            $ret.openColumn = c;
            $ret.closeColumn = d;
            $ret.highColumn = e;
            $ret.lowColumn = f;
            $ret.volumeColumn = g;
            $ret.calculateFrom = a;
            $ret.calculateCount = b;
            $ret.minimumValue = NaN;
            $ret.maximumValue = NaN;
            $ret.count = _this.ck != null ? _this.ck.count : 0;
            return $ret;
        })());
        return h;
    };
    FinancialSeries.prototype.r7 = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.qp = function (a) {
        var _this = this;
        return ((function () {
            var $ret = new FinancialCalculationSupportingCalculations();
            $ret.a = new ColumnSupportingCalculation(1, TrendCalculators.b, new List$1(String_$type, 0));
            $ret.c = new ColumnSupportingCalculation(1, TrendCalculators.e, new List$1(String_$type, 0));
            $ret.d = new ColumnSupportingCalculation(1, TrendCalculators.f, new List$1(String_$type, 0));
            $ret.b = new ColumnSupportingCalculation(1, TrendCalculators.d, new List$1(String_$type, 0));
            $ret.h = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.volumeColumn, b.shortPeriod); }, ((function () {
                var $ret = new List$1(String_$type, 0);
                $ret.add("VolumeColumn");
                return $ret;
            })()));
            $ret.f = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.volumeColumn, b.longPeriod); }, ((function () {
                var $ret = new List$1(String_$type, 0);
                $ret.add("VolumeColumn");
                return $ret;
            })()));
            $ret.g = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.typicalColumn, b.shortPeriod); }, a.typicalColumn.basedOn);
            $ret.e = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.typicalColumn, b.longPeriod); }, a.typicalColumn.basedOn);
            $ret.k = Series.fe;
            $ret.j = Series.fd;
            $ret.i = runOn(_this, _this.r7);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.qb;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.mj = function (a, b) {
        _super.prototype.mj.call(this, a, b);
        if (!this.ez) {
            this.b0.a2(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.bz);
        this.b0.a2(b);
        c.bx.e(this.ft);
        if (this.cx(this.bz)) {
            return;
        }
        if (!this.et) {
            this.s2(this.qg, c);
        }
        this.et = false;
        this.s4(this.qg, c);
        this.ez = false;
    };
    FinancialSeries.prototype.mg = function (a, b, c, d, e) {
        _super.prototype.mg.call(this, a, b, c, d, e);
        var f = this.a6.a$h.item(d);
        var g = f;
        g.bx.e(this.ft);
        f.a1(c);
        if (this.cx(g)) {
            return;
        }
        if (this.qc == null) {
            this.qc = new CategoryFrame(3);
        }
        this.qc.u();
        this.s2(this.qc, g);
        this.s4(this.qc, g);
    };
    FinancialSeries.prototype.an = function (a) {
        if (this.qb == a) {
            return this.qx;
        }
        if (this.qx == a) {
            return this.qb;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.qb);
        return b != null ? b.preferredCategoryMode(this) : this.qj;
    };
    Object.defineProperty(FinancialSeries.prototype, "qj", {
        get: function () {
            return this.qi;
        },
        set: function (a) {
            var b = this.qj;
            if (a != b) {
                this.qi = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.qj));
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.get_d3 = function () {
        return true;
    };
    FinancialSeries.prototype.mm = function (a, b) {
        _super.prototype.mm.call(this, a, b);
        this.th = a;
    };
    FinancialSeries.prototype.s5 = function () {
        this.f1 = this.q4 == null || this.q4.count == 0 ? NaN : this.q4.item(this.q4.count - 1);
    };
    FinancialSeries.prototype.hv = function (a) {
        if (this.qw != null && a != null) {
            if (this.qy == null || this.qy.propertyName != this.qw.dateTimeMemberPath) {
                this.qy = new FastReflectionHelper(false, this.qw.dateTimeMemberPath);
            }
            var b = this.qy.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.qw.itemLabelFormat());
            }
        }
        return _super.prototype.hv.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:sf:s6', [2, null], 'HighMemberPath:si:s7', [2, null], 'IsCustomCategoryStyleAllowed:rh:s8', [0, false], 'IsTransitionInEnabled:ri:s9', [0, false], 'LowMemberPath:sn:ta', [2, null], 'NegativeBrush:th:tb', [Brush.$, null], 'OpenMemberPath:sr:tc', [2, null], 'TransitionInMode:qm:td', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:sv:te', [2, null], 'XAxis:qb:tf', [CategoryAxisBase.$, null], 'YAxis:qx:tg', [NumericYAxis.$, null]]);
    return FinancialSeries;
}(Series));
export { FinancialSeries };
/**
 * @hidden
 */
var FinancialCalculationSupportingCalculations = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialCalculationSupportingCalculations, _super);
    function FinancialCalculationSupportingCalculations() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = null;
        _this.c = null;
        _this.d = null;
        _this.b = null;
        _this.h = null;
        _this.f = null;
        _this.g = null;
        _this.e = null;
        _this.k = null;
        _this.j = null;
        _this.i = null;
        return _this;
    }
    FinancialCalculationSupportingCalculations.$t = markType(FinancialCalculationSupportingCalculations, 'FinancialCalculationSupportingCalculations');
    return FinancialCalculationSupportingCalculations;
}(Base));
export { FinancialCalculationSupportingCalculations };
/**
 * @hidden
 */
var DataSourceSupportingCalculation = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataSourceSupportingCalculation, _super);
    function DataSourceSupportingCalculation(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = this;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0:
                {
                    var c = _rest[0];
                    _this = _super.call(this, Delegate_$type, 0, c) || this;
                }
                break;
            case 1:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    _this = _super.call(this, Delegate_$type, 1, c, d) || this;
                }
                break;
        }
        return _this;
    }
    DataSourceSupportingCalculation.$t = markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', SupportingCalculation$1.$.specialize(Delegate_$type));
    return DataSourceSupportingCalculation;
}(SupportingCalculation$1));
export { DataSourceSupportingCalculation };
/**
 * @hidden
 */
var FinancialCalculationDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialCalculationDataSource, _super);
    function FinancialCalculationDataSource() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._openColumn = null;
        _this._closeColumn = null;
        _this._highColumn = null;
        _this._lowColumn = null;
        _this._volumeColumn = null;
        _this._indicatorColumn = null;
        _this._typicalColumn = null;
        _this._trueRange = null;
        _this._trueLow = null;
        _this._period = 0;
        _this._shortPeriod = 0;
        _this._longPeriod = 0;
        _this._count = 0;
        _this._calculateFrom = 0;
        _this._calculateCount = 0;
        _this._multiplier = 0;
        _this._minimumValue = 0;
        _this._maximumValue = 0;
        _this._specifiesRange = false;
        _this._series = null;
        return _this;
    }
    Object.defineProperty(FinancialCalculationDataSource.prototype, "openColumn", {
        get: function () {
            return this._openColumn;
        },
        set: function (a) {
            this._openColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "closeColumn", {
        get: function () {
            return this._closeColumn;
        },
        set: function (a) {
            this._closeColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "highColumn", {
        get: function () {
            return this._highColumn;
        },
        set: function (a) {
            this._highColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "lowColumn", {
        get: function () {
            return this._lowColumn;
        },
        set: function (a) {
            this._lowColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "volumeColumn", {
        get: function () {
            return this._volumeColumn;
        },
        set: function (a) {
            this._volumeColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "indicatorColumn", {
        get: function () {
            return this._indicatorColumn;
        },
        set: function (a) {
            this._indicatorColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "typicalColumn", {
        get: function () {
            return this._typicalColumn;
        },
        set: function (a) {
            this._typicalColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueRange", {
        get: function () {
            return this._trueRange;
        },
        set: function (a) {
            this._trueRange = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueLow", {
        get: function () {
            return this._trueLow;
        },
        set: function (a) {
            this._trueLow = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "period", {
        get: function () {
            return this._period;
        },
        set: function (a) {
            this._period = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "shortPeriod", {
        get: function () {
            return this._shortPeriod;
        },
        set: function (a) {
            this._shortPeriod = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "longPeriod", {
        get: function () {
            return this._longPeriod;
        },
        set: function (a) {
            this._longPeriod = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateFrom", {
        get: function () {
            return this._calculateFrom;
        },
        set: function (a) {
            this._calculateFrom = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateCount", {
        get: function () {
            return this._calculateCount;
        },
        set: function (a) {
            this._calculateCount = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "multiplier", {
        get: function () {
            return this._multiplier;
        },
        set: function (a) {
            this._multiplier = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "minimumValue", {
        get: function () {
            return this._minimumValue;
        },
        set: function (a) {
            this._minimumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "maximumValue", {
        get: function () {
            return this._maximumValue;
        },
        set: function (a) {
            this._maximumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "specifiesRange", {
        get: function () {
            return this._specifiesRange;
        },
        set: function (a) {
            this._specifiesRange = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    FinancialCalculationDataSource.$t = markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
    return FinancialCalculationDataSource;
}(Base));
export { FinancialCalculationDataSource };
/**
 * @hidden
 */
var FinancialSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialSeriesView, _super);
    function FinancialSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.bz = null;
        _this.bx = null;
        _this.b1 = 0;
        _this.b1 = -1;
        _this.bz = a;
        _this.bx = _this.by();
        return _this;
    }
    FinancialSeriesView.prototype.b0 = function (a) {
        if (this.b1 != a.t) {
            return true;
        }
        return false;
    };
    FinancialSeriesView.prototype.b2 = function (a) {
        this.b1 = a.t;
    };
    FinancialSeriesView.prototype.as = function () {
        _super.prototype.as.call(this);
        if (!this.q) {
        }
    };
    FinancialSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.bz.qb.cd) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.bz.qb.fz != null) {
            a += "<span>${item." + this.bz.qb.fz + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        var b = this.e.a6.a$r(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        var c = new SRProvider(this.w);
        var d = c.b1("financialSeries_Open");
        var e = c.b1("financialSeries_High");
        var f = c.b1("financialSeries_Low");
        var g = c.b1("financialSeries_Close");
        d = stringIsNullOrEmpty(d) ? "Open" : d;
        e = stringIsNullOrEmpty(e) ? "High" : e;
        f = stringIsNullOrEmpty(f) ? "Low" : f;
        g = stringIsNullOrEmpty(g) ? "Close" : g;
        a += ">" + this.bz.title + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bz.sr + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bz.si + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bz.sn + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bz.sf + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bz.sv)) {
            var h = c.b1("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bz.sv + "}</td></tr>";
        }
        a += "</table></div>";
        return a;
    };
    FinancialSeriesView.prototype.af = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.pa = a;
        this.e.gw = 5;
        this.e.gx = 2;
        this.e.gy = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
