/*
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-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 */ (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 */ (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.bw.eu;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    };
    FinancialBucketCalculator.prototype.e = function (a) {
        var b = this.a.bs;
        var c = this.a.br;
        var d = this.a.br;
        if (this.a.bw != null) {
            d = this.a.bw.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.bw.l8 == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.bw.l8 != null) ? this.a.bw.l8.b8 : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.bw.lq(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.bw.l8);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.bw.l8.dz(g.left, f));
            var j = Math.ceil(this.a.bw.l8.dz(g.right, f));
            if (this.a.bw.l8.b8) {
                j = Math.ceil(this.a.bw.l8.dz(g.left, f));
                i = Math.floor(this.a.bw.l8.dz(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 */ (function (_super) {
    tslib_1.__extends(FinancialSeries, _super);
    function FinancialSeries() {
        var _this = _super.call(this) || this;
        _this.m1 = null;
        _this.mx = null;
        _this.mz = null;
        _this.mv = null;
        _this.m4 = null;
        _this.m8 = false;
        _this.assigningCategoryStyle = null;
        _this.mg = null;
        _this.nj = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.nk = new Dictionary$2(String_$type, String_$type, 0);
        _this.m7 = false;
        _this.mr = null;
        _this.mb = null;
        _this.md = null;
        _this.ma = null;
        _this.mj = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.m6 = false;
        _this.nw = null;
        _this.nu = null;
        _this.nv = null;
        _this.nt = null;
        _this.nx = null;
        _this.mc = null;
        _this.l9 = null;
        _this.me = 0;
        _this.ms = null;
        _this.mu = null;
        _this.mg = new CategorySeriesRenderManager();
        _this.m8 = false;
        _this.mj = new CategoryTransitionSourceFramePreparer();
        _this.mc = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.mf = 0;
        return _this;
    }
    FinancialSeries.prototype.iu = function (a) {
        _super.prototype.iu.call(this, a);
        this.mo = a;
    };
    FinancialSeries.prototype.get_cr = function () {
        return true;
    };
    FinancialSeries.prototype.ag = function () {
        return [this.l8, this.mt];
    };
    FinancialSeries.prototype.fs = function (a, b) {
        var c = this.gu(b);
        if (c == FinancialSeries.$$p[6]) {
            return this.ft(a, b, this.oo);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.ft(a, b, this.of);
        }
        if (c == FinancialSeries.$$p[4]) {
            return this.ft(a, b, this.ok);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.ft(a, b, this.oc);
        }
        if (c == FinancialSeries.$$p[8]) {
            return this.ft(a, b, this.os);
        }
        return _super.prototype.fs.call(this, a, b);
    };
    FinancialSeries.prototype.n8 = function () {
        return 2;
    };
    FinancialSeries.prototype.n6 = function () {
        return 4;
    };
    FinancialSeries.prototype.ah = function (a) {
        var b = this.aj(this.l8, this.ma.f, this.n5(this.bi), this.n7(this.bi), this.lo(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.n8();
        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.l8, this.ma.f, this.n5(this.bi), this.n7(this.bi), this.lo(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.k9 = function () {
        return this.pe;
    };
    FinancialSeries.prototype.ht = function () {
        _super.prototype.ht.call(this);
        this.l8 = null;
        this.mt = null;
    };
    Object.defineProperty(FinancialSeries.prototype, "m2", {
        get: function () {
            return this.m1;
        },
        set: function (a) {
            if (this.m1 != a) {
                var b = this.m1;
                this.m1 = a;
                this.raisePropertyChanged("OpenColumn", b, this.m1);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "my", {
        get: function () {
            return this.mx;
        },
        set: function (a) {
            if (this.mx != a) {
                var b = this.mx;
                this.mx = a;
                this.raisePropertyChanged("HighColumn", b, this.mx);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "m0", {
        get: function () {
            return this.mz;
        },
        set: function (a) {
            if (this.mz != a) {
                var b = this.mz;
                this.mz = a;
                this.raisePropertyChanged("LowColumn", b, this.mz);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mw", {
        get: function () {
            return this.mv;
        },
        set: function (a) {
            if (this.mv != a) {
                var b = this.mv;
                this.mv = a;
                this.raisePropertyChanged("CloseColumn", b, this.mv);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "m5", {
        get: function () {
            return this.m4;
        },
        set: function (a) {
            if (this.m4 != a) {
                var b = this.m4;
                this.m4 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.m4);
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.ng = function () {
        return (this.assigningCategoryStyle != null && this.m8) || this.cu;
    };
    FinancialSeries.prototype.o0 = function (a) {
        if (this.assigningCategoryStyle != null && this.m8) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.oy = function (a, b, c, d, e, f) {
        var g = this.b9;
        this.mg.ac(a, b, c, d, e, f, g);
        var h = this.mg.c;
        var i = null;
        var j = this.bz;
        if (g && this.bs != null) {
            i = this.bs.az.getHighlightingInfo(this, j, d, h.m, h.l, false);
            h.b = i;
        }
        h.f = f;
        this.o0(h);
        this.mg.aa(i, f, g);
    };
    FinancialSeries.prototype.ny = function (a) {
        return this.ed(a, this.l8);
    };
    FinancialSeries.prototype.fe = function (a, b) {
        return this.ff(a, b, this.l8, runOn(this, this.ny), new FinancialValueList(this.m2, this.my, this.m0, this.mw, this.m5));
    };
    FinancialSeries.prototype.fc = function (a, b) {
        return this.fd(a, b, this.l8, runOn(this, this.ny), new FinancialValueList(this.m2, this.my, this.m0, this.mw, this.m5));
    };
    FinancialSeries.prototype.d9 = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.l8.jy;
        return this.ea(a, b, this.l8, d, e, f, runOn(this, this.ny));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.nz(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.l8.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    FinancialSeries.prototype.ll = function (a, b, c) {
        return this.ln(a, b, c, this.nz(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mt, this.l8, null, null, null);
    };
    FinancialSeries.prototype.en = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nz(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l8.b8, d);
        return this.ep(new FinancialValueList(this.m2, this.my, this.m0, this.mw, this.m5), a, this.l8, f, e, runOn(this, this.ny), b, c);
    };
    FinancialSeries.prototype.ej = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nz(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l8.b8, d);
        return this.ep(this.my, a, this.l8, f, e, runOn(this, this.ny), b, c);
    };
    FinancialSeries.prototype.el = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nz(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l8.b8, d);
        return this.ep(this.m0, a, this.l8, f, e, runOn(this, this.ny), b, c);
    };
    FinancialSeries.prototype.n0 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nz(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l8.b8, d);
        return this.ep(this.mw, a, this.l8, f, e, runOn(this, this.ny), b, c);
    };
    FinancialSeries.prototype.n1 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nz(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l8.b8, d);
        return this.ep(this.m2, a, this.l8, f, e, runOn(this, this.ny), b, c);
    };
    FinancialSeries.prototype.n2 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nz(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l8.b8, d);
        return this.ep(this.m5, a, this.l8, f, e, runOn(this, this.ny), b, c);
    };
    FinancialSeries.prototype.lh = function (a, b, c) {
        var _this = this;
        return this.ln(a, b, c, this.nz(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mt, this.l8, runOn(this, this.ej), function (d, e) { return _this.ff(d, e, _this.l8, runOn(_this, _this.ny), _this.my); }, function (d, e) { return _this.fd(d, e, _this.l8, runOn(_this, _this.ny), _this.my); });
    };
    FinancialSeries.prototype.lj = function (a, b, c) {
        var _this = this;
        return this.ln(a, b, c, this.nz(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mt, this.l8, runOn(this, this.el), function (d, e) { return _this.ff(d, e, _this.l8, runOn(_this, _this.ny), _this.m0); }, function (d, e) { return _this.fd(d, e, _this.l8, runOn(_this, _this.ny), _this.m0); });
    };
    FinancialSeries.prototype.pg = function (a, b, c) {
        var _this = this;
        return this.ln(a, b, c, this.nz(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mt, this.l8, runOn(this, this.n1), function (d, e) { return _this.ff(d, e, _this.l8, runOn(_this, _this.ny), _this.m2); }, function (d, e) { return _this.fd(d, e, _this.l8, runOn(_this, _this.ny), _this.m2); });
    };
    FinancialSeries.prototype.pf = function (a, b, c) {
        var _this = this;
        return this.ln(a, b, c, this.nz(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mt, this.l8, runOn(this, this.n0), function (d, e) { return _this.ff(d, e, _this.l8, runOn(_this, _this.ny), _this.mw); }, function (d, e) { return _this.fd(d, e, _this.l8, runOn(_this, _this.ny), _this.mw); });
    };
    FinancialSeries.prototype.ph = function (a, b, c) {
        var _this = this;
        return this.ln(a, b, c, this.nz(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mt, this.l8, runOn(this, this.n2), function (d, e) { return _this.ff(d, e, _this.l8, runOn(_this, _this.ny), _this.m5); }, function (d, e) { return _this.fd(d, e, _this.l8, runOn(_this, _this.ny), _this.m5); });
    };
    FinancialSeries.prototype.ib = function () {
        _super.prototype.ib.call(this);
        if (this.l8 != null) {
            this.l8.g6(false);
        }
        if (this.mt != null) {
            this.mt.g6(false);
        }
    };
    FinancialSeries.prototype.jt = function (a, b) {
        this.mo.bu.e(this.eu);
        this.jd(false);
    };
    FinancialSeries.prototype.js = function (a, b) {
        if (this.dm && this.ez < 0.05) {
            this.dn = true;
        }
        this.mo.bu.e(this.eu);
        this.jd(false);
    };
    FinancialSeries.prototype.m3 = function (a, b, c) {
        var d = this.bw(b);
        this.nj.addItem(d, b);
        this.nk.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.ox = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.nj.item(b);
        this.nk.removeItem(c);
        this.nj.removeItem(b);
    };
    FinancialSeries.prototype.iz = function (a, b, c, d) {
        _super.prototype.iz.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.bn != null && this.bs != null) {
                    this.mo.bu.e(this.eu);
                    this.jd(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.l8 != null) {
                        this.l8.bv(this);
                    }
                    if (this.mt != null) {
                        this.mt.bv(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.l8 != null) {
                        this.l8.ci(this);
                    }
                    if (this.mt != null) {
                        this.mt.ci(this);
                    }
                }
                this.mo.bu.e(this.eu);
                this.jd(false);
                break;
            case "FastItemsSource":
                this.m7 = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.ox(typeCast(IFastItemsSource_$type, c), this.m2);
                    this.ox(typeCast(IFastItemsSource_$type, c), this.my);
                    this.ox(typeCast(IFastItemsSource_$type, c), this.m0);
                    this.ox(typeCast(IFastItemsSource_$type, c), this.mw);
                    this.ox(typeCast(IFastItemsSource_$type, c), this.m5);
                    this.m2 = null;
                    this.my = null;
                    this.m0 = null;
                    this.mw = null;
                    this.m5 = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.oo) == false) {
                        this.m2 = this.m3(typeCast(IFastItemsSource_$type, d), this.oo, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.of) == false) {
                        this.my = this.m3(typeCast(IFastItemsSource_$type, d), this.of, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.ok) == false) {
                        this.m0 = this.m3(typeCast(IFastItemsSource_$type, d), this.ok, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.oc) == false) {
                        this.mw = this.m3(typeCast(IFastItemsSource_$type, d), this.oc, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.os) == false) {
                        this.m5 = this.m3(typeCast(IFastItemsSource_$type, d), this.os, "VolumeColumn");
                    }
                }
                this.m7 = false;
                if (this.mt != null && !this.mt.cl()) {
                    this.mo.bu.e(this.eu);
                    this.jd(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.bz != null) {
                    this.ox(this.bz, this.m2);
                    this.m2 = this.m3(this.bz, this.oo, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.mt != null && !this.mt.cl() && !this.m7) {
                    this.mo.bu.e(this.eu);
                    this.jd(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.bz != null) {
                    this.ox(this.bz, this.my);
                    this.my = this.m3(this.bz, this.of, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.mt != null && !this.mt.cl() && !this.m7) {
                    this.mo.bu.e(this.eu);
                    this.jd(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.bz != null) {
                    this.ox(this.bz, this.m0);
                    this.m0 = this.m3(this.bz, this.ok, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.mt != null && !this.mt.cl() && !this.m7) {
                    this.mo.bu.e(this.eu);
                    this.jd(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.bz != null) {
                    this.ox(this.bz, this.mw);
                    this.mw = this.m3(this.bz, this.oc, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.mt != null && !this.mt.cl() && !this.m7) {
                    this.mo.bu.e(this.eu);
                    this.jd(false);
                }
                this.o2();
                break;
            case FinancialSeries.$$p[8]:
                if (this.bz != null) {
                    this.ox(this.bz, this.m5);
                    this.m5 = this.m3(this.bz, this.os, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.mt != null && !this.mt.cl() && !this.m7) {
                    this.mo.bu.e(this.eu);
                    this.jd(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ci(this);
                }
                this.mo.bu.e(this.eu);
                this.jd(false);
                this.ik();
                this.ms = typeCast(ITimeRangeSelectorAxis_$type, this.l8);
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ci(this);
                }
                this.mo.bu.e(this.eu);
                if (this.mt != null) {
                    this.mt.cl();
                }
                {
                    this.jd(false);
                }
                this.ik();
                break;
            case "TransitionProgress":
                this.md.c(this.ez, this.mb, this.ma);
                if (this.cc(this.bi)) {
                    return;
                }
                if (this.ez == 1) {
                    this.ma.v();
                    this.o1(this.ma, this.mo);
                    if (this.dm) {
                        this.dm = false;
                        this.hw();
                        this.bt.r = truncate(this.eq());
                        this.bt.b = this.bu;
                    }
                }
                else {
                    this.o1(this.md, this.mo);
                }
                if (this.bs != null) {
                    this.bs.jj(this);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.jd(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.m8 = this.nb();
                this.jd(false);
                break;
            case "CategoryMode":
                if (this.l8 != null) {
                    this.l8.kn(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.na = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.m9 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.l1 = function (a, b, c) {
        if (b < a || a < 0 || a > this.bz.count || b < 0 || b > this.bz.count || c == null) {
            return null;
        }
        var d = new Array((b - a) + 1);
        var e = c.cd;
        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.bz.item(g);
        }
        return d;
    };
    FinancialSeries.prototype.n5 = function (a) {
        return a.bu.b;
    };
    FinancialSeries.prototype.n7 = function (a) {
        return a.bu.c;
    };
    FinancialSeries.prototype.l0 = function (a, b) {
        return this.l1(a, b, this.mt);
    };
    FinancialSeries.prototype.get_nc = function () {
        return false;
    };
    Object.defineProperty(FinancialSeries.prototype, "nc", {
        get: function () {
            return this.get_nc();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_cv = function () {
        return true;
    };
    FinancialSeries.prototype.at = function (a, b) {
        if (this.nc) {
            var c = this.mq(a, b, this.mr);
            this.mr = c;
            return c;
        }
        else {
            var d = this.mp(a, b, this.mr);
            this.mr = d;
            return d;
        }
    };
    FinancialSeries.prototype.n9 = function (a) {
        var b = this.ma;
        if (this.ca()) {
            b = this.md;
        }
        var c = this.bi.br;
        var d = this.bi.bs;
        var e = this.l8;
        var f = 0;
        if (e.cf) {
            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.mq = function (a, b, c) {
        var d = this.bz.count;
        var e = this.mo.bu.c;
        var f = this.mo.bu.d;
        var g = this.mo.bu.b;
        var h = this.l8;
        var i = -1;
        var j = -1;
        if (h.cd) {
            var k = this.ma;
            if (this.ca()) {
                k = this.md;
            }
            var l = this.n9(b);
            i = l;
            j = l;
        }
        else {
            var m = this.e8(b);
            i = truncate(Math.floor((intDivide(m, g)))) * g;
            j = i + (g - 1);
        }
        if (c != null && c.f == i && c.e == j) {
            return c;
        }
        var n = new HighlightingInfo();
        n.b = this;
        n.f = i;
        n.e = j;
        return n;
    };
    FinancialSeries.prototype.mp = function (a, b, c) {
        var d = new HighlightingInfo();
        d.b = this;
        d.f = 0;
        d.e = this.bz.count - 1;
        if (c != null && c.f == d.f && c.e == d.e) {
            return c;
        }
        return d;
    };
    FinancialSeries.prototype.nb = function () {
        return this.ne;
    };
    FinancialSeries.prototype.eb = function (a) {
        var b = this.bi.bs;
        var c = this.bi.br;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.l8 != null) {
            var e = this.getEffectiveViewport1(this.bi);
            var f = new ScalerParams(0, b, c, this.l8.b8, e);
            var g = this.lq(this.bi);
            var h = this.l8.dz(g.left, f);
            var i = this.l8.dz(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.l8.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.e8 = function (a) {
        return truncate(Math.round(this.eb(a)));
    };
    FinancialSeries.prototype.get_c1 = function () {
        return typeCast(ISortingAxis_$type, this.l8) !== null;
    };
    FinancialSeries.prototype.ap = function () {
        return this.l8;
    };
    FinancialSeries.prototype.fa = function (a) {
        var b = this.bi.bs;
        var c = this.bi.br;
        var d = this.getEffectiveViewport1(this.bi);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        var e = new Rect(0, 0, 0, 1, 1);
        var f = new ScalerParams(0, b, c, this.l8.b8, d);
        var g = typeCast(ISortingAxis_$type, this.l8);
        var h = this.lq(this.bi);
        var i = h.left;
        var j = h.right;
        var k = this.lg(a).x;
        var l = this.l8.dz(k, f);
        var m = this.l8.dz(i, f);
        var n = this.l8.dz(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.fp = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.l8) !== null) {
            b = this.fa(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.e8(a);
        }
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    };
    FinancialSeries.prototype.nz = function (a, b, c) {
        if (this.l8 == null) {
            return 0;
        }
        return this.l8.js(a, b, c, this.fh);
    };
    FinancialSeries.prototype.dc = function () {
        return this.nf;
    };
    FinancialSeries.prototype.mh = function () {
        return 11;
    };
    FinancialSeries.prototype.bo = function () {
        return 3;
    };
    FinancialSeries.prototype.o1 = function (a, b) {
        this.lp = a.aa;
        b.ar();
    };
    FinancialSeries.prototype.oz = function (a, b) {
        a.u();
    };
    FinancialSeries.prototype.dw = function (a, b, c) {
        var d = _super.prototype.dw.call(this, a, b, c);
        var e = c;
        if (this.bz == null || this.bz.count == 0 || !c.l() || b.isEmpty || a.isEmpty || this.l8 == null || this.mt == null || e.bu.b < 1 || this.l8.bf == null || this.mt.bf == null || this.mt.j4 == this.mt.j3 || this.l8.itemsSource == null || this.l8.jy < 1) {
            e.bu.b = 0;
            d = false;
        }
        return d;
    };
    FinancialSeries.prototype.getViewInfo = function (a, b) {
        b = this.bi.bs;
        a = this.bi.br;
        return {
            p0: a,
            p1: b
        };
    };
    FinancialSeries.prototype.n3 = function (a) {
        var b = 0;
        var c = a.bs;
        var d = a.br;
        var e = this.getEffectiveViewport1(this.bi);
        if (!c.isEmpty && !d.isEmpty && this.mt != null) {
            var f = new ScalerParams(0, c, d, this.mt.b8, e);
            f.b = this.eh();
            b = this.mt.dw(this.mt.ke, f);
        }
        return b;
    };
    FinancialSeries.prototype.hw = function () {
        _super.prototype.hw.call(this);
        this.mb.v();
        this.ma.v();
        this.md.v();
    };
    FinancialSeries.prototype.je = function (a) {
        var _this = this;
        _super.prototype.je.call(this, a);
        this.mo.bu.e(this.eu);
        if (this.cc(this.bi)) {
            return;
        }
        if (this.de) {
            if (this.ca()) {
                this.o1(this.md, this.mo);
            }
            else {
                this.o1(this.ma, this.mo);
            }
            return;
        }
        if (this.da(a)) {
            var b = this.mb;
            if (this.ca()) {
                if (this.bt.g) {
                    this.bt.t();
                }
                this.mb = this.md;
                this.md = b;
            }
            else {
                this.mb = this.ma;
                this.ma = b;
            }
            this.oz(this.ma, this.mo);
            if (this.dp) {
                this.bt.w();
                this.bt.r = truncate(this.er());
                this.bt.b = this.bv != null ? this.bv : this.bu;
                this.mj.p(this.mb, this.ma, this.isVertical, this.l8, this.mt, this.mi, this.mh(), this.bp, this.bo(), function () { return _this.n3(_this.mo); }, this.mo.br);
            }
            this.hs();
            this.jl();
            if (this.dp) {
                this.dn = false;
                this.dm = true;
            }
        }
        else {
            this.oz(this.ma, this.mo);
            this.o1(this.ma, this.mo);
        }
    };
    FinancialSeries.prototype.nh = 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.my == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.m0 == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.m2 == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.mw == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.m5 == 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, "ni", {
        get: function () {
            return this.l8 != null && typeCast(ISortingAxis_$type, this.l8) !== null;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.nd = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.ow = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "nq", {
        get: function () {
            return this.nn();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nn = 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.nd()) return [3 /*break*/, 8];
                    b = this.mk(0, this.bz.count);
                    this.ow(new FinancialEventArgs(0, this.bz.count, b, this.ml(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.ni && this.l8.i$b != null)) return [3 /*break*/, 13];
                    d = this.bz.count;
                    e = this.l8.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d)) return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.my.item(e.item(f)) + this.m0.item(e.item(f)) + this.mw.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.bz.count;
                    h = 0;
                    _d.label = 14;
                case 14:
                    if (!(h < g)) return [3 /*break*/, 17];
                    return [4 /*yield*/, (this.my.item(h) + this.m0.item(h) + this.mw.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nn = function () {
        var _this = this;
        return toEnum(function () { return _this._nn(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "np", {
        get: function () {
            return this.nm();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nm = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.ni && this.l8.i$b != null)) return [3 /*break*/, 7];
                    a = this.my.count;
                    b = this.l8.i$b;
                    if (!(a > 0)) return [3 /*break*/, 2];
                    return [4 /*yield*/, this.n4(this.my.item(b.item(0)) - this.m0.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.n4(this.my.item(b.item(c)) - this.m0.item(b.item(c))), Math.max(this.n4(Math.abs(this.my.item(b.item(c)) - this.mw.item(b.item(c - 1)))), this.n4(Math.abs(this.m0.item(b.item(c)) - this.mw.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.my.count;
                    if (!(d > 0)) return [3 /*break*/, 9];
                    return [4 /*yield*/, this.n4(this.my.item(0) - this.m0.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.n4(this.my.item(e) - this.m0.item(e)), Math.max(this.n4(Math.abs(this.my.item(e) - this.mw.item(e - 1))), this.n4(Math.abs(this.m0.item(e) - this.mw.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nm = function () {
        var _this = this;
        return toEnum(function () { return _this._nm(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "no", {
        get: function () {
            return this.nl();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nl = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.ni && this.l8.i$b != null)) return [3 /*break*/, 7];
                    a = this.m0.count;
                    b = this.l8.i$b;
                    if (!(a > 0)) return [3 /*break*/, 2];
                    return [4 /*yield*/, this.n4(this.m0.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.n4(this.m0.item(b.item(c))), this.n4(this.mw.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.m0.count;
                    if (!(d > 0)) return [3 /*break*/, 9];
                    return [4 /*yield*/, this.n4(this.m0.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.n4(this.m0.item(e)), this.n4(this.mw.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nl = function () {
        var _this = this;
        return toEnum(function () { return _this._nl(); });
    };
    FinancialSeries.prototype.ns = function (a) {
        if (a == null) {
            return null;
        }
        if (this.ni && this.l8.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.l8.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.nr = function () {
        var a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.bz != null && !this.m6) {
            this.m6 = true;
            var b = this.mk(0, this.bz.count);
            this.m6 = false;
            var c = new FinancialEventArgs(0, this.bz.count, b, this.ml(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.m2 == null) {
            return null;
        }
        if (this.l8 != null && typeCast(ISortingAxis_$type, this.l8) !== null) {
            if (this.nw != null) {
                return this.nw.asArray();
            }
            var a = new List$1(Number_$type, 2, this.m2.count);
            var b = this.l8.i$b;
            var c = this.m2.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nw = a;
            return this.nw.asArray();
        }
        else {
            return this.m2.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.my == null) {
            return null;
        }
        if (this.l8 != null && typeCast(ISortingAxis_$type, this.l8) !== null) {
            if (this.nu != null) {
                return this.nu.asArray();
            }
            var a = new List$1(Number_$type, 2, this.my.count);
            var b = this.l8.i$b;
            var c = this.my.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nu = a;
            return this.nu.asArray();
        }
        else {
            return this.my.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.m0 == null) {
            return null;
        }
        if (this.l8 != null && typeCast(ISortingAxis_$type, this.l8) !== null) {
            if (this.nv != null) {
                return this.nv.asArray();
            }
            var a = new List$1(Number_$type, 2, this.m0.count);
            var b = this.l8.i$b;
            var c = this.m0.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nv = a;
            return this.nv.asArray();
        }
        else {
            return this.m0.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.mw == null) {
            return null;
        }
        if (this.l8 != null && typeCast(ISortingAxis_$type, this.l8) !== null) {
            if (this.nt != null) {
                return this.nt.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mw.count);
            var b = this.l8.i$b;
            var c = this.mw.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nt = a;
            return this.nt.asArray();
        }
        else {
            return this.mw.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.m5 == null) {
            return null;
        }
        if (this.l8 != null && typeCast(ISortingAxis_$type, this.l8) !== null) {
            if (this.nx != null) {
                return this.nx.asArray();
            }
            var a = new List$1(Number_$type, 2, this.m5.count);
            var b = this.l8.i$b;
            var c = this.m5.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nx = a;
            return this.nx.asArray();
        }
        else {
            return this.m5.asArray();
        }
    };
    FinancialSeries.prototype.hy = function (a, b, c, d) {
        _super.prototype.hy.call(this, a, b, c, d);
        if (this.l8 == null || !(typeCast(ISortingAxis_$type, this.l8) !== null)) {
            return;
        }
        var e = this.l8.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.nw != null) {
                        this.nw.insert(f, this.m2.item(g));
                    }
                    if (this.nu != null) {
                        this.nu.insert(f, this.my.item(g));
                    }
                    if (this.nv != null) {
                        this.nv.insert(f, this.m0.item(g));
                    }
                    if (this.nt != null) {
                        this.nt.insert(f, this.mw.item(g));
                    }
                    if (this.nx != null) {
                        this.nx.insert(f, this.m5.item(g));
                    }
                }
                break;
            case 0:
                if (this.nw != null) {
                    this.nw.v(b, c);
                }
                if (this.nu != null) {
                    this.nu.v(b, c);
                }
                if (this.nv != null) {
                    this.nv.v(b, c);
                }
                if (this.nt != null) {
                    this.nt.v(b, c);
                }
                if (this.nx != null) {
                    this.nx.v(b, c);
                }
                break;
            case 4:
                if (this.nw != null) {
                    this.nw = new List$1(Number_$type, 0);
                }
                if (this.nu != null) {
                    this.nu = new List$1(Number_$type, 0);
                }
                if (this.nv != null) {
                    this.nv = new List$1(Number_$type, 0);
                }
                if (this.nt != null) {
                    this.nt = new List$1(Number_$type, 0);
                }
                if (this.nx != null) {
                    this.nx = 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.nw != null) {
                        this.nw._inner[h] = this.m2.item(i);
                    }
                    if (this.nu != null) {
                        this.nu._inner[h] = this.my.item(i);
                    }
                    if (this.nv != null) {
                        this.nv._inner[h] = this.m0.item(i);
                    }
                    if (this.nt != null) {
                        this.nt._inner[h] = this.mw.item(i);
                    }
                    if (this.nx != null) {
                        this.nx._inner[h] = this.m5.item(i);
                    }
                }
                break;
        }
        this.o2();
        this.jq();
    };
    FinancialSeries.prototype.mk = function (a, b) {
        var _this = this;
        var c = this.ns(this.m2);
        var d = this.ns(this.mw);
        var e = this.ns(this.my);
        var f = this.ns(this.m0);
        var g = this.ns(this.m5);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.nq), _this.nr());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.np), ((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.no), ((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.bz != null ? _this.bz.count : 0;
            return $ret;
        })());
        return h;
    };
    FinancialSeries.prototype.n4 = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.ml = 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.d1;
            $ret.j = Series.d0;
            $ret.i = runOn(_this, _this.n4);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.l8;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.jf = function (a, b) {
        _super.prototype.jf.call(this, a, b);
        if (!this.dl) {
            this.bi.az(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.bh);
        this.bi.az(b);
        c.bu.e(this.eu);
        if (this.cc(this.bh)) {
            return;
        }
        if (!this.df) {
            this.oz(this.mc, c);
        }
        this.df = false;
        this.o1(this.mc, c);
        this.dl = false;
    };
    FinancialSeries.prototype.jc = function (a, b, c, d, e) {
        _super.prototype.jc.call(this, a, b, c, d, e);
        var f = this.a0.a$h.item(d);
        var g = f;
        g.bu.e(this.eu);
        f.ay(c);
        if (this.cc(g)) {
            return;
        }
        if (this.l9 == null) {
            this.l9 = new CategoryFrame(3);
        }
        this.l9.u();
        this.oz(this.l9, g);
        this.o1(this.l9, g);
    };
    FinancialSeries.prototype.am = function (a) {
        if (this.l8 == a) {
            return this.mt;
        }
        if (this.mt == a) {
            return this.l8;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.l8);
        return b != null ? b.preferredCategoryMode(this) : this.mf;
    };
    Object.defineProperty(FinancialSeries.prototype, "mf", {
        get: function () {
            return this.me;
        },
        set: function (a) {
            var b = this.mf;
            if (a != b) {
                this.me = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.mf));
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_cz = function () {
        return true;
    };
    FinancialSeries.prototype.ji = function (a, b) {
        _super.prototype.ji.call(this, a, b);
        this.pe = a;
    };
    FinancialSeries.prototype.o2 = function () {
        this.d8 = this.mw == null || this.mw.count == 0 ? NaN : this.mw.item(this.mw.count - 1);
    };
    FinancialSeries.prototype.fr = function (a) {
        if (this.ms != null && a != null) {
            if (this.mu == null || this.mu.propertyName != this.ms.dateTimeMemberPath) {
                this.mu = new FastReflectionHelper(false, this.ms.dateTimeMemberPath);
            }
            var b = this.mu.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.ms.itemLabelFormat());
            }
        }
        return _super.prototype.fr.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:oc:o3', [2, null], 'HighMemberPath:of:o4', [2, null], 'IsCustomCategoryStyleAllowed:ne:o5', [0, false], 'IsTransitionInEnabled:nf:o6', [0, false], 'LowMemberPath:ok:o7', [2, null], 'NegativeBrush:pe:o8', [Brush.$, null], 'OpenMemberPath:oo:o9', [2, null], 'TransitionInMode:mi:pa', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:os:pb', [2, null], 'XAxis:l8:pc', [CategoryAxisBase.$, null], 'YAxis:mt:pd', [NumericYAxis.$, null]]);
    return FinancialSeries;
}(Series));
export { FinancialSeries };
/**
 * @hidden
 */
var FinancialCalculationSupportingCalculations = /** @class */ (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 */ (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 */ (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 */ (function (_super) {
    tslib_1.__extends(FinancialSeriesView, _super);
    function FinancialSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.bw = null;
        _this.bu = null;
        _this.by = 0;
        _this.by = -1;
        _this.bw = a;
        _this.bu = _this.bv();
        return _this;
    }
    FinancialSeriesView.prototype.bx = function (a) {
        if (this.by != a.t) {
            return true;
        }
        return false;
    };
    FinancialSeriesView.prototype.bz = function (a) {
        this.by = a.t;
    };
    FinancialSeriesView.prototype.ap = function () {
        _super.prototype.ap.call(this);
        if (!this.n) {
            this.e.bj = 6;
        }
    };
    FinancialSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.bw.l8.b5) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.bw.l8.e7 != null) {
            a += "<span>${item." + this.bw.l8.e7 + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        var b = this.e.a0.a$q(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        var c = new SRProvider(this.t);
        var d = c.al("financialSeries_Open");
        var e = c.al("financialSeries_High");
        var f = c.al("financialSeries_Low");
        var g = c.al("financialSeries_Close");
        d = stringIsNullOrEmpty(d) ? "Open" : d;
        e = stringIsNullOrEmpty(e) ? "High" : e;
        f = stringIsNullOrEmpty(f) ? "Low" : f;
        g = stringIsNullOrEmpty(g) ? "Close" : g;
        a += ">" + this.bw.fx + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bw.oo + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bw.of + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bw.ok + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bw.oc + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bw.os)) {
            var h = c.al("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bw.os + "}</td></tr>";
        }
        a += "</table></div>";
        return a;
    };
    FinancialSeriesView.prototype.ac = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.la = a;
        this.e.ev = 5;
        this.e.ew = 2;
        this.e.ex = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
//# sourceMappingURL=FinancialEventArgs_combined.js.map