/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends, __generator, __values } from "tslib";
import { EventArgs, Base, markType, typeCast, runOn, delegateCombine, enumGetBox, Point_$type, String_$type, Number_$type, fromEnum, toEnum, Date_$type, markDep, Delegate_$type } from "igniteui-react-core";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-react-core";
import { IFastItemColumn$1_$type } from "igniteui-react-core";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-react-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "igniteui-react-core";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { CategoryFrame } from "./CategoryFrame";
import { CategoryMode_$type } from "./CategoryMode";
import { ITimeRangeSelectorAxis_$type } from "./ITimeRangeSelectorAxis";
import { FastReflectionHelper } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { Dictionary$2 } from "igniteui-react-core";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { FinancialValueList } from "./FinancialValueList";
import { CategoryXAxis } from "./CategoryXAxis";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
import { SafeReadOnlyDoubleCollection } from "./SafeReadOnlyDoubleCollection";
import { SafeEnumerable } from "./SafeEnumerable";
import { CalculatedColumn } from "./CalculatedColumn";
import { TrendCalculators } from "igniteui-react-core";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { dateToStringFormat } from "igniteui-react-core";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
/**
 * @hidden
 */
var FinancialEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialEventArgs, _super);
    function FinancialEventArgs(a, b, c, d, e) {
        var _this = _super.call(this) || this;
        _this._position = 0;
        _this._count = 0;
        _this._dataSource = null;
        _this._supportingCalculations = null;
        _this._basedOn = null;
        _this.position = a;
        _this.count = b;
        _this.dataSource = c;
        _this.supportingCalculations = d;
        if (c != null) {
            c.series = e;
        }
        return _this;
    }
    Object.defineProperty(FinancialEventArgs.prototype, "position", {
        get: function () {
            return this._position;
        },
        set: function (a) {
            this._position = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "dataSource", {
        get: function () {
            return this._dataSource;
        },
        set: function (a) {
            this._dataSource = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "supportingCalculations", {
        get: function () {
            return this._supportingCalculations;
        },
        set: function (a) {
            this._supportingCalculations = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "basedOn", {
        get: function () {
            return this._basedOn;
        },
        set: function (a) {
            this._basedOn = a;
        },
        enumerable: false,
        configurable: true
    });
    FinancialEventArgs.$t = markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
    return FinancialEventArgs;
}(EventArgs));
export { FinancialEventArgs };
/**
 * @hidden
 */
var FinancialBucketCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialBucketCalculator, _super);
    function FinancialBucketCalculator(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.c = 0;
        _this.d = 0;
        _this.b = 0;
        if (a == null) {
            throw new ArgumentNullException(0, "view");
        }
        _this.a = a;
        _this.c = -1;
        _this.d = _this.d;
        _this.b = 0;
        return _this;
    }
    FinancialBucketCalculator.prototype.getBucket = function (a) {
        return null;
    };
    FinancialBucketCalculator.prototype.getBucketWithoutUnknowns = function (a) {
        return this.getBucket(a);
    };
    FinancialBucketCalculator.prototype.getErrorBucket = function (a, b) {
        return NaN;
    };
    FinancialBucketCalculator.prototype.getBucketInfo = function (a, b, c, d) {
        a = this.c;
        b = this.d;
        c = this.b;
        d = this.a.b2.ib;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    };
    FinancialBucketCalculator.prototype.e = function (a) {
        var b = this.a.by;
        var c = this.a.bx;
        var d = this.a.bx;
        if (this.a.b2 != null) {
            d = this.a.b2.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.b2.wx == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.b2.wx != null) ? this.a.b2.wx.ch : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.b2.wc(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.b2.wx);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.b2.wx.en(g.left, f));
            var j = Math.ceil(this.a.b2.wx.en(g.right, f));
            if (this.a.b2.wx.ch) {
                j = Math.ceil(this.a.b2.wx.en(g.left, f));
                i = Math.floor(this.a.b2.wx.en(g.right, f));
            }
            var k = Math.floor((j - i + 1) * a / g.width);
            this.b = truncate(Math.max(1, k));
            this.c = truncate(Math.floor(i / this.b));
            this.d = truncate(Math.ceil(j / this.b));
        }
        else {
            this.c = h.i$e(b, c, d, g);
            this.d = h.i$g(b, c, d, g);
            this.b = 1;
        }
    };
    FinancialBucketCalculator.prototype.cacheValues = function () {
    };
    FinancialBucketCalculator.prototype.unCacheValues = function () {
    };
    FinancialBucketCalculator.$t = markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
    return FinancialBucketCalculator;
}(Base));
export { FinancialBucketCalculator };
/**
 * @hidden
 */
var FinancialSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialSeries, _super);
    function FinancialSeries() {
        var _this = _super.call(this) || this;
        _this.xo = null;
        _this.xm = null;
        _this.xn = null;
        _this.xl = null;
        _this.xp = null;
        _this.xy = false;
        _this.assigningCategoryStyle = null;
        _this.w6 = null;
        _this.x8 = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.x9 = new Dictionary$2(String_$type, String_$type, 0);
        _this.xx = false;
        _this.xk = null;
        _this.w1 = null;
        _this.w3 = null;
        _this.wz = null;
        _this.w9 = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.xw = false;
        _this.yl = null;
        _this.yj = null;
        _this.yk = null;
        _this.yi = null;
        _this.ym = null;
        _this.w2 = null;
        _this.wy = null;
        _this.w4 = 0;
        _this.xf = null;
        _this.xh = null;
        _this.w6 = new CategorySeriesRenderManager();
        _this.xy = false;
        _this.w9 = new CategoryTransitionSourceFramePreparer();
        _this.w2 = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.w5 = 0;
        return _this;
    }
    FinancialSeries.prototype.hr = function () {
        var a = _super.prototype.hr.call(this);
        {
            var b = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "OpenMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedOpenMemberPath";
                $ret.q = true;
                return $ret;
            })());
            b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.z0));
            a.add(b);
        }
        {
            var c = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "HighMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedHighMemberPath";
                $ret.q = true;
                return $ret;
            })());
            c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.zy));
            a.add(c);
        }
        {
            var d = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "LowMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedLowMemberPath";
                $ret.q = true;
                return $ret;
            })());
            d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.zz));
            a.add(d);
        }
        {
            var e = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "CloseMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedCloseMemberPath";
                $ret.q = true;
                return $ret;
            })());
            e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.zx));
            a.add(e);
        }
        {
            var f = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "VolumeMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedVolumeMemberPath";
                $ret.q = true;
                return $ret;
            })());
            f.valueResolving = delegateCombine(f.valueResolving, runOn(this, this.z1));
            a.add(f);
        }
        {
            var g = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "Brush";
                $ret.p = true;
                $ret.y = "ActualBrush";
                $ret.q = true;
                return $ret;
            })());
            g.valueResolving = delegateCombine(g.valueResolving, runOn(this, this.ru));
            a.add(g);
        }
        {
            var h = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "Outline";
                $ret.p = true;
                $ret.y = "ActualOutline";
                $ret.q = true;
                return $ret;
            })());
            h.valueResolving = delegateCombine(h.valueResolving, runOn(this, this.ru));
            a.add(h);
        }
        {
            var i = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "NegativeBrush";
                $ret.p = true;
                $ret.q = true;
                return $ret;
            })());
            i.valueResolving = delegateCombine(i.valueResolving, runOn(this, this.ru));
            a.add(i);
        }
        {
            var j = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "NegativeOutline";
                $ret.p = true;
                $ret.q = true;
                return $ret;
            })());
            j.valueResolving = delegateCombine(j.valueResolving, runOn(this, this.ru));
            a.add(j);
        }
        var k = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.p = true;
            $ret.ad = "IsTransitionInEnabled";
            $ret.x = true;
            $ret.q = true;
            return $ret;
        })());
        a.add(k);
        var l = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.p = true;
            $ret.ad = "TransitionInMode";
            $ret.x = enumGetBox(CategoryTransitionInMode_$type, 20);
            $ret.q = true;
            return $ret;
        })());
        a.add(l);
        return a;
    };
    FinancialSeries.prototype.z0 = function (a, b) {
        if (this.za != null) {
            b.value = this.za;
            return;
        }
        b.value = this.zn;
    };
    FinancialSeries.prototype.zy = function (a, b) {
        if (this.y6 != null) {
            b.value = this.y6;
            return;
        }
        b.value = this.ze;
    };
    FinancialSeries.prototype.zz = function (a, b) {
        if (this.y8 != null) {
            b.value = this.y8;
            return;
        }
        b.value = this.zj;
    };
    FinancialSeries.prototype.zx = function (a, b) {
        if (this.y4 != null) {
            b.value = this.y4;
            return;
        }
        b.value = this.y1;
    };
    FinancialSeries.prototype.z1 = function (a, b) {
        if (this.zc != null) {
            b.value = this.zc;
            return;
        }
        b.value = this.zr;
    };
    FinancialSeries.prototype.ks = function () {
        if (this.d1()) {
            return this.bl.w3;
        }
        else {
            return this.bl.wz;
        }
    };
    FinancialSeries.prototype.qw = function (a) {
        _super.prototype.qw.call(this, a);
        this.xe = a;
    };
    FinancialSeries.prototype.get_e4 = function () {
        return true;
    };
    FinancialSeries.prototype.ai = function () {
        return [this.wx, this.xg];
    };
    FinancialSeries.prototype.ko = function (a, b) {
        var c = this.na(b);
        if (c == FinancialSeries.$$p[11]) {
            return this.kp(a, b, this.zn);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.kp(a, b, this.ze);
        }
        if (c == FinancialSeries.$$p[9]) {
            return this.kp(a, b, this.zj);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.kp(a, b, this.y1);
        }
        if (c == FinancialSeries.$$p[13]) {
            return this.kp(a, b, this.zr);
        }
        if (c == FinancialSeries.$$p[5]) {
            return this.kp(a, b, this.za);
        }
        if (c == FinancialSeries.$$p[3]) {
            return this.kp(a, b, this.y6);
        }
        if (c == FinancialSeries.$$p[4]) {
            return this.kp(a, b, this.y8);
        }
        if (c == FinancialSeries.$$p[2]) {
            return this.kp(a, b, this.y4);
        }
        if (c == FinancialSeries.$$p[6]) {
            return this.kp(a, b, this.zc);
        }
        return _super.prototype.ko.call(this, a, b);
    };
    FinancialSeries.prototype.ma = function (a) {
        var b = this.na(a);
        if (b == FinancialSeries.$$p[11]) {
            return this.zn;
        }
        if (b == FinancialSeries.$$p[1]) {
            return this.ze;
        }
        if (b == FinancialSeries.$$p[9]) {
            return this.zj;
        }
        if (b == FinancialSeries.$$p[0]) {
            return this.y1;
        }
        if (b == FinancialSeries.$$p[13]) {
            return this.zr;
        }
        if (b == FinancialSeries.$$p[5]) {
            return this.za;
        }
        if (b == FinancialSeries.$$p[3]) {
            return this.y6;
        }
        if (b == FinancialSeries.$$p[4]) {
            return this.y8;
        }
        if (b == FinancialSeries.$$p[2]) {
            return this.y4;
        }
        if (b == FinancialSeries.$$p[6]) {
            return this.zc;
        }
        return _super.prototype.ma.call(this, a);
    };
    FinancialSeries.prototype.yx = function () {
        return 2;
    };
    FinancialSeries.prototype.yv = function () {
        return 4;
    };
    FinancialSeries.prototype.aj = function (a) {
        var b = this.am(this.wx, this.wz.f, this.yu(this.ct), this.yw(this.ct), this.wa(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.yx();
        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.ak = function (a) {
        var b = this.am(this.wx, this.wz.f, this.yu(this.ct), this.yw(this.ct), this.wa(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.vp = function () {
        return this.aan;
    };
    FinancialSeries.prototype.vq = function () {
        return this.aan;
    };
    FinancialSeries.prototype.oz = function () {
        _super.prototype.oz.call(this);
        this.wx = null;
        this.xg = null;
    };
    FinancialSeries.prototype.get_ei = function () {
        return true;
    };
    FinancialSeries.prototype.get_f3 = function () {
        return this.xg != null && this.xg.ch;
    };
    Object.defineProperty(FinancialSeries.prototype, "xt", {
        get: function () {
            return this.xo;
        },
        set: function (a) {
            if (this.xo != a) {
                var b = this.xo;
                this.xo = a;
                this.raisePropertyChanged("OpenColumn", b, this.xo);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "xr", {
        get: function () {
            return this.xm;
        },
        set: function (a) {
            if (this.xm != a) {
                var b = this.xm;
                this.xm = a;
                this.raisePropertyChanged("HighColumn", b, this.xm);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "xs", {
        get: function () {
            return this.xn;
        },
        set: function (a) {
            if (this.xn != a) {
                var b = this.xn;
                this.xn = a;
                this.raisePropertyChanged("LowColumn", b, this.xn);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "xq", {
        get: function () {
            return this.xl;
        },
        set: function (a) {
            if (this.xl != a) {
                var b = this.xl;
                this.xl = a;
                this.raisePropertyChanged("CloseColumn", b, this.xl);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "xv", {
        get: function () {
            return this.xp;
        },
        set: function (a) {
            if (this.xp != a) {
                var b = this.xp;
                this.xp = a;
                this.raisePropertyChanged("VolumeColumn", b, this.xp);
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.f9 = function () {
        return this.highlightedItemsSource != null || (this.za != null && this.y6 != null && this.y8 != null && this.y4 != null);
    };
    FinancialSeries.prototype.x5 = function () {
        return (this.assigningCategoryStyle != null && this.xy) || this.bv != 1 || this.cn != 1 || this.cm != 1;
    };
    FinancialSeries.prototype.z4 = function (a) {
        if (this.assigningCategoryStyle != null && this.xy) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.z2 = function (a, b, c, d, e, f, g) {
        var h = this.bv != 1;
        var i = this.cn != 1;
        var j = this.cm != 1;
        this.w6.a3(this.w6.b, d.cn, a, b, c, d, e, f, false, g);
        this.w6.ab(this.h9);
        var k = this.w6.ay;
        var l = null;
        var m = null;
        var n = null;
        var o = this.dl;
        if (h && this.c9 != null) {
            l = this.c9.dj.getHighlightingInfo(this, o, k.z, k.y, false);
            k.c = l;
        }
        if (i && this.c9 != null) {
            m = this.c9.dk.getHighlightingInfo(this, o, k.z, k.y, false);
            if (m == null && this.bl != null) {
                m = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, k.z, k.y, false);
            }
            k.d = m;
        }
        if (j && this.c9 != null) {
            n = this.c9.di.getHighlightingInfo(this, o, k.z, k.y, false);
            k.b = n;
        }
        k.h = f;
        this.z4(k);
        this.w6.z(this, l, m, n, f, h, i, j, b < 0);
    };
    FinancialSeries.prototype.yn = function (a) {
        return this.ir(a, this.wx);
    };
    FinancialSeries.prototype.j8 = function (a, b) {
        return this.j9(a, b, this.wx, runOn(this, this.yn), new FinancialValueList(this.xt, this.xr, this.xs, this.xq, this.xv));
    };
    FinancialSeries.prototype.j6 = function (a, b) {
        return this.j7(a, b, this.wx, runOn(this, this.yn), new FinancialValueList(this.xt, this.xr, this.xs, this.xq, this.xv));
    };
    FinancialSeries.prototype.im = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.wx.lg;
        return this.io(a, b, this.wx, d, e, f, runOn(this, this.yn));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.wx.getCategorySize(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
    };
    FinancialSeries.prototype.v5 = function (a, b, c) {
        return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, null, null, null);
    };
    FinancialSeries.prototype.i3 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.ct);
        var e = this.yo(this.ct.by, this.ct.bx, d);
        var f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
        return this.i5(new FinancialValueList(this.xt, this.xr, this.xs, this.xq, this.xv), a, this.wx, f, e, runOn(this, this.yn), b, c);
    };
    FinancialSeries.prototype.iz = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.ct);
        var e = this.yo(this.ct.by, this.ct.bx, d);
        var f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
        return this.i5(this.xr, a, this.wx, f, e, runOn(this, this.yn), b, c);
    };
    FinancialSeries.prototype.i1 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.ct);
        var e = this.yo(this.ct.by, this.ct.bx, d);
        var f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
        return this.i5(this.xs, a, this.wx, f, e, runOn(this, this.yn), b, c);
    };
    FinancialSeries.prototype.yp = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.ct);
        var e = this.yo(this.ct.by, this.ct.bx, d);
        var f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
        return this.i5(this.xq, a, this.wx, f, e, runOn(this, this.yn), b, c);
    };
    FinancialSeries.prototype.yq = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.ct);
        var e = this.yo(this.ct.by, this.ct.bx, d);
        var f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
        return this.i5(this.xt, a, this.wx, f, e, runOn(this, this.yn), b, c);
    };
    FinancialSeries.prototype.yr = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.ct);
        var e = this.yo(this.ct.by, this.ct.bx, d);
        var f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
        return this.i5(this.xv, a, this.wx, f, e, runOn(this, this.yn), b, c);
    };
    FinancialSeries.prototype.v1 = function (a, b, c) {
        var _this = this;
        return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, runOn(this, this.iz), function (d, e) { return _this.j9(d, e, _this.wx, runOn(_this, _this.yn), _this.xr); }, function (d, e) { return _this.j7(d, e, _this.wx, runOn(_this, _this.yn), _this.xr); });
    };
    FinancialSeries.prototype.v3 = function (a, b, c) {
        var _this = this;
        return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, runOn(this, this.i1), function (d, e) { return _this.j9(d, e, _this.wx, runOn(_this, _this.yn), _this.xs); }, function (d, e) { return _this.j7(d, e, _this.wx, runOn(_this, _this.yn), _this.xs); });
    };
    FinancialSeries.prototype.aap = function (a, b, c) {
        var _this = this;
        return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, runOn(this, this.yq), function (d, e) { return _this.j9(d, e, _this.wx, runOn(_this, _this.yn), _this.xt); }, function (d, e) { return _this.j7(d, e, _this.wx, runOn(_this, _this.yn), _this.xt); });
    };
    FinancialSeries.prototype.aao = function (a, b, c) {
        var _this = this;
        return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, runOn(this, this.yp), function (d, e) { return _this.j9(d, e, _this.wx, runOn(_this, _this.yn), _this.xq); }, function (d, e) { return _this.j7(d, e, _this.wx, runOn(_this, _this.yn), _this.xq); });
    };
    FinancialSeries.prototype.aaq = function (a, b, c) {
        var _this = this;
        return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, runOn(this, this.yr), function (d, e) { return _this.j9(d, e, _this.wx, runOn(_this, _this.yn), _this.xv); }, function (d, e) { return _this.j7(d, e, _this.wx, runOn(_this, _this.yn), _this.xv); });
    };
    FinancialSeries.prototype.p5 = function () {
        _super.prototype.p5.call(this);
        if (this.wx != null) {
            this.wx.h9(false);
        }
        if (this.xg != null) {
            this.xg.h9(false);
        }
    };
    FinancialSeries.prototype.sk = function (a, b) {
        this.xe.b0.e(this.ib);
        this.rm(false);
    };
    FinancialSeries.prototype.sj = function (a, b) {
        if (this.gz && this.jo < 0.05) {
            this.g0 = true;
            this.g3 = false;
            this.gi = false;
        }
        this.xe.b0.e(this.ib);
        this.rm(false);
    };
    FinancialSeries.prototype.xu = function (a, b, c) {
        var d = this.di(b);
        this.x8.addItem(d, b);
        this.x9.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.zw = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.x8.item(b);
        this.x9.removeItem(c);
        this.x8.removeItem(b);
    };
    FinancialSeries.prototype.q4 = function (a, b, c, d) {
        _super.prototype.q4.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.c1 != null && this.c9 != null) {
                    this.xe.b0.e(this.ib);
                    this.rm(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.wx != null) {
                        this.wx.b0(this);
                    }
                    if (this.xg != null) {
                        this.xg.b0(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.wx != null) {
                        this.wx.ct(this);
                    }
                    if (this.xg != null) {
                        this.xg.ct(this);
                    }
                }
                this.xe.b0.e(this.ib);
                this.rm(false);
                break;
            case "FastItemsSource":
                this.xx = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.zw(typeCast(IFastItemsSource_$type, c), this.xt);
                    this.zw(typeCast(IFastItemsSource_$type, c), this.xr);
                    this.zw(typeCast(IFastItemsSource_$type, c), this.xs);
                    this.zw(typeCast(IFastItemsSource_$type, c), this.xq);
                    this.zw(typeCast(IFastItemsSource_$type, c), this.xv);
                    this.xt = null;
                    this.xr = null;
                    this.xs = null;
                    this.xq = null;
                    this.xv = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.zn) == false) {
                        this.xt = this.xu(typeCast(IFastItemsSource_$type, d), this.zn, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.ze) == false) {
                        this.xr = this.xu(typeCast(IFastItemsSource_$type, d), this.ze, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.zj) == false) {
                        this.xs = this.xu(typeCast(IFastItemsSource_$type, d), this.zj, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.y1) == false) {
                        this.xq = this.xu(typeCast(IFastItemsSource_$type, d), this.y1, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.zr) == false) {
                        this.xv = this.xu(typeCast(IFastItemsSource_$type, d), this.zr, "VolumeColumn");
                    }
                }
                this.xx = false;
                if (this.xg != null && !this.xg.c1()) {
                    this.xe.b0.e(this.ib);
                    this.rm(this.ge && c != null);
                }
                break;
            case FinancialSeries.$$p[11]:
                if (this.dl != null) {
                    this.zw(this.dl, this.xt);
                    this.xt = this.xu(this.dl, this.zn, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.xg != null && !this.xg.c1() && !this.xx) {
                    this.xe.b0.e(this.ib);
                    this.rm(this.ge && this.d5);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.dl != null) {
                    this.zw(this.dl, this.xr);
                    this.xr = this.xu(this.dl, this.ze, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.xg != null && !this.xg.c1() && !this.xx) {
                    this.xe.b0.e(this.ib);
                    this.rm(this.ge && this.d5);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (this.dl != null) {
                    this.zw(this.dl, this.xs);
                    this.xs = this.xu(this.dl, this.zj, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.xg != null && !this.xg.c1() && !this.xx) {
                    this.xe.b0.e(this.ib);
                    this.rm(this.ge && this.d5);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.dl != null) {
                    this.zw(this.dl, this.xq);
                    this.xq = this.xu(this.dl, this.y1, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.xg != null && !this.xg.c1() && !this.xx) {
                    this.xe.b0.e(this.ib);
                    this.rm(this.ge && this.d5);
                }
                this.z6();
                break;
            case FinancialSeries.$$p[13]:
                if (this.dl != null) {
                    this.zw(this.dl, this.xv);
                    this.xv = this.xu(this.dl, this.zr, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.xg != null && !this.xg.c1() && !this.xx) {
                    this.xe.b0.e(this.ib);
                    this.rm(this.ge && this.d5);
                }
                break;
            case FinancialSeries.$$p[14]:
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.xe.b0.e(this.ib);
                this.rm(false);
                this.qg();
                this.xf = typeCast(ITimeRangeSelectorAxis_$type, this.wx);
                break;
            case FinancialSeries.$$p[15]:
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.xe.b0.e(this.ib);
                if (this.xg != null) {
                    this.xg.c1();
                }
                {
                    this.rm(false);
                }
                this.qg();
                break;
            case "TransitionProgress":
                this.w3.c(this.jo, this.w1, this.wz);
                if (this.d3(this.ct)) {
                    return;
                }
                if (this.jo == 1) {
                    this.wz.w();
                    this.z5(this.wz, this.xe);
                    if (this.gz) {
                        this.gz = false;
                        this.o3();
                        this.da.r = truncate(this.i7());
                        this.da.b = this.db;
                    }
                    if (this.g2) {
                        this.g2 = false;
                        this.o3();
                        this.da.r = truncate(this.i7());
                        this.da.b = this.db;
                        this.qv();
                    }
                    this.qj();
                }
                else {
                    this.z5(this.w3, this.xe);
                }
                if (this.c9 != null) {
                    this.c9.qa(this);
                }
                break;
            case FinancialSeries.$$p[10]:
                this.rm(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.xy = this.x1();
                this.rm(false);
                break;
            case "CategoryMode":
                if (this.wx != null) {
                    this.wx.l7(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.x0 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.xz = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.wq = function (a, b, c) {
        if (b < a || a < 0 || a > this.dl.count || b < 0 || b > this.dl.count || c == null) {
            return null;
        }
        var d = new Array((b - a) + 1);
        var e = c.cn;
        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.dl.item(g);
        }
        return d;
    };
    FinancialSeries.prototype.yu = function (a) {
        return a.b0.b;
    };
    FinancialSeries.prototype.yw = function (a) {
        return a.b0.c;
    };
    FinancialSeries.prototype.wp = function (a, b) {
        return this.wq(a, b, this.xg);
    };
    FinancialSeries.prototype.get_fc = function () {
        return true;
    };
    FinancialSeries.prototype.o0 = function () {
        _super.prototype.o0.call(this);
        this.xk = null;
    };
    FinancialSeries.prototype.de = function (a, b, c) {
        if (this.eb && this.fx(this.bv) && !c) {
            var d = this.xj(a, b, this.xk);
            this.xk = d;
            return d;
        }
        else {
            var e = this.xi(a, b, this.xk);
            this.xk = e;
            return e;
        }
    };
    FinancialSeries.prototype.yy = function (a) {
        var b = this.w0();
        var c = this.ct.bx;
        var d = this.ct.by;
        var e = this.wx;
        var f = 0;
        if (e.cp) {
            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.xj = function (a, b, c) {
        if (this.dl == null) {
            return null;
        }
        var d = this.dl.count;
        var e = this.xe.b0.c;
        var f = this.xe.b0.d;
        var g = this.xe.b0.b;
        var h = this.wx;
        var i = -1;
        var j = -1;
        if (h.cn) {
            var k = this.w0();
            var l = this.yy(b);
            if (k.m != null && l >= 0 && l < k.m.count) {
                l = truncate(Math.round(k.m._inner[l]));
            }
            i = l;
            j = l;
        }
        else {
            var m = this.j1(b);
            i = truncate(Math.floor((intDivide(m, g)))) * g;
            j = i + (g - 1);
        }
        if (c != null && c.g == i && c.f == j) {
            return c;
        }
        var n = new HighlightingInfo();
        n.i = this;
        n.g = i;
        n.f = j;
        return n;
    };
    FinancialSeries.prototype.xi = function (a, b, c) {
        var d = new HighlightingInfo();
        d.i = this;
        d.g = 0;
        d.f = this.dl.count - 1;
        d.c = true;
        if (c != null && c.g == d.g && c.f == d.f) {
            return c;
        }
        return d;
    };
    FinancialSeries.prototype.x1 = function () {
        return this.x3;
    };
    FinancialSeries.prototype.ip = function (a) {
        var b = this.ct.by;
        var c = this.ct.bx;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.wx != null) {
            var e = this.getEffectiveViewport1(this.ct);
            var f = new ScalerParams(0, b, c, this.wx.ch, e);
            var g = this.wc(this.ct);
            var h = this.wx.en(g.left, f);
            var i = this.wx.en(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.wx.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.j1 = function (a) {
        return truncate(Math.round(this.ip(a)));
    };
    FinancialSeries.prototype.get_fq = function () {
        return typeCast(ISortingAxis_$type, this.wx) !== null;
    };
    FinancialSeries.prototype.az = function () {
        return this.wx;
    };
    FinancialSeries.prototype.j3 = function (a) {
        var b = this.ct.by;
        var c = this.ct.bx;
        var d = this.getEffectiveViewport1(this.ct);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        var e = new Rect(0, 0, 0, 1, 1);
        var f = new ScalerParams(0, b, c, this.wx.ch, d);
        var g = typeCast(ISortingAxis_$type, this.wx);
        var h = this.wc(this.ct);
        var i = h.left;
        var j = h.right;
        var k = this.v0(a).x;
        var l = this.wx.en(k, f);
        var m = this.wx.en(i, f);
        var n = this.wx.en(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.kl = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.wx) !== null) {
            b = this.j3(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.j1(a);
        }
        return b >= 0 && this.dl != null && b < this.dl.count ? this.dl.item(b) : null;
    };
    FinancialSeries.prototype.w0 = function () {
        var a = this.wz;
        if (this.d1()) {
            if (this.da.g) {
                this.da.t();
            }
            a = this.w3;
        }
        return a;
    };
    FinancialSeries.prototype.yo = function (a, b, c) {
        if (this.wx == null) {
            return 0;
        }
        return this.wx.k6(a, b, c, this.index);
    };
    FinancialSeries.prototype.gl = function () {
        return this.x4;
    };
    FinancialSeries.prototype.w7 = function () {
        return 11;
    };
    FinancialSeries.prototype.c2 = function () {
        return 3;
    };
    FinancialSeries.prototype.c5 = function () {
        return 3;
    };
    FinancialSeries.prototype.z5 = function (a, b) {
        this.qs();
        this.wb = a.ab;
        b.aw();
    };
    FinancialSeries.prototype.z3 = function (a, b) {
        a.v();
    };
    FinancialSeries.prototype.hc = function (a, b, c) {
        var d = _super.prototype.hc.call(this, a, b, c);
        var e = c;
        if (this.dl == null || this.dl.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.wx == null || this.xg == null || e.b0.b < 1 || this.wx.bi == null || this.xg.bi == null || this.xg.ly == this.xg.lx || this.wx.itemsSource == null || this.wx.lg < 1) {
            e.b0.b = 0;
            d = false;
        }
        return d;
    };
    FinancialSeries.prototype.getViewInfo = function (a, b) {
        b = this.ct.by;
        a = this.ct.bx;
        return {
            p0: a,
            p1: b
        };
    };
    FinancialSeries.prototype.ys = function (a) {
        var b = 0;
        var c = a.by;
        var d = a.bx;
        var e = this.getEffectiveViewport1(this.ct);
        if (!c.isEmpty && !d.isEmpty && this.xg != null) {
            var f = new ScalerParams(0, c, d, this.xg.ch, e);
            f.b = this.iw();
            b = this.xg.ek(this.xg.l8, f);
        }
        return b;
    };
    FinancialSeries.prototype.o3 = function () {
        _super.prototype.o3.call(this);
        this.w1.w();
        this.wz.w();
        this.w3.w();
    };
    FinancialSeries.prototype.rn = function (a) {
        var _this = this;
        _super.prototype.rn.call(this, a);
        this.xe.b0.e(this.ib);
        if (this.d3(this.ct)) {
            return;
        }
        if (this.gp) {
            if (this.d1()) {
                this.z5(this.w3, this.xe);
            }
            else {
                this.z5(this.wz, this.xe);
            }
            return;
        }
        if (this.gd(a)) {
            var b = this.w1;
            if (this.d1()) {
                if (this.da.g) {
                    this.da.t();
                }
                this.w1 = this.w3;
                this.w3 = b;
            }
            else {
                this.w1 = this.wz;
                this.wz = b;
            }
            this.z3(this.wz, this.xe);
            var c = false;
            if (this.g1) {
                this.da.w();
                this.da.r = truncate(this.i8());
                this.da.b = this.dc != null ? this.dc : this.db;
                if (this.g2) {
                    var d = this.w3;
                    this.w3 = this.w1;
                    this.w1 = d;
                    c = true;
                }
                this.w9.s(this, this.w1, this.wz, this.isVertical, this.wx, this.xg, this.w8, this.w7(), this.c3, this.c2(), function () { return _this.ys(_this.xe); }, this.xe.bx);
                if (this.g2) {
                    var e = this.w3;
                    this.w3 = this.w1;
                    this.w1 = e;
                }
                this.g2 = false;
            }
            if (this.g4) {
                this.da.w();
                this.da.r = truncate(this.i9());
                this.da.b = this.dd != null ? this.dd : this.db;
                if (this.gz) {
                    var f = this.w3;
                    this.w3 = this.w1;
                    this.w1 = f;
                    c = true;
                }
                this.w9.s(this, this.w1, this.wz, this.isVertical, this.wx, this.xg, this.w8, this.w7(), this.c3, this.c2(), function () { return _this.ys(_this.xe); }, this.xe.bx);
                var g = this.wz;
                this.wz = this.w1;
                this.w1 = g;
                if (this.gz) {
                    var h = this.w3;
                    this.w3 = this.w1;
                    this.w1 = h;
                }
                this.gz = false;
            }
            this.d7 = false;
            if (!c) {
                this.oy();
            }
            this.r0();
            if (this.g1) {
                this.g0 = false;
                this.g3 = false;
                this.gi = false;
                this.gz = true;
            }
            if (this.g4) {
                this.g3 = false;
                this.g2 = true;
            }
        }
        else {
            this.z3(this.wz, this.xe);
            this.z5(this.wz, this.xe);
        }
    };
    FinancialSeries.prototype.gm = function () {
        return true;
    };
    FinancialSeries.prototype.x6 = function (a) {
        var e_1, _a;
        try {
            for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                switch (b) {
                    case "HighColumn":
                        if (this.xr == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.xs == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.xt == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.xq == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.xv == 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, "x7", {
        get: function () {
            return this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.x2 = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.zv = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "yf", {
        get: function () {
            return this.yc();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._yc = function () {
        var a, b, _a, _b, c, e_2_1, d, e, f, g, h;
        var e_2, _c;
        return __generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    a = false;
                    if (!this.x2())
                        return [3 /*break*/, 8];
                    b = this.xa(0, this.dl.count);
                    this.zv(new FinancialEventArgs(0, this.dl.count, b, this.xb(b), this));
                    if (!(b.typicalColumn != null))
                        return [3 /*break*/, 8];
                    a = true;
                    _d.label = 1;
                case 1:
                    _d.trys.push([1, 6, 7, 8]);
                    _a = __values(fromEnum(b.typicalColumn)), _b = _a.next();
                    _d.label = 2;
                case 2:
                    if (!!_b.done)
                        return [3 /*break*/, 5];
                    c = _b.value;
                    return [4 /*yield*/, c];
                case 3:
                    _d.sent();
                    _d.label = 4;
                case 4:
                    _b = _a.next();
                    return [3 /*break*/, 2];
                case 5: return [3 /*break*/, 8];
                case 6:
                    e_2_1 = _d.sent();
                    e_2 = { error: e_2_1 };
                    return [3 /*break*/, 8];
                case 7:
                    try {
                        if (_b && !_b.done && (_c = _a.return))
                            _c.call(_a);
                    }
                    finally {
                        if (e_2)
                            throw e_2.error;
                    }
                    return [7 /*endfinally*/];
                case 8:
                    if (!!a)
                        return [3 /*break*/, 17];
                    if (!(this.x7 && this.wx.i$b != null))
                        return [3 /*break*/, 13];
                    d = this.dl.count;
                    e = this.wx.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d))
                        return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.xr.item(e.item(f)) + this.xs.item(e.item(f)) + this.xq.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.dl.count;
                    h = 0;
                    _d.label = 14;
                case 14:
                    if (!(h < g))
                        return [3 /*break*/, 17];
                    return [4 /*yield*/, (this.xr.item(h) + this.xs.item(h) + this.xq.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.yc = function () {
        var _this = this;
        return toEnum(function () { return _this._yc(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "ye", {
        get: function () {
            return this.yb();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._yb = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.x7 && this.wx.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.xr.count;
                    b = this.wx.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.yt(this.xr.item(b.item(0)) - this.xs.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.yt(this.xr.item(b.item(c)) - this.xs.item(b.item(c))), Math.max(this.yt(Math.abs(this.xr.item(b.item(c)) - this.xq.item(b.item(c - 1)))), this.yt(Math.abs(this.xs.item(b.item(c)) - this.xq.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.xr.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.yt(this.xr.item(0) - this.xs.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.yt(this.xr.item(e) - this.xs.item(e)), Math.max(this.yt(Math.abs(this.xr.item(e) - this.xq.item(e - 1))), this.yt(Math.abs(this.xs.item(e) - this.xq.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.yb = function () {
        var _this = this;
        return toEnum(function () { return _this._yb(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "yd", {
        get: function () {
            return this.ya();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._ya = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.x7 && this.wx.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.xs.count;
                    b = this.wx.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.yt(this.xs.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.yt(this.xs.item(b.item(c))), this.yt(this.xq.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.xs.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.yt(this.xs.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.yt(this.xs.item(e)), this.yt(this.xq.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.ya = function () {
        var _this = this;
        return toEnum(function () { return _this._ya(); });
    };
    FinancialSeries.prototype.yh = function (a) {
        if (a == null) {
            return null;
        }
        if (this.x7 && this.wx.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.wx.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.yg = function () {
        var a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.dl != null && !this.xw) {
            this.xw = true;
            var b = this.xa(0, this.dl.count);
            this.xw = false;
            var c = new FinancialEventArgs(0, this.dl.count, b, this.xb(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.xt == null) {
            return null;
        }
        if (this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null) {
            if (this.yl != null) {
                return this.yl.asArray();
            }
            var a = new List$1(Number_$type, 2, this.xt.count);
            var b = this.wx.i$b;
            var c = this.xt.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.yl = a;
            return this.yl.asArray();
        }
        else {
            return this.xt.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.xr == null) {
            return null;
        }
        if (this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null) {
            if (this.yj != null) {
                return this.yj.asArray();
            }
            var a = new List$1(Number_$type, 2, this.xr.count);
            var b = this.wx.i$b;
            var c = this.xr.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.yj = a;
            return this.yj.asArray();
        }
        else {
            return this.xr.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.xs == null) {
            return null;
        }
        if (this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null) {
            if (this.yk != null) {
                return this.yk.asArray();
            }
            var a = new List$1(Number_$type, 2, this.xs.count);
            var b = this.wx.i$b;
            var c = this.xs.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.yk = a;
            return this.yk.asArray();
        }
        else {
            return this.xs.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.xq == null) {
            return null;
        }
        if (this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null) {
            if (this.yi != null) {
                return this.yi.asArray();
            }
            var a = new List$1(Number_$type, 2, this.xq.count);
            var b = this.wx.i$b;
            var c = this.xq.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.yi = a;
            return this.yi.asArray();
        }
        else {
            return this.xq.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.xv == null) {
            return null;
        }
        if (this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null) {
            if (this.ym != null) {
                return this.ym.asArray();
            }
            var a = new List$1(Number_$type, 2, this.xv.count);
            var b = this.wx.i$b;
            var c = this.xv.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.ym = a;
            return this.ym.asArray();
        }
        else {
            return this.xv.asArray();
        }
    };
    FinancialSeries.prototype.o8 = function (a, b, c, d) {
        _super.prototype.o8.call(this, a, b, c, d);
        if (this.wx == null || !(typeCast(ISortingAxis_$type, this.wx) !== null)) {
            return;
        }
        var e = this.wx.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.yl != null) {
                        this.yl.insert(f, this.xt.item(g));
                    }
                    if (this.yj != null) {
                        this.yj.insert(f, this.xr.item(g));
                    }
                    if (this.yk != null) {
                        this.yk.insert(f, this.xs.item(g));
                    }
                    if (this.yi != null) {
                        this.yi.insert(f, this.xq.item(g));
                    }
                    if (this.ym != null) {
                        this.ym.insert(f, this.xv.item(g));
                    }
                }
                break;
            case 0:
                if (this.yl != null) {
                    this.yl.v(b, c);
                }
                if (this.yj != null) {
                    this.yj.v(b, c);
                }
                if (this.yk != null) {
                    this.yk.v(b, c);
                }
                if (this.yi != null) {
                    this.yi.v(b, c);
                }
                if (this.ym != null) {
                    this.ym.v(b, c);
                }
                break;
            case 4:
                if (this.yl != null) {
                    this.yl = new List$1(Number_$type, 0);
                }
                if (this.yj != null) {
                    this.yj = new List$1(Number_$type, 0);
                }
                if (this.yk != null) {
                    this.yk = new List$1(Number_$type, 0);
                }
                if (this.yi != null) {
                    this.yi = new List$1(Number_$type, 0);
                }
                if (this.ym != null) {
                    this.ym = 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.yl != null) {
                        this.yl._inner[h] = this.xt.item(i);
                    }
                    if (this.yj != null) {
                        this.yj._inner[h] = this.xr.item(i);
                    }
                    if (this.yk != null) {
                        this.yk._inner[h] = this.xs.item(i);
                    }
                    if (this.yi != null) {
                        this.yi._inner[h] = this.xq.item(i);
                    }
                    if (this.ym != null) {
                        this.ym._inner[h] = this.xv.item(i);
                    }
                }
                break;
        }
        this.z6();
        this.sg();
    };
    FinancialSeries.prototype.xa = function (a, b) {
        var _this = this;
        var c = this.yh(this.xt);
        var d = this.yh(this.xq);
        var e = this.yh(this.xr);
        var f = this.yh(this.xs);
        var g = this.yh(this.xv);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.yf), _this.yg());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.ye), ((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.yd), ((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.dl != null ? _this.dl.count : 0;
            return $ret;
        })());
        return h;
    };
    FinancialSeries.prototype.yt = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.xb = 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.ho;
            $ret.j = Series.hn;
            $ret.i = runOn(_this, _this.yt);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.wx;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.ro = function (a, b) {
        _super.prototype.ro.call(this, a, b);
        if (!this.gy) {
            this.ct.a4(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.cs);
        this.ct.a4(b);
        c.b0.e(this.ib);
        if (this.d3(this.cs)) {
            return;
        }
        if (!this.gq) {
            this.z3(this.w2, c);
        }
        this.gq = false;
        this.z5(this.w2, c);
        this.gy = false;
    };
    FinancialSeries.prototype.rl = function (a, b, c, d, e) {
        _super.prototype.rl.call(this, a, b, c, d, e);
        var f = this.a9.a$j.item(d);
        var g = f;
        g.b0.e(this.ib);
        f.a3(c);
        if (this.d3(g)) {
            return;
        }
        if (this.wy == null) {
            this.wy = new CategoryFrame(3);
        }
        this.wy.v();
        this.z3(this.wy, g);
        this.z5(this.wy, g);
    };
    FinancialSeries.prototype.av = function (a) {
        if (this.wx == a) {
            return this.xg;
        }
        if (this.xg == a) {
            return this.wx;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.wx);
        return b != null ? b.preferredCategoryMode(this) : this.w5;
    };
    Object.defineProperty(FinancialSeries.prototype, "w5", {
        get: function () {
            return this.w4;
        },
        set: function (a) {
            var b = this.w5;
            if (a != b) {
                this.w4 = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.w5));
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.get_fk = function () {
        return true;
    };
    FinancialSeries.prototype.rw = function (a, b) {
        _super.prototype.rw.call(this, a, b);
        this.aan = a;
    };
    FinancialSeries.prototype.z6 = function () {
        this.ik = this.xq == null || this.xq.count == 0 ? NaN : this.xq.item(this.xq.count - 1);
    };
    FinancialSeries.prototype.kn = function (a) {
        if (this.xf != null && a != null) {
            if (this.xh == null || this.xh.propertyName != this.xf.dateTimeMemberPath) {
                this.xh = new FastReflectionHelper(false, this.xf.dateTimeMemberPath);
            }
            var b = this.xh.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.xf.itemLabelFormat());
            }
        }
        return _super.prototype.kn.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:y1:z7', [2, null], 'HighMemberPath:ze:aad', [2, null], 'HighlightedCloseMemberPath:y4:z8', [2, null], 'HighlightedHighMemberPath:y6:z9', [2, null], 'HighlightedLowMemberPath:y8:aaa', [2, null], 'HighlightedOpenMemberPath:za:aab', [2, null], 'HighlightedVolumeMemberPath:zc:aac', [2, null], 'IsCustomCategoryStyleAllowed:x3:aae', [0, false], 'IsTransitionInEnabled:x4:aaf', [0, false], 'LowMemberPath:zj:aag', [2, null], 'NegativeBrush:aan:aah', [Brush.$, null], 'OpenMemberPath:zn:aai', [2, null], 'TransitionInMode:w8:aaj', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:zr:aak', [2, null], 'XAxis:wx:aal', [CategoryAxisBase.$, null], 'YAxis:xg:aam', [NumericYAxis.$, null]]);
    return FinancialSeries;
}(Series));
export { FinancialSeries };
/**
 * @hidden
 */
var FinancialCalculationSupportingCalculations = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialCalculationSupportingCalculations, _super);
    function FinancialCalculationSupportingCalculations() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = null;
        _this.c = null;
        _this.d = null;
        _this.b = null;
        _this.h = null;
        _this.f = null;
        _this.g = null;
        _this.e = null;
        _this.k = null;
        _this.j = null;
        _this.i = null;
        return _this;
    }
    FinancialCalculationSupportingCalculations.$t = markType(FinancialCalculationSupportingCalculations, 'FinancialCalculationSupportingCalculations');
    return FinancialCalculationSupportingCalculations;
}(Base));
export { FinancialCalculationSupportingCalculations };
/**
 * @hidden
 */
var DataSourceSupportingCalculation = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataSourceSupportingCalculation, _super);
    function DataSourceSupportingCalculation(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = this;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0:
                {
                    var c = _rest[0];
                    _this = _super.call(this, Delegate_$type, 0, c) || this;
                }
                break;
            case 1:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    _this = _super.call(this, Delegate_$type, 1, c, d) || this;
                }
                break;
        }
        return _this;
    }
    DataSourceSupportingCalculation.$t = markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', SupportingCalculation$1.$.specialize(Delegate_$type));
    return DataSourceSupportingCalculation;
}(SupportingCalculation$1));
export { DataSourceSupportingCalculation };
/**
 * @hidden
 */
var FinancialCalculationDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialCalculationDataSource, _super);
    function FinancialCalculationDataSource() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._openColumn = null;
        _this._closeColumn = null;
        _this._highColumn = null;
        _this._lowColumn = null;
        _this._volumeColumn = null;
        _this._indicatorColumn = null;
        _this._typicalColumn = null;
        _this._trueRange = null;
        _this._trueLow = null;
        _this._period = 0;
        _this._shortPeriod = 0;
        _this._longPeriod = 0;
        _this._count = 0;
        _this._calculateFrom = 0;
        _this._calculateCount = 0;
        _this._multiplier = 0;
        _this._minimumValue = 0;
        _this._maximumValue = 0;
        _this._specifiesRange = false;
        _this._series = null;
        return _this;
    }
    Object.defineProperty(FinancialCalculationDataSource.prototype, "openColumn", {
        get: function () {
            return this._openColumn;
        },
        set: function (a) {
            this._openColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "closeColumn", {
        get: function () {
            return this._closeColumn;
        },
        set: function (a) {
            this._closeColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "highColumn", {
        get: function () {
            return this._highColumn;
        },
        set: function (a) {
            this._highColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "lowColumn", {
        get: function () {
            return this._lowColumn;
        },
        set: function (a) {
            this._lowColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "volumeColumn", {
        get: function () {
            return this._volumeColumn;
        },
        set: function (a) {
            this._volumeColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "indicatorColumn", {
        get: function () {
            return this._indicatorColumn;
        },
        set: function (a) {
            this._indicatorColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "typicalColumn", {
        get: function () {
            return this._typicalColumn;
        },
        set: function (a) {
            this._typicalColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueRange", {
        get: function () {
            return this._trueRange;
        },
        set: function (a) {
            this._trueRange = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueLow", {
        get: function () {
            return this._trueLow;
        },
        set: function (a) {
            this._trueLow = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "period", {
        get: function () {
            return this._period;
        },
        set: function (a) {
            this._period = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "shortPeriod", {
        get: function () {
            return this._shortPeriod;
        },
        set: function (a) {
            this._shortPeriod = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "longPeriod", {
        get: function () {
            return this._longPeriod;
        },
        set: function (a) {
            this._longPeriod = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateFrom", {
        get: function () {
            return this._calculateFrom;
        },
        set: function (a) {
            this._calculateFrom = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateCount", {
        get: function () {
            return this._calculateCount;
        },
        set: function (a) {
            this._calculateCount = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "multiplier", {
        get: function () {
            return this._multiplier;
        },
        set: function (a) {
            this._multiplier = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "minimumValue", {
        get: function () {
            return this._minimumValue;
        },
        set: function (a) {
            this._minimumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "maximumValue", {
        get: function () {
            return this._maximumValue;
        },
        set: function (a) {
            this._maximumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "specifiesRange", {
        get: function () {
            return this._specifiesRange;
        },
        set: function (a) {
            this._specifiesRange = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    FinancialCalculationDataSource.$t = markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
    return FinancialCalculationDataSource;
}(Base));
export { FinancialCalculationDataSource };
/**
 * @hidden
 */
var FinancialSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialSeriesView, _super);
    function FinancialSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.b2 = null;
        _this.b0 = null;
        _this.b4 = 0;
        _this.b4 = -1;
        _this.b2 = a;
        _this.b0 = _this.b1();
        return _this;
    }
    FinancialSeriesView.prototype.b3 = function (a) {
        if (this.b4 != a.u) {
            return true;
        }
        return false;
    };
    FinancialSeriesView.prototype.b5 = function (a) {
        this.b4 = a.u;
    };
    FinancialSeriesView.prototype.au = function () {
        _super.prototype.au.call(this);
        if (!this.q) {
        }
    };
    FinancialSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.b2.wx.ce) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.b2.wx.f1 != null) {
            a += "<span>${item." + this.b2.wx.f1 + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        var b = this.e.a9.a$u(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        var c = new SRProvider(this.w);
        var d = c.b1("financialSeries_Open");
        var e = c.b1("financialSeries_High");
        var f = c.b1("financialSeries_Low");
        var g = c.b1("financialSeries_Close");
        d = stringIsNullOrEmpty(d) ? "Open" : d;
        e = stringIsNullOrEmpty(e) ? "High" : e;
        f = stringIsNullOrEmpty(f) ? "Low" : f;
        g = stringIsNullOrEmpty(g) ? "Close" : g;
        a += ">" + this.b2.title + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.b2.zn + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.b2.ze + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.b2.zj + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.b2.y1 + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.b2.zr)) {
            var h = c.b1("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.b2.zr + "}</td></tr>";
        }
        a += "</table></div>";
        return a;
    };
    FinancialSeriesView.prototype.af = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.vu = a;
        this.e.jk = 5;
        this.e.jl = 2;
        this.e.jm = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
