/*
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 { EventArgs, Base, markType, typeCast, Point_$type, String_$type, runOn, Number_$type, enumGetBox, fromEnum, toEnum, Date_$type, markDep, Delegate_$type } from "igniteui-react-core";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-react-core";
import { IFastItemColumn$1_$type } from "igniteui-react-core";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-react-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-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-react-core";
import { List$1 } from "igniteui-react-core";
import { Dictionary$2 } from "igniteui-react-core";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-react-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-react-core";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { dateToStringFormat } from "igniteui-react-core";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
/**
 * @hidden
 */
var FinancialEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__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: true,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "dataSource", {
        get: function () {
            return this._dataSource;
        },
        set: function (a) {
            this._dataSource = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "supportingCalculations", {
        get: function () {
            return this._supportingCalculations;
        },
        set: function (a) {
            this._supportingCalculations = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "basedOn", {
        get: function () {
            return this._basedOn;
        },
        set: function (a) {
            this._basedOn = a;
        },
        enumerable: true,
        configurable: true
    });
    FinancialEventArgs.$t = markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
    return FinancialEventArgs;
}(EventArgs));
export { FinancialEventArgs };
/**
 * @hidden
 */
var FinancialBucketCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__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.fq;
        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.oh == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.bz.oh != null) ? this.a.bz.oh.ca : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.bz.ny(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.bz.oh);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.bz.oh.d2(g.left, f));
            var j = Math.ceil(this.a.bz.oh.d2(g.right, f));
            if (this.a.bz.oh.ca) {
                j = Math.ceil(this.a.bz.oh.d2(g.left, f));
                i = Math.floor(this.a.bz.oh.d2(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) {
    tslib_1.__extends(FinancialSeries, _super);
    function FinancialSeries() {
        var _this = _super.call(this) || this;
        _this.o7 = null;
        _this.o5 = null;
        _this.o6 = null;
        _this.o4 = null;
        _this.o8 = null;
        _this.ph = false;
        _this.assigningCategoryStyle = null;
        _this.op = null;
        _this.pr = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.ps = new Dictionary$2(String_$type, String_$type, 0);
        _this.pg = false;
        _this.o0 = null;
        _this.ok = null;
        _this.om = null;
        _this.oj = null;
        _this.os = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.pf = false;
        _this.p4 = null;
        _this.p2 = null;
        _this.p3 = null;
        _this.p1 = null;
        _this.p5 = null;
        _this.ol = null;
        _this.oi = null;
        _this.on = 0;
        _this.o1 = null;
        _this.o3 = null;
        _this.op = new CategorySeriesRenderManager();
        _this.ph = false;
        _this.os = new CategoryTransitionSourceFramePreparer();
        _this.ol = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.oo = 0;
        return _this;
    }
    FinancialSeries.prototype.kk = function (a) {
        _super.prototype.kk.call(this, a);
        this.ox = a;
    };
    FinancialSeries.prototype.get_c6 = function () {
        return true;
    };
    FinancialSeries.prototype.ag = function () {
        return [this.oh, this.o2];
    };
    FinancialSeries.prototype.gt = function (a, b) {
        var c = this.ic(b);
        if (c == FinancialSeries.$$p[6]) {
            return this.gu(a, b, this.qw);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.gu(a, b, this.qn);
        }
        if (c == FinancialSeries.$$p[4]) {
            return this.gu(a, b, this.qs);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.gu(a, b, this.qk);
        }
        if (c == FinancialSeries.$$p[8]) {
            return this.gu(a, b, this.q0);
        }
        return _super.prototype.gt.call(this, a, b);
    };
    FinancialSeries.prototype.qg = function () {
        return 2;
    };
    FinancialSeries.prototype.qe = function () {
        return 4;
    };
    FinancialSeries.prototype.ah = function (a) {
        var b = this.aj(this.oh, this.oj.f, this.qd(this.bs), this.qf(this.bs), this.nw(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.qg();
        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.oh, this.oj.f, this.qd(this.bs), this.qf(this.bs), this.nw(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.nh = function () {
        return this.rm;
    };
    FinancialSeries.prototype.ji = function () {
        _super.prototype.ji.call(this);
        this.oh = null;
        this.o2 = null;
    };
    Object.defineProperty(FinancialSeries.prototype, "pc", {
        get: function () {
            return this.o7;
        },
        set: function (a) {
            if (this.o7 != a) {
                var b = this.o7;
                this.o7 = a;
                this.raisePropertyChanged("OpenColumn", b, this.o7);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "pa", {
        get: function () {
            return this.o5;
        },
        set: function (a) {
            if (this.o5 != a) {
                var b = this.o5;
                this.o5 = a;
                this.raisePropertyChanged("HighColumn", b, this.o5);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "pb", {
        get: function () {
            return this.o6;
        },
        set: function (a) {
            if (this.o6 != a) {
                var b = this.o6;
                this.o6 = a;
                this.raisePropertyChanged("LowColumn", b, this.o6);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "o9", {
        get: function () {
            return this.o4;
        },
        set: function (a) {
            if (this.o4 != a) {
                var b = this.o4;
                this.o4 = a;
                this.raisePropertyChanged("CloseColumn", b, this.o4);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "pe", {
        get: function () {
            return this.o8;
        },
        set: function (a) {
            if (this.o8 != a) {
                var b = this.o8;
                this.o8 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.o8);
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.po = function () {
        return (this.assigningCategoryStyle != null && this.ph) || this.be != 1;
    };
    FinancialSeries.prototype.q8 = function (a) {
        if (this.assigningCategoryStyle != null && this.ph) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.q6 = function (a, b, c, d, e, f) {
        var g = this.be != 1;
        this.op.a1(this.op.b, d.cf, a, b, c, d, e, f, false);
        this.op.ab(this.es);
        var h = this.op.aw;
        var i = null;
        var j = this.cd;
        if (g && this.b6 != null) {
            i = this.b6.az.getHighlightingInfo(this, j, h.o, h.n, false);
            h.b = i;
        }
        h.f = f;
        this.q8(h);
        this.op.z(this, i, f, g, b < 0);
    };
    FinancialSeries.prototype.p6 = function (a) {
        return this.e6(a, this.oh);
    };
    FinancialSeries.prototype.gf = function (a, b) {
        return this.gg(a, b, this.oh, runOn(this, this.p6), new FinancialValueList(this.pc, this.pa, this.pb, this.o9, this.pe));
    };
    FinancialSeries.prototype.gd = function (a, b) {
        return this.ge(a, b, this.oh, runOn(this, this.p6), new FinancialValueList(this.pc, this.pa, this.pb, this.o9, this.pe));
    };
    FinancialSeries.prototype.e2 = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.oh.j8;
        return this.e3(a, b, this.oh, d, e, f, runOn(this, this.p6));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.oh.getCategorySize(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs));
    };
    FinancialSeries.prototype.nt = function (a, b, c) {
        return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, null, null, null);
    };
    FinancialSeries.prototype.fh = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bs);
        var e = this.p7(this.bs.bv, this.bs.bu, d);
        var f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
        return this.fj(new FinancialValueList(this.pc, this.pa, this.pb, this.o9, this.pe), a, this.oh, f, e, runOn(this, this.p6), b, c);
    };
    FinancialSeries.prototype.fd = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bs);
        var e = this.p7(this.bs.bv, this.bs.bu, d);
        var f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
        return this.fj(this.pa, a, this.oh, f, e, runOn(this, this.p6), b, c);
    };
    FinancialSeries.prototype.ff = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bs);
        var e = this.p7(this.bs.bv, this.bs.bu, d);
        var f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
        return this.fj(this.pb, a, this.oh, f, e, runOn(this, this.p6), b, c);
    };
    FinancialSeries.prototype.p8 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bs);
        var e = this.p7(this.bs.bv, this.bs.bu, d);
        var f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
        return this.fj(this.o9, a, this.oh, f, e, runOn(this, this.p6), b, c);
    };
    FinancialSeries.prototype.p9 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bs);
        var e = this.p7(this.bs.bv, this.bs.bu, d);
        var f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
        return this.fj(this.pc, a, this.oh, f, e, runOn(this, this.p6), b, c);
    };
    FinancialSeries.prototype.qa = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bs);
        var e = this.p7(this.bs.bv, this.bs.bu, d);
        var f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
        return this.fj(this.pe, a, this.oh, f, e, runOn(this, this.p6), b, c);
    };
    FinancialSeries.prototype.np = function (a, b, c) {
        var _this = this;
        return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, runOn(this, this.fd), function (d, e) { return _this.gg(d, e, _this.oh, runOn(_this, _this.p6), _this.pa); }, function (d, e) { return _this.ge(d, e, _this.oh, runOn(_this, _this.p6), _this.pa); });
    };
    FinancialSeries.prototype.nr = function (a, b, c) {
        var _this = this;
        return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, runOn(this, this.ff), function (d, e) { return _this.gg(d, e, _this.oh, runOn(_this, _this.p6), _this.pb); }, function (d, e) { return _this.ge(d, e, _this.oh, runOn(_this, _this.p6), _this.pb); });
    };
    FinancialSeries.prototype.ro = function (a, b, c) {
        var _this = this;
        return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, runOn(this, this.p9), function (d, e) { return _this.gg(d, e, _this.oh, runOn(_this, _this.p6), _this.pc); }, function (d, e) { return _this.ge(d, e, _this.oh, runOn(_this, _this.p6), _this.pc); });
    };
    FinancialSeries.prototype.rn = function (a, b, c) {
        var _this = this;
        return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, runOn(this, this.p8), function (d, e) { return _this.gg(d, e, _this.oh, runOn(_this, _this.p6), _this.o9); }, function (d, e) { return _this.ge(d, e, _this.oh, runOn(_this, _this.p6), _this.o9); });
    };
    FinancialSeries.prototype.rp = function (a, b, c) {
        var _this = this;
        return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, runOn(this, this.qa), function (d, e) { return _this.gg(d, e, _this.oh, runOn(_this, _this.p6), _this.pe); }, function (d, e) { return _this.ge(d, e, _this.oh, runOn(_this, _this.p6), _this.pe); });
    };
    FinancialSeries.prototype.j2 = function () {
        _super.prototype.j2.call(this);
        if (this.oh != null) {
            this.oh.hc(false);
        }
        if (this.o2 != null) {
            this.o2.hc(false);
        }
    };
    FinancialSeries.prototype.lo = function (a, b) {
        this.ox.bx.e(this.fq);
        this.k3(false);
    };
    FinancialSeries.prototype.ln = function (a, b) {
        if (this.d3 && this.fw < 0.05) {
            this.d4 = true;
        }
        this.ox.bx.e(this.fq);
        this.k3(false);
    };
    FinancialSeries.prototype.pd = function (a, b, c) {
        var d = this.ca(b);
        this.pr.addItem(d, b);
        this.ps.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.q5 = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.pr.item(b);
        this.ps.removeItem(c);
        this.pr.removeItem(b);
    };
    FinancialSeries.prototype.kp = function (a, b, c, d) {
        _super.prototype.kp.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.b1 != null && this.b6 != null) {
                    this.ox.bx.e(this.fq);
                    this.k3(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.oh != null) {
                        this.oh.bx(this);
                    }
                    if (this.o2 != null) {
                        this.o2.bx(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.oh != null) {
                        this.oh.ck(this);
                    }
                    if (this.o2 != null) {
                        this.o2.ck(this);
                    }
                }
                this.ox.bx.e(this.fq);
                this.k3(false);
                break;
            case "FastItemsSource":
                this.pg = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.q5(typeCast(IFastItemsSource_$type, c), this.pc);
                    this.q5(typeCast(IFastItemsSource_$type, c), this.pa);
                    this.q5(typeCast(IFastItemsSource_$type, c), this.pb);
                    this.q5(typeCast(IFastItemsSource_$type, c), this.o9);
                    this.q5(typeCast(IFastItemsSource_$type, c), this.pe);
                    this.pc = null;
                    this.pa = null;
                    this.pb = null;
                    this.o9 = null;
                    this.pe = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.qw) == false) {
                        this.pc = this.pd(typeCast(IFastItemsSource_$type, d), this.qw, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.qn) == false) {
                        this.pa = this.pd(typeCast(IFastItemsSource_$type, d), this.qn, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.qs) == false) {
                        this.pb = this.pd(typeCast(IFastItemsSource_$type, d), this.qs, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.qk) == false) {
                        this.o9 = this.pd(typeCast(IFastItemsSource_$type, d), this.qk, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.q0) == false) {
                        this.pe = this.pd(typeCast(IFastItemsSource_$type, d), this.q0, "VolumeColumn");
                    }
                }
                this.pg = false;
                if (this.o2 != null && !this.o2.cn()) {
                    this.ox.bx.e(this.fq);
                    this.k3(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.cd != null) {
                    this.q5(this.cd, this.pc);
                    this.pc = this.pd(this.cd, this.qw, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.o2 != null && !this.o2.cn() && !this.pg) {
                    this.ox.bx.e(this.fq);
                    this.k3(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.cd != null) {
                    this.q5(this.cd, this.pa);
                    this.pa = this.pd(this.cd, this.qn, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.o2 != null && !this.o2.cn() && !this.pg) {
                    this.ox.bx.e(this.fq);
                    this.k3(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.cd != null) {
                    this.q5(this.cd, this.pb);
                    this.pb = this.pd(this.cd, this.qs, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.o2 != null && !this.o2.cn() && !this.pg) {
                    this.ox.bx.e(this.fq);
                    this.k3(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.cd != null) {
                    this.q5(this.cd, this.o9);
                    this.o9 = this.pd(this.cd, this.qk, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.o2 != null && !this.o2.cn() && !this.pg) {
                    this.ox.bx.e(this.fq);
                    this.k3(false);
                }
                this.ra();
                break;
            case FinancialSeries.$$p[8]:
                if (this.cd != null) {
                    this.q5(this.cd, this.pe);
                    this.pe = this.pd(this.cd, this.q0, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.o2 != null && !this.o2.cn() && !this.pg) {
                    this.ox.bx.e(this.fq);
                    this.k3(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bx(this);
                }
                if (d != null) {
                    d.ck(this);
                }
                this.ox.bx.e(this.fq);
                this.k3(false);
                this.ka();
                this.o1 = typeCast(ITimeRangeSelectorAxis_$type, this.oh);
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bx(this);
                }
                if (d != null) {
                    d.ck(this);
                }
                this.ox.bx.e(this.fq);
                if (this.o2 != null) {
                    this.o2.cn();
                }
                {
                    this.k3(false);
                }
                this.ka();
                break;
            case "TransitionProgress":
                this.om.c(this.fw, this.ok, this.oj);
                if (this.cp(this.bs)) {
                    return;
                }
                if (this.fw == 1) {
                    this.oj.v();
                    this.q9(this.oj, this.ox);
                    if (this.d3) {
                        this.d3 = false;
                        this.jm();
                        this.b7.r = truncate(this.fk());
                        this.b7.b = this.b8;
                    }
                }
                else {
                    this.q9(this.om, this.ox);
                }
                if (this.b6 != null) {
                    this.b6.k7(this);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.k3(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.ph = this.pk();
                this.k3(false);
                break;
            case "CategoryMode":
                if (this.oh != null) {
                    this.oh.kw(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.pj = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.pi = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b7) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.oa = function (a, b, c) {
        if (b < a || a < 0 || a > this.cd.count || b < 0 || b > this.cd.count || c == null) {
            return null;
        }
        var d = new Array((b - a) + 1);
        var e = c.cf;
        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.cd.item(g);
        }
        return d;
    };
    FinancialSeries.prototype.qd = function (a) {
        return a.bx.b;
    };
    FinancialSeries.prototype.qf = function (a) {
        return a.bx.c;
    };
    FinancialSeries.prototype.n9 = function (a, b) {
        return this.oa(a, b, this.o2);
    };
    FinancialSeries.prototype.get_da = function () {
        return true;
    };
    FinancialSeries.prototype.jj = function () {
        _super.prototype.jj.call(this);
        this.o0 = null;
    };
    FinancialSeries.prototype.au = function (a, b, c) {
        if (this.cu && this.dl(this.be) && !c) {
            var d = this.oz(a, b, this.o0);
            this.o0 = d;
            return d;
        }
        else {
            var e = this.oy(a, b, this.o0);
            this.o0 = e;
            return e;
        }
    };
    FinancialSeries.prototype.qh = function (a) {
        var b = this.oj;
        if (this.cn()) {
            b = this.om;
        }
        var c = this.bs.bu;
        var d = this.bs.bv;
        var e = this.oh;
        var f = 0;
        if (e.ch) {
            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.oz = function (a, b, c) {
        var d = this.cd.count;
        var e = this.ox.bx.c;
        var f = this.ox.bx.d;
        var g = this.ox.bx.b;
        var h = this.oh;
        var i = -1;
        var j = -1;
        if (h.cf) {
            var k = this.oj;
            if (this.cn()) {
                k = this.om;
            }
            var l = this.qh(b);
            i = l;
            j = l;
        }
        else {
            var m = this.f9(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.oy = function (a, b, c) {
        var d = new HighlightingInfo();
        d.b = this;
        d.h = 0;
        d.g = this.cd.count - 1;
        d.d = true;
        if (c != null && c.h == d.h && c.g == d.g) {
            return c;
        }
        return d;
    };
    FinancialSeries.prototype.pk = function () {
        return this.pm;
    };
    FinancialSeries.prototype.e4 = function (a) {
        var b = this.bs.bv;
        var c = this.bs.bu;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.oh != null) {
            var e = this.getEffectiveViewport1(this.bs);
            var f = new ScalerParams(0, b, c, this.oh.ca, e);
            var g = this.ny(this.bs);
            var h = this.oh.d2(g.left, f);
            var i = this.oh.d2(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.oh.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.f9 = function (a) {
        return truncate(Math.round(this.e4(a)));
    };
    FinancialSeries.prototype.get_dg = function () {
        return typeCast(ISortingAxis_$type, this.oh) !== null;
    };
    FinancialSeries.prototype.aq = function () {
        return this.oh;
    };
    FinancialSeries.prototype.gb = function (a) {
        var b = this.bs.bv;
        var c = this.bs.bu;
        var d = this.getEffectiveViewport1(this.bs);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        var e = new Rect(0, 0, 0, 1, 1);
        var f = new ScalerParams(0, b, c, this.oh.ca, d);
        var g = typeCast(ISortingAxis_$type, this.oh);
        var h = this.ny(this.bs);
        var i = h.left;
        var j = h.right;
        var k = this.no(a).x;
        var l = this.oh.d2(k, f);
        var m = this.oh.d2(i, f);
        var n = this.oh.d2(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.gq = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.oh) !== null) {
            b = this.gb(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.f9(a);
        }
        return b >= 0 && this.cd != null && b < this.cd.count ? this.cd.item(b) : null;
    };
    FinancialSeries.prototype.p7 = function (a, b, c) {
        if (this.oh == null) {
            return 0;
        }
        return this.oh.j1(a, b, c, this.gi);
    };
    FinancialSeries.prototype.dt = function () {
        return this.pn;
    };
    FinancialSeries.prototype.oq = function () {
        return 11;
    };
    FinancialSeries.prototype.b2 = function () {
        return 3;
    };
    FinancialSeries.prototype.q9 = function (a, b) {
        this.nx = a.aa;
        b.au();
    };
    FinancialSeries.prototype.q7 = function (a, b) {
        a.u();
    };
    FinancialSeries.prototype.ec = function (a, b, c) {
        var d = _super.prototype.ec.call(this, a, b, c);
        var e = c;
        if (this.cd == null || this.cd.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.oh == null || this.o2 == null || e.bx.b < 1 || this.oh.bh == null || this.o2.bh == null || this.o2.kd == this.o2.kc || this.oh.itemsSource == null || this.oh.j8 < 1) {
            e.bx.b = 0;
            d = false;
        }
        return d;
    };
    FinancialSeries.prototype.getViewInfo = function (a, b) {
        b = this.bs.bv;
        a = this.bs.bu;
        return {
            p0: a,
            p1: b
        };
    };
    FinancialSeries.prototype.qb = function (a) {
        var b = 0;
        var c = a.bv;
        var d = a.bu;
        var e = this.getEffectiveViewport1(this.bs);
        if (!c.isEmpty && !d.isEmpty && this.o2 != null) {
            var f = new ScalerParams(0, c, d, this.o2.ca, e);
            f.b = this.fa();
            b = this.o2.dz(this.o2.kn, f);
        }
        return b;
    };
    FinancialSeries.prototype.jm = function () {
        _super.prototype.jm.call(this);
        this.ok.v();
        this.oj.v();
        this.om.v();
    };
    FinancialSeries.prototype.k4 = function (a) {
        var _this = this;
        _super.prototype.k4.call(this, a);
        this.ox.bx.e(this.fq);
        if (this.cp(this.bs)) {
            return;
        }
        if (this.dv) {
            if (this.cn()) {
                this.q9(this.om, this.ox);
            }
            else {
                this.q9(this.oj, this.ox);
            }
            return;
        }
        if (this.dr(a)) {
            var b = this.ok;
            if (this.cn()) {
                if (this.b7.g) {
                    this.b7.t();
                }
                this.ok = this.om;
                this.om = b;
            }
            else {
                this.ok = this.oj;
                this.oj = b;
            }
            this.q7(this.oj, this.ox);
            if (this.d5) {
                this.b7.w();
                this.b7.r = truncate(this.fl());
                this.b7.b = this.b9 != null ? this.b9 : this.b8;
                this.os.p(this.ok, this.oj, this.isVertical, this.oh, this.o2, this.or, this.oq(), this.b3, this.b2(), function () { return _this.qb(_this.ox); }, this.ox.bu);
            }
            this.jh();
            this.lb();
            if (this.d5) {
                this.d4 = false;
                this.d3 = true;
            }
        }
        else {
            this.q7(this.oj, this.ox);
            this.q9(this.oj, this.ox);
        }
    };
    FinancialSeries.prototype.pp = function (a) {
        var e_1, _a;
        try {
            for (var _b = tslib_1.__values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                switch (b) {
                    case "HighColumn":
                        if (this.pa == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.pb == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.pc == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.o9 == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.pe == 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, "pq", {
        get: function () {
            return this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.pl = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.q4 = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "py", {
        get: function () {
            return this.pv();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._pv = function () {
        var a, b, _a, _b, c, e_2_1, d, e, f, g, h;
        var e_2, _c;
        return tslib_1.__generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    a = false;
                    if (!this.pl())
                        return [3 /*break*/, 8];
                    b = this.ot(0, this.cd.count);
                    this.q4(new FinancialEventArgs(0, this.cd.count, b, this.ou(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 = tslib_1.__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.pq && this.oh.i$b != null))
                        return [3 /*break*/, 13];
                    d = this.cd.count;
                    e = this.oh.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d))
                        return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.pa.item(e.item(f)) + this.pb.item(e.item(f)) + this.o9.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.cd.count;
                    h = 0;
                    _d.label = 14;
                case 14:
                    if (!(h < g))
                        return [3 /*break*/, 17];
                    return [4 /*yield*/, (this.pa.item(h) + this.pb.item(h) + this.o9.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.pv = function () {
        var _this = this;
        return toEnum(function () { return _this._pv(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "px", {
        get: function () {
            return this.pu();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._pu = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.pq && this.oh.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.pa.count;
                    b = this.oh.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.qc(this.pa.item(b.item(0)) - this.pb.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.qc(this.pa.item(b.item(c)) - this.pb.item(b.item(c))), Math.max(this.qc(Math.abs(this.pa.item(b.item(c)) - this.o9.item(b.item(c - 1)))), this.qc(Math.abs(this.pb.item(b.item(c)) - this.o9.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.pa.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.qc(this.pa.item(0) - this.pb.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.qc(this.pa.item(e) - this.pb.item(e)), Math.max(this.qc(Math.abs(this.pa.item(e) - this.o9.item(e - 1))), this.qc(Math.abs(this.pb.item(e) - this.o9.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.pu = function () {
        var _this = this;
        return toEnum(function () { return _this._pu(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "pw", {
        get: function () {
            return this.pt();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._pt = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.pq && this.oh.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.pb.count;
                    b = this.oh.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.qc(this.pb.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.qc(this.pb.item(b.item(c))), this.qc(this.o9.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.pb.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.qc(this.pb.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.qc(this.pb.item(e)), this.qc(this.o9.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.pt = function () {
        var _this = this;
        return toEnum(function () { return _this._pt(); });
    };
    FinancialSeries.prototype.p0 = function (a) {
        if (a == null) {
            return null;
        }
        if (this.pq && this.oh.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.oh.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.pz = function () {
        var a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.cd != null && !this.pf) {
            this.pf = true;
            var b = this.ot(0, this.cd.count);
            this.pf = false;
            var c = new FinancialEventArgs(0, this.cd.count, b, this.ou(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.pc == null) {
            return null;
        }
        if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
            if (this.p4 != null) {
                return this.p4.asArray();
            }
            var a = new List$1(Number_$type, 2, this.pc.count);
            var b = this.oh.i$b;
            var c = this.pc.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.p4 = a;
            return this.p4.asArray();
        }
        else {
            return this.pc.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.pa == null) {
            return null;
        }
        if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
            if (this.p2 != null) {
                return this.p2.asArray();
            }
            var a = new List$1(Number_$type, 2, this.pa.count);
            var b = this.oh.i$b;
            var c = this.pa.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.p2 = a;
            return this.p2.asArray();
        }
        else {
            return this.pa.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.pb == null) {
            return null;
        }
        if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
            if (this.p3 != null) {
                return this.p3.asArray();
            }
            var a = new List$1(Number_$type, 2, this.pb.count);
            var b = this.oh.i$b;
            var c = this.pb.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.p3 = a;
            return this.p3.asArray();
        }
        else {
            return this.pb.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.o9 == null) {
            return null;
        }
        if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
            if (this.p1 != null) {
                return this.p1.asArray();
            }
            var a = new List$1(Number_$type, 2, this.o9.count);
            var b = this.oh.i$b;
            var c = this.o9.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.p1 = a;
            return this.p1.asArray();
        }
        else {
            return this.o9.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.pe == null) {
            return null;
        }
        if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
            if (this.p5 != null) {
                return this.p5.asArray();
            }
            var a = new List$1(Number_$type, 2, this.pe.count);
            var b = this.oh.i$b;
            var c = this.pe.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.p5 = a;
            return this.p5.asArray();
        }
        else {
            return this.pe.asArray();
        }
    };
    FinancialSeries.prototype.jo = function (a, b, c, d) {
        _super.prototype.jo.call(this, a, b, c, d);
        if (this.oh == null || !(typeCast(ISortingAxis_$type, this.oh) !== null)) {
            return;
        }
        var e = this.oh.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.p4 != null) {
                        this.p4.insert(f, this.pc.item(g));
                    }
                    if (this.p2 != null) {
                        this.p2.insert(f, this.pa.item(g));
                    }
                    if (this.p3 != null) {
                        this.p3.insert(f, this.pb.item(g));
                    }
                    if (this.p1 != null) {
                        this.p1.insert(f, this.o9.item(g));
                    }
                    if (this.p5 != null) {
                        this.p5.insert(f, this.pe.item(g));
                    }
                }
                break;
            case 0:
                if (this.p4 != null) {
                    this.p4.v(b, c);
                }
                if (this.p2 != null) {
                    this.p2.v(b, c);
                }
                if (this.p3 != null) {
                    this.p3.v(b, c);
                }
                if (this.p1 != null) {
                    this.p1.v(b, c);
                }
                if (this.p5 != null) {
                    this.p5.v(b, c);
                }
                break;
            case 4:
                if (this.p4 != null) {
                    this.p4 = new List$1(Number_$type, 0);
                }
                if (this.p2 != null) {
                    this.p2 = new List$1(Number_$type, 0);
                }
                if (this.p3 != null) {
                    this.p3 = new List$1(Number_$type, 0);
                }
                if (this.p1 != null) {
                    this.p1 = new List$1(Number_$type, 0);
                }
                if (this.p5 != null) {
                    this.p5 = 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.p4 != null) {
                        this.p4._inner[h] = this.pc.item(i);
                    }
                    if (this.p2 != null) {
                        this.p2._inner[h] = this.pa.item(i);
                    }
                    if (this.p3 != null) {
                        this.p3._inner[h] = this.pb.item(i);
                    }
                    if (this.p1 != null) {
                        this.p1._inner[h] = this.o9.item(i);
                    }
                    if (this.p5 != null) {
                        this.p5._inner[h] = this.pe.item(i);
                    }
                }
                break;
        }
        this.ra();
        this.lk();
    };
    FinancialSeries.prototype.ot = function (a, b) {
        var _this = this;
        var c = this.p0(this.pc);
        var d = this.p0(this.o9);
        var e = this.p0(this.pa);
        var f = this.p0(this.pb);
        var g = this.p0(this.pe);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.py), _this.pz());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.px), ((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.pw), ((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.cd != null ? _this.cd.count : 0;
            return $ret;
        })());
        return h;
    };
    FinancialSeries.prototype.qc = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.ou = 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.eh;
            $ret.j = Series.eg;
            $ret.i = runOn(_this, _this.qc);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.oh;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.k5 = function (a, b) {
        _super.prototype.k5.call(this, a, b);
        if (!this.d2) {
            this.bs.a2(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.br);
        this.bs.a2(b);
        c.bx.e(this.fq);
        if (this.cp(this.br)) {
            return;
        }
        if (!this.dw) {
            this.q7(this.ol, c);
        }
        this.dw = false;
        this.q9(this.ol, c);
        this.d2 = false;
    };
    FinancialSeries.prototype.k2 = function (a, b, c, d, e) {
        _super.prototype.k2.call(this, a, b, c, d, e);
        var f = this.a3.a$h.item(d);
        var g = f;
        g.bx.e(this.fq);
        f.a1(c);
        if (this.cp(g)) {
            return;
        }
        if (this.oi == null) {
            this.oi = new CategoryFrame(3);
        }
        this.oi.u();
        this.q7(this.oi, g);
        this.q9(this.oi, g);
    };
    FinancialSeries.prototype.am = function (a) {
        if (this.oh == a) {
            return this.o2;
        }
        if (this.o2 == a) {
            return this.oh;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.oh);
        return b != null ? b.preferredCategoryMode(this) : this.oo;
    };
    Object.defineProperty(FinancialSeries.prototype, "oo", {
        get: function () {
            return this.on;
        },
        set: function (a) {
            var b = this.oo;
            if (a != b) {
                this.on = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.oo));
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_de = function () {
        return true;
    };
    FinancialSeries.prototype.k8 = function (a, b) {
        _super.prototype.k8.call(this, a, b);
        this.rm = a;
    };
    FinancialSeries.prototype.ra = function () {
        this.e1 = this.o9 == null || this.o9.count == 0 ? NaN : this.o9.item(this.o9.count - 1);
    };
    FinancialSeries.prototype.gs = function (a) {
        if (this.o1 != null && a != null) {
            if (this.o3 == null || this.o3.propertyName != this.o1.dateTimeMemberPath) {
                this.o3 = new FastReflectionHelper(false, this.o1.dateTimeMemberPath);
            }
            var b = this.o3.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.o1.itemLabelFormat());
            }
        }
        return _super.prototype.gs.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:qk:rb', [2, null], 'HighMemberPath:qn:rc', [2, null], 'IsCustomCategoryStyleAllowed:pm:rd', [0, false], 'IsTransitionInEnabled:pn:re', [0, false], 'LowMemberPath:qs:rf', [2, null], 'NegativeBrush:rm:rg', [Brush.$, null], 'OpenMemberPath:qw:rh', [2, null], 'TransitionInMode:or:ri', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:q0:rj', [2, null], 'XAxis:oh:rk', [CategoryAxisBase.$, null], 'YAxis:o2:rl', [NumericYAxis.$, null]]);
    return FinancialSeries;
}(Series));
export { FinancialSeries };
/**
 * @hidden
 */
var FinancialCalculationSupportingCalculations = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__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) {
    tslib_1.__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) {
    tslib_1.__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: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "closeColumn", {
        get: function () {
            return this._closeColumn;
        },
        set: function (a) {
            this._closeColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "highColumn", {
        get: function () {
            return this._highColumn;
        },
        set: function (a) {
            this._highColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "lowColumn", {
        get: function () {
            return this._lowColumn;
        },
        set: function (a) {
            this._lowColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "volumeColumn", {
        get: function () {
            return this._volumeColumn;
        },
        set: function (a) {
            this._volumeColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "indicatorColumn", {
        get: function () {
            return this._indicatorColumn;
        },
        set: function (a) {
            this._indicatorColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "typicalColumn", {
        get: function () {
            return this._typicalColumn;
        },
        set: function (a) {
            this._typicalColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueRange", {
        get: function () {
            return this._trueRange;
        },
        set: function (a) {
            this._trueRange = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueLow", {
        get: function () {
            return this._trueLow;
        },
        set: function (a) {
            this._trueLow = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "period", {
        get: function () {
            return this._period;
        },
        set: function (a) {
            this._period = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "shortPeriod", {
        get: function () {
            return this._shortPeriod;
        },
        set: function (a) {
            this._shortPeriod = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "longPeriod", {
        get: function () {
            return this._longPeriod;
        },
        set: function (a) {
            this._longPeriod = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateFrom", {
        get: function () {
            return this._calculateFrom;
        },
        set: function (a) {
            this._calculateFrom = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateCount", {
        get: function () {
            return this._calculateCount;
        },
        set: function (a) {
            this._calculateCount = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "multiplier", {
        get: function () {
            return this._multiplier;
        },
        set: function (a) {
            this._multiplier = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "minimumValue", {
        get: function () {
            return this._minimumValue;
        },
        set: function (a) {
            this._minimumValue = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "maximumValue", {
        get: function () {
            return this._maximumValue;
        },
        set: function (a) {
            this._maximumValue = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "specifiesRange", {
        get: function () {
            return this._specifiesRange;
        },
        set: function (a) {
            this._specifiesRange = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: true,
        configurable: true
    });
    FinancialCalculationDataSource.$t = markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
    return FinancialCalculationDataSource;
}(Base));
export { FinancialCalculationDataSource };
/**
 * @hidden
 */
var FinancialSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__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) {
            this.e.bx = 6;
        }
    };
    FinancialSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.bz.oh.b7) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.bz.oh.fa != null) {
            a += "<span>${item." + this.bz.oh.fa + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        var b = this.e.a3.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.gy + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bz.qw + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bz.qn + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bz.qs + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bz.qk + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bz.q0)) {
            var h = c.b1("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bz.q0 + "}</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.ni = a;
        this.e.fs = 5;
        this.e.ft = 2;
        this.e.fu = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
//# sourceMappingURL=FinancialEventArgs_combined.js.map
