/*
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, Type, markType, typeCast, Point_$type, String_$type, runOn, Number_$type, enumGetBox, fromEnum, toEnum, Date_$type, Delegate_$type } from "igniteui-react-core/ES5/type";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-react-core/ES5/ArgumentNullException";
import { IFastItemColumn$1_$type } from "igniteui-react-core/ES5/IFastItemColumn$1";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core/ES5/Rect";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-react-core/ES5/number";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-react-core/ES5/Brush";
import { DependencyProperty } from "igniteui-react-core/ES5/DependencyProperty";
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/ES5/FastReflectionHelper";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { Dictionary$2 } from "igniteui-react-core/ES5/Dictionary$2";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-react-core/ES5/IFastItemsSource";
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/ES5/TrendCalculators";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-react-core/ES5/PropertyMetadata";
import { dateToStringFormat } from "igniteui-react-core/ES5/dateExtended";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-react-core/ES5/SRProvider";
import { Color } from "igniteui-react-core/ES5/Color";
import { stringIsNullOrEmpty } from "igniteui-react-core/ES5/string";
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 };
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.eq;
        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.lz == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.bw.lz != null) ? this.a.bw.lz.b8 : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.bw.lh(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.bw.lz);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.bw.lz.dw(g.left, f));
            var j = Math.ceil(this.a.bw.lz.dw(g.right, f));
            if (this.a.bw.lz.b8) {
                j = Math.ceil(this.a.bw.lz.dw(g.left, f));
                i = Math.floor(this.a.bw.lz.dw(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 };
var FinancialSeries = /** @class */ (function (_super) {
    tslib_1.__extends(FinancialSeries, _super);
    function FinancialSeries() {
        var _this = _super.call(this) || this;
        _this.ms = null;
        _this.mo = null;
        _this.mq = null;
        _this.mm = null;
        _this.mv = null;
        _this.mz = false;
        _this.assigningCategoryStyle = null;
        _this.l7 = null;
        _this.na = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.nb = new Dictionary$2(String_$type, String_$type, 0);
        _this.my = false;
        _this.mi = null;
        _this.l2 = null;
        _this.l4 = null;
        _this.l1 = null;
        _this.ma = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.mx = false;
        _this.nn = null;
        _this.nl = null;
        _this.nm = null;
        _this.nk = null;
        _this.no = null;
        _this.l3 = null;
        _this.l0 = null;
        _this.l5 = 0;
        _this.mj = null;
        _this.ml = null;
        _this.l7 = new CategorySeriesRenderManager();
        _this.mz = false;
        _this.ma = new CategoryTransitionSourceFramePreparer();
        _this.l3 = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.l6 = 0;
        return _this;
    }
    FinancialSeries.prototype.il = function (a) {
        _super.prototype.il.call(this, a);
        this.mf = a;
    };
    FinancialSeries.prototype.get_cr = function () {
        return true;
    };
    FinancialSeries.prototype.ag = function () {
        return [this.lz, this.mk];
    };
    FinancialSeries.prototype.nz = function () {
        return 2;
    };
    FinancialSeries.prototype.nx = function () {
        return 4;
    };
    FinancialSeries.prototype.ah = function (a) {
        var b = this.aj(this.lz, this.l1.f, this.nw(this.bi), this.ny(this.bi), this.lf(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.nz();
        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.lz, this.l1.f, this.nw(this.bi), this.ny(this.bi), this.lf(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.k0 = function () {
        return this.o5;
    };
    FinancialSeries.prototype.hm = function () {
        _super.prototype.hm.call(this);
        this.lz = null;
        this.mk = null;
    };
    Object.defineProperty(FinancialSeries.prototype, "mt", {
        get: function () {
            return this.ms;
        },
        set: function (a) {
            if (this.ms != a) {
                var b = this.ms;
                this.ms = a;
                this.raisePropertyChanged("OpenColumn", b, this.ms);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mp", {
        get: function () {
            return this.mo;
        },
        set: function (a) {
            if (this.mo != a) {
                var b = this.mo;
                this.mo = a;
                this.raisePropertyChanged("HighColumn", b, this.mo);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mr", {
        get: function () {
            return this.mq;
        },
        set: function (a) {
            if (this.mq != a) {
                var b = this.mq;
                this.mq = a;
                this.raisePropertyChanged("LowColumn", b, this.mq);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mn", {
        get: function () {
            return this.mm;
        },
        set: function (a) {
            if (this.mm != a) {
                var b = this.mm;
                this.mm = a;
                this.raisePropertyChanged("CloseColumn", b, this.mm);
            }
        },
        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("VolumeColumn", b, this.mv);
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.m7 = function () {
        return (this.assigningCategoryStyle != null && this.mz) || this.cu;
    };
    FinancialSeries.prototype.or = function (a) {
        if (this.assigningCategoryStyle != null && this.mz) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.op = function (a, b, c, d, e, f) {
        var g = this.b9;
        this.l7.ac(a, b, c, d, e, f, g);
        var h = this.l7.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.or(h);
        this.l7.aa(i, f, g);
    };
    FinancialSeries.prototype.np = function (a) {
        return this.d9(a, this.lz);
    };
    FinancialSeries.prototype.fa = function (a, b) {
        return this.fb(a, b, this.lz, runOn(this, this.np), new FinancialValueList(this.mt, this.mp, this.mr, this.mn, this.mw));
    };
    FinancialSeries.prototype.e8 = function (a, b) {
        return this.e9(a, b, this.lz, runOn(this, this.np), new FinancialValueList(this.mt, this.mp, this.mr, this.mn, this.mw));
    };
    FinancialSeries.prototype.d5 = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.lz.jr;
        return this.d6(a, b, this.lz, d, e, f, runOn(this, this.np));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.lz.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    FinancialSeries.prototype.lc = function (a, b, c) {
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, null, null, null);
    };
    FinancialSeries.prototype.ej = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nq(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(new FinancialValueList(this.mt, this.mp, this.mr, this.mn, this.mw), a, this.lz, f, e, runOn(this, this.np), b, c);
    };
    FinancialSeries.prototype.ef = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nq(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(this.mp, a, this.lz, f, e, runOn(this, this.np), b, c);
    };
    FinancialSeries.prototype.eh = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nq(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(this.mr, a, this.lz, f, e, runOn(this, this.np), b, c);
    };
    FinancialSeries.prototype.nr = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nq(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(this.mn, a, this.lz, f, e, runOn(this, this.np), b, c);
    };
    FinancialSeries.prototype.ns = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nq(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(this.mt, a, this.lz, f, e, runOn(this, this.np), b, c);
    };
    FinancialSeries.prototype.nt = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nq(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(this.mw, a, this.lz, f, e, runOn(this, this.np), b, c);
    };
    FinancialSeries.prototype.k8 = function (a, b, c) {
        var _this = this;
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, runOn(this, this.ef), function (d, e) { return _this.fb(d, e, _this.lz, runOn(_this, _this.np), _this.mp); }, function (d, e) { return _this.e9(d, e, _this.lz, runOn(_this, _this.np), _this.mp); });
    };
    FinancialSeries.prototype.la = function (a, b, c) {
        var _this = this;
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, runOn(this, this.eh), function (d, e) { return _this.fb(d, e, _this.lz, runOn(_this, _this.np), _this.mr); }, function (d, e) { return _this.e9(d, e, _this.lz, runOn(_this, _this.np), _this.mr); });
    };
    FinancialSeries.prototype.o7 = function (a, b, c) {
        var _this = this;
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, runOn(this, this.ns), function (d, e) { return _this.fb(d, e, _this.lz, runOn(_this, _this.np), _this.mt); }, function (d, e) { return _this.e9(d, e, _this.lz, runOn(_this, _this.np), _this.mt); });
    };
    FinancialSeries.prototype.o6 = function (a, b, c) {
        var _this = this;
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, runOn(this, this.nr), function (d, e) { return _this.fb(d, e, _this.lz, runOn(_this, _this.np), _this.mn); }, function (d, e) { return _this.e9(d, e, _this.lz, runOn(_this, _this.np), _this.mn); });
    };
    FinancialSeries.prototype.o8 = function (a, b, c) {
        var _this = this;
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, runOn(this, this.nt), function (d, e) { return _this.fb(d, e, _this.lz, runOn(_this, _this.np), _this.mw); }, function (d, e) { return _this.e9(d, e, _this.lz, runOn(_this, _this.np), _this.mw); });
    };
    FinancialSeries.prototype.h3 = function () {
        _super.prototype.h3.call(this);
        if (this.lz != null) {
            this.lz.g0(false);
        }
        if (this.mk != null) {
            this.mk.g0(false);
        }
    };
    FinancialSeries.prototype.jk = function (a, b) {
        this.mf.bu.e(this.eq);
        this.i4(false);
    };
    FinancialSeries.prototype.jj = function (a, b) {
        if (this.dk && this.ev < 0.05) {
            this.dl = true;
        }
        this.mf.bu.e(this.eq);
        this.i4(false);
    };
    FinancialSeries.prototype.mu = function (a, b, c) {
        var d = this.bw(b);
        this.na.addItem(d, b);
        this.nb.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.oo = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.na.item(b);
        this.nb.removeItem(c);
        this.na.removeItem(b);
    };
    FinancialSeries.prototype.ir = function (a, b, c, d) {
        _super.prototype.ir.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.bn != null && this.bs != null) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.lz != null) {
                        this.lz.bv(this);
                    }
                    if (this.mk != null) {
                        this.mk.bv(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.lz != null) {
                        this.lz.ch(this);
                    }
                    if (this.mk != null) {
                        this.mk.ch(this);
                    }
                }
                this.mf.bu.e(this.eq);
                this.i4(false);
                break;
            case "FastItemsSource":
                this.my = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.oo(typeCast(IFastItemsSource_$type, c), this.mt);
                    this.oo(typeCast(IFastItemsSource_$type, c), this.mp);
                    this.oo(typeCast(IFastItemsSource_$type, c), this.mr);
                    this.oo(typeCast(IFastItemsSource_$type, c), this.mn);
                    this.oo(typeCast(IFastItemsSource_$type, c), this.mw);
                    this.mt = null;
                    this.mp = null;
                    this.mr = null;
                    this.mn = null;
                    this.mw = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (this.of != null) {
                        this.mt = this.mu(typeCast(IFastItemsSource_$type, d), this.of, "OpenColumn");
                    }
                    if (this.n6 != null) {
                        this.mp = this.mu(typeCast(IFastItemsSource_$type, d), this.n6, "HighColumn");
                    }
                    if (this.ob != null) {
                        this.mr = this.mu(typeCast(IFastItemsSource_$type, d), this.ob, "LowColumn");
                    }
                    if (this.n3 != null) {
                        this.mn = this.mu(typeCast(IFastItemsSource_$type, d), this.n3, "CloseColumn");
                    }
                    if (this.oj != null) {
                        this.mw = this.mu(typeCast(IFastItemsSource_$type, d), this.oj, "VolumeColumn");
                    }
                }
                this.my = false;
                if (this.mk != null && !this.mk.ck()) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.bz != null) {
                    this.oo(this.bz, this.mt);
                    this.mt = this.mu(this.bz, this.of, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.mk != null && !this.mk.ck() && !this.my) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.bz != null) {
                    this.oo(this.bz, this.mp);
                    this.mp = this.mu(this.bz, this.n6, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.mk != null && !this.mk.ck() && !this.my) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.bz != null) {
                    this.oo(this.bz, this.mr);
                    this.mr = this.mu(this.bz, this.ob, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.mk != null && !this.mk.ck() && !this.my) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.bz != null) {
                    this.oo(this.bz, this.mn);
                    this.mn = this.mu(this.bz, this.n3, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.mk != null && !this.mk.ck() && !this.my) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                this.ot();
                break;
            case FinancialSeries.$$p[8]:
                if (this.bz != null) {
                    this.oo(this.bz, this.mw);
                    this.mw = this.mu(this.bz, this.oj, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.mk != null && !this.mk.ck() && !this.my) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mf.bu.e(this.eq);
                this.i4(false);
                this.ib();
                this.mj = typeCast(ITimeRangeSelectorAxis_$type, this.lz);
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mf.bu.e(this.eq);
                if (this.mk != null) {
                    this.mk.ck();
                }
                {
                    this.i4(false);
                }
                this.ib();
                break;
            case "TransitionProgress":
                this.l4.c(this.ev, this.l2, this.l1);
                if (this.cc(this.bi)) {
                    return;
                }
                if (this.ev == 1) {
                    this.l1.v();
                    this.os(this.l1, this.mf);
                    if (this.dk) {
                        this.dk = false;
                        this.hp();
                        this.bt.r = truncate(this.em());
                        this.bt.b = this.bu;
                    }
                }
                else {
                    this.os(this.l4, this.mf);
                }
                if (this.bs != null) {
                    this.bs.jh(this);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.i4(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.mz = this.m2();
                this.i4(false);
                break;
            case "CategoryMode":
                if (this.lz != null) {
                    this.lz.kg(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.m1 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.m0 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.ls = 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.cc;
        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.nw = function (a) {
        return a.bu.b;
    };
    FinancialSeries.prototype.ny = function (a) {
        return a.bu.c;
    };
    FinancialSeries.prototype.lr = function (a, b) {
        return this.ls(a, b, this.mk);
    };
    FinancialSeries.prototype.get_m3 = function () {
        return false;
    };
    Object.defineProperty(FinancialSeries.prototype, "m3", {
        get: function () {
            return this.get_m3();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_cv = function () {
        return true;
    };
    FinancialSeries.prototype.at = function (a, b) {
        if (this.m3) {
            var c = this.mh(a, b, this.mi);
            this.mi = c;
            return c;
        }
        else {
            var d = this.mg(a, b, this.mi);
            this.mi = d;
            return d;
        }
    };
    FinancialSeries.prototype.n0 = function (a) {
        var b = this.l1;
        if (this.ca()) {
            b = this.l4;
        }
        var c = this.bi.br;
        var d = this.bi.bs;
        var e = this.lz;
        var f = 0;
        if (e.ce) {
            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.mh = function (a, b, c) {
        var d = this.bz.count;
        var e = this.mf.bu.c;
        var f = this.mf.bu.d;
        var g = this.mf.bu.b;
        var h = this.lz;
        var i = -1;
        var j = -1;
        if (h.cc) {
            var k = this.l1;
            if (this.ca()) {
                k = this.l4;
            }
            var l = this.n0(b);
            i = l;
            j = l;
        }
        else {
            var m = this.e4(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.mg = 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.m2 = function () {
        return this.m5;
    };
    FinancialSeries.prototype.d7 = function (a) {
        var b = this.bi.bs;
        var c = this.bi.br;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.lz != null) {
            var e = this.getEffectiveViewport1(this.bi);
            var f = new ScalerParams(0, b, c, this.lz.b8, e);
            var g = this.lh(this.bi);
            var h = this.lz.dw(g.left, f);
            var i = this.lz.dw(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.lz.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.e4 = function (a) {
        return truncate(Math.round(this.d7(a)));
    };
    FinancialSeries.prototype.get_c1 = function () {
        return typeCast(ISortingAxis_$type, this.lz) !== null;
    };
    FinancialSeries.prototype.ap = function () {
        return this.lz;
    };
    FinancialSeries.prototype.e6 = 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.lz.b8, d);
        var g = typeCast(ISortingAxis_$type, this.lz);
        var h = this.lh(this.bi);
        var i = h.left;
        var j = h.right;
        var k = this.k7(a).x;
        var l = this.lz.dw(k, f);
        var m = this.lz.dw(i, f);
        var n = this.lz.dw(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.fl = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.lz) !== null) {
            b = this.e6(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.e4(a);
        }
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    };
    FinancialSeries.prototype.nq = function (a, b, c) {
        if (this.lz == null) {
            return 0;
        }
        return this.lz.jl(a, b, c, this.fd);
    };
    FinancialSeries.prototype.da = function () {
        return this.m6;
    };
    FinancialSeries.prototype.l8 = function () {
        return 11;
    };
    FinancialSeries.prototype.bo = function () {
        return 3;
    };
    FinancialSeries.prototype.os = function (a, b) {
        this.lg = a.aa;
        b.ar();
    };
    FinancialSeries.prototype.oq = function (a, b) {
        a.u();
    };
    FinancialSeries.prototype.du = function (a, b, c) {
        var d = _super.prototype.du.call(this, a, b, c);
        var e = c;
        if (this.bz == null || this.bz.count == 0 || !c.l() || b.isEmpty || a.isEmpty || this.lz == null || this.mk == null || e.bu.b < 1 || this.lz.bf == null || this.mk.bf == null || this.mk.jx == this.mk.jw || this.lz.itemsSource == null || this.lz.jr < 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.nu = 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.mk != null) {
            var f = new ScalerParams(0, c, d, this.mk.b8, e);
            f.b = this.ed();
            b = this.mk.dt(this.mk.j7, f);
        }
        return b;
    };
    FinancialSeries.prototype.hp = function () {
        _super.prototype.hp.call(this);
        this.l2.v();
        this.l1.v();
        this.l4.v();
    };
    FinancialSeries.prototype.i5 = function (a) {
        var _this = this;
        _super.prototype.i5.call(this, a);
        this.mf.bu.e(this.eq);
        if (this.cc(this.bi)) {
            return;
        }
        if (this.dc) {
            if (this.ca()) {
                this.os(this.l4, this.mf);
            }
            else {
                this.os(this.l1, this.mf);
            }
            return;
        }
        if (this.c8(a)) {
            var b = this.l2;
            if (this.ca()) {
                if (this.bt.g) {
                    this.bt.t();
                }
                this.l2 = this.l4;
                this.l4 = b;
            }
            else {
                this.l2 = this.l1;
                this.l1 = b;
            }
            this.oq(this.l1, this.mf);
            if (this.dm) {
                this.bt.w();
                this.bt.r = truncate(this.en());
                this.bt.b = this.bv != null ? this.bv : this.bu;
                this.ma.p(this.l2, this.l1, this.isVertical, this.lz, this.mk, this.l9, this.l8(), this.bp, this.bo(), function () { return _this.nu(_this.mf); }, this.mf.br);
            }
            this.hl();
            this.jc();
            if (this.dm) {
                this.dl = false;
                this.dk = true;
            }
        }
        else {
            this.oq(this.l1, this.mf);
            this.os(this.l1, this.mf);
        }
    };
    FinancialSeries.prototype.m8 = 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.mp == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.mr == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.mt == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.mn == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.mw == 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, "m9", {
        get: function () {
            return this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.m4 = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.on = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "nh", {
        get: function () {
            return this.ne();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._ne = function () {
        var e_2, _a, a, b, _b, _c, c, e_2_1, d, e, f, g, h;
        return tslib_1.__generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    a = false;
                    if (!this.m4()) return [3 /*break*/, 8];
                    b = this.mb(0, this.bz.count);
                    this.on(new FinancialEventArgs(0, this.bz.count, b, this.mc(b), this));
                    if (!(b.typicalColumn != null)) return [3 /*break*/, 8];
                    a = true;
                    _d.label = 1;
                case 1:
                    _d.trys.push([1, 6, 7, 8]);
                    _b = tslib_1.__values(fromEnum(b.typicalColumn)), _c = _b.next();
                    _d.label = 2;
                case 2:
                    if (!!_c.done) return [3 /*break*/, 5];
                    c = _c.value;
                    return [4 /*yield*/, c];
                case 3:
                    _d.sent();
                    _d.label = 4;
                case 4:
                    _c = _b.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 (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_2) throw e_2.error; }
                    return [7 /*endfinally*/];
                case 8:
                    if (!!a) return [3 /*break*/, 17];
                    if (!(this.m9 && this.lz.i$b != null)) return [3 /*break*/, 13];
                    d = this.bz.count;
                    e = this.lz.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d)) return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.mp.item(e.item(f)) + this.mr.item(e.item(f)) + this.mn.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.mp.item(h) + this.mr.item(h) + this.mn.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.ne = function () {
        var _this = this;
        return toEnum(function () { return _this._ne(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "ng", {
        get: function () {
            return this.nd();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nd = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.m9 && this.lz.i$b != null)) return [3 /*break*/, 7];
                    a = this.mp.count;
                    b = this.lz.i$b;
                    if (!(a > 0)) return [3 /*break*/, 2];
                    return [4 /*yield*/, this.nv(this.mp.item(b.item(0)) - this.mr.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.nv(this.mp.item(b.item(c)) - this.mr.item(b.item(c))), Math.max(this.nv(Math.abs(this.mp.item(b.item(c)) - this.mn.item(b.item(c - 1)))), this.nv(Math.abs(this.mr.item(b.item(c)) - this.mn.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.mp.count;
                    if (!(d > 0)) return [3 /*break*/, 9];
                    return [4 /*yield*/, this.nv(this.mp.item(0) - this.mr.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.nv(this.mp.item(e) - this.mr.item(e)), Math.max(this.nv(Math.abs(this.mp.item(e) - this.mn.item(e - 1))), this.nv(Math.abs(this.mr.item(e) - this.mn.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nd = function () {
        var _this = this;
        return toEnum(function () { return _this._nd(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "nf", {
        get: function () {
            return this.nc();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nc = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.m9 && this.lz.i$b != null)) return [3 /*break*/, 7];
                    a = this.mr.count;
                    b = this.lz.i$b;
                    if (!(a > 0)) return [3 /*break*/, 2];
                    return [4 /*yield*/, this.nv(this.mr.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.nv(this.mr.item(b.item(c))), this.nv(this.mn.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.mr.count;
                    if (!(d > 0)) return [3 /*break*/, 9];
                    return [4 /*yield*/, this.nv(this.mr.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.nv(this.mr.item(e)), this.nv(this.mn.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nc = function () {
        var _this = this;
        return toEnum(function () { return _this._nc(); });
    };
    FinancialSeries.prototype.nj = function (a) {
        if (a == null) {
            return null;
        }
        if (this.m9 && this.lz.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.lz.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.ni = 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.mx) {
            this.mx = true;
            var b = this.mb(0, this.bz.count);
            this.mx = false;
            var c = new FinancialEventArgs(0, this.bz.count, b, this.mc(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.mt == null) {
            return null;
        }
        if (this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null) {
            if (this.nn != null) {
                return this.nn.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mt.count);
            var b = this.lz.i$b;
            var c = this.mt.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nn = a;
            return this.nn.asArray();
        }
        else {
            return this.mt.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.mp == null) {
            return null;
        }
        if (this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null) {
            if (this.nl != null) {
                return this.nl.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mp.count);
            var b = this.lz.i$b;
            var c = this.mp.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nl = a;
            return this.nl.asArray();
        }
        else {
            return this.mp.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.mr == null) {
            return null;
        }
        if (this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null) {
            if (this.nm != null) {
                return this.nm.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mr.count);
            var b = this.lz.i$b;
            var c = this.mr.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nm = a;
            return this.nm.asArray();
        }
        else {
            return this.mr.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.mn == null) {
            return null;
        }
        if (this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null) {
            if (this.nk != null) {
                return this.nk.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mn.count);
            var b = this.lz.i$b;
            var c = this.mn.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nk = a;
            return this.nk.asArray();
        }
        else {
            return this.mn.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.mw == null) {
            return null;
        }
        if (this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null) {
            if (this.no != null) {
                return this.no.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mw.count);
            var b = this.lz.i$b;
            var c = this.mw.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.no = a;
            return this.no.asArray();
        }
        else {
            return this.mw.asArray();
        }
    };
    FinancialSeries.prototype.hr = function (a, b, c, d) {
        _super.prototype.hr.call(this, a, b, c, d);
        if (this.lz == null || !(typeCast(ISortingAxis_$type, this.lz) !== null)) {
            return;
        }
        var e = this.lz.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.nn != null) {
                        this.nn.insert(f, this.mt.item(g));
                    }
                    if (this.nl != null) {
                        this.nl.insert(f, this.mp.item(g));
                    }
                    if (this.nm != null) {
                        this.nm.insert(f, this.mr.item(g));
                    }
                    if (this.nk != null) {
                        this.nk.insert(f, this.mn.item(g));
                    }
                    if (this.no != null) {
                        this.no.insert(f, this.mw.item(g));
                    }
                }
                break;
            case 0:
                if (this.nn != null) {
                    this.nn.v(b, c);
                }
                if (this.nl != null) {
                    this.nl.v(b, c);
                }
                if (this.nm != null) {
                    this.nm.v(b, c);
                }
                if (this.nk != null) {
                    this.nk.v(b, c);
                }
                if (this.no != null) {
                    this.no.v(b, c);
                }
                break;
            case 4:
                if (this.nn != null) {
                    this.nn = new List$1(Number_$type, 0);
                }
                if (this.nl != null) {
                    this.nl = new List$1(Number_$type, 0);
                }
                if (this.nm != null) {
                    this.nm = new List$1(Number_$type, 0);
                }
                if (this.nk != null) {
                    this.nk = new List$1(Number_$type, 0);
                }
                if (this.no != null) {
                    this.no = 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.nn != null) {
                        this.nn._inner[h] = this.mt.item(i);
                    }
                    if (this.nl != null) {
                        this.nl._inner[h] = this.mp.item(i);
                    }
                    if (this.nm != null) {
                        this.nm._inner[h] = this.mr.item(i);
                    }
                    if (this.nk != null) {
                        this.nk._inner[h] = this.mn.item(i);
                    }
                    if (this.no != null) {
                        this.no._inner[h] = this.mw.item(i);
                    }
                }
                break;
        }
        this.ot();
        this.jh();
    };
    FinancialSeries.prototype.mb = function (a, b) {
        var _this = this;
        var c = this.nj(this.mt);
        var d = this.nj(this.mn);
        var e = this.nj(this.mp);
        var f = this.nj(this.mr);
        var g = this.nj(this.mw);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.nh), _this.ni());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.ng), ((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.nf), ((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.nv = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.mc = 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.dx;
            $ret.j = Series.dw;
            $ret.i = runOn(_this, _this.nv);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.lz;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.i6 = function (a, b) {
        _super.prototype.i6.call(this, a, b);
        if (!this.dj) {
            this.bi.az(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.bh);
        this.bi.az(b);
        c.bu.e(this.eq);
        if (this.cc(this.bh)) {
            return;
        }
        if (!this.dd) {
            this.oq(this.l3, c);
        }
        this.dd = false;
        this.os(this.l3, c);
        this.dj = false;
    };
    FinancialSeries.prototype.i3 = function (a, b, c, d, e) {
        _super.prototype.i3.call(this, a, b, c, d, e);
        var f = this.a0.a$h.item(d);
        var g = f;
        g.bu.e(this.eq);
        f.ay(c);
        if (this.cc(g)) {
            return;
        }
        if (this.l0 == null) {
            this.l0 = new CategoryFrame(3);
        }
        this.l0.u();
        this.oq(this.l0, g);
        this.os(this.l0, g);
    };
    FinancialSeries.prototype.am = function (a) {
        if (this.lz == a) {
            return this.mk;
        }
        if (this.mk == a) {
            return this.lz;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.lz);
        return b != null ? b.preferredCategoryMode(this) : this.l6;
    };
    Object.defineProperty(FinancialSeries.prototype, "l6", {
        get: function () {
            return this.l5;
        },
        set: function (a) {
            var b = this.l6;
            if (a != b) {
                this.l5 = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.l6));
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_cz = function () {
        return true;
    };
    FinancialSeries.prototype.i9 = function (a, b) {
        _super.prototype.i9.call(this, a, b);
        this.o5 = a;
    };
    FinancialSeries.prototype.ot = function () {
        this.d4 = this.mn == null || this.mn.count == 0 ? NaN : this.mn.item(this.mn.count - 1);
    };
    FinancialSeries.prototype.fn = function (a) {
        if (this.mj != null && a != null) {
            if (this.ml == null || this.ml.e != this.mj.dateTimeMemberPath) {
                this.ml = new FastReflectionHelper(false, this.mj.dateTimeMemberPath);
            }
            var b = this.ml.c(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.mj.itemLabelFormat());
            }
        }
        return _super.prototype.fn.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    return FinancialSeries;
}(Series));
export { FinancialSeries };
Type.dep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:n3:ou', [2, null], 'HighMemberPath:n6:ov', [2, null], 'IsCustomCategoryStyleAllowed:m5:ow', [0, false], 'IsTransitionInEnabled:m6:ox', [0, false], 'LowMemberPath:ob:oy', [2, null], 'NegativeBrush:o5:oz', [Brush.$, null], 'OpenMemberPath:of:o0', [2, null], 'TransitionInMode:l9:o1', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:oj:o2', [2, null], 'XAxis:lz:o3', [CategoryAxisBase.$, null], 'YAxis:mk:o4', [NumericYAxis.$, null]]);
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 };
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 };
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 };
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.lz.b5) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.bw.lz.e2 != null) {
            a += "<span>${item." + this.bw.lz.e2 + "}</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.fr + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bw.of + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bw.n6 + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bw.ob + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bw.n3 + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bw.oj)) {
            var h = c.al("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bw.oj + "}</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.k1 = a;
        this.e.er = 5;
        this.e.es = 2;
        this.e.et = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
